arXiv:2606.13392cs.AI2026-06被引 17

让大模型处理百万级上下文,计算量降28倍

MiniMax Sparse Attention

论文配图:MiniMax Sparse Attention
图 1 · 摘自论文原文
  • 按块稀疏注意力,每组独立选关键块,加速计算
  • 百万上下文时,单令牌计算量减少28.4倍,速度提升14.2倍
  • 适配多卡部署,适合需要长文本理解的工业级应用

超长上下文能力已成为前沿大模型的必备需求:智能体工作流、代码库级推理和持久记忆都需要模型同时关注数十万到上百万个标记,但传统的softmax注意力存在二次计算开销,难以在实际部署中实现。我们提出MiniMax稀疏注意力(MSA),基于分组查询注意力(GQA)构建块级稀疏注意力机制。轻量级索引分支对键值块进行评分,并为每个GQA组独立选择Top-k子集,实现组内稀疏检索,同时保持块级高效执行;主分支则仅对所选块执行精确的块稀疏注意力。设计上强调简洁与可扩展性,结构精简,便于在多种GPU上高效部署。为将稀疏性转化为实际加速,我们协同设计了支持无exp Top-k选择和KV外稀疏注意力的GPU执行路径,提升块粒度访问下的张量核心利用率。在1090亿参数的原生多模态训练模型上,MSA性能与GQA相当,但在100万上下文长度下,单令牌注意力计算量降低28.4倍。配合自研内核,其在H800上实现预填充阶段14.2倍、解码阶段7.6倍的墙钟速度提升。推理内核开源地址:https://github.com/MiniMax-AI/MSA。基于MSA的生产级原生多模态模型已公开发布:https://huggingface.co/MiniMaxAI/MiniMax-M3。

原文摘要 · Abstract (English)

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.

稀疏注意力长上下文高性能推理多模态

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