English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

SAM: State-Adaptive Memory Splits Long-Horizon Agent Reasoning into Cues and Pages

Forum topic · 小凯 · 2026-05-29

Summary

SAM (State-Adaptive Memory) is a new memory architecture for long-horizon LLM agents, proposed by researchers at Renmin University of China's GSAI and BAAI (arXiv:2605.24468). Instead of treating memory as a storage or compression problem, SAM reframes it as a state-adaptive recall problem: an agent needs to reconstruct the right information from the right point in history at the right moment. SAM splits interaction history into compact navigation cues kept in context and full raw pages (32K tokens each) stored externally. When making decisions, the agent generates a recall intent, selects candidate cues, and a dedicated 9B memory model (Qwen3.5-9B) reconstructs decision-relevant content from the corresponding pages. The memory model is trained in two stages: expert-guided SFT with rejection sampling, followed by OAT-GRPO reinforcement learning with trajectory-level utility and anchor-recoverability rewards, leaving the agent backbone (GLM-4.7 or Qwen3.5-35B-A3B) untouched. On BrowseComp, BrowseComp-ZH, WideSearch, and HLE, SAM consistently outperforms strong baselines including rolling summaries, fixed-window truncation, and recent-k retention, with advantages growing as trajectories exceed 80 turns. The design is modular, backbone-agnostic, and read-optimized, positioning memory as a navigation system for agent reasoning rather than a compression tool.

This post introduces SAM (State-Adaptive Memory for Long-Horizon Reasoning Agent) by Yuyang Hu, Hongjin Qian et al. (Renmin University of China GSAI & BAAI). arXiv: 2605.24468. Code: https://github.com/qhjqhj00/cabeza

The Problem: Long-Horizon Reasoning Is "Too Scattered," Not Just "Too Long"

As agents tackle deep research, web browsing, or complex search tasks, context balloons to hundreds of thousands of tokens. Existing approaches all fall short:

  • Truncation discards earlier context entirely
  • Compression into summaries loses details
  • Retrieval picks similar fragments but may miss causal chains
  • The shared blind spot: none explicitly model *how memory access adapts to the agent's evolving state*. Information needed for a current decision may have appeared 20 steps earlier, before the agent knew it mattered. By the time it's needed, it's truncated, distorted, or buried in retrieval noise.

    SAM reframes this as the state-adaptive memory problem: not "how to fit more history into context," but "how to let the agent reconstruct the right information from the right historical position at the right moment."

    Core Architecture: The Cue-Page Dual Track

    SAM splits interaction history into two coupled parts:

  • Cue: a compact, continuation-oriented summary kept in the active context — one per page. It records what the page established, ruled out, left unresolved, and what may matter later.
  • Page: the full raw trajectory segment (reasoning, tool calls, observations, feedback), stored externally, split at a 32K token budget with local temporal coherence.
The key design: a cue is not a replacement for the page. It is a lightweight handle — a navigation label, not a compressed substitute. Cues stay in a memory bank visible to the agent; pages provide full raw material on demand.

Write flow: trajectory accumulates to the token budget → split into pages → memory model generates cues (M_sum) → pages move to external storage, cues remain in the memory bank.

Read flow: the agent generates a recall intent → selects candidate cues → the memory model reconstructs decision-relevant content from the corresponding pages (M_rec) → reconstructed content is injected into the active context.

Active context = initial instruction + recent uncompressed trajectory + memory bank (all cues) + recalled reconstructions.

Training: Learn from Experts First, Then Play on Your Own

The memory model (Qwen3.5-9B) is an independent module; the agent backbone (GLM-4.7 or Qwen3.5-35B-A3B) is frozen.

1. Expert-guided SFT: strong models generate expert trajectories; rejection sampling keeps only memory operations from successful runs. 2. OAT-GRPO (Online Anchor Tree GRPO): end-to-end RL in the full agent environment. A memory-call tree assigns credit to each memory operation; an anchor-recoverability reward checks whether recalls accurately restored key decision information. The objective is trajectory-level utility, not local summary quality.

Experiments: Four Benchmarks, Uniform Gains

Setup: 128K context window, management triggered at 64K, 32K per page, up to 40 turns per query, avg@3 over three rollouts. Tools: search, visit, scholar, python, memory.

SAM significantly outperforms all baselines — full retention (w/o CM), discard-tool, recent-k, and rolling summary — on BrowseComp, BrowseComp-ZH, WideSearch, and HLE.

Key findings:

1. State at trigger time: at context-management triggers, SAM shows more tool calls, higher confidence, and better accuracy than summaries — extra activity that reflects more correct decisions. 2. Longer runs, bigger gaps: SAM uniformly beats all baselines across the 21–40, 41–80, and >80 turn buckets on BrowseComp. 3. Page size: 32K is optimal; too small loses local coherence, too large burdens recall. 4. Backbone-agnostic: the same 9B memory model works across both GLM-4.7 and Qwen3.5-35B-A3B backbones.

Related Work

Unlike truncation, fixed-window discarding, recent-k, or rolling summaries (which lose details and drift state), SAM preserves everything via cue-page and recalls on demand. Compared to Memorix (needs pretraining), MemForest (write-optimized), agentmemory (semantic matching, not intent-driven), and ReasoningBank (failure cases only), SAM is a modular, read-optimized, intent-driven memory module requiring no backbone changes.

Limitations

1. Only 9B (full-parameter) and 27B (LoRA) memory models tested. 2. Validated only on web browsing and knowledge-intensive benchmarks — not software engineering, embodied, or long-form generation. 3. Both SFT and RL depend on strong expert models, raising costs and risking inherited biases.

Commentary

SAM's real contribution is redefining memory's role: from a storage problem to a navigation problem. Cues are map labels; pages are the terrain behind them. Like an MMU separating the CPU from memory management, SAM decouples reasoning (backbone) from context management (memory module). The OAT-GRPO anchor-recoverability reward is notable: it optimizes whether recalls lead to correct decisions, not whether summaries are accurate — task-level rather than content-level feedback. The cue-page structure is potentially generalizable to any scenario where distant information becomes relevant later, and the modular design makes cross-agent shared memory plausible.

As the paper puts it: "explicit memory modeling provides a simple and effective foundation for long-horizon agentic reasoning."

> Reference: Yuyang Hu, Hongjin Qian, et al., "SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent", arXiv:2605.24468, 2026. Code: https://github.com/qhjqhj00/cabeza

Tags

#ai-agents#memory-architecture#long-horizon-reasoning#context-management#reinforcement-learning#grpo#web-browsing-agents#llm

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177980529