SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent
Yuyang Hu, Hongjin Qian, Shuting Wang, Jiongnan Liu, Ziliang Zhao, Jiejun Tan, Zheng Liu, Zhicheng Dou · 2026
Read SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent by Yuyang Hu, Hongjin Qian, Shuting Wang, Jiongnan Liu, Ziliang Zhao, Jiejun Tan, Zheng Liu, Zhicheng Dou (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-24468.txt.
Introduction
Hu and seven co-authors propose State-Adaptive Memory, a frame for reasoning consolidating interaction into compact cues. Long histories challenge agents not just by length, but because information may sit in distant steps. Existing fixes truncate, compress, or retrieve history, but none model how past access should adapt to state. Memory cues act as handles for rebuilding distant information as needs dictate. The memory module is tuned through expert-guided supervision and reinforcement learning. Across BrowseComp, BrowseComp-ZH, WideSearch, and HLE, the frame beats strong baselines across backbones.
Catalog record
| CREATOR | Yuyang Hu, Hongjin Qian, Shuting Wang, Jiongnan Liu, Ziliang Zhao, Jiejun Tan, Zheng Liu, Zhicheng Dou |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 90242 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.24468
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent Yuyang Hu, Hongjin Qian, Shuting Wang, Jiongnan Liu, Ziliang Zhao, Jiejun Tan, Zheng Liu, Zhicheng Dou Abstract Long-horizon agentic reasoning requires large language models to act over long interaction histories containing thoughts, tool calls, observations, and partial conclusions. The challenge is not merely that these histories grow long, but that information needed for the current decision may be scattered across distant steps and only become relevant later. Existing approaches address this difficulty by truncating the interaction history, compressing it into shorter surrogates, or retrieving selected parts of it for reuse, but they do not explicitly model how access to past interaction should adapt to the agent’s evolving state. We instead cast long-horizon reasoning as a problem of state-adaptive memory. To this end, we propose State-Adaptive Memory (SAM), a standalone framework that consolidates ongoing interaction into compact memory cues while preserving raw trajectory pages for intent-driven recall. These cues are not treated as replacements for history; rather, they serve as lightweight handles that allow the agent to reconstruct temporally distant information according to its current needs, without retraining the underlying backbone. We further optimize the memory module through expert-guided supervision and reinforcement learning, aligning it with trajectory-level utility. Across BrowseComp, BrowseComp-ZH, WideSearch, and HLE, SAM consistently outperforms strong baselines over diverse agent backbones. Our results suggest that explicit memory modeling provides a simple and effective foundation for long-horizon agentic reasoning. Our code is available at https://github.com/qhjqhj00/cabeza . 1 Introduction Large language models (LLMs) are increasingly used as agents that reason and interact with external environments over extended horizons ( 16 ; 40 ; 10 ; 13 ; 15 ; 43 ) . Unlike single-pass generation, these tasks require the model to continually gather evidence, track progress, and choose subsequent actions based on a growing interaction history ( 33 ; 40 ; 28 ; 26 ; 21 ; 32 ; 23 ) . As this history accumulates, it quickly becomes long and heterogeneous, interleaving thoughts, tool calls, observations, and partial conclusions. The resulting challenge is not only to continue reasoning, but also to recover what has already been established, what remains unresolved, and what information is needed next ( 29 ; 41 ; 36 ; 2 ) . For example, information encountered early in a trajectory may appear peripheral at first, yet later become critical for choosing the next action, ruling out an incorrect branch, or interpreting newly acquired evidence ( 9 ) . Long-horizon agentic reasoning therefore poses a central problem of how to organize past trajectories so that it remains accessible to the current decision. Many existing approaches address this problem, at least in part, through context management. Common strategies include discarding interaction history ( 3 ) , folding earlier steps into compact summaries ( 42 ; 29 ; 15 ; 37 ; 25 ; 2 ) , or retrieving selected past content for reuse ( 22 ; 45 ; 7 ; 38 ; 27 ; 44 ) . These methods can be effective when the information needed for the next step remains recent or can be adequately preserved in compressed form ( 47 ; 42 ; 20 ; 11 ; 31 ; 48 ) . However, long-horizon trajectories are often less forgiving: useful information may be distributed across distant steps, and its importance may only become apparent as the task unfolds. In such cases, the difficulty lies not only in limiting context length, but also in making past information available in a form that matches the agent’s current needs ( 39 ; 14 ; 18 ; 19 ; 25 ; 2 ) . We argue that this challenge is better understood as one of state-adaptive memory. At any moment, an agent needs a coherent view of what has been established, what has been resolved, and what should be pursued next . Yet these elements are rarely presented explicitly in the raw trajectory; instead, they are scattered across a growing stream of loosely organized interaction history. A more natural view is that not all past information should remain equally active: as interaction unfolds, rich local context must gradually give way to a more compact form that still preserves what may later need to be recalled, echoing the classic distinction between active and more persistent memory states ( 1 ; 9 ) . From this perspective, the goal is not to keep the entire past in view, but to make the right parts of past information recoverable when the agent’s current state demands them ( 9 ) . To this end, we propose State-Adaptive Memory (SAM) , a standalone framework that equips an agentic LLM with an external memory model for trajectory consolidation and intent-driven recall. Rather than asking the agent to carry an ever-growing history forward, SAM converts ongoing interaction into two coupled forms: compact memory cues that remain visible in context as lightweight summaries and entry points for deeper recall, and raw trajectory pages preserved outside the live context window. Crucially, the cues are not treated as replacements for history; they act as persistent handles to the underlying pages. When the agent needs to revisit the past, it selects potentially relevant cues according to its current intent, and the memory model reconstructs the needed information from the corresponding pages. SAM therefore turns long-horizon history from a passive burden into a navigable memory space, enabling the agent to access temporally distant information on demand. This design also changes what it means to optimize memory. In SAM, memory is a representation whose value is realized only through future use: it must compress ongoing interaction, preserve information whose importance may surface only later, and remain recoverable under a changing decision state. We therefore optimize memory as an independent capability rather than absorbing it into a particular agent backbone: leading LLMs first validate the SAM framework, then this capability is transferred into a compact memory model via expert-guided supervision from rejection sampling, and finally refined with end-to-end RL (OAT-GRPO) in the full agent-environment loop. The result is a reusable memory module aligned with delayed, trajectory-level decision utility rather than local summary quality alone. We evaluate SAM on four long-horizon agent benchmarks: BrowseComp ( 34 ) , BrowseComp-ZH ( 46 ) , WideSearch ( 35 ) , and HLE ( 24 ) . Across these settings, SAM consistently outperforms strong baselines over diverse agent backbones, indicating that explicit memory modeling can substantially improve long-horizon reasoning. Our contributions are threefold: (1) we formulate long-horizon context management as a state-adaptive memory problem, emphasizing demand-driven access to temporally distant information rather than recency-based compression alone; (2) we introduce a cue-page memory architecture that decouples lightweight write-time consolidation from intent-conditioned read-time reconstruction over preserved raw trajectory pages; and (3) we develop an optimization recipe for standalone memory models, combining expert-guided supervision with OAT-GRPO, a memory-action-level RL objective that assigns credit through memory-call trees and oracle-anchored recoverability rewards. 2 Method 2.1 Preliminary In long-horizon agentic reasoning, the information relevant to the next decision is often only a small and implicit subset of the full interaction history ( 12 ) . Consider a long-horizon agent interacting with an environment to solve a task instance x . At reasoning step t , the agent