Continuous Context Management
作者: William Hoy, Jingxuan Fan, Nurcin Celik, Xu Pan
分类: cs.AI
发布日期: 2026-09-28
💡 一句话要点
提出连续上下文管理方法以优化长时交互历史处理
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 长时大语言模型 上下文管理 历史压缩 强化学习 蒸馏训练 智能代理 对话系统
📋 核心要点
- 现有的长时大语言模型在处理交互历史时容易导致输入量和提示大小过大,影响模型性能。
- 本文提出的连续上下文管理(CCM)方法在每个回合进行历史压缩,保留必要的信息以优化模型的输入效率。
- 实验结果显示,CCM在多个模型上显著降低了输入使用量,并在特定情况下提升了模型的任务成功率。
📝 摘要(中文)
长时大语言模型(LLM)代理通常在达到预定义阈值时保留完整的交互历史。本文研究了连续上下文管理(CCM),该方法在每个回合进行压缩,以防止交互历史在活动提示中积累。CCM代理在每个回合发出更新的记忆和环境动作,其下一个提示包含原始任务、保留的记忆和最新观察,而不是完整的记录。实验结果表明,CCM显著减少了输入使用量和活动提示大小,尽管对大多数模型的任务成功率有所降低,但Kimi K3的性能得以保持。通过特权全历史蒸馏的GRPO方法进一步提升了CCM的表现,尤其在WebShop和Endless Terminals的实验中显示出显著的改进。
🔬 方法详解
问题定义:本文旨在解决长时大语言模型在处理交互历史时面临的输入量过大和提示大小膨胀的问题。现有方法通常在达到阈值时才进行历史压缩,导致效率低下。
核心思路:提出的连续上下文管理(CCM)方法在每个回合都进行历史压缩,确保每次提示仅包含必要的信息,从而减少输入量和提示大小。
技术框架:CCM的整体架构包括三个主要模块:任务描述、保留的记忆和最新观察。每个回合,代理会更新记忆并执行环境动作,生成新的提示。
关键创新:CCM的最大创新在于其动态历史压缩机制,与传统方法相比,能够在每个回合实时更新上下文,显著提高了输入效率。
关键设计:在实现中,采用了特权全历史蒸馏的GRPO方法,通过冻结学生模型的初始副本来评估每个采样动作,提供密集的动作标记监督,避免了额外的教师回合或参考解决方案。
🖼️ 关键图片
📊 实验亮点
实验结果显示,CCM在WebShop任务中显著提升了模型的表现,尤其在Qwen3-4B-Instruct模型上超越了全历史GRPO,尽管在Qwen3-8B模型上未能实现相同的提升。此外,CCM在Endless Terminals任务中也表现出相对较好的改进,所有CCM策略均优于未训练的全历史基线。
🎯 应用场景
该研究的潜在应用领域包括智能助手、对话系统和自动化客服等场景,能够有效提升模型在长时交互中的表现,减少资源消耗,优化用户体验。未来,CCM方法有望在更多复杂任务中得到应用,推动智能代理的进一步发展。
📄 摘要(原文)
Long-horizon large language model (LLM) agents commonly retain their complete interaction history until compaction is triggered at a predefined threshold. We study Continuous Context Management (CCM), which performs compaction at every turn to prevent interaction history from accumulating in the active prompt. At each turn, a CCM agent emits an updated memory together with an environment action; its next prompt contains the original task, retained memory, and newest observation rather than the complete transcript. We first evaluate CCM without fine-tuning on TerminalBench-2 using Claude Sonnet 4.6, Claude Opus 4.6, GLM-5, and Kimi K3. CCM substantially reduces cumulative input usage and active-prompt size, although it lowers task success for most models while preserving performance for Kimi K3. We use GRPO with privileged full-history distillation to improve CCM in open-weight models. A frozen copy of the student's initial model scores each sampled student action under the complete history reconstructed from that student's rollout, providing dense action-token supervision without a separate teacher rollout or reference solution. On WebShop, this objective substantially improves CCM over GRPO at both evaluated model scales and surpasses full-history GRPO for Qwen3-4B-Instruct, though not for Qwen3-8B. On Endless Terminals, the augmented method provides a modest improvement over GRPO, with both CCM policies outperforming the untrained full-history baseline. These results demonstrate that CCM is a viable inference paradigm for agents operating with substantially reduced retained context and that its performance can be improved through reinforcement learning with privileged full-history distillation.