Don't Lose the Thread: Empowering Long-Horizon LLM Agents with Cognitive Resource Self-Allocation
Organizations: The Chinese University of Hong Kong · Tencent · The Hong Kong University of Science and Technology
Abstract
Agents powered by large language models (LLMs) have demonstrated remarkable progress in solving complex reasoning tasks. However, LLM agents often falter on long-horizon tasks due to cognitive overload, as their working memory becomes cluttered with expanding and irrelevant information, which dilutes their attention and hinders effective planning and reasoning. To mitigate this challenge, we introduce Cognitive Resource Self-Allocation (CORAL), a novel reasoning paradigm that empowers agents to proactively optimize their context. Implemented as an agent-callable working memory management toolset, CORAL allows an agent to checkpoint its task progress and verified facts, and adaptively initiate a new problem-solving episode by resetting cluttered context while preserving only the checkpointed information, enabling it to resume reasoning from a clean state. We further enhance the agent's checkpointing capabilities using a Multi-episode Agentic Reinforced Policy Optimization algorithm. On the GAIA benchmark, CORAL with an 8B model achieves 42.8% average accuracy, with particularly strong gains on the most challenging long-horizon tasks (Level 2 and Level 3). Crucially, these gains come at a substantially lower inference cost: CORAL consumes 6-7 fewer input tokens than a ReAct agent. It also generalizes to multi-hop Knowledge QA benchmarks and to the considerably harder BrowseComp, where it improves a strong proprietary agent by 8.0 points.
Figures & tables
| Model | Level 1 | Level 2 | Level 3 | Average |
| Direct Inference | ||||
| GPT-4o | 23.1 | 15.4 | 8.3 | 17.5 |
| DeepSeek-R1 | 43.6 | 26.9 | 8.3 | 31.1 |
| Claude Sonnet 4 | 38.5 | 36.5 | 8.3 | 34.0 |
| Agentic Inference | ||||
| 7–8B backbones | ||||
| Method | per trajectory | GAIA | ||||
|---|---|---|---|---|---|---|
| In. tok. | Calls | Peak ctx. | MM | CO | ||
| ReAct | 1,078K | 45.3 | 30.6K | – | – | 19.4 |
| CORAL Prompting | 314K | 21.8 | 14.3K | 20.6 | 4.3 | 20.4 |
| CORAL SFT | 153K | 15.9 | 13.9K | 3.9 | 0.21 | 41.6 |
| CORAL RL | 136K | 15.2 | 12.7K | 4.1 | 0.21 | 42.8 |
| Method | NQ | HotpotQA | 2Wiki. | Musique | Bamboogle |
|---|---|---|---|---|---|
| Search-o1 | 55.1 | 42.4 | 37.7 | 19.7 | 53.6 |
| R1-Searcher | 52.3 | 53.1 | 65.8 | 25.6 | 65.6 |
| DeepResearcher | 61.9 | 64.3 | 66.6 | 29.3 | 72.8 |
| SimpleDeepSearcher | - | - | 79.8 | 29.4 | 76.8 |
| CORAL | 71.0 | 70.4 | 79.2 | 43.2 | 79.2 |
| SFT training set | #Conv. | L1 | L2 | L3 | Avg |
|---|---|---|---|---|---|
| Full (web + math) | 3,682 | 47.1 | 43.5 | 15.6 | 41.6 |
| w/o math | 3,441 | 47.1 | 40.4 | 14.6 | 39.9 |
| w/o incorrect | 2,030 | 49.7 | 37.5 | 13.5 | 39.3 |
| random subsample | 2,030 | 42.0 | 36.8 | 17.7 | 36.5 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Number of epochs | 3 |
| Learning rate | 1e-5 |
| Per-device batch size | 4 |
| Gradient accumulation steps | 2 |
| Effective batch size | 64 |
| Warmup ratio | 0.05 |
| Hyperparameter | Value |
| Actor learning rate | 1e-6 |
| Train batch size | 64 |
| Mini-batch size | 16 |
| Samples per prompt ( ) | 8 |
| Clip ratio (low) | 0.2 |
| Clip ratio (high) | 0.28 |
| Model | L1 | L2 | L3 | Avg |
|---|---|---|---|---|
| Qwen3-8B + SFT | ||||
| Pass@1 (Avg@8) | 47.1 4.1 | 43.5 4.5 | 15.6 9.4 | 41.6 3.5 |
| Best Pass@1 | 53.8 | 51.9 | 33.3 | 47.6 |
| Worst Pass@1 | 41.0 | 38.5 | 8.3 | 36.9 |
| Maj@8 | 51.3 | 50.0 | 16.7 | 46.6 |
| Pass@8 | 74.4 | 78.9 | 33.3 | 71.8 |
| Configuration | Outcome | MM / traj. | CO / traj. |
|---|---|---|---|
| Prompting-only | Correct | 20.11 | 2.05 |
| Incorrect | 20.69 | 4.80 | |
| Overall | 20.58 | 4.29 | |
| SFT | Correct | 3.37 | 0.12 |
| Incorrect | 4.44 | 0.29 | |
| Overall | 3.93 | 0.21 |
| Backbone | Benchmark | ReAct | + CORAL | |
|---|---|---|---|---|
| Qwen2.5-7B-Instruct | GAIA | 17.5 | 13.6 | 3.9 |
| Qwen3-8B | GAIA | 19.4 | 20.4 | 1.0 |
| QwQ-32B | GAIA | 26.2 | 32.0 | 5.8 |
| Qwen3-32B | GAIA | 34.0 | 36.3 | 2.3 |
| Claude Sonnet 4 | GAIA | 60.2 | 65.0 | 4.8 |
| Claude Sonnet 4 | BrowseComp † | 22.7 | 30.7 | 8.0 |
| # | MM checkpoint | Verified fact recorded |
|---|---|---|
| 1 | Task decomposition | Objective and sub-task plan |
| 2 | Strike identified | Newsboys’ strike of 1899, New York |
| 3 | Company identified | Bumble Bee Seafoods (founded 1897); moved back to downtown San Diego in 2014 |
| 4 | Nu metal band | P.O.D. (“Payable on Death”), formed in San Diego, 1992 |
| 5 | Band and song | Mephiskapheles; “Bumble Bee Tuna Song” (1994), which references Bumble Bee products |
| 6 | Artist identified | Joanna Davidovich; blog post of 10 June 2012 ( ) mentioning the song |
| Metric | CORAL | ReAct |
|---|---|---|
| Total turns | 36 | 47 |
| Web searches | 17 | 42 |
| Page browses | 11 | 4 |
| MM checkpoints | 7 | – |
| Outcome | correct | gave up |
Long-Horizon LLM Agents
Long-horizon large language model agents plan, use tools, and preserve task state across extended, multi-step interactions.
See all 451 papers