arXiv:2510.11967cs.CLcs.LG2025-10被引 107

让大模型主动压缩工作记忆,高效处理长时序任务。

Scaling Long-Horizon LLM Agent via Context-Folding

  • 通过分枝-折叠机制动态管理上下文,自动合并中间步骤
  • 在复杂任务中用1/10的活跃上下文达到或超越基线表现
  • 适合需要长期规划与资源受限的智能体应用

大语言模型代理在长时序任务中受制于上下文长度。我们提出上下文折叠(Context-Folding)框架,使代理能主动管理其工作上下文:可将任务分解为子轨迹执行,完成后折叠并保留结果摘要。为使该行为可学习,我们设计端到端强化学习框架FoldGRPO,采用特定过程奖励促进任务分解与上下文管理。在深度研究(Deep Research)和SWE等复杂长时序任务上,折叠代理在使用仅1/10活跃上下文的情况下,性能与或优于ReAct基线,并显著超越依赖摘要的上下文管理模型。

原文摘要 · Abstract (English)

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.

大模型代理上下文压缩强化学习长时序任务

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