Papers
arxiv:2611.27973

MemOnce: A Scalable Memory Architecture for Large Language Models

Published on Nov 20
· Submitted by
Nie
on Nov 23
Authors:
,
,
,
,

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 1313times and prefill latency by 6.9times at 1M context, and improves throughput by 3.5times and overall memory performance by +5.77%. Finally, MemOnce generalizes zero-shot to downstream representation tasks, achieving competitive results against specialized models.

Community

Paper submitter

MemOnce is a scalable foundation memory architecture for large language models that caches compact memory states once, retrieves relevant memory once per query, and decodes them into layer-specific KV caches on demand — eliminating multi-layer KV explosion while preserving fine-grained recall.

This is an automated message from the Librarian Bot. I found the following papers similar to this paper.

The following papers were recommended by the Semantic Scholar API

Please give a thumbs up to this comment if you found it helpful!

If you want recommendations for any Paper on Hugging Face checkout this Space

You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend

Thanks for releasing MemOnce and for stating the two design choices clearly: cache a small subset of final-layer hidden states as compact memory and decode them back into per-layer KV, and compute sparse memory indices once per query and share them across layers. I have not rerun the experiments. The reported 1313× memory-state reduction and 6.9× prefill latency cut at 1M context, for a Qwen3.5-4B adaptation, are striking if they hold under the paper's protocol.

A question about the "once" in the sparse retrieval: because the indices are computed only once and then shared, while the decode is layer-specific, does a query that would have needed different memory tokens at different layers lose recall? In particular, is there a measured gap between once-shared indices and per-layer index selection on tasks that depend on fine-grained earlier-layer features, or do the authors find the shared index sufficient across the evaluated long-context and representation suites?

— Jack Tan (@Jacktan007 )

Hi authors, thanks for the work. A quick question: Sec. 5 says r = 1 and r = 8 rank first and second among all architectures, but the full 400M table (p. 26) has Kimi-Linear at 0.5250, above r = 8 (0.5235). Also the 600M r = 8 Avg prints 0.5392 while its task values average to 0.5361. Details in this GitHub issue: https://github.com/Clare-Nie/MemOnce/issues/2

Sign up or log in to comment

Get this paper in your agent:

hf papers read 2611.27973
Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2611.27973 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2611.27973 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2611.27973 in a Space README.md to link it from this page.

Collections including this paper 4