Scaling Long-Horizon LLM Agent via Context-Folding
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
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× smaller and significantly outperforms models that rely on summarization-based context management.
Key facts. Cited by 136 papers in the map (data through 7 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 33 of its 42 references that are in the map. First posted on arXiv 13 Oct 2025.
Builds on
33 of 42 references.
Closest ancestors · 3
Same direction, newest first
- 2025ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization16 Sep
- 2025Agent KB: Leveraging Cross-Domain Experience for Agentic Problem Solving8 Jul
- 2025MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents18 Jun
Other references · 30
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
- 2023A Survey on Large Language Model based Autonomous Agentscited by 2,203
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,081
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 1,908
- 2025Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learningcited by 1,371
- 2022Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agentscited by 1,029
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 956
18 more
- 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 873
- 2025BrowseComp: A Simple Yet Challenging Benchmark for Browsing Agentscited by 616
- 2025WebThinker: Empowering Large Reasoning Models with Deep Research Capabilitycited by 320
- 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 300
- 2025MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agentcited by 235
- 2024Chain of Agents: Large Language Models Collaborating on Long-Context Taskscited by 201
- 2025The Landscape of Agentic Reinforcement Learning for LLMs: A Surveycited by 195
- 2025BrowseComp-Plus: A More Fair and Transparent Evaluation Benchmark of Deep-Research Agentcited by 183
- 2025Measuring AI Ability to Complete Long Software Taskscited by 142
- 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agentscited by 127
- 2025WideSearch: Benchmarking Agentic Broad Info-Seekingcited by 66
- 2025WebResearcher: Unleashing unbounded reasoning capability in Long-Horizon Agentscited by 66
- 2025WebSailor-V2: Bridging the Chasm to Proprietary Agents via Synthetic Data and Scalable Reinforcement Learningcited by 59
- 2025Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Managementcited by 51
- 2024LongAgent: Scaling Language Models to 128k Context through Multi-Agent Collaborationcited by 38
- 2025CO-Bench: Benchmarking Language Model Agents in Algorithm Search for Combinatorial Optimizationcited by 28
- 2024Long Context RAG Performance of Large Language Modelscited by 23
- 2025CoMind: Towards Community-Driven Agents for Machine Learning Engineeringcited by 5
Built on by
Citing papers per year: 2025: 10; 2026: 126.
136 papers.
Sort:
By area:
- 2025Memory in the Age of AI Agentscited by 285
- 2025Recursive Language Modelscited by 94
- 2025DeepAgent: A General Reasoning Agent with Scalable Toolsetscited by 69
- 2026Natural-Language Agent Harnessescited by 54
- 2025Training Proactive and Personalized LLM Agentscited by 42
- 2026Meta Context Engineering via Agentic Skill Evolutioncited by 42
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 40
- 2026A Survey of Agent Memory in the Second Half: Towards Self-Evolving and Long-Horizon Agentscited by 40
- 2026Code as Agent Harnesscited by 40
- 2025Context as a Tool: Context Management for Long-Horizon SWE-Agentscited by 38
- 2026AOrchestra: Automating Sub-Agent Creation for Agentic Orchestrationcited by 30
- 2026SWE-rebench V2: Language-Agnostic SWE Task Collection at Scalecited by 24
38 more
- 2026Anatomy of Agentic Memory: Taxonomy and Empirical Analysis of Evaluation and System Limitationscited by 20
- 2026OS-Symphony: A Holistic Framework for Robust and Generalist Computer-Using Agentcited by 19
- 2026From Storage to Experience: A Survey on the Evolution of LLM Agent Memory Mechanismscited by 19
- 2025Resolving Evidence Sparsity: Agentic Context Engineering for Long-Document Understandingcited by 18
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Trainingcited by 18
- 2026Building Effective AI Coding Agents for the Terminal: Scaffolding, Harness, Context Engineering, and Lessons Learnedcited by 18
- 2026Agentic Aggregation for Parallel Scaling of Long-Horizon Agentic Taskscited by 18
- 2025SCOPE: Prompt Evolution for Enhancing Agent Effectivenesscited by 16
- 2026Scaling the Horizon, Not the Parameters: Reaching Trillion-Parameter Performance with a 35B Agentcited by 16
- 2026MemOCR: Layout-Aware Visual Memory for Efficient Long-Horizon Reasoningcited by 15
- 2026MemoryCD: Benchmarking Long-Context User Memory of LLM Agents for Lifelong Cross-Domain Personalizationcited by 15
- 2026Mem-T: Densifying Rewards for Long-Horizon Memory Agentscited by 14
- 2026ContextBudget: Budget-Aware Context Management for Long-Horizon Search Agentscited by 13
- 2025AI Meets Brain: Memory Systems from Cognitive Neuroscience to Autonomous Agentscited by 12
- 2026MemoBrain: Executive Memory as an Agentic Brain for Reasoningcited by 12
- 2026Learning Agent-Compatible Context Management for Long-Horizon Taskscited by 12
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 12
- 2026Evo-Harness: Context-to-Harness Skill Compilation for Self-Evolving Agentscited by 12
- 2026Memex(RL): Scaling Long-Horizon LLM Agents via Indexed Experience Memorycited by 11
- 2026Coding Agents are Effective Long-Context Processorscited by 11
- 2026ClawGym: A Scalable Framework for Building Effective Claw Agentscited by 11
- 2026VitaBench 2.0: Evaluating Personalized and Proactive Agents in Long-Term User Interactionscited by 11
- 2026Self-Compacting Language Model Agentscited by 11
- 2026SideQuest: Model-Driven KV Cache Management for Long-Horizon Agentic Reasoningcited by 10
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agentcited by 10
- 2026Remember When It Matters: Proactive Memory Agent for Long-Horizon Agentscited by 10
- 2026Recursive Models for Long-Horizon Reasoningcited by 9
- 2026The Pensieve Paradigm: Stateful Language Models Mastering Their Own Contextcited by 8
- 2026All-Mem: Agentic Lifelong Memory via Dynamic Topology Evolutioncited by 8
- 2026Understanding the Challenges in Iterative Generative Optimization with LLMscited by 8
- 2026CompactionRL: Reinforcement Learning with Context Compaction for Long-Horizon Agentscited by 8
- 2026ACM: Agentic Context Management for Long Horizon Taskscited by 8
- 2026U-Fold: Dynamic Intent-Aware Context Folding for User-Centric Agentscited by 7
- 2026Ares: Adaptive Reasoning Effort Selection for Efficient LLM Agentscited by 7
- 2026Decentralized Multi-Agent Systems with Shared Contextcited by 7
- 2026Beyond Compaction: Structured Context Eviction for Long-Horizon Agentscited by 7
- 2025FoldAct: Efficient and Stable Context Folding for Long-Horizon Search Agentscited by 6
- 2026VimRAG: Navigating Massive Visual Context in Retrieval-Augmented Generation via Multimodal Memory Graphcited by 5
50 most cited of 136 All 136 (JSON)
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents1 Oct 2026
- 2026JevSpawn: Adaptive Agentic Inference through Compositional Action Spaces30 Sep 2026
- 2026Persistent Context Graphs for Efficient Memory Compaction in LLM Agents30 Sep 2026
- 2026LatentHarness: Learning Latent Actions for Memory and Reasoning via Counterfactual Policy Distillation30 Sep 2026
- 2026DAGent: Evaluate-then-Grow Planning for Deep Research Agents30 Sep 2026
- 2026Hermes: Learning Contextual Reasoning Unlocks Test-Time Scaling29 Sep 2026
- 2026ContextRender: From Execution Dependencies to Agent Context29 Sep 2026
- 2026Context Language Models29 Sep 2026
- 2026FOCUS: Training-Free Decision-Preserving Context Compression for LLM Agents29 Sep 2026
- 2026Traverse: Learning When to Remember, Reset, and Redirect for Long-Horizon Web Search29 Sep 2026
- 2026CADOC: Cache-Aware Dynamic Object Context for Long-Horizon Agents29 Sep 2026
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learning28 Sep 2026
38 more
- 2026EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?27 Sep 2026
- 2026Probe to Act: Elevating Browser-Use Agent via Active Visual Probing27 Sep 2026
- 2026Beyond Memory Construction: Rethinking Memory Access for LLM-based Conversational Agents27 Sep 2026
- 2026Decision-Sufficient State Representations: Measuring and Reducing Write-Time Regret26 Sep 2026
- 2026Dude, Where's My State? Execution Information Requirements for Stateful Agents26 Sep 2026
- 2026SWE-MILE: Asynchronous Potential-Induced Milestone Credit Assignment for Long-Horizon Software Engineering Agents26 Sep 2026
- 2026Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agents25 Sep 2026
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compression24 Sep 2026
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agents23 Sep 2026
- 2026CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agents22 Sep 2026
- 2026SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness17 Sep 2026
- 2026Parsing the Stream: A Live Trace Model for Long-Horizon Agents and Their Observers1 Sep 2026
- 2026When History Is Multimodal: Rethinking Context Management for Long-Horizon Agents30 Aug 2026
- 2026Terminal Agents: A Survey of AI Agents in Command-Line Environments20 Aug 2026
- 2026HyMem: Hierarchical Context Management for Long-Horizon Agents via Information Isolation16 Aug 2026
- 2026Evo-Harness: Context-to-Harness Skill Compilation for Self-Evolving Agents15 Aug 2026
- 2026MemOPD: On-Policy Distillation through Memory State Alignment for Long-Horizon Agents7 Aug 2026
- 2026The Horizon Gap: Planning, Memory, Execution, Training, and Evaluation for Long-Horizon LLM Agents7 Aug 2026
- 2026Boosting Deepresearch and LongContext Ability with Self-Generated Deepresearch Rollouts Traces5 Aug 2026
- 2026OneDayAgent: Towards a Long-Horizon Harness for Autonomous Agents4 Aug 2026
- 2026Screenshots or Tools? Eliciting Tool Use and Managing Multimodal Context in Hybrid GUI-MCP Computer-Use Agents4 Aug 2026
- 2026PI-Mem: Pushing Long-Context Reasoning to 3.6M Tokens with Parallel-Iterative Memory4 Aug 2026
- 2026AutoFyn Technical Report: Non-Parametric Expert Iteration for Long-Horizon Agents31 Jul 2026
- 2026Speculate While You Reason: Teaching Agents to Predict Their Next Tool Call via Joint Agent-Speculator RL28 Jul 2026
- 2026ACM: Agentic Context Management for Long Horizon Tasks26 Jul 2026
- 2026Recursive Language Models Generalize Out of Domain23 Jul 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents9 Jul 2026
- 2026Beyond the Leaderboard: A Synthesis of Tool-Use, Planning, and Reasoning Failures in Large Language Model Agents7 Jul 2026
- 2026CompactionRL: Reinforcement Learning with Context Compaction for Long-Horizon Agents6 Jul 2026
- 2026CoACT: Action-Preserving Observation Compression for Coding Agents3 Jul 2026
- 2026ECHO: Prune To Act, Trace To Learn With Selective Turn Memory In Agentic RL30 Jun 2026
- 2026ACE: Pluggable Adaptive Context Elasticizer across Agents30 Jun 2026
- 2026Scaling the Horizon, Not the Parameters: Reaching Trillion-Parameter Performance with a 35B Agent29 Jun 2026
- 2026LLM Agents Are Latent Context Managers: Eliciting Self-Managed Context via State Proprioception29 Jun 2026
- 2026Diagnosing and Mitigating Context Rot in Long-horizon Search29 Jun 2026
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents26 Jun 2026
- 2026Self-Compacting Language Model Agents22 Jun 2026
50 newest of 136 All 136 (JSON)
- 2025Memory in the Age of AI Agentscited by 285
- 2025Training Proactive and Personalized LLM Agentscited by 42
- 2026Meta Context Engineering via Agentic Skill Evolutioncited by 42
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 40
- 2026A Survey of Agent Memory in the Second Half: Towards Self-Evolving and Long-Horizon Agentscited by 40
- 2026Code as Agent Harnesscited by 40
- 2025Context as a Tool: Context Management for Long-Horizon SWE-Agentscited by 38
- 2026AOrchestra: Automating Sub-Agent Creation for Agentic Orchestrationcited by 30
- 2026SWE-rebench V2: Language-Agnostic SWE Task Collection at Scalecited by 24
- 2026Anatomy of Agentic Memory: Taxonomy and Empirical Analysis of Evaluation and System Limitationscited by 20
- 2026From Storage to Experience: A Survey on the Evolution of LLM Agent Memory Mechanismscited by 19
- 2025Resolving Evidence Sparsity: Agentic Context Engineering for Long-Document Understandingcited by 18
12 most cited of 77 All 77 (JSON)
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents1 Oct 2026
- 2026Persistent Context Graphs for Efficient Memory Compaction in LLM Agents30 Sep 2026
- 2026DAGent: Evaluate-then-Grow Planning for Deep Research Agents30 Sep 2026
- 2026ContextRender: From Execution Dependencies to Agent Context29 Sep 2026
- 2026FOCUS: Training-Free Decision-Preserving Context Compression for LLM Agents29 Sep 2026
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learning28 Sep 2026
- 2026EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?27 Sep 2026
- 2026Decision-Sufficient State Representations: Measuring and Reducing Write-Time Regret26 Sep 2026
- 2026SWE-MILE: Asynchronous Potential-Induced Milestone Credit Assignment for Long-Horizon Software Engineering Agents26 Sep 2026
- 2026Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agents25 Sep 2026
- 2026CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agents22 Sep 2026
- 2026SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness17 Sep 2026
12 newest of 77 All 77 (JSON)
- 2025Recursive Language Modelscited by 94
- 2025DeepAgent: A General Reasoning Agent with Scalable Toolsetscited by 69
- 2026Agentic Aggregation for Parallel Scaling of Long-Horizon Agentic Taskscited by 18
- 2026MemoBrain: Executive Memory as an Agentic Brain for Reasoningcited by 12
- 2026SideQuest: Model-Driven KV Cache Management for Long-Horizon Agentic Reasoningcited by 10
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agentcited by 10
- 2026Recursive Models for Long-Horizon Reasoningcited by 9
- 2026Ares: Adaptive Reasoning Effort Selection for Efficient LLM Agentscited by 7
- 2026Decentralized Multi-Agent Systems with Shared Contextcited by 7
- 2026LightThinker++: From Reasoning Compression to Memory Managementcited by 4
- 2026Hindsight Hint Distillation: Scaffolded Reasoning for SWE Agents from CoT-free Answerscited by 4
- 2026See, Remember, Explore: A Benchmark and Baselines for Streaming Spatial Reasoningcited by 3
12 most cited of 29 All 29 (JSON)
- 2026JevSpawn: Adaptive Agentic Inference through Compositional Action Spaces30 Sep 2026
- 2026LatentHarness: Learning Latent Actions for Memory and Reasoning via Counterfactual Policy Distillation30 Sep 2026
- 2026Hermes: Learning Contextual Reasoning Unlocks Test-Time Scaling29 Sep 2026
- 2026Beyond Memory Construction: Rethinking Memory Access for LLM-based Conversational Agents27 Sep 2026
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compression24 Sep 2026
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agents23 Sep 2026
- 2026The Horizon Gap: Planning, Memory, Execution, Training, and Evaluation for Long-Horizon LLM Agents7 Aug 2026
- 2026PI-Mem: Pushing Long-Context Reasoning to 3.6M Tokens with Parallel-Iterative Memory4 Aug 2026
- 2026Speculate While You Reason: Teaching Agents to Predict Their Next Tool Call via Joint Agent-Speculator RL28 Jul 2026
- 2026Beyond the Leaderboard: A Synthesis of Tool-Use, Planning, and Reasoning Failures in Large Language Model Agents7 Jul 2026
- 2026HyperTool: Beyond Step-Wise Tool Calls for Tool-Augmented Agents11 Jun 2026
- 2026Decentralized Multi-Agent Systems with Shared Context9 Jun 2026
12 newest of 29 All 29 (JSON)
- 2026Natural-Language Agent Harnessescited by 54
- 2026Mem-T: Densifying Rewards for Long-Horizon Memory Agentscited by 14
- 2026Remember When It Matters: Proactive Memory Agent for Long-Horizon Agentscited by 10
- 2026The Pensieve Paradigm: Stateful Language Models Mastering Their Own Contextcited by 8
- 2026Understanding the Challenges in Iterative Generative Optimization with LLMscited by 8
- 2026SWE-AGILE: A Software Agent Framework for Efficiently Managing Dynamic Reasoning Contextcited by 5
- 2026How Inference Compute Shapes Frontier LLM Evaluationcited by 5
- 2026Recursive Agent Optimizationcited by 4
- 2026The Y-Combinator for LLMs: Solving Long-Context Rot with λ-Calculuscited by 3
- 2026Economy of Minds: Emerging Multi-Agent Intelligence with Economic Interactionscited by 3
- 2026TraceMem: Weaving Narrative Memory Schemata from User Conversational Tracescited by 2
- 2026Self-Manager: Parallel Agent Loop for Long-form Deep Researchcited by 1
12 most cited of 25 All 25 (JSON)
- 2026Context Language Models29 Sep 2026
- 2026Traverse: Learning When to Remember, Reset, and Redirect for Long-Horizon Web Search29 Sep 2026
- 2026CADOC: Cache-Aware Dynamic Object Context for Long-Horizon Agents29 Sep 2026
- 2026Probe to Act: Elevating Browser-Use Agent via Active Visual Probing27 Sep 2026
- 2026Dude, Where's My State? Execution Information Requirements for Stateful Agents26 Sep 2026
- 2026When History Is Multimodal: Rethinking Context Management for Long-Horizon Agents30 Aug 2026
- 2026MemOPD: On-Policy Distillation through Memory State Alignment for Long-Horizon Agents7 Aug 2026
- 2026Boosting Deepresearch and LongContext Ability with Self-Generated Deepresearch Rollouts Traces5 Aug 2026
- 2026AutoFyn Technical Report: Non-Parametric Expert Iteration for Long-Horizon Agents31 Jul 2026
- 2026Recursive Language Models Generalize Out of Domain23 Jul 2026
- 2026Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents9 Jul 2026
- 2026Diagnosing and Mitigating Context Rot in Long-horizon Search29 Jun 2026
12 newest of 25 All 25 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2026PRO-LONG: Programmatic Memory Enables Long-Horizon Reasoning
- 2026Escaping the Context Bottleneck: Active Context Curation for LLM Agents via Reinforcement Learning
- 2026Parallel Context Compaction for Long-Horizon LLM Agent Serving
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agents
- 2026ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RL
- 2026Toward Reliable Context Compression for Long-Horizon Agents: An Empirical Study of Execution Instability
- 2024Controlling Large Language Model Agents with Entropic Activation Steering
- 2026A Subgoal-driven Framework for Improving Long-Horizon LLM Agents