MiniMax Sparse Attention

📄 arXiv: 2606.13392 📥 PDF

作者: Xunhao Lai, Weiqi Xu, Yufeng Yang, Qiaorui Chen, Yang Xu, Lunbin Zeng, Xiaolong Li, Haohai Sun, Haichao Zhu, Vito Zhang, Pengyu Zhao

分类: cs.AI

发布日期: 2026-06-12


💡 一句话要点

提出MiniMax稀疏注意力以解决超长上下文处理问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 稀疏注意力 超长上下文 大语言模型 计算效率 GPU优化

📋 核心要点

  1. 现有的softmax注意力机制在处理超长上下文时面临二次复杂度的挑战,难以满足实际应用需求。
  2. MiniMax稀疏注意力(MSA)通过块状稀疏注意力和分组查询注意力的结合,实现了高效的上下文处理。
  3. 在实验中,MSA在109B参数模型上表现出与GQA相当的性能,同时显著降低了计算成本和提升了速度。

📝 摘要(中文)

超长上下文能力对于前沿大语言模型(LLMs)变得不可或缺,然而现有的softmax注意力机制由于其二次复杂度在实际部署中难以实现。本文提出了MiniMax稀疏注意力(MSA),基于分组查询注意力(GQA)构建的块状稀疏注意力。通过轻量级的索引分支对键值块进行评分,并为每个GQA组独立选择Top-k子集,MSA实现了组特定的稀疏检索,同时保持高效的块级执行。MSA在109B参数的模型上,与GQA性能相当,同时在1M上下文下将每个token的注意力计算减少了28.4倍。配合共同设计的内核,MSA在H800上实现了14.2倍的预填充和7.6倍的解码速度提升。

🔬 方法详解

问题定义:本文旨在解决超长上下文处理中的计算复杂度问题,现有的softmax注意力机制在处理数十万到百万token时,计算成本呈二次增长,难以在实际部署中应用。

核心思路:MiniMax稀疏注意力(MSA)通过引入块状稀疏注意力和分组查询注意力的结合,采用轻量级的索引分支进行Top-k选择,从而实现高效的稀疏检索和块级执行。

技术框架:MSA的整体架构包括两个主要分支:索引分支用于评分和选择键值块,主分支则在选定的块上执行精确的块稀疏注意力。该设计旨在简化实现并提高可扩展性,适用于多种GPU环境。

关键创新:MSA的核心创新在于其块状稀疏注意力机制和高效的Top-k选择策略,显著降低了计算复杂度,并提高了GPU的张量核心利用率。与现有方法相比,MSA在处理超长上下文时表现出更高的效率和更低的计算成本。

关键设计:在MSA中,采用了无指数的Top-k选择和KV外部稀疏注意力的设计,以提高块粒度访问下的计算效率。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在实验中,MSA在109B参数的模型上与分组查询注意力(GQA)性能相当,但在1M上下文下将每个token的注意力计算减少了28.4倍。此外,配合共同设计的内核,MSA在H800上实现了14.2倍的预填充速度提升和7.6倍的解码速度提升,展现出显著的性能优势。

🎯 应用场景

MiniMax稀疏注意力(MSA)在处理超长上下文的任务中具有广泛的应用潜力,特别是在需要高效信息检索和处理的场景,如智能助手、代码推理和持久性记忆系统。其高效的计算性能和可扩展性使其适合于大规模模型的实际部署,推动了大语言模型在各领域的应用。

📄 摘要(原文)

Ultra-long-context capability is becoming indispensable for frontier LLMs: agentic workflows, repository-scale code reasoning, and persistent memory all require the model to jointly attend over hundreds of thousands to millions of tokens, yet the quadratic cost of softmax attention makes this untenable at deployment scale. We introduce MiniMax Sparse Attention (MSA), a blockwise sparse attention built upon Grouped Query Attention (GQA). A lightweight Index Branch scores key-value blocks and independently selects a Top-k subset for each GQA group, enabling group-specific sparse retrieval while maintaining efficient block-level execution; the Main Branch then performs exact block-sparse attention over only the selected blocks. Designed around a principle of simplicity and scalability, MSA is deliberately streamlined, making it straightforward to deploy efficiently across a broad range of GPUs. To translate sparsity into practical speedups, we co-design MSA with a GPU execution path that uses exp-free Top-k selection and KV-outer sparse attention to improve tensor-core utilization under block-granular access. On a 109B-parameter model with native multimodal training, MSA performs on par with GQA while reducing per-token attention compute by 28.4x at 1M context. Paired with our co-designed kernel, MSA achieves 14.2x prefill and 7.6x decoding wall-clock speedups on H800. Our inference kernel is available at:this https URL. A production-grade natively multimodal model powered by MSA has been publicly released at:this https URL.