通过上下文折叠扩展长程LLM智能体
Scaling Long-Horizon LLM Agent via Context-Folding
AI总结:
本文提出上下文折叠框架及FoldGRPO强化学习方法,使LLM智能体主动管理上下文,在长程任务中匹配或超越基线且上下文使用量减少10倍。
摘要:
大型语言模型(LLM)智能体在长程任务中从根本上受到上下文长度的限制。我们引入了上下文折叠(Context-Folding)框架,该框架使智能体能够主动管理其工作上下文。智能体可以程序化地分支进入子轨迹以处理子任务,并在完成后将其折叠,压缩中间步骤同时保留结果的简明摘要。为了使这种行为可学习,我们开发了一个端到端强化学习框架FoldGRPO,并带有特定的过程奖励,以鼓励有效的任务分解和上下文管理。在复杂的长程任务(深度研究和SWE)上,我们的折叠智能体在匹配或超越ReAct基线的同时,使用的活动上下文小了10倍,并且显著优于依赖基于摘要的上下文管理的模型。
英文摘要:
Large language model (LLM) agents are fundamentally constrained by context length on long-horizon tasks. We introduce Context-Folding, a framework that empowers agents to actively manage their working context. An agent can procedurally branch into a sub-trajectory to handle a subtask and then fold it upon completion, collapsing the intermediate steps while retaining a concise summary of the outcome. To make this behavior learnable, we develop an end-to-end reinforcement learning framework FoldGRPO with specific process rewards to encourage effective task decomposition and context management. On complex long-horizon tasks (Deep Research and SWE), our folding agent matches or outperforms the ReAct baselines while using an active context 10$\times$ smaller and significantly outperforms models that rely on summarization-based context management.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。