Scaling Long-Horizon Agent via Context Folding
Weiwei Sun, Lu Miao, Zhan Ling, Kang Liu, Xuesong Yao, Yiming Yang, Jiecao Chen
摘要
Large language model (LLM) agents are fundamentally constrained by context length on long-horizon tasks. Existing agent frameworks usually rely on manually defined context engineering pipelines, such as multi-agent or post-hoc summary. 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 propose FoldGRPO, an end-to-end reinforcement learning framework with specific process rewards to encourage effective task decomposition and context management. On long-horizon tasks, our agent matches the performance of baselines while using an active context up to 10x smaller, and significantly outperforms models constrained to the same context size. Code is available at https://github.com/sunnweiwei/FoldAgent.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Tree of Thoughts: Deliberate Problem Solving with Large Language Models 引用了 Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agents
- LightWM: Training-Free Hierarchical Working Memory for Small Language Model Agents 引用了 Tree of Thoughts: Deliberate Problem Solving with Large Language Models
- LightWM: Training-Free Hierarchical Working Memory for Small Language Model Agents 引用了 Graph of Thoughts: Solving Elaborate Problems with Large Language Models
- ACON: Optimizing Context Compression for Long-horizon LLM Agents 引用了 SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Graph of Thoughts: Solving Elaborate Problems with Large Language Models 引用了 Tree of Thoughts: Deliberate Problem Solving with Large Language Models
- Graph of Thoughts: Solving Elaborate Problems with Large Language Models 引用了 Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agents
引用它的顶会 Paper4
- Resolving Evidence Sparsity: Agentic Context Engineering for Long-Document UnderstandingKeliang Liu, Zizhi Chen, Mingcheng Li, Jingqun Tang 等CVPR 2026 · 19 次引用
- Mem-T: Densifying Rewards for Long-Horizon Memory AgentsYanwei Yue, Guibin Zhang, Boci Peng, Xuanbo Fan 等ICML 2026
- LightWM: Training-Free Hierarchical Working Memory for Small Language Model AgentsZiyi Wang, Haonan Jin, Zian Wang, Wendong Wang 等ICML 2026
- ACON: Optimizing Context Compression for Long-horizon LLM AgentsMinki Kang, Wei-Ning Chen, Dongge Han, Huseyin Inan 等ICML 2026
它引用的 Paper15
- Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran 等NeurIPS 2023 · 5,068 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
- SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao 等ICLR 2024 · 2,082 次引用
- Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied AgentsWenlong Huang, Pieter Abbeel, Deepak Pathak, Igor MordatchICML 2022 · 1,539 次引用
- Graph of Thoughts: Solving Elaborate Problems with Large Language ModelsMaciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger 等AAAI 2024 · 1,292 次引用
相关 Paper
- U-Fold: Dynamic Intent-Aware Context Folding for User-Centric AgentsJin Su, Runnan Fang, Yeqiu Li, Xiaobin Wang 等ACL Findings 2026
- AgentFold: Long-Horizon Web Agents with Proactive Context FoldingRui Ye, Zhongwang Zhang, Kuan Li, Huifeng Yin 等ICLR 2026 · 45 次引用
- Beyond the Context Window: Scaling Agentic RL via End-to-end Optimized Context CompressionMiao Lu, Weiwei Sun, Weihua Du, Zhan Ling 等ACL 2026
- Context as a Tool: Context Management for Long-Horizon SWE-AgentsShukai Liu, Bo Jiang, Jian Yang, Yizhi Li 等ACL Findings 2026
- PACE: Predictive Adaptive Context Extraction for Long-Horizon LLM AgentsLei Wei, Xiao Peng, TT, Guannan Zhang 等ACL 2026
