MemOnce: A Scalable Memory Architecture for Large Language Models
Chang Nie, Chaoyou Fu, Songlin Liu, Yiqing Hu, Caifeng Shan
Nanjing University · University of Science and Technology of China
Published November 20, 2026 · on the feed November 23, 2026 · ▲ 30 · arXiv 2611.27973
The 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.
The Brief
2:33A short podcast summary of the paper. Written and voiced by AI.
Transcript
MemOnce. A Scalable Memory Architecture for Large Language Models. By Chang Nie and four others, from Nanjing University and the University of Science and Technology of China. Published on the twentieth of November.
A language model deployed in long-horizon or continual interactions has to keep memory states it can reuse for later inference. Neither of the two familiar architectures does this comfortably. Standard Transformers accumulate key-value caches layer by layer and token by token, so GPU memory grows linearly and computation grows quadratically as the context expands. Linear-time architectures avoid that by compressing history into a state of fixed size, but in doing so they struggle to hold on to fine-grained details. One approach keeps everything at a rising cost; the other keeps the cost flat and loses the detail.
MemOnce is offered as a foundation architecture that learns scalable memory states for language models. Rather than storing every layer's cache, it stores something much smaller and rebuilds what attention needs from it, and it decides what to retrieve a single time instead of at every layer.
That rests on two core designs. The first is a memory encoder-decoder. It caches only a small subset of the final layer's hidden states, as compact memory representations, and dynamically decodes them back into key-value caches for the attention layers.
The second is memory sparse attention. For each new continual input, MemOnce adaptively retrieves the memory representations that are relevant, and the sparse indices for that retrieval are computed only once, then shared across layers. Coupled together, the two designs allow memory to be loaded and key value caches to be decoded on the fly. The result is a drastically smaller GPU memory footprint and linear-time complexity.
Extensive experiments report that MemOnce outperforms Transformers and other architectures across model sizes, context lengths, and training paradigms, covering both pretraining and adaptation after training. The headline case is adapting Qwen3.5-4B. At a context length of one million, the memory state cache shrinks by a factor of one thousand three hundred thirteen, and prefill latency drops by six point nine times.
In the same setting, throughput improves three point five times, and overall memory performance rises by five point seven seven percent. Finally, MemOnce generalises zero shot to downstream representation tasks, with results competitive against specialised models.
The design answers the trade-off by refusing both of its ends. History is not kept in full at every layer, and it is not squeezed into one fixed state. A compact final-layer memory is kept instead, with the detail decoded back only when it is needed, and the question of which memories matter is answered once for the whole stack.
Paper Quest · 7 chapters · about 41 min
Play this paper
Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.
Chapter 1 🧩 · The problem
Long conversations need memory. The trouble is paying for it.
You are deploying a language model as a long-running assistant. It must keep reusable memory of everything it has seen so later turns don't recompute the whole history.
The road ahead
- 1 · The problem ~7 min A long-running assistant needs reusable memory, but full Transformer caches grow without limit and fixed-size states forget details.
- 2 · What came before ~3 min
- 3 · The key idea ~9 min Cache only a small slice of final-layer states, retrieve the relevant ones once per input, and decode them into each layer's KV cache on demand.
- 4 · Choose your own research ~3 min
- 5 · Build the method ~8 min Write a compact final-layer memory, retrieve the relevant part once per input, share that choice across layers, and decode it into KV caches.
- 6 · The experiment ~6 min You’ll guess: Adapting Qwen3.5-4B with MemOnce at 1M context, by how many times did the memory state cache shrink?
- 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Free, with Google or an email address. Your stars and progress are kept.