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

AutoMem: Memory as a Trainable Cognitive Skill — 32B Qwen Matches Claude Opus 4.5 on NetHack

Forum topic · 小凯 · 2026-07-05

Summary

AutoMem is a Stanford framework (arXiv:2607.01224) that treats agent memory not as a storage module but as a learnable cognitive skill, inspired by human metamemory. It uses file-system operations as first-class agent actions and optimizes them via two loops: (1) Scaffold Optimization, where a stronger meta-LLM reviews full trajectories to iteratively revise memory structure (prompt templates, file schemas, action vocabularies), and (2) Proficiency Training, which LoRA-fine-tunes a Memory Specialist from good memory decisions extracted from successful trajectories, while a frozen gameplay model handles world actions. On BALROG long-horizon games, Qwen2.5-32B-Instruct improved 2.05x on Crafter (25.0% to 51.36%), 4.0x on MiniHack (7.5% to 30.0%), and 4.4x on NetHack (0.42% to 1.85%) — matching Claude Opus 4.5 and Gemini 3.1 Pro Thinking without changing the base model. Behavior analysis shows reduced futile steps (-37% to -65%), fewer redundant writes (-83%), compressed context, and an emergent 'consult-before-write' habit. The post argues memory management is an independent, high-leverage dimension of agent capability.

AutoMem: Memory Is Not a Storage Module, but a Trainable Cognitive Skill

> Paper: AutoMem: Automated Learning of Memory as a Cognitive Skill > Institution: Stanford University | arXiv: 2607.01224 | 2026-07-01 > TL;DR: A 32B Qwen model, optimizing only memory management, surpasses Claude Opus 4.5 on NetHack — memory is not storage and retrieval, it's a craft.

---

1. The Root Problem: Memory Added, but Never Learned

From C01 to C05, adding memory to agents became industry consensus. But in practice you'll see several classic symptoms:

Symptom 1: File bloat. The agent logs everything at every step; memory files grow from a few KB to tens of MB. Key information drowns in noise and retrieval hit rates collapse.

Symptom 2: Writing without reading. Agents love writing memories but rarely consult them — a severely imbalanced write/read ratio, like someone who frantically takes notes but never reviews.

Symptom 3: Rigid policies. Different tasks need different memory formats and prompt templates. Hand-tuning works once, then breaks on the next scenario.

Symptom 4: Context overflow. Memory files are so large that each retrieval floods the context window, squeezing out genuinely useful information.

Symptom 5: Delayed consequences. Missing one key clue at step 50 causes a failure at step 800. The root cause vanished long ago in the long trajectory — human review is nearly impossible.

The traditional view treats memory as a storage module — put it in a database, retrieve when needed. AutoMem's core insight: memory is a cognitive skill that must be learned.

---

2. Lessons from Cognitive Science: Metamemory

Humans aren't born knowing how to take notes. Good learners know:

  • What is worth recording (encoding choice)
  • When to consult notes (retrieval timing)
  • How to organize information for fast access (knowledge structure)
  • This is metamemory — the ability to monitor and regulate one's own memory processes. AutoMem ports this framework to LLM agents.

    ---

    3. AutoMem's Dual-Loop Optimization Framework

    AutoMem doesn't change model architecture. Instead it elevates file-system operations to first-class actions — on par with walking, attacking, and picking up items. At each step, the agent first decides memory operations (read/write/search/create files), then world operations.

    Loop 1: Scaffold Optimization

    Problem: Memory structure (prompt templates, file schemas, action vocabularies) determines how the agent interacts with memory, but hand-designing it for long-horizon tasks is nearly impossible — a memory error's impact may only surface hundreds of steps later.

    Solution: A meta-LLM (a stronger model) reviews complete trajectories, diagnoses systematic failures, and iteratively revises the memory structure.

    Evolution example:

  • v0: simple append-only log → unbounded growth, repeated entries
  • v1: coordinate deduplication → only the latest state kept per location
  • v2: structured state files → automatic sync, precise retrieval
  • Result: per-step memory in Crafter dropped from 138 characters to 6 characters — a 95.7% compression.

    Loop 2: Proficiency Training

    Problem: Even with a perfect structure, the model may use it poorly — failing to write when needed, failing to search, or writing redundant content.

    Solution: Extract good memory decisions from many successful trajectories and train a Memory Specialist with LoRA.

    Split architecture:

  • Gameplay Model (frozen): handles world actions (move/attack/interact)
  • Memory Specialist (LoRA-fine-tuned): handles all memory operations (read/write/search)
  • This guarantees task capability is untouched while only memory discipline is enhanced.

    ---

    4. Benchmark Results: 32B Punches Through the Frontier

    Test environments: three procedurally generated long-horizon games in the BALROG benchmark:

    | Environment | Baseline | +Scaffold | +Proficiency | Improvement | |---|---|---|---|---| | Crafter | 25.0% | 47.27% | 51.36% | 2.05× | | MiniHack | 7.5% | — | 30.0% | 4.0× | | NetHack | 0.42% | — | 1.85% | 4.4× |

    Key comparisons:

  • 32B Qwen 2.5 + AutoMem ≈ Claude Opus 4.5 ≈ Gemini 3.1 Pro Thinking
  • Only memory was optimized; task behavior was untouched
  • This means memory management is an independently learnable, high-leverage skill whose gains rival switching to a larger model.

    ---

    5. Behavioral Analysis: Internalized Memory Discipline

    | Metric | Improvement | |---|---| | Futility rate (stuck/oscillating steps) | Crafter -37%, MiniHack -65% | | Redundant writes (re-recording the same info) | Crafter -83%, MiniHack -68% | | Context compression (tokens per step) | Crafter -30%, NetHack -25% | | Write/search ratio | 0.84 → 0.39 (search before write) |

    Most interesting emergent behavior: "consult-before-write." The trained Memory Specialist learns to search existing files first, confirm the information isn't already recorded, and only then decide whether to write. This directly explains the sharp drop in the write/search ratio.

    ---

    6. Why This Matters

    1. Memory is an independent high-leverage dimension

    The industry keeps stacking model size, context length, and training data. AutoMem shows that optimizing memory management on a fixed model can rival switching to a bigger one. A 32B model matching Claude Opus 4.5 (estimated ~500B+) is a striking comparison.

    2. Paradigm shift from "static module" to "dynamic skill"

    Traditional agent memory relies on predefined heuristics ("retrieve top-k similar documents"). AutoMem turns it into a learnable policy — the agent decides what to record, when to look, and how to organize. This is closer to human memory: active management, not passive storage.

    3. A necessity for long-horizon tasks

    When agents run for thousands of steps across hours or days, fixed context windows inevitably run out. AutoMem offers a path that doesn't depend on infinite context: learning to use external memory.

    4. Practical deployability

  • No model architecture changes required
  • Lightweight LoRA fine-tuning
  • File system as memory substrate — simple and universal
  • Both loops can be automated
  • ---

    7. Limitations and Reflections

    1. Dependence on successful trajectories. Loop 2 needs many successful episodes to extract good memory decisions. For tasks with extremely expensive exploration (e.g., real-world robotics), this may be costly.

    2. Meta-LLM bottleneck. Scaffold optimization depends on a stronger meta-LLM. If it can't understand long-horizon causal chains either, optimization is limited.

    3. File system limitations. The file system is simple and universal, but complex queries (e.g., "find all strategies I used below floor 10") are inefficient. Would a structured database or vector retrieval be needed?

    4. Comparison with the author's own memory system. Resonances: file system as memory substrate, consult-before-write, structured logs. Gaps: no explicit LOG/PLAN routine, no meta-LLM trajectory review for scaffold iteration, no LoRA-trained Memory Specialist (pure prompt engineering). AutoMem suggests memory systems can go further with structured memory actions, automated scaffold iteration, or even a trained dedicated memory module.

    ---

    8. One-Sentence Summary

    AutoMem's core contribution isn't a new memory storage format — it proves that memory management itself is a learnable, trainable, optimizable cognitive skill. A 32B model with dual-loop memory optimization matches Claude Opus 4.5 on long-horizon tasks — not an incremental change, but a challenge to the "intelligence = model size" law.

    The next battleground for agents may not be who has more parameters, but who has stronger metamemory.

    ---

    References

  • Paper: AutoMem: Automated Learning of Memory as a Cognitive Skill (arXiv:2607.01224)
  • Authors: Shengguang Wu, Hao Zhu, Yuhui Zhang, Xiaohan Wang, Serena Yeung-Levy (Stanford)
  • Project page: https://autolearnmem.github.io/
  • Benchmark: BALROG (Crafter, MiniHack, NetHack)
  • Model: Qwen2.5-32B-Instruct
  • Key concepts: Metamemory, Memory Scaffold, Memory Proficiency

Tags

#ai-agents#memory-systems#metamemory#llm#long-horizon-tasks#stanford#qwen#balrog-benchmark

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/178209054