MemOnce: A Scalable Memory Architecture for Large Language Models
Abstract
Deploying large language models (LLMs) in long-horizon and continual interactions requires maintaining reusable memory states for future inference, posing challenges for existing architectures. Standard Transformers accumulate layer-wise, token-level KV caches, incurring linear GPU memory growth and quadratic computational complexity as the context expands. In contrast, linear-time architectures compress history into fixed-size states, but struggle to retain fine-grained details. We introduce MemOnce, a foundation architecture that learns scalable memory states for language models. MemOnce is based on two core designs: (a) Memory encoder-decoder: it caches only a small subset of final-layer hidden states as compact memory representations and dynamically decodes them back into KV caches for attention layers; (b) Memory sparse attention: for each continual input, MemOnce adaptively retrieves relevant memory representations, with the sparse indices computed only once across layers. Coupling these two designs enables efficient on-the-fly memory loading and KV cache decoding, drastically reducing the GPU memory footprint and achieving linear-time complexity. We conduct extensive experiments to show that MemOnce outperforms Transformers and other architectures across varying model sizes, context lengths, and training paradigms (pretraining and post-training adaptation). In particular, adapting Qwen3.5-4B with MemOnce reduces memory state cache by 1313 and prefill latency by 6.9 at 1M context, and improves throughput by 3.5 and overall memory performance by +5.77%. Finally, MemOnce generalizes zero-shot to downstream representation tasks, achieving competitive results against specialized models.
Create a lesson
Metadata
- Comments
- Project Page: https://clare-nie.github.io/MemOnce
Related papers
From Geographic Memory to Spatial Generalization in Large Language Models
Shared title terminologycs.CLChen Chu, Zhaonan Wang, Cyrus Shahabi et al.
Explainable Emotion and Mental Health Reasoning in Large Language Models Using Theories of Emotion
Shared title terminologycs.CLTadesse Destaw Bela, Iqra Ameer, Helena Gómez Adorno et al.
From Vanishing Gradients to Recursive Self-Improvement: Evaluating the Most Influential Papers in Large Language Model Evolution (1997-2026)
Shared title terminologycs.CLSaadh Jawwadh
Beyond Omission: Measuring Critical-Information Fulfillment of Large Language Models in Bengali and English
Shared title terminologycs.CLAvijit Roy
Population-Based Post-Training for Large Language Models
Shared title terminologycs.CLYixuan Even Xu, Aleksei Petrenko, Raja Giryes et al.
Reducing Permutation Sensitivity in Multimodal Large Language Models via Shared Positions and Attention-Only Distillation
Shared title terminologycs.CLYifei Cheng, Xiaolin Zhang, Yu-Xuan Qiu