Blog
MiniMax Sparse Attention 2M Flash KVMiniMax M4 architecture

How Does MiniMax M4 Handle 1M Tokens? Sparse Attention Explained

MiniMax M4 is a 2.74T model with 66B active parameters. Here is how sparse attention, a 4x smaller KV cache and SSD storage make 1M tokens practical.

Portrait of Luis Chavez-Mattos
Edited by Luis Chavez-Mattos, Director, Product··RSS

For Engineering

The number 1M in large type.

How does MiniMax M4 make a 2.74T-parameter, 1M-context model practical?

MiniMax M4 stays practical through three design choices. First, it is a mixture-of-experts model, so only about 66 billion of its 2.74 trillion parameters work on each token. Second, a new method called MiniMax Sparse Attention 2 lets a small "scout" pick the relevant chunks of earlier text instead of re-reading everything. Third, its memory of the past is about four times smaller than the previous design, and a system called M Flash KV lets that memory live on ordinary SSD storage.

TL;DR

  • M4 has about 2.74 trillion parameters, but only about 66 billion are active for each token, because a router sends work to a few specialists.
  • MiniMax Sparse Attention 2 uses a small scout to select the most relevant chunks of earlier context, and it does this two layers early so the data is ready when needed.
  • The model keeps one shared copy of its memory notes, which MiniMax says cuts the memory footprint four times compared with its previous design.
  • M Flash KV lets that memory sit on ordinary SSD storage instead of only on scarce, expensive chip memory, and MiniMax says this does not slow things down.
  • MiniMax says M4 runs efficiently on Huawei's Ascend chips, which on paper have less memory and computing power than Nvidia's GB300.
  • Open weights are expected within weeks after safety checks, so these claims will be easier to test independently soon.

What does "2.74T parameters, 66B active" actually mean?

Parameters are the numbers a model learned during training. More parameters generally means more stored knowledge and skill, but also more work every time the model produces a word.

M4 gets around that with a mixture-of-experts design (often shortened to MoE). Picture a big team of specialists. For each token (a word or piece of a word), a router decides which few specialists should handle it. One shared specialist always helps. The rest sit idle for that token.

The result: the model holds about 2.74 trillion parameters in total, but only about 66 billion do work on any single token. You get the capacity of a huge model with the per-token running cost of a much smaller one.

The same idea applies to images. According to the hands-on walkthrough of M4, the specialists pick which image pieces they take, so no single specialist gets overloaded or swapped out. M4 is multimodal, meaning it reads pictures as well as text.

Why is a 1M-token context so hard to run?

A million tokens is roughly the length of several long books. Holding that much in one conversation creates a memory problem, and the culprit is the KV cache.

When a model reads text, it stores a compact set of notes about every earlier token so it does not have to recompute them. Those notes are the key-value cache, or KV cache. The longer the context, the bigger the cache. At a million tokens, it can grow larger than what fits comfortably in a chip's fast memory. Standard attention also makes the model look back over all of it for every new token, which gets slow.

So long context is a double cost: lots of memory to store the notes, and lots of work to read them. M4's design attacks both.

What is MiniMax Sparse Attention 2?

Attention is how a model decides which earlier parts of the text matter for the next word. Full attention checks everything. Sparse attention checks only a selected portion.

In MiniMax Sparse Attention 2, a small scout does the selecting. Instead of re-reading everything the model has seen, the scout picks out only the most relevant chunks. It does this two layers early, so the chosen data is already ready by the time a later layer needs it.

A practical analogy: you are answering a question about a 500-page contract. You do not re-read every page. You use the index, flag the five relevant sections, and read those. The twist here is that the flagging happens ahead of time, so you are never waiting for it.

How does the smaller KV memory work?

MiniMax says M4 keeps a much smaller memory of the past. The source description is that many "readers" (attention heads) look at one shared copy of the same notes, rather than each keeping its own. MiniMax says this cuts the memory footprint by four times compared with its previous design.

This matters because memory, not raw thinking power, often limits how many people a server can handle at once. A cache that is four times smaller means more long conversations fit on the same hardware.

What does M Flash KV change?

Even a smaller cache is large at a million tokens. M Flash KV is the system that lets the cache live on ordinary SSD storage instead of only on scarce, expensive chip memory. MiniMax says it does this without slowing things down.

