📜

A Survey of Context Engineering for Lage Language Models

Publish
Aug 1, 2025
Categroy
Paper Review
Tags
#LLM
Summary
📜
原文:arXiv.orgarXiv.orgA Survey of Context Engineering for Large Language Models
notion image
notion image

Definition of Context Engineering

  • 序列 指目标输出序列。
  • 上下文 ,其中 代表组装函数。

Critical Phases

Context Retrieval and Generation 上下文检索与生成

  1. Prompt Engineering and Context Generation 提示工程与上下文生成:如何写 Prompt
    1. Zero-Shot and Few-Shot Learning Paradigms 零样本和少样本学习范式
        • Zero-Shot Learning 零样本学习
        • Few-Shot Learning 少样本学习
    2. Chain-of-Thought Foundation 思维链基础
        • Zero-shot Chain-of-Thought(CoT) 思维链: Think step by step…
        • Tree-of-Thought(ToT) 思维树
        • Graph-of-Thought(GoT) 思维图
    3. Cognitive Architecture Integration 认知架构集成:认知架构集成指在提示词中模拟人类的系统性认知操作,例如目标澄清(goal clarification)、任务分解(decomposition)、信息过滤(filtering)等过程。
  1. External Knowledge Retrieval 外部知识检索:如何获取外部知识
    1. Retrieval-Augmented Generation(RAG) Fundamentals 检索增强生成基础:即 RAG,用于将大语言模型自身训练得到的参数化知识,与外部知识源结合
    2. Knowledge Graph Integration and Structured Retrieval 知识图谱集成和结构化检索:主要关注于如何组织外部知识源,以提升信息检索的质量
    3. Agentic and Modular Retrieval Systems 代理式和模块化检索系统:主要关注于如何使得 LLM 和 RAG 系统进行更加动态的交互
  1. Dynamic Context Assembly 动态上下文组装
    1. Assembly Functions and Orchestration Mechanisms 组装函数和编排机制
        • Assembly Function 组装函数:单个 Agent 如何调用工具、处理数据
          • template-based formatting 预设的模板
          • priority-based selection 基于优先级的选择
          • adaptive composition strategies 根据不同的任务要求自适应选择组合策略
        • Orchestration Mechanism 编排机制:多个 Agent 如何交互协同
          • Agent Selection 代理选择
          • Context Distribution 上下文分配
          • Interaction Flow Control 交互流控制
    2. Multi-Component Integration Strategies 多组件集成策略
        • Cross-modal Integration 跨模态集成
        • Programming Language Representations of Structured Data 结构化数据的编程语言表示
    3. Automated Assembly Optimization 自动化组装优化
        • Automated prompt engineering(APE)自动提示工程:自动优化 Prompt
        • Tool integration frameworks 工具迁移框架:自动执行外部工具

Context Processing 上下文处理

💡
对获取的信息进行结构化、压缩、潜入等处理。
  • Long Sequence Processing 长上下文处理
    • Architectural Innovations for Long Context 用于长上下文的架构创新
    • Position Interpolation and Context Extension 位置插值和上下文扩展
    • Optimization Techniques for Efficient Processing 高效处理的优化技术
    • Memory Management and Context Compression 内存管理与上下文压缩
  • Contextual Self-Refinement and Adaptation 上下文自细化和自适应
    • Foundational Self-Refinement Frameworks 基础自细化框架
    • Meta-Learning and Autonomous Evolution 元学习和自主进化
    • Memory-Augmented Adaptation Frameworks 记忆增强适应框架
    • Long Chain-of-Thought and Advanced Reasoning 长思维链和高级推理
  • Multimodal Context 多模态上下文
  • Relational and Structured Context 关系和结构化上下文

Context Management 上下文管理

💡
主要关注如何组织、存储和利用上下文信息。
  • Memory Hierarchies and Storage Architectures 内存层次结构和存储架构:将上下文存储在临时工作区,使用函数调用访问外部上下文
  • Context Compression 上下文压缩

System Implementations

notion image

Retrieval-Augmented Generation

notion image

Memory System

notion image

Tool-Integrated Reasoning

notion image

Multi-Agent System

notion image