arXiv:2610.40350cs.CLOct 2026

Manuscript Offprint

arXiv:2610.40350

Don't Lose the Thread: Empowering Long-Horizon LLM Agents with Cognitive Resource Self-Allocation

Zheng Zhu, Xiaozhuan Liang, Xi Chen, Bei Yu, Jiaya Jia

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.

1 Introduction

LLM-driven agents extend the capabilities of Large Language Models (LLMs) through the integration of external tools (OpenAI, 2025; Gemini, 2025; Liu et al., 2025; Li et al., 2025d), substantially outperforming single-turn inference. On long-horizon tasks they operate a THOUGHT-ACTION-OBSERVATION cycle (Yao et al., 2022), interleaving planning, environmental interaction, and reasoning (Erdogan et al., 2025; Qiao et al., 2024; Huang et al., 2024). A critical challenge arises as each cycle populates the context with verbose environmental feedback and a history of failed attempts (Wu et al., 2025b; Shinn et al., 2023). This escalating contextual noise progressively degrades the model's planning and reasoning faculties (Yang et al., 2025), a phenomenon comparable to the cognitive overload that impairs human problem-solving when working memory becomes saturated (Baddeley & Hitch, 1974; Sweller, 1988).

Current paradigms for context optimization seek to prevent this bloat by pruning messages or distilling salient information, generally activated by rule-based heuristics such as fixed intervals (Zhou et al., 2025; Yu et al., 2025a) or imminent saturation of the context window (Wu et al., 2025c), and implemented either by truncating the context directly (Luo et al., 2025) or by using external models to compress it (Wu et al., 2025c).

Fundamentally, this redundant context is a consequence of the agent's own imperfect planning: suboptimal tool use generates irrelevant environmental feedback (Wang et al., 2025), which clutters the context and further degrades reasoning, creating a vicious cycle. One line of research breaks this cycle with agentic reinforcement learning (RL) over the tool-

Figure

Figure 1: Comparison of the ReAct and CORAL frameworks; both rows read left to right as the context grows. Top (ReAct). One context accumulates N ReAct blocks (thought, action, observation) above the system prompt and user task, and nothing is ever removed. Bottom (CORAL). The same blocks are interleaved with two agent-callable tools. Memory Management (MM) writes into the persistent MEMORY panel below the trace, holding task progress (the plan, each sub-goal pending or completed) and verified facts, so that panel evolves while the raw trace only grows. Context Optimization (CO), the vertical bar, ends the current episode: everything to its left is discarded and the next episode restarts from only the system prompt, the user task, and the current panel. A trajectory is thus a sequence of episodes (here 0–3).

use policy (Qian et al., 2025; Zhang et al., 2025; Jin et al., 2025), but on long-horizon tasks such methods struggle with reward sparsity, since relying solely on final outcomes makes credit assignment to intermediate actions difficult (Feng et al., 2025; Xia et al., 2025). Proactive context optimization is a powerful orthogonal approach, improving both reasoning quality and RL training dynamics (Kimi, 2025; Wu et al., 2025c).

We therefore introduce the COgnitive Resource Self-ALlocation (CORAL) framework, which extends existing agentic architectures with a callable toolset for working memory management. The agent autonomously invokes a Memory Management tool to checkpoint its task progress and verified facts, and a Context Optimization tool to reset cluttered context while preserving only the checkpointed information, so it can resume reasoning from a clean state. This systematically refocuses the agent's cognitive resources on its current state rather than letting them be diluted by obsolete information. We first instill the checkpointing ability through Supervised Fine-Tuning (SFT).

To further enable the model to discover optimal checkpointing strategies without additional trajectory data, we introduce a Multi-episode Agentic Reinforced Policy Optimization (Multi-episode ARPO) algorithm, which refines the agent's checkpointing policy and improves the overall agentic RL dynamics.

The key contributions of this work are as follows:

• We introduce CORAL, a framework that empowers agents to manage their own working memory through a callable toolset comprising a Memory Management tool and a Context Optimization tool. By dynamically checkpointing progress and resetting cluttered context, CORAL enables robust long-horizon planning and reasoning.

• We propose a two-stage training approach: Supervised Fine-Tuning (SFT) to instill core checkpointing skills, followed by Multi-episode ARPO, a novel RL algorithm that propagates trajectory-level rewards across episode boundaries to optimize checkpointing strategies.

• On GAIA, a suite of multi-hop Knowledge QA tasks, and the harder BrowseComp benchmark, CORAL significantly outperforms existing approaches on challenging long-horizon tasks—while consuming 6–7× fewer input tokens than a ReAct agent, so that better attention management is a source of accuracy rather than a cost paid for it.