arXiv:2510.04618cs.LGcs.AI2025-10被引 292

让提示词像剧本一样不断进化,提升大模型自适应能力

Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models

  • 将上下文设计为可迭代优化的模块化剧本,分生成、反思、整理三步演化
  • 在代理和金融任务上分别提升10.6%和8.6%,且推理延迟更低
  • 无需标注数据,仅靠运行反馈即可自动优化,适合低资源场景

大型语言模型(LLM)在智能体和领域推理中的应用日益依赖上下文适配:通过修改输入指令、策略或证据来调整行为,而非更新权重。现有方法虽提升可用性,但常受简洁性偏差影响,导致领域知识被压缩;同时存在上下文坍塌问题,多次重写会丢失细节。我们提出ACE(Agentic Context Engineering),将上下文视为可演化的剧本,通过生成、反思与整理的模块化流程积累并优化策略。该框架采用结构化增量更新,有效防止信息流失,支持长上下文模型扩展。在代理和领域基准测试中,ACE在离线(如系统提示)和在线(如代理记忆)场景均表现优异,相较强基线提升10.6%(代理)和8.6%(金融),显著降低适配延迟与部署成本。值得注意的是,ACE无需标注监督,仅利用自然执行反馈即可有效适应。在AppWorld排行榜上,其整体平均得分媲美顶级生产级智能体,且在更难的测试挑战集上超越后者,尽管使用的是更小的开源模型。结果表明,全面演化的上下文可实现高效、可扩展、自改进的LLM系统,且开销极低。

原文摘要 · Abstract (English)

Large language model (LLM) applications such as agents and domain-specific reasoning increasingly rely on context adaptation: modifying inputs with instructions, strategies, or evidence, rather than weight updates. Prior approaches improve usability but often suffer from brevity bias, which drops domain insights for concise summaries, and from context collapse, where iterative rewriting erodes details over time. We introduce ACE (Agentic Context Engineering), a framework that treats contexts as evolving playbooks that accumulate, refine, and organize strategies through a modular process of generation, reflection, and curation. ACE prevents collapse with structured, incremental updates that preserve detailed knowledge and scale with long-context models. Across agent and domain-specific benchmarks, ACE optimizes contexts both offline (e.g., system prompts) and online (e.g., agent memory), consistently outperforming strong baselines: +10.6% on agents and +8.6% on finance, while significantly reducing adaptation latency and rollout cost. Notably, ACE could adapt effectively without labeled supervision and instead by leveraging natural execution feedback. On the AppWorld leaderboard, ACE matches the top-ranked production-level agent on the overall average and surpasses it on the harder test-challenge split, despite using a smaller open-source model. These results show that comprehensive, evolving contexts enable scalable, efficient, and self-improving LLM systems with low overhead.

上下文工程智能体自进化提示优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。