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

A Chinese tech forum post reviews SAM (State-Adaptive Memory), a framework for long-horizon agent reasoning (arXiv: 2605.24468) by researchers from Renmin University of China's GSAI and BAAI, with code at github.com/qhjqhj00/cabeza. The post argues that agent failures on long tasks stem not from limited context windows but from information that appears early yet becomes relevant only later, getting truncated, compressed, or lost in retrieval noise. SAM reframes this as a state-adaptive memory problem, splitting interaction history into compact cues (navigation handles kept in context) and full raw pages (stored externally). At decision time, the agent issues a recall intent; a separate 9B memory model (Qwen3.5-9B) reconstructs decision-relevant content from the corresponding page. Training proceeds in two stages: expert-guided SFT with rejection sampling, followed by OAT-GRPO reinforcement learning with credit assignment over memory-call trees and anchor recoverability rewards. On BrowseComp, BrowseComp-ZH, WideSearch, and HLE, SAM outperforms truncation, rolling-summary, recent-k, and discard-tool baselines across both GLM-4.7 and Qwen3.5-35B-A3B backbones, with advantages growing at longer episode lengths. The author highlights limitations: only 9B/27B memory models tested, web-browsing domains only, and reliance on strong expert models for training signals.

What SAM Is

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

The core thesis: long-horizon agents fail not because context windows are too short, but because "needed information appears far away and only becomes relevant late." Truncation, compression, and similarity retrieval all miss one thing — they never explicitly model how memory access should adapt to the agent's evolving state. SAM reframes this as a state-adaptive memory problem: how to let the agent reconstruct the right information, from the right point in history, at the right moment.

Cue-Page Dual-Track Architecture

SAM splits interaction history into two coupled components:

  • Cues: compact, continuation-oriented summaries kept in the active context — what a page established, ruled out, left unresolved, and what may matter later. Cues are lightweight navigation handles, not compressed replacements of pages.
  • Pages: complete raw trajectory segments (reasoning, tool calls, observations, feedback), stored externally, split at a 32K token budget with local temporal coherence.
  • Write path: trajectory accumulates → split into 32K pages → memory model generates a cue per page (M_sum) → pages move to external storage, cues stay visible.

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

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

    Training: Imitate Experts, Then Optimize for Task Utility

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

    1. Expert-guided SFT: expert trajectories from strong models, rejection-sampled to keep only memory operations from successful runs. 2. OAT-GRPO (Online Anchor Tree GRPO): end-to-end RL in the full agent environment, with credit assignment across the memory-call tree and an anchor recoverability reward — rewarding whether recalled content enables correct decisions, i.e., trajectory-level utility rather than local summary quality.

    Experimental Results

    Setup: 128K context window, management triggered at 64K, 32K pages, max 40 turns per query, avg@3 over three rollouts; tools: search, visit, scholar, python, memory.

    Baselines: w/o CM (keep everything until 128K overflows), discard-tool, recent-k, and rolling summary (strongest heuristic baseline).

    SAM significantly outperforms both the summary baseline and w/o CM on all four benchmarks: BrowseComp, BrowseComp-ZH, WideSearch, and HLE.

    Key findings:

  • At management-trigger moments, SAM shows more tool calls, higher confidence, and higher accuracy than summary — intent-driven recall leads to more decisive states, not context noise.
  • The advantage grows with episode length; the SAM-over-summary gap remains clear even beyond 80 turns, where single rolling summaries start losing useful state.
  • 32K page size performs best; smaller loses local coherence, larger burdens recall.
  • The same 9B memory model transfers across both backbones — the design is modular and model-agnostic.
  • How SAM Differs from Related Work

    | Approach | Limitation | SAM's improvement | |---|---|---| | Truncation (w/o CM) | Fails on long trajectories | Proactive management | | Discard tool responses | Dropped info may matter later | Keep all, recall on demand | | Recent-k | Distant info permanently lost | Intent-driven recall of distant pages | | Rolling summary | Detail loss, state drift | Cues as handles, pages kept intact | | Memorix | Needs pretraining, not modular | Standalone module, no backbone changes | | agentmemory | Semantic retrieval, not intent-driven | Intent + reconstruction | | ReasoningBank | Only learns from failures | Full-trajectory management |

    Limitations

    1. Only 9B (full-parameter) and 27B (LoRA) memory models tested. 2. Validated only on web browsing / knowledge-intensive benchmarks; software engineering, embodied, and long-form generation settings are untested. 3. Both SFT and RL depend on strong expert models (GLM-4.7 / Qwen3.5-35B) for trajectories and rewards — costly, and may inherit expert bias.

    The Author's Take

    The poster argues SAM's real contribution is redefining memory's role: from a storage problem (how to pack/compress more) to a navigation problem (the agent needs a map system to reconstruct history on demand). Two deeper insights:

  • Separation of concerns: backbone handles reasoning, memory module handles context management — like the CPU/MMU split in operating systems. SAM aims to be the agent's MMU.
  • Task-level training signal: OAT-GRPO's anchor recoverability reward asks not "is the summary accurate?" but "did the recall enable the right decision?" — aligning memory optimization directly with final task utility.
The poster also speculates about cross-agent cue-page sharing: agents exchanging knowledge via a common memory interface, without needing unified backbones.

> 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#long-horizon-reasoning#context-management#memory-architectures#reinforcement-learning#grpo#browser-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