Back to articles

MemOnce Aims to Make Long-Term LLM Memory More Scalable

3 min read

Introduction

Long-running conversations and continuing tasks require a model to reuse information from earlier interactions. In a standard Transformer, that history is typically represented by key-value (KV) caches for every token and layer. The cache grows with context length, while computation also becomes more demanding. Architectures with fixed-size states can keep processing costs linear, but may discard details needed for precise recall. MemOnce proposes a middle ground: retain a compact memory, then reconstruct the attention representations needed for a particular query.

How the architecture works

The design combines a memory encoder-decoder with memory sparse attention.

  • Store compactly, decode when needed. MemOnce caches only a small subset of final-layer hidden states as memory representations. When new input arrives, it dynamically decodes selected representations into the KV caches used by attention layers. Instead of permanently keeping a full token-level cache at every layer, it postpones that reconstruction until the information is needed.
  • Retrieve once across layers. For each continuing input, the model adaptively selects relevant memories. The indices used for sparse attention are computed once and shared across layers, rather than independently recalculated at each layer.

Together, these choices aim to reduce the memory kept resident on the GPU without relying solely on a fixed-size summary that may lose fine-grained information. The paper presents the architecture as a way to achieve linear-time complexity and reports experiments spanning pretraining and post-training adaptation.

Results and implications

The supplied paper summary reports that adapting Qwen3.5-4B with MemOnce at a one-million-token context reduced the memory-state cache by about 1,313 times and prefill latency by 6.9 times, while increasing throughput by 3.5 times. It also reports a 5.77% improvement in an overall memory-performance measure, without defining that measure in the supplied material. The authors say their evaluations span different model sizes, context lengths, and training paradigms, and that MemOnce transfers zero-shot to downstream representation tasks with competitive results against specialized models.

The broader idea is relevant to systems that must carry useful context across many interactions. Rather than choosing between retaining every historical token and compressing everything into a fixed state, a model could store a smaller learned representation and selectively expand it for attention. If effective, that approach could reduce the cost of long-context inference while preserving access to detail.

The reported figures should be read alongside the full evaluation: the supplied summary does not specify hardware, benchmark composition, comparison settings, or variability. Deployment also depends on whether decoding and retrieval overhead offset the cache savings, and whether memory selection remains reliable as interaction histories grow. MemOnce is therefore a promising architectural proposal, not by itself evidence that the same gains will hold across workloads.

Source: Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles