MemGen: Weaving Generative Latent Memory for Self-Evolving Agents

Guibin Zhang, Muxin Fu, Shuicheng Yan · 2025

Read MemGen: Weaving Generative Latent Memory for Self-Evolving Agents by Guibin Zhang, Muxin Fu, Shuicheng Yan (2025) 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-2509-24704.txt.

Introduction

Guibin Zhang, Muxin Fu, and Shuicheng Yan propose MemGen in a 2025 paper on memory for language model agents. An agent does tasks by talking and acting step by step, and what it learns should shape later work. Older designs either retrain the model or store notes in a fixed database, and both miss how thought and memory blend in people.

MemGen adds two parts that work while the agent thinks. A trigger watches the thought flow and decides when to call memory up. A weaver then builds a short string of hidden tokens from the current state to enrich the next steps. Across eight test sets, the method beat strong rivals and carried skills to new fields with no extra training.

Catalog record

CREATORGuibin Zhang, Muxin Fu, Shuicheng Yan
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE84 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2509-24704

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

MemGen: Weaving Generative Latent Memory for Self-Evolving Agents Guibin Zhang, Muxin Fu, Shuicheng Yan Abstract Agent memory shapes how Large Language Model (LLM)-powered agents, akin to the human brain, progressively refine themselves through environment interactions. Existing paradigms remain constrained: parametric memory forcibly adjusts model parameters, and retrieval-based memory externalizes experience into structured databases, yet neither captures the fluid interweaving of reasoning and memory that underlies human cognition. To address this gap, we propose MemGen , a dynamic generative memory framework that equips agents with a human-esque cognitive faculty. It consists of a memory trigger , which monitors the agent’s reasoning state to decide explicit memory invocation, and a memory weaver , which takes the agent’s current state as stimulus to construct a latent token sequence as machine-native memory to enrich its reasoning. In this way, MemGen enables agents to recall and augment latent memory throughout reasoning, producing a tightly interwoven cycle of memory and cognition. Extensive experiments across eight benchmarks show that MemGen surpasses leading external memory systems such as ExpeL and AWM by up to 38.22 % 38.22\% , exceeds GRPO by up to 13.44 % 13.44\% , and exhibits strong cross-domain generalization ability. More importantly, we find that without explicit supervision, MemGen spontaneously evolves distinct human-like memory faculties, including planning memory, procedural memory, and working memory, suggesting an emergent trajectory toward more naturalistic forms of machine cognition. † † affiliation: National University of Singapore † † contribution: Equal Contribution † † date: August 10, 2026 † † \faGithub\ Github: https://github.com/KANABOON1/MemGen 1 Introduction The ascent of Large Language Model (LLM)-powered agents marks a paradigm shift across diverse domains ( Luo et al. 2025b ; Yang et al. 2024b ; Qian et al. 2025 ; Singh et al. 2025 ; Pantiukhin et al. 2025 ; Ren et al. 2025 ) . Pivotal to this success is the concept of agent memory ( Zhang et al. 2024b ; Wu et al. 2025b ) , which enables LLM agents to learn progressively from environmental interactions ( Zhang et al. 2025a ; Qiu et al. 2025b ) . Crucially, this conception of agent memory extends beyond that of conversational agents ( i.e. , personalized memory ( Wu et al. 2025b ) ), whose primary role is to sustain coherence across long-horizon, multi-turn dialogues ( Chhikara et al. 2025 ; Xu et al. 2025a ; Packer et al. 2024 ; Zhong et al. 2023 ) . Rather, the scope of this paper is primarily on enabling agents to internalize experience, simulate human-like cognitive iteration, and progressively enhance problem-solving competence ( Gao et al. 2025 ) . The memory serving as this self-evolving engine typically manifests in two dominant paradigms. The first is (I) parametric memory , which internalizes experiences by directly updating agents’ parameters ( Yao et al. 2024 ; Zeng et al. 2023 ; Chen et al. 2024b ; Chen et al. 2025 ) . While this approach can yield substantial performance gains, its reliance on parameter modification inevitably entails catastrophic forgetting , i.e. , the erosion of general knowledge ( Dou et al. 2024 ) . Conversely, the second paradigm is (II) retrieval-based memory , which externalizes past experiences into a structured database, such as (i) raw trajectories ( Luo et al. 2025a ; Zhang et al. 2025a ; Zhao et al. 2024 ) , (ii) high-level experiences ( Zhao et al. 2024 ; Fang et al. 2025 ; Wang et al. 2024c ) , and (iii) condensed skills like reusable APIs ( Zheng et al. 2025 ) or MCP boxes ( Qiu et al. 2025b ; Qiu et al. 2025a ) . Although this non-invasive approach circumvents catastrophic forgetting, its efficacy is fundamentally tethered to context engineering. It adheres to a rigid execution pipeline, providing retrieved context to the agent without achieving the fluid, seamless integration characteristic of truly internalized memory ( Su et al. 2025b ) . Given these deficiencies, latent memory offers a compelling alternative, leveraging latent states as a machine-native, high-density medium for memory. Existing approaches either use the (i) key-value (KV) cache to maintain dynamic memory set ( Gim et al. 2024 ; Jin et al. 2024 ; Hongkang Yang et al. 2024 ) , yet which is primarily confined to addressing long-context issues, or (ii) latent token embeddings to store agent experiences ( Wang et al. 2024b ; Wang et al. 2025a ) , which still rely on invasive LLM parameter updates. More fundamentally, these methods diverge from human cognition in two critical dimensions: they lack the seamless interleaving of reasoning and memory, a process where thought and memory dynamically reshape one another, and remain largely retrieval-based, fetching memories by embedding similarity ( Wang et al. 2024b ) rather than generatively reconstructing them into novel, coherent insights. This leads to our pivotal research question: Figure 1: The comparison among parametric memory, retrieval-based memory and MemGen . How can we architect agent memory as a dynamic cognitive faculty, capable of fluid, reconstructive processes that interweave seamlessly with reasoning? To address this challenge, we introduce MemGen , a dynamic and generative memory framework designed to endow any LLM agent with a more human-esque cognitive faculty. At its core, MemGen continuously monitors an agent’s cognitive state, enabling it to dynamically invoke a generative process that synthesizes a bespoke latent memory at any critical juncture during its reasoning process. Practically, MemGen comprises two synergistic components: a reinforcement learning (RL)-trained \clubsuit memory trigger , which acts as a metacognitive monitor to discern the opportune moments for explicit memory invocation; and a \spadesuit memory weaver , which takes the agent’s current state as a stimulus to draw upon relevant implicit parametric memory (potentially augmented with externally retrieved information) and then reconstructs this synthesis into a succinct, machine-native latent memory . With the reasoning core fixed, MemGen inherently mitigates catastrophic forgetting when exposed to new data, and, moving beyond the static and extractive paradigm of prior memory systems, equips agents with a fluid, generative faculty deeply integrated with reasoning cores. Experimental Observation. Extensive experiments across nine benchmarks and four baseline categories demonstrate that MemGen delivers ❶ substantial performance gains , with improvements of up to 31.7\% on ALFWorld ( Shridhar et al. 2021 ) and 27.1\% on KodCode ( Xu et al. 2025d ) with Qwen3-8B , surpassing parametric memory (REINFORCE++, +5.8\% ) and the GRPO method ( +5.32\% ); ❷ strong cross-domain generalization , where training in the math domain not only avoids degradation elsewhere but also boosts performance in science reasoning ( +6.06\% ) and code generation ( +5.1\% ); and ❸ continual learning ability , maintaining stable performance in previously trained domains even after fine-tuning on three additional ones. Analysis & Interpretation. Beyond quantitative evaluation, we sought to interpret the learned behavior of MemGen . Through post-hoc interventions examining the impact of removing specific latent memory on different agent failure modes, we found that MemGen implicitly evolves a human-like memory hierarchy without any external guidance, including ❶ planning memory , where certain latent tokens specifically support high-level task planning, ❷ procedural memory , where some latent memory tokens facilitate the agent’s recall of task-specific procedural skills, such as tool usage and answer formatting, and ❸ working memory , where certain

Read the complete text