提出ACON框架,优化长时序智能体的上下文压缩,减少内存占用并提升推理效果。
ACON: Optimizing Context Compression for Long-horizon LLM Agents
- 在自然语言空间迭代优化压缩规则,不需微调大模型
- 在多个基准上降低26%-54%峰值令牌使用量
- 适合资源有限的模型做长期任务,显著缓解上下文干扰
大型语言模型越来越多地被用作动态现实环境中的智能体,其成功依赖于对动作与观测的精确记录。然而,长时序任务导致上下文无限增长,带来两大瓶颈:高昂的推理内存开销,以及因冗余信息导致的推理性能下降。现有压缩方法难以解决此问题,常依赖脆弱启发式规则或需参数更新,对专有或大规模LLM不适用。本文提出代理上下文优化(ACON),一个统一框架,可将观测与历史高效压缩为简洁且信息丰富的表示。不同于以往工作,ACON在自然语言空间中进行优化:基于智能体失败分析迭代改进压缩准则,确保关键状态信息保留,且无需模型微调。为进一步降低计算开销,我们将优化后的压缩器蒸馏为小型模型。在AppWorld、OfficeBench和多目标问答任务上的实验表明,ACON将峰值令牌使用量降低26%-54%,同时提升任务成功率。尤其重要的是,它使小型语言模型也能有效执行长时序任务,通过缓解上下文干扰,性能最高提升46%。代码已开源:https://github.com/microsoft/acon。
原文摘要 · Abstract (English)
Large language models (LLMs) are increasingly deployed as agents in dynamic real-world environments, where success depends on maintaining precise records of actions and observations. However, the resulting unbounded context growth in long-horizon agentic tasks makes two critical bottlenecks: prohibitive inference memory costs and reasoning degradation due to irrelevant information. Existing compression methods fail to fully address this, often relying on brittle heuristics or requiring parameter updates impractical for proprietary or large-scale LLMs. We introduce Agent Context Optimization (ACON), a unified framework that optimally compresses both observations and history into concise, informative representations. Distinct from prior works, ACON employs an optimization in natural language space: it iteratively refines compression guidelines based on failure analysis of the agent, ensuring critical state information is preserved without model fine-tuning. To further minimize computational overhead, we distill the optimized compressor into smaller models. Experiments on AppWorld, OfficeBench, and Multi-objective QA demonstrate that ACON reduces peak token usage by 26-54% while improving task success over existing compression baselines. Notably, it enables smaller LMs to function effectively as long-horizon agents, achieving up to 46% performance improvement by mitigating context distraction. Our code is available at https://github.com/microsoft/acon.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。