NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MiniMax Sparse Attention

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 ZhaoarXiv 2026

TL;DR

MiniMax Sparse Attention (MSA) is a streamlined, blockwise sparse attention mechanism that slashes per-token attention compute by 28.4× at a 1-million token context length. By co-designing the algorithm with custom GPU kernels, MSA translates these theoretical savings into massive real-world performance gains—achieving a 14.2× speedup in prefill and a 7.6× speedup in decoding on H800 GPUs while matching full-attention accuracy on a 109B-parameter multimodal model.

What Problem Does This Paper Address?

As large language models (LLMs) transition to long-horizon agentic workflows, repository-scale code analysis, and persistent memory applications, they must process contexts spanning hundreds of thousands to millions of tokens. However, standard softmax attention scales quadratically ($O(N^2)$) with sequence length, creating severe compute and memory bottlenecks during both training and inference.

While many sparse attention methods have been proposed to mitigate this, they often introduce complex token-level routing overheads or irregular memory access patterns. Consequently, their theoretical FLOP savings rarely translate into actual wall-clock speedups on modern GPU architectures, which favor regular, block-level matrix operations.

Methods

MSA tackles this hardware mismatch by building directly upon Grouped Query Attention (GQA) and enforcing a strict principle of blockwise simplicity. The architecture splits the attention mechanism into two distinct stages:

  1. The Index Branch: An ultra-lightweight module that introduces just two projection matrices to standard GQA. It uses a single query head per GQA group to score key-value blocks via max-pooling. It then selects a $Top-k$ subset of the most relevant blocks (always retaining the most recent local block to ensure training stability).
  2. The Main Branch: This branch performs exact, standard block-sparse attention restricted only to the blocks selected by the Index Branch.
Overview of the MiniMax Sparse Attention (MSA) architecture.

To ensure stable optimization, MSA is trained using an auxiliary KL alignment loss that forces the Index Branch's selection distribution to match the Main Branch's actual attention weights. Crucially, a stop-gradient operation isolates this auxiliary loss from the model's backbone backbone, preventing optimization degradation.

Algorithm 1: Training forward pass and auxiliary KL loss for a single MSA layer.

Hardware Co-Design

To turn block sparsity into real-world speedups, the authors co-designed MSA with highly specialized GPU execution paths:

  • Exp-free Top-k Selection: Because softmax is order-preserving, the Index Branch ranks raw dot-product scores directly, bypassing expensive exponential and summation math before block selection.
  • KV-Outer Sparse Attention: The main attention loop is inverted to iterate over key-value blocks rather than queries. This maximizes Tensor Core utilization and arithmetic intensity.
  • Pre-scheduled Tile Chunking: To handle "sink rows" (highly popular blocks that almost every query attends to), a scheduler splits hot tiles across multiple cooperative thread arrays (CTAs) to balance the workload without relying on slow atomic updates.

Datasets

The authors validated MSA by training a 109B-parameter Mixture-of-Experts (MoE) model from scratch on a 3-trillion token native multimodal dataset (comprising text, image, and video data).

They evaluated the model across a massive downstream suite:

  • General Reasoning: MMLU, MMLU-Pro, BBH, GPQA Hard, ARC Challenge, TriviaQA, WinoGrande.
  • Math & Code: GSM8K, MGSM, MathVista, OlymMATH, HumanEval, EvalPlus, BigCodeBench, MultiPL-E MBPP.
  • Long-Context & Retrieval: RULER, HELMET.
  • Multimodal (Image & Video): AI2D, ChartQA, MMMU, OCRBench v2, CharXiv, VisualWebBench, CVBench, EgoSchema, LongVideoBench, MLVU, MMVU, VideoMME, TemporalBench.
  • Agent Tasks: $\tau^2$-bench, TheAgentCompany, Humanity's Last Exam, SWE-bench.

Key Insights and Ideas

  • Occam’s Razor for Sparsity: Complex token-level routing is a trap for hardware efficiency. Sharing block-level selection across entire GQA groups drastically reduces routing overhead and aligns perfectly with GPU memory layouts.
  • The Danger of Self-Distillation: If the auxiliary KL loss is allowed to flow back into the model's backbone, the model takes a shortcut: it simplifies its main attention maps to satisfy the indexer rather than making the indexer smarter. Detaching the gradient at the Index Branch input is vital for maintaining short-context capabilities.
  • Dynamic Beats Fixed: When compared against a FLOP-matched sliding-window baseline, MSA's dynamic, content-dependent token selection achieved significantly lower perplexity on complex agent tasks, proving that static patterns cannot substitute for adaptive retrieval.

Key Results

  • Compute Reduction: At a 1M token context length, MSA reduces per-token attention FLOPs by 28.4× compared to standard GQA.
  • Wall-Clock Speedups: Paired with their custom kernels, MSA delivers a 14.2× speedup during the prefill phase and a 7.6× speedup during decoding on NVIDIA H800 GPUs.
  • Custom Kernel Efficiency: The specialized exp-free Top-k kernel consistently outperformed standard PyTorch and TileLang baselines, showing the starkest advantages at the deployed setting of $k=16$.
Table 1: Top-k latency comparison showing the speedup of the custom exp-free kernel.
  • Zero Performance Degradation: Whether trained from scratch (MSA-PT) or converted from a pretrained dense GQA checkpoint (MSA-CPT), MSA matched the downstream task accuracy of the full-attention baseline across text, math, code, image, and video benchmarks.

Limitations and Future Work

While MSA demonstrates exceptional efficiency, the authors note a residual long-context retrieval gap on specific needle-in-a-haystack style benchmarks when compared to full attention.

Future work will focus on closing this gap by exploring longer sparse training windows, expanding the selection budget dynamically at inference time, or implementing richer indexer scoring functions. Additionally, they plan to extend this selector-only sparse design to reinforcement learning post-training stages.

Summary updated

BibTeX
@misc{lai2026minimax,
  author = {Xunhao Lai and Weiqi Xu and Yufeng Yang and Qiaorui Chen and Yang Xu and Lunbin Zeng and Xiaolong Li and Haohai Sun and Haichao Zhu and Vito Zhang and Jinkai Hu and Jiayao Li and Rui Gao and Zekun Li and Songquan Zhu and Jingkai Zhou and Pengyu Zhao},
  title = {{MiniMax Sparse Attention}},
  year = {2026},
  eprint = {2606.13392},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.13392},
}
Figure