MiniMax M4 and the Economics of a 1M-Token Context
Published · 5 min read
MiniMax’s 2.74-trillion-parameter model combines sparse attention with an SSD-backed cache to cut the memory required per token. Its one-million-token context shows how serving costs, reinforcement learning and API pricing fit together.
In this article
How M4 fits long context into memory
A long prompt leaves behind a key-value (KV) cache that the model reads as it generates new tokens. Keeping that cache in high-bandwidth memory (HBM) gets harder as the sequence grows. MiniMax used two changes to make long contexts more practical on the hardware it had available.
MSA2 uses shared KV heads and fine-grained sparse attention across all 68 attention layers. It builds a compact index of relevant blocks and predicts which ones will be needed two layers ahead. MFlashKV keeps the index and frequently used blocks in HBM during decoding. The rest can live on SSD, with lookahead reads overlapping the previous layer’s work.
| Metric | Versus the previous version |
|---|---|
| KV capacity per token | One quarter as much |
| Prefill throughput | 4.48× |
| Decode throughput | 8× |
MiniMax says the model runs on Huawei 950DT and T-Head Zhenwu M890 supernodes. The launch write-up cites a SemiAnalysis comparison at a target of 100 output tokens per second. In that setup, M4 on Huawei 950DT delivered more than three times the throughput of Kimi K3.1 on Nvidia GB300. MiniMax puts the 950DT at half the HBM and 13% of the compute of the GB300. The result compares two model-and-hardware configurations, so it is specific to that serving setup.
Why serving efficiency matters during training
Reinforcement learning (RL) and evaluation require many model runs, particularly when an agent has to take actions and wait for feedback over a long task. MiniMax estimates that RL and evaluation together account for 30–40% of its R&D compute. The team therefore designed for three things at once: portability across chip types, better utilization on each chip, and efficient inference throughout training and evaluation.
For M4, the team reports spending roughly 20% as much compute on RL as it did on pretraining. It trained 28 domain experts and merged them into one model, using CISPO to stabilize training and adding fault tolerance across the cluster, training and inference engines, and agent sandboxes. MiniMax says the strongest gains over its supervised fine-tuning baseline showed up on specialized and long-horizon tasks. The lab described a future RL budget of up to 50% of pretraining compute.
Early versions of M4 also helped prepare RL data, improve infrastructure and monitor training for later versions. MiniMax put that work at about 15% of total R&D compute and reported a score of 38.2 on Posttrain Bench v1.2. The company says it limited certain security-sensitive capabilities in the public release after internal evaluations.
Where MiniMax reports the strongest results
M4 is natively multimodal. MiniMax’s comparison places it ahead of the open-weight models listed across many of the tested tasks, including coding, domain knowledge, design and computer use. The same chart lists closed models for reference. Treat the rankings as MiniMax’s release results and compare them with the workloads you actually run.
What M4 built in the launch demos
MiniMax published four videos showing what the model could build with code and tools:
- A short film assembled entirely in code, including scenes, camera movement and music.
- A 64-second Three.js documentary that opens with 100,000 particles forming a portrait of Alan Turing.
- An Unreal Engine 5 first-person shooter with gameplay in C++ and a street scene generated with Blender scripts.
- A part-level CAD model of a robotic dog, with an animation that explodes and reassembles 3,097 parts.
Watch the four demo videos in MiniMax’s original announcement →
In a separate demo, MiniMax gave M4 an empty directory and 24 hours to build a desktop browser. The team reports more than 4,000 tool calls and about 120,000 lines of Rust, including a JavaScript engine built without third-party dependencies. The browser scored 100/100 on Acid3 and ran select React 18 and Redux apps in the demo. Acid3 covers a specific set of web standards, so broader compatibility requires additional testing.
API pricing and availability
MiniMax listed M4 through its API, M Plan and MiniMax Code at launch. The API bills fresh input, generated output and cache reads separately.
| API region | Input / 1M | Output / 1M | Cache read / 1M |
|---|---|---|---|
| China | ¥5 | ¥20 | ¥0.30 |
| International | $0.80 | $3.10 | $0.05 |
For repeated repository or document runs, cache hits can lower the cost of rereading the same context. Long generations still accrue output charges, and a one-million-token context window tells you how much can fit in a request. To estimate spend, use the cached input, fresh input and output reported by your own runs.
What to measure on your own workload
M4’s engineering choices matter most when a model repeatedly works through large contexts or long agent runs. To compare it with your current model, run the same repository task with a cold cache and then with a warm one. Record prompt-processing time, output speed and cost per completed task. That gives you a way to judge whether the long-context gains carry over to the work you pay for.