MiniMax Sparse Attention

📄 arXiv: 2606.13392v2 📥 PDF

作者: Xunhao Lai, Weiqi Xu, Yufeng Yang, Qiaorui Chen, Yang Xu, Lunbin Zeng, Xiaolong Li, Haohai Sun, Haichao Zhu, Vito Zhang, Jinkai Hu, Jiayao Li, Rui Gao, Zekun Li, Songquan Zhu, Jingkai Zhou, Pengyu Zhao

分类: cs.AI

发布日期: 2026-06-11 (更新: 2026-06-12)

备注: 30 pages, 14 figures

🔗 代码/项目: GITHUB | HUGGINGFACE


💡 一句话要点

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

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

关键词: 稀疏注意力 长上下文处理 多模态学习 高效计算 深度学习模型

📋 核心要点

  1. 现有的softmax注意力方法在处理超长上下文时计算复杂度高,难以满足实际应用需求。
  2. MiniMax稀疏注意力通过块状稀疏机制和轻量级索引分支,优化了注意力计算效率。
  3. 在实验中,MSA在保持性能的同时显著降低了计算开销,提升了模型的推理速度。

📝 摘要(中文)

超长上下文能力对前沿大型语言模型(LLMs)至关重要,然而,传统的softmax注意力在计算上存在二次复杂度,使得在实际部署中难以实现。本文提出了MiniMax稀疏注意力(MSA),一种基于分组查询注意力(GQA)的块状稀疏注意力方法。通过轻量级的索引分支对关键值块进行评分,并为每个GQA组独立选择Top-k子集,MSA实现了组特定的稀疏检索,同时保持高效的块级执行。实验表明,MSA在109B参数模型上与GQA性能相当,但在1M上下文下每个token的注意力计算减少了28.4倍,并在H800上实现了14.2倍的预填充和7.6倍的解码速度提升。

🔬 方法详解

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

核心思路:MiniMax稀疏注意力(MSA)通过引入块状稀疏机制和分组查询注意力(GQA),实现了高效的稀疏检索和计算。该方法旨在简化设计,提升可扩展性,使其能够在多种GPU上高效部署。

技术框架:MSA的整体架构包括两个主要分支:索引分支用于评分关键值块并选择Top-k子集,主分支则在选定块上执行精确的块稀疏注意力。该设计确保了高效的块级执行和稀疏检索。

关键创新:MSA的核心创新在于其块状稀疏机制和轻量级索引分支的结合,使得模型能够在保持性能的同时显著降低计算复杂度。这与传统的全连接softmax注意力方法形成了鲜明对比。

关键设计:MSA的设计中,采用了无指数的Top-k选择和KV外部稀疏注意力,以提高张量核心的利用率。此外,模型在参数设置和网络结构上进行了优化,以适应块粒度的访问需求。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在实验中,MSA在109B参数的模型上表现出色,与GQA性能相当,但在1M上下文下每个token的注意力计算减少了28.4倍。同时,结合专门设计的内核,MSA在H800上实现了14.2倍的预填充速度和7.6倍的解码速度提升,显示出显著的效率优势。

🎯 应用场景

MiniMax稀疏注意力的研究具有广泛的应用潜力,特别是在需要处理超长上下文的任务中,如智能助手、代码推理和持久记忆系统。其高效的计算能力使得在大规模数据集上进行实时推理成为可能,推动了自然语言处理和多模态学习的发展。

📄 摘要(原文)

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: https://github.com/MiniMax-AI/MSA. A production-grade natively multimodal model powered by MSA has been publicly released at: https://huggingface.co/MiniMaxAI/MiniMax-M3.