TL;DR
The paper introduces Latent Graph Memory (LGM), a novel neuro-symbolic framework that shifts long-term memory processing and relational reasoning for LLM agents into a continuous latent space. By combining sparse autoencoders with dynamic, query-conditioned graph neural networks, LGM successfully extracts implicit user preferences from scattered historical interactions without the massive computational overhead of replaying raw text history.
What Problem Does This Paper Address?
For AI agents to feel truly personalized, they need to remember long-horizon user interactions and infer both explicit instructions (e.g., "I don't eat meat") and implicit habits (e.g., ordering dairy-free items over several weeks).
Existing memory frameworks fall into two flawed paradigms:
- Flat Retrieval (Vector RAG): Scores memory fragments independently, completely missing multi-hop or distributed clues spread across distant chat sessions.
- Structured Retrieval (GraphRAG): Builds explicit text-level graphs, but these graphs are static and query-agnostic—the connections don't adapt based on what the user is currently asking.
Crucially, raw textual memories are noisy and entangled. Processing them entirely within the token or prompt space leads to ballooning KV caches, repeated expensive LLM calls, and prompt distraction. LGM addresses this by asking: Can we disentangle and organize long-term memory on demand in a continuous latent space instead of the text space?
Methods
LGM operates via a three-stage pipeline that moves memory management from external text retrieval into an end-to-end differentiable architecture:
- Latent Memory Disentanglement: Instead of storing raw text, LGM extracts and averages multi-layer hidden states from the backbone LLM for both historical chunks and the current query, projecting them into a compact latent space. A Sparse Autoencoder (SAE) decomposes these dense vectors into sparse, interpretable concept activations, separating what a memory is about from how it was phrased.
- Query-Conditioned Latent Graph Construction: Rather than maintaining a rigid global graph, LGM dynamically builds a latent subgraph for every incoming query. Edge weights are determined by the overlap of sparse concepts between the query and memory nodes. A Relational Graph Neural Network (GNN) then performs message passing to aggregate weak, scattered clues.
- Graph-Conditioned Reasoning: The final aggregated graph state is projected into a small set of soft latent prefix tokens (memory prompts) that are prepended to the query. To prevent the latent space from collapsing or being ignored by the LLM, the authors introduce a crucial evidence-reconstruction loss that forces the prefix tokens to remain capable of decoding back the original supporting facts.
Datasets
The framework was evaluated across three long-term personalization benchmarks:
- PersonaMem: Evaluates a model's ability to track and update user preferences over long multi-session histories (tested at 32K and 128K token scales).
- PrefEval: Focuses on preference-following behavior, split into explicit and implicit preference tasks.
- PersonaMem-v2 (Implicit Split): A highly challenging dataset where target user preferences are never stated verbatim and must be synthesized entirely from behavioral cues.
Key Insights and Ideas
- Concept-Level Alignment: By mapping text to sparse autoencoder concepts, LGM connects surface-level unrelated statements. For instance, "black coffee, no milk" and "creamy ones upset my stomach" naturally co-activate an underlying "AVOID-DAIRY" concept node.
- Dynamic Topology at Inference: Graphs shouldn't be static databases. Deferring graph topology construction to inference time allows the incoming query to uniquely dictate how historical events relate to one another.
- Preventing Latent Collapse: Latent memory representations often suffer from optimization issues where the LLM simply learns to ignore the prefix tokens. The inclusion of an explicit evidence reconstruction objective anchors the continuous representations firmly to historical facts.
Key Results
LGM was evaluated using Qwen2.5-7B, Gemma3-4B, and Qwen3-4B backbones, consistently outperforming state-of-the-art baselines like MemCoE, GraphRAG, and LightMem.
- Accuracy Gains: LGM achieved the highest average accuracy on both Qwen2.5-7B (72.28%) and Gemma3-4B (66.16%), beating the strongest baseline (MemCoE) by over 11 absolute percentage points.
- Implicit Preference Mastery: On the difficult PersonaMem-v2 implicit split, LGM (using a 4B model) scored 62.9% (32K) and 51.9% (128K), notably outperforming massive proprietary models like the GPT-5 and GPT-4.1 families.
- Efficiency Frontier: Because it avoids replaying raw text history in the prompt, LGM dramatically reduces computational overhead, maintaining low token consumption and stable time-to-first-token (TTFT) latencies even as context lengths scale up to 128K.
Limitations and Future Work
- Backbone Fine-Tuning Dependency: LGM requires access to and optimization of the backbone LLM's intermediate hidden states, making it less suitable for closed, API-only models where internal representations are inaccessible.
- Fixed Concept Dimension: The sparse autoencoder relies on a predefined concept dimension (set to 256 in the experiments). Scaling this framework to handle open-ended, highly diverse real-world web scale concepts may require dynamically scaling or hierarchically structuring the SAE component.
Summary updated