用总结压缩对话历史,让大模型在长流程任务中更高效、不超长。
Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Management
- 用LLM自动生成摘要压缩工具调用历史,保持关键信息。
- 在固定上下文长度下,成功率显著提升,且平均使用上下文更短。
- 适合需要长时间交互的任务,如复杂搜索和函数调用。
我们研究了大型语言模型(LLM)代理在长周期多轮工具使用任务中的强化学习(RL)微调问题,其中上下文长度迅速成为核心瓶颈。现有RL流程常面临指令遵循能力下降、推理开销过大以及严格上下文限制等问题。为此,我们引入基于总结的上下文管理机制:通过LLM生成的摘要定期压缩工具调用历史,保留任务相关性信息,从而维持紧凑上下文并突破固定上下文窗口限制。在此框架基础上,我们推导出一种策略梯度表示,使标准LLM RL基础设施能端到端优化工具使用行为与摘要策略。我们构建了SUmmarization augmented Policy Optimization( exttt{SUPO}),该算法支持超出固定上下文限制的长周期训练。在交互式函数调用与搜索任务上的实验表明, exttt{SUPO} 显著提升了成功率达数个百分点,同时保持或降低平均上下文长度。在复杂搜索任务中,当测试时总结轮次超过训练时, exttt{SUPO} 性能仍可进一步提升。结果证明,基于总结的上下文管理是一种原理清晰、可扩展的长周期训练方法。
原文摘要 · Abstract (English)
We study reinforcement learning (RL) fine-tuning of large language model (LLM) agents for long-horizon multi-turn tool use, where context length quickly becomes a fundamental bottleneck. Existing RL pipelines can suffer from degraded instruction following, excessive rollout costs, and most importantly, strict context limits. To address these challenges, we introduce summarization-based context management to training. In specific, it periodically compresses the tool using history by LLM-generated summaries that retain task-relevant information to keep a compact context while enabling the agent to scale beyond the fixed context window. Building on this formulation, we derive a policy gradient representation that seamlessly enables standard LLM RL infrastructures to optimize both tool-use behaviors as well as summarization strategies in an end-to-end fashion. We instantiate this framework with \underline{SU}mmarization augmented \underline{P}olicy \underline{O}ptimization (\texttt{SUPO}), an LLM RL algorithm that enables long-horizon training beyond a fixed context limit. Experiments on interactive function calling and searching tasks demonstrate that \texttt{SUPO} significantly improves the success rate while maintaining the same or even lower working context length compared to baselines. We also demonstrate that for complex searching tasks, \texttt{SUPO} can further improve the evaluation performance when scaling test-time maximum round of summarization beyond that of training time. Our results establish summarization-based context management as a principled and scalable approach for training RL agents beyond a fixed context length limit.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。