MSA reduces long-context inference cost by 28x!
MiniMax has introduced their MSA sparse attention mechanism, reducing per-token compute by 28x at a 1M token context size while maintaining parity with regular attention on standard benchmarks. They have deployed it in their MiniMax-M3 model.
MiniMax has introduced their MSA (MiniMax Sparse Attention) mechanism which reduces the per-token compute of attention by 28.4x at a one million token context size while maintaining parity with regular attention on standard benchmarks. They have deployed it in their MiniMax-M3 model and released an inference kernel under an MIT license.
This is the problem they are solving: The “attention” component of all modern language models requires comparing every token to every other token, resulting in quadratic complexity with respect to the length of the input. If we want to process an entire codebase or a book (i.e., long context), then this quadratic computation becomes too slow and too expensive. Sparse attention aims to avoid unnecessary comparisons, but we want to do so without sacrificing model intelligence.
How the two-branch trick works
MSA divides the task into two stages. First, the “Index Branch” computes scores for parts of the input (blocks of 128 tokens) and selects the 16 most relevant tokens for each query, ensuring that the query’s block remains local. Next, the “Main Branch” performs accurate attention calculations, but only between the chosen blocks rather than the entire input. Each token now attends to approximately 2,048 other tokens regardless of the length of the document, explaining why the gains are so dramatic at long context sizes: 28.4x fewer computations per token when processing a 1M token context, and 14.2x faster prefill and 7.6x faster decoding times on Nvidia H800 GPUs.
What really counts here is whether performance remains unchanged. According to MiniMax, their MSA model developed from scratch performs nearly identically to full attention on several metrics (MMLU 67.2 vs 67.0, GSM8K 77.7 vs 76.2, HumanEval 64.0 vs 61.0) and even surpasses it on a long context retrieval task (RULER-8K, 84.2 vs 79.8). That means you get most of the benefit for free! Their underlying model is a 109B parameter Mixture-of-Experts model trained on 3 trillion tokens, and their released kernel (fmha_sm100) includes support for modern precision types such as FP8 and FP4.
Even if you don’t build models yourself, this type of optimization can lead to significant improvements in the cost and performance of the tools you use. With long context, AI can read your entire project, a long PDF, or months worth of conversation history simultaneously — right now, this is a luxury feature. But if it becomes 28x cheaper, then everyone will be able to afford it! Of course, you should take claims about “free lunch” with a grain of salt since every research group claims that their sparse attention mechanism preserves full attention. Usually, discrepancies appear when dealing with unusual cases not covered by standard benchmarks.
However, there are some caveats. Currently, the open kernel only works on Nvidia’s latest SM100 GPUs; other devices require custom implementations. There may still be minor differences in certain subtasks compared to full attention, and all measurements were obtained using MiniMax’s internal testing framework without external verification. Nevertheless, deploying it in a real product instead of a proof-of-concept demonstrates that the competition for efficient long context processing is becoming fierce.
If you build with LLMs, watch the trend rather than this single model: the cost of long context is collapsing, so designs you rejected last year as "too expensive to stuff everything into the prompt" may be worth revisiting. If you just use AI, the takeaway is simpler — the "feed it everything" workflows, like dropping in a whole document or codebase, are about to get cheaper and more common across providers, not only MiniMax.
Source: www.marktechpost.com
Free course
Stop reading about AI — start building with it
The free Claude Code course: your first site, tool or game — no coding. No upsells, no cross-sells — nothing to buy here.
Start free →
Author
Evgenii Arsentev
PhD · Founder & CEO, Dad4Kids
Articles · Latest articles