Skip to content

TransMem: Transforming Hidden States into Memory for Large Language Models

Jul 2026 · arXiv.org · Vol abs/2607.29032 · 0 citations · 38 references
Computer Science

TL;DR

TransMem is proposed, a lightweight inference-time parametric memory module that transforms sparse historical hidden states from a frozen LLM backbone into reusable memory representations and introduces evidence-conditioned self-distillation to learn transferable memory utilization rather than task-specific knowledge.

Abstract

Large language model (LLM) agents increasingly operate over long interaction histories, where effective reasoning requires identifying and exploiting task-relevant evidence distributed across past observations and actions. However, useful information encoded in previously computed representations is often underutilized during subsequent generation. We propose \textbf{TransMem}, a lightweight inference-time parametric memory module that transforms sparse historical hidden states from a frozen LLM backbone into reusable memory representations. TransMem uses a lightweight gating network to dynamically apply the latent intervention to the current hidden states, without repeatedly encoding the preceding context. To learn transferable memory utilization rather than task-specific knowledge, we introduce evidence-conditioned self-distillation. A memory-augmented student processes the full context and matches the predictive distribution of an evidence-only teacher that shares the same frozen backbone. Experiments on LoCoMo, HotpotQA, and MemoryAgentBench demonstrate consistent improvements across different model architectures and scales. TransMem yields gains of 11.58--29.25 $F_1$ on LoCoMo and 10.20--13.03 $F_1$ on HotpotQA, while improving the average MemoryAgentBench accuracy from 29.54\% to 40.00\%. These results establish sparse historical hidden states as an effective and efficient memory substrate for long-context LLM agents. Our code is available at https://github.com/Haodong-Lei-Ray/TransMem.

View source

Similar papers

Jul 2026

Penelope: Localized Latent Recurrence for Efficient Structured Reasoning

Penelope is introduced, an efficient latent-reasoning framework for pretrained decoder-only Transformers that localizes recurrent computation to a selected decoder interval and attains competitive accuracy relative to established latent-reasoning models while reducing measured inference latency.

Yutong Chen, Shouqian Shi, Xinran Liu et al. · 0 citations
Preprint Aug 2026

Stop When Memory Suffices: Evidence-Conditioned Progressive Execution for LLM Agents

This work introduces Router-Mem, an evidence-conditioned progressive execution framework for long-horizon agent memory that is trained with evidence-level supervision and rationale-conditioned representation distillation and achieves strong answer quality while maintaining low online latency.

Yidan Lin, Kai-Xiang Wang, Jiong Lou et al. · 0 citations
#natural language process... Preprint Sep 2026

Lngram v2: Latent N-Gram Memory with Interpretable Discrete Representations

Transformers lack a native lookup mechanism, requiring repeated dense computation to recognize and reuse local static patterns. Lngram v1 introduces tokenizer-independent conditional memory through discrete latent n-gram addressing, but its memory capacity is coupled with the backbone width, limiting scalability due to high parameter and activation costs. We propose Lngram v2, which decouples the number of routes, memory dimension, and backbone width, and introduces a context-aware grouped-query attention readout to scale memory capacity independently. A zero-value Sink and counterfactual surrogate gradients further improve readout selectivity and routing trainability while preserving hard discrete addressing. Experiments across vision--language models (VLMs) of different scales show consistent improvements, including successful scaling to a 30B-parameter model. Compared with Lngram v1, Lngram v2 substantially reduces both total and activated memory parameters while maintaining or improving language modeling performance. Further analysis shows that its discrete IDs preserve substantial semantic structure of continuous hidden states, enabling semantic recovery from IDs alone and stable ID--semantic associations across datasets. These results establish Lngram v2 as an efficient and scalable latent conditional memory mechanism whose discrete addresses also provide a structured interface for analyzing internal model representations.

Yun-Ao Zheng, Bin Wen, Xiao-Jie Wang · 0 citations
Preprint Aug 2026

DART: Decoded Attention over Recurrent States for Efficient Long-Context Sequence Modeling

DART (Decoded Attention over Recurrent sTates), which retains the chunk state contributions produced by the Mamba-2 chunked scan as chunk state memories, decodes token-conditioned keys and values from these memories, and performs state-memory attention (SMA) over the resulting KV pairs.

Yixiao Qian, Song Chen, Pengkai Wang et al. · 0 citations
Preprint Aug 2026

Architecture-Dependent Causal Transfer of Activation States Across Large Language Models

End-to-end activation-state transfer between LLMs, as currently implemented, is architecture-dependent rather than universal, and it is concluded that end-to-end activation-state transfer between LLMs is architecture-dependent rather than universal.

Fernando Cardenas Piepereit · 1 citation

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.