arXiv:2603.23516cs.CLcs.AI2026-03被引 5

让大模型轻松处理1亿字节记忆,突破长文本推理瓶颈。

MSA: Memory Sparse Attention for Efficient End-to-End Memory Model Scaling to 100M Tokens

  • 采用稀疏注意力与文档级旋转位置编码,实现线性复杂度训练与推理。
  • 从16K到1亿令牌,性能下降低于9%,支持端到端优化。
  • 适合需要超长上下文的大规模摘要、数字孪生与多跳推理任务。

长期记忆是人类智能的核心。使AI能处理终身规模信息仍是该领域的长期追求。由于全注意力架构的限制,大语言模型(LLMs)的有效上下文长度通常仅限于100万字节。现有方法如混合线性注意力、固定大小记忆状态(如RNNs)以及外部存储方式(如RAG或代理系统)虽试图扩展此极限,但往往伴随严重精度下降、延迟快速上升、无法动态修改记忆内容或缺乏端到端优化。这些瓶颈阻碍了大规模语料摘要、数字孪生及长历史代理推理等复杂场景的应用,同时限制了记忆容量并减缓推理速度。我们提出记忆稀疏注意力(MSA),一种可端到端训练、高效且可大规模扩展的记忆模型框架。通过可扩展稀疏注意力和文档级旋转位置编码(RoPE)等核心创新,MSA在训练与推理中均实现线性复杂度,保持优异稳定性,在从16K扩展至1亿令牌时性能下降不足9%。结合KV缓存压缩与内存并行,可在2张A800 GPU上完成1亿令牌推理。我们还提出记忆交织(Memory Interleaving)机制,支持跨分散记忆段的复杂多跳推理。MSA在长上下文基准测试中显著超越前沿大模型、最先进的RAG系统及领先记忆代理。结果表明,通过解耦记忆容量与推理能力,MSA为通用模型赋予内在的、生命周期级记忆提供了可扩展基础。

原文摘要 · Abstract (English)

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.

长上下文记忆建模稀疏注意力大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。