[2603.23516] MSA: Memory Sparse Attention for Efficient End-to-End Memory Model Scaling to 100M Tokens
Abstract:Long-term memory is a cornerstone of human intelligence. Enabling AI to process lifetime-scale information remains a long-standing pursuit in the field. Due to the constraints of full-attention architectures, the effective context length of large language models (LLMs) is typically limited to 1M tokens. Existing approaches, such as hybrid linear attention, fixed-size memory states (e.g., RNNs), and external storage methods like RAG or agent systems, attempt to extend this limit. However, they often suffer from severe precision degradation and rapidly increasing latency as context length grows, an inability to dynamically modify memory content, or a lack of end-to-end optimization. These bottlenecks impede complex scenarios like large-corpus summarization, Digital Twins, and long-history agent reasoning, while limiting memory capacity and slowing inference. We present Memory Sparse Attention (MSA), an end-to-end trainable, efficient, and massively scalable memory model framework. Through core innovations including scalable sparse attention and document-wise RoPE, MSA achieves linear complexity in both training and inference while maintaining exceptional stability, exhibiting less than 9% degradation when scaling from 16K to 100M tokens. Furthermore, KV cache compression, combined with Memory Parallel, enables 100M-token inference on 2xA800 GPUs. We also propose Memory Interleaving to facilitate complex multi-hop reasoning across scattered memory segments. MSA significantly surpasses frontier LLMs, state-of-the-art RAG systems, and leading memory agents in long-context benchmarks. These results demonstrate that by decoupling memory capacity from reasoning, MSA provides a scalable foundation to endow general-purpose models with intrinsic, lifetime-scale memory.
MSA: Memory Sparse Attention for Efficient End-to-End Memory Model Scaling to 100M Tokens Yu Chen1,2∗, Runkai Chen1,2,3∗, Sheng Yi1,2 , Xinda Zhao1,2 , Xiaohong Li1,2 , Jianjin Zhang1,2 , Jun Sun3 , Chuanrui Hu1,2 , Yunyun Han1,2 , Lidong Bing2 , Yafeng Deng1,2†, Tianqiao Chen2† 1…
saved by
related reading
- 2502.11089arxiv.org
- [2501.00663] Titans: Learning to Memorize at Test Timearxiv.org
- [2005.11401] Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasksarxiv.org
- [2205.14135] FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenessarxiv.org
- [2604.20920] Simplified Sparse Attention via Gist Tokensarxiv.org
- [2512.23675] End-to-End Test-Time Training for Long Contextarxiv.org
- [2506.06266] Cartridges: Lightweight and general-purpose long context representations via self-studyarxiv.org
- [2510.13786] The Art of Scaling Reinforcement Learning Compute for LLMsarxiv.org
- [2605.15156] MeMo: Memory as a Modelarxiv.org
- [2304.13343] Unleashing Infinite-Length Input Capacity for Large-scale Language Models with Self-Controlled Memory Systemarxiv.org
- How Attention Got So Efficient [GQA/MLA/DSA]youtube.com
- Transformers Inference Optimization Toolset | AstraBlogastralord.github.io