Research map / Multi-agent systems and games / LLM agents
Scaling Long-Horizon Agent via Context Folding
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Context Folding, where an LLM agent learns to branch into sub-trajectories and fold them back into a summary, trained end-to-end with FoldGRPO (GRPO plus token-level process rewards), reaching 62.0% on BrowseComp-Plus and 58.0% on SWE-Bench Verified with a 32K active context.
Problem
LLM agents on long-horizon tasks accumulate ever-growing interaction histories, which degrade reasoning and efficiency; existing fixes are post-hoc summarization or handcrafted multi-agent workflows that resist end-to-end optimization.
Approach
Give the agent learnable branch and return tools that fold the intermediate steps of a sub-task into a short return message, and train this behavior with RL using a folded-context GRPO variant with token-level process penalties (unfolded token, out-of-scope, failure) on top of outcome reward.
Key results
- FoldGRPO reaches pass@1 0.620 on BrowseComp-Plus (N=150) with a 32K context and up to 10 branches, versus 0.540 for 327K ReAct+GRPO.
- On SWE-Bench Verified (N=500), the folding agent reaches 0.580 pass@1, versus 0.574 for the 327K ReAct+GRPO baseline.
- FoldGRPO cuts main-thread length to about 8K tokens while processing over 100K total tokens, reported as over 90% context compression.
Surprising findings
- Plain GRPO on the folding agent lowered the finish rate and lengthened the main trajectory on SWE-Bench (0.612 vs 0.781 finish before RL), so folding without process rewards can hurt.
- Parallel branching gave 0.6133 pass@1 on BrowseComp-Plus, similar to single-branch, rather than a clear gain.
Limitations
- Evaluated only on two tasks (BrowseComp-Plus with 150 eval instances and SWE-Bench Verified), with single-branch depth-first structure.
- Out-of-scope penalty relies on an external GPT-5-nano judge.
- Training uses a single base model (Seed-OSS-36B) and a small RL schedule of 50 steps.
Experimental setup
Datasets: BrowseComp-Plus SWE-Gym SWE-Rebench
Benchmarks: BrowseComp-Plus SWE-Bench Verified
Metrics: pass@1 tool calls finish rate scope accuracy number of branches
Baselines: ReAct agent Summary agent GRPO GPT-5 GPT-4.1 DeepSeek-V3.1 GLM-4.5-Air Qwen3-235B-A22B
Builds on: GRPO ReAct VeRL OpenHands
Closest papers by meaning
- Balancing Context Length and Mixing Times for Reinforcement Learning at Scale (NeurIPS 2024 · similarity 0.88)
- Language Control Diffusion: Efficiently Scaling through Space, Time, and Tasks (ICLR 2024 · similarity 0.87)
- MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents (ICLR 2026 · similarity 0.87)
- Controlling Large Language Model with Latent Action (ICML 2025 · similarity 0.86)
- Can large language models explore in-context? (NeurIPS 2024 · similarity 0.86)
- LongRLVR: Long-Context Reinforcement Learning Requires Verifiable Context Rewards (ICLR 2026 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