Think of a desk and a filing cabinet. The desk (chip memory) is fast but small and costly. The cabinet (SSD) is slower but large and cheap. Plain use of the cabinet would be painful. The trick is to fetch the right files before you need them. Sparse attention helps here, because the scout already knows which chunks are relevant and can request just those.

Treat the "no slowdown" claim as MiniMax's own statement. It is a company claim until independent testers can run the open weights.

Why does the Huawei Ascend chip matter?

This is the part of the story that surprised the reviewer who tested M4. MiniMax says M4 runs on Huawei's Ascend 950 DT, which on paper has half the memory and far less raw computing power than Nvidia's GB300. MiniMax's results show it keeping pace with some larger rivals, helped by the linear memory design described above.

The caveats are real. The comparison is not clean across the board, because the models being compared differ. And M4 falls away at higher speeds. Still, the takeaway holds: smart design can make up a lot of ground when you do not have the biggest hardware. For anyone who worries about AI costs, this is the trend to watch. Efficiency gains, not just bigger chips, are driving what becomes affordable.

How did M4 perform in hands-on tests?

Architecture is a promise. Output is the proof. In one creator's hands-on session (a single tester, not a formal benchmark), the results were mixed:

TaskResult
Fix a double-booking bug in a full-stack Docker appPass. It found the root cause, though it took longer than expected and held a database lock during card charging.
Build an interactive Rafflesia flower simulation in one HTML fileFail. Polished title page, but a weak scene and controls that did little.
Turn a photo of six messy receipts and claim rules into a PDF expense claimPass. It rejected a duplicate receipt, removed a personal item, corrected a total and applied a meal cap.
Read tanker images and reason about physicsMostly right, with one small slip.

On published comparisons, MiniMax's own benchmark picture shows M4 on top among open models across six tests (coding to finance to web design), while the best closed models are mostly ahead. That is a vendor-supplied summary, so wait for independent results.

What does this mean for you?

If you use AI at work: long context is what makes tasks like "read this whole folder of documents and tell me what conflicts" possible. The expense example is the pattern to copy. Give a model messy inputs, a clear set of rules, and ask it to show its reasoning line by line so you can check it.

If you manage costs or buy AI tools: watch for efficiency claims like these. Cheaper memory and smaller active parameter counts tend to show up later as lower prices and wider availability. Do not assume it yet, though. No pricing is confirmed in the material here.

If you are technical or evaluate models: wait for the open weights, expected on Hugging Face and ModelScope after safety checks. Then test the long-context claims on your own documents. A model that handles one million tokens in a demo can still miss details in your data.

What you can do now: pick one long, messy task you do regularly. Write down the rules a person would follow. Those rules are your prompt, and they work with any capable long-context model.

Could you build a small tool around a long-context model like this?

The expense-claim example is a good template for a tool a team might want: upload receipts, apply the company's claim rules, and produce a reviewable summary. With Remy, you can describe that tracker in plain English and get a deployed full-stack app with a database, sign-in and a claim approval screen, instead of juggling spreadsheets or buying another subscription. Remy offers nearly 400 AI models inside the apps it builds, so you can choose the model that fits the document-reading step. Check the live model list to see what is currently available.

Frequently Asked Questions

4 questions

What is a KV cache in simple terms?

It is the model's set of notes about everything it has already read in the conversation. Storing the notes saves the model from recomputing them for each new word. The longer the conversation, the larger the notes become, which is why long context strains memory.

Does "66B active parameters" mean M4 is a 66B model?

No. The full model has about 2.74 trillion parameters. Only about 66 billion are used for each token, because a router picks a few specialists. You get the knowledge of the large model at closer to the running cost of a smaller one.

Is MiniMax M4 open source?

MiniMax says open weights should follow within weeks after safety checks, on Hugging Face and ModelScope. Until they are released, you cannot download or inspect the model yourself.

Does M4 beat the best closed models?

According to MiniMax's benchmark summary, M4 leads among open models on six tests, while the best closed models are mostly ahead. Those are vendor-supplied results, and a single hands-on test showed both strong and weak outputs.

How we source, write, and correct our articles. Editorial standards

Related articles

The AI Brief, presented by Remy
The week in AI, and what it means for your work. Every Friday.