NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AutoMem: Automated Learning of Memory as a Cognitive Skill

Shengguang Wu, Hao Zhu, Yuhui Zhang, Xiaohan Wang, Serena Yeung-Levy

TL;DR

AutoMem introduces a novel framework that treats memory management for LLM agents as an active, learnable cognitive skill rather than a static architectural module. By automating both the optimization of memory structures (prompts and schemas) and the training of model proficiency, AutoMem boosts a 32B open-weight model's performance by 2× to 4× on long-horizon tasks, making it competitive with frontier models like Claude 4.5 and Gemini 3.1 Pro Thinking.

What Problem Does This Paper Address?

While the context window of a Large Language Model (LLM) acts like human working memory, long-horizon tasks routinely overwhelm this fixed-size buffer. Traditional solutions treat external memory as a static architectural component—such as a vector database or a fixed summary buffer.

However, cognitive science tells us that humans rely on metamemory: the learned skill of actively deciding what is worth remembering, how to organize it, and when to retrieve it. Replicating this in LLM agents is incredibly difficult. Long-horizon tasks can run for tens of thousands of steps, and a single memory mistake (like failing to log a coordinate or duplicating data) might not cause a visible failure until hundreds of steps later. This delayed-consequence problem makes manual prompt engineering and human review of full execution logs entirely impractical.

Methods

AutoMem addresses this challenge by promoting file-system operations (read, write, search, append, create) to first-class actions within the agent's action space. The model itself decides how to manage its memory files alongside its standard environment actions.

To optimize this skill, AutoMem implements two sequential, automated outer loops driven by a powerful "meta-LLM" (such as Claude):

  1. Outer-Loop 1 (Scaffold Optimization): The meta-LLM acts as a code reviewer. It reads complete episode traces, diagnoses where the memory structure failed, and iteratively rewrites the agent's scaffold—including the code, prompts, and memory file schemas. For instance, it might replace an unwieldy append-only map file with a deduplicated coordinate-keyed format.
  2. Outer-Loop 2 (Memory Proficiency Training): Once the structure is optimized, AutoMem refines the model's parametric ability to use that structure. The meta-LLM filters the agent's own historical trajectories to curate high-quality memory decisions. It then uses this data to fine-tune a dedicated memory specialist model via LoRA, while keeping the core gameplay model frozen. This ensures memory proficiency sharpens without degrading the agent's existing task competence.
Overview of the AutoMem framework showing the dual-loop optimization process.

Datasets

The authors evaluated AutoMem using the BALROG benchmark, focusing on three procedurally generated, long-horizon game environments that minimize the utility of pretraining knowledge:

  • Crafter: A 2D open-world survival and crafting game (~10³ steps).
  • MiniHack: A suite of focused puzzle, navigation, and combat tasks (~10² steps).
  • NetHack: A notoriously complex roguelike game with vast exploration spaces and episodes spanning $10^4$ to $10^5$ steps.

Key Insights and Ideas

  • Memory is a Separable, High-Leverage Skill: You do not need to modify an agent's task-action weights to achieve massive performance gains. Optimizing how the agent interacts with its memory alone yields outsized benefits.
  • Better Memory Dictates Better Actions: Even though the optimization loops only target memory management, they inherently improve task behavior. Better-organized memory naturally reduces redundant exploration and directionless pacing.
  • The Emergence of Discipline: Proficiency training naturally internalizes a "consult-before-write" discipline. Instead of blindly logging data, the trained memory specialist learns to search existing files first to see if the information is already present.

Key Results

AutoMem achieved dramatic performance improvements across the board using Qwen2.5-32B-Instruct as the base model:

  • Massive Progression Gains: Game progression scores roughly doubled or tripled across all environments: Crafter jumped from 25.0% to 51.36%, MiniHack rose from 7.5% to 30.0%, and NetHack increased from 0.42% to 1.85%.
  • Beating Model Scale: The optimized 32B agent substantially outperformed the larger Qwen2.5-72B-Instruct base model, proving that smart memory management is higher-leverage than raw model scale.
  • Closing the Proprietary Gap: The framework brought the 32B open-weight model to parity with frontier proprietary systems like Claude Opus 4.5 and Gemini 3.1 Pro Thinking.
  • Behavioral Efficiency: Scaffold optimization cut "unproductive actions" (steps where the agent was stuck or oscillating back and forth) by 32% to 65% and reduced redundant memory writes by up to 83%.
Figure 1: Memory skill optimization with Qwen2.5-32B-Instruct. Starting from a base agent equipped with file-system memory (v0), AUTOMEM progressively improves performance through memory scaffold optimization (v0–v5/v4/v2), followed by memory proficiency training (+train) that yields further gains on top of the optimized scaffold.

Limitations and Future Work

Despite its success, the authors note a few key limitations:

  • Episodic Constraints: The agent's memory file system resets at the beginning of each episode. Developing persistent memory that carries knowledge across different episodes remains an open challenge.
  • Environment Specificity: AutoMem currently optimizes a separate scaffold and memory specialist for each game. Future work is needed to explore whether a single, unified memory scaffold can generalize across entirely different environments.
  • Scope of Evaluation: The framework was validated exclusively on simulated game environments; its efficacy in real-world, information-heavy software engineering or data-analysis tasks has yet to be tested.

Summary updated

BibTeX
@inproceedings{wu2026automem,
  author = {Shengguang Wu and Hao Zhu and Yuhui Zhang and Xiaohan Wang and Serena Yeung-Levy},
  title = {{AutoMem: Automated Learning of Memory as a Cognitive Skill}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=gOtWoYZuUo},
}
Figure