Large language models (LLMs) like those used in chatbots and AI assistants are powerful but require huge amounts of memory and computing power—especially when they need to handle very long conversations or ongoing interactions. A newly published research paper introduces MemOnce, a novel memory architecture designed to help these models remember and reuse information more efficiently over time. This advancement could pave the way for AI systems that maintain context better, respond faster, and run on less expensive hardware.
Key Takeaways
- MemOnce drastically reduces GPU memory usage by compressing and storing only essential memory states instead of the entire history.
- It achieves linear-time complexity, meaning the time it takes to process input grows proportionally rather than exponentially with longer contexts.
- Experiments show MemOnce can cut memory cache size by over 1300 times and speed up prefill latency nearly 7 times on very long context lengths (up to 1 million tokens).
- The architecture generalizes well, performing competitively on tasks without additional training, indicating strong zero-shot capabilities.
Traditional large language models rely on a mechanism called “Transformers,” which use attention layers to process and remember information from input text. However, these models store detailed “key-value” (KV) caches for every token and every layer, causing memory use to balloon as conversations get longer. This makes it difficult to deploy LLMs in real-world settings where long-term memory and efficiency are crucial.
MemOnce tackles this problem with two main innovations. First, it uses a “memory encoder-decoder” system that compresses the vast amount of hidden state data into a small, compact set of memory representations. Instead of keeping detailed data for every token, it selectively keeps only what’s most important. Later, these compressed memories can be dynamically “decoded” back into the KV caches needed for the model’s attention layers, but only when necessary.
Second, MemOnce introduces “memory sparse attention,” a method that retrieves only the most relevant memory pieces for each new input. Rather than searching through all stored memories repeatedly, it calculates sparse indices once and reuses them across layers. This targeted focus reduces computational overhead and speeds up processing.
By combining these two elements, MemOnce achieves significant improvements in both speed and memory efficiency. The researchers tested MemOnce on Qwen3.5-4B, a popular language model, and found that it could handle extremely long contexts—up to one million tokens—while using dramatically less memory and running much faster than standard Transformers. It also maintained or improved overall performance, showing that the efficiency gains do not come at the cost of accuracy.
Beyond just speeding up AI models, MemOnce’s approach to scalable memory could have broad implications. For example, AI assistants could better maintain context over hours or days, improving user experience in applications like customer service, tutoring, or creative writing. Additionally, the reduced hardware requirements could make powerful language models more accessible and environmentally friendly.
While MemOnce represents a promising advance, further research will be needed to explore its integration into even larger models and diverse real-world applications. Nonetheless, this work establishes a strong foundation for building AI systems that can remember more, run faster, and operate more sustainably—key steps toward more intelligent and practical language technologies.
Based on research published on arXiv by Chang Nie, Chaoyou Fu, Songlin Liu et al..
