Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Reader activity
0 Useful 0 Views 8 min Read — No ratings
Artificial Intelligence
8 min read

MiniMax M4: 3T MoE Model Scales RL to 50% Pretraining Compute on Domestic Chips

MiniMax's M4, a 2.74T parameter sparse MoE model with 66B active parameters and 1M token context, achieves open-source SOTA across six benchmarks and runs efficiently on domestic chips like Huawei Ascend 950DT via MSA2 sparse attention, MFlashKV SSD offloading, and quantization-aware training, while scaling reinforcement learning to 50% of pretraining compute using 28 domain-specific expert models merged via MOPD distillation.

Model Overview & Benchmarks

MiniMax's new flagship M4 is a sparse Mixture-of-Experts (MoE) model with 2.74 trillion total parameters and 66 billion activated parameters per token, supporting a 1 million token context window . On six core benchmarks, M4 secures open-source first place across the board, reaching domestic state-of-the-art (SOTA) and matching top proprietary models such as GPT-6.2 and Claude Opus 5.5 in coding, agent, finance, and design tasks. On the Arena.ai leaderboard, M4 scores 1194 to top the Agent Arena open-model ranking, with a single-task median cost of only $0.35 .

The company also released a 78-page technical report (GitHub: https://github.com/MiniMax-AI/MiniMax-M4) covering architecture, training/inference optimization, and large-scale RL.

Running a 3T Model on Domestic Chips

Sparse MoE Architecture

Each MoE layer contains 384 routed experts ; each token activates 4 experts plus a shared expert, keeping activated parameters at 66B. This design reduces memory pressure on hardware with limited HBM.

MSA2: Next-Generation Sparse Attention

To handle long-context agent workloads where KV cache grows continuously, MiniMax developed MSA2 (MiniMax Sparse Attention 2) deployed across all 68 attention layers . MSA2 uses a two-branch design: a lightweight indexer branch selects relevant KV blocks from history, and a main attention branch computes exactly on those tokens. Key improvements over the previous MSA:

128 query heads share 1 KV head , cutting per-token KV cache to 1/4 of MSA .

Block size reduced from 128 to 16 tokens , refining retrieval granularity 8× while keeping a 2048-token attention budget, enabling more precise key-info location in long contexts.

Operator benchmarks show MSA2 delivers 3.98× BF16 training forward and 1.54× backward throughput gains; 4.48× FP8 prefill and 8× FP8 decode throughput gains versus MSA.

MFlashKV: Offloading KV Cache to SSD

To further alleviate HBM capacity limits, MFlashKV stores the vast majority of historical KV states on SSD, retaining only compressed indices, fixed retention blocks, local blocks, and hot caches for active requests in HBM. It leverages MSA2's Indexer Lookahead (two-layer lookahead) mechanism: while computing the current layer, the model already selects KV blocks needed by future attention layers and asynchronously prefetches them from SSD. This hides SSD latency, allowing massive KV cache expansion without noticeable inference latency increase.

Quantization-Aware Training (QAT) & Low-Precision Execution

From the million-token mid-training stage onward, MiniMax employs QAT consistently through SFT and RL. Linear layers in routed MoE experts use FP4 quantization; attention projections and shared-expert layers use FP8 . The same quantization scheme applies to training forward, RL rollout, and inference deployment. Combined with operator fusion, communication optimization, and chip-specific scheduling, M4 maximizes hardware utilization.

Inference Efficiency on Domestic Chips

Under 100 tokens/s/user, M4 achieves 1589 token/s single-chip decode throughput on Huawei Ascend 950DT — roughly 3× Kimi K3.1 on NVIDIA GB300 — despite Ascend 950DT having half the HBM capacity/bandwidth, ~20% FP8 peak FLOPS, and ~13% FP4 peak FLOPS of GB300. M4 is also adapted to PingTouGe Zhenwu M890 and other domestic chips.

Million-Token Context & Native Multimodal Architecture

The 1M context enables long-horizon agents to retain more code, tool outputs, and action history, reducing information loss from frequent compression. M4 adopts a native multimodal architecture from pretraining, jointly training text, image, and video. A 631M-parameter vision encoder processes spatiotemporal relations via 3D RoPE , allowing adjacent video frames to attend jointly. Visual tokens are compressed: temporal compression of adjacent frames followed by spatial patch merging. Compared to per-frame per-patch input, single-image visual tokens drop to 1/4 and two-frame video tokens drop to 1/8 .

Context extension uses a staged curriculum: pretraining at 24K, mid-training first to 192K then to 1M, with data progressively lengthened while preserving short-text and natural corpora. Mid-training injects massive real agent trajectories spanning coding, office collaboration, computer operation, design, recursive self-improvement, and cybersecurity, teaching full task execution (tool use, environment feedback, error correction, multi-turn goal pursuit). Trajectories from diverse frameworks (Claude Code, Codex, OpenCode) reduce overfitting to a single tool protocol.

RL Scaling: Tasks, Infrastructure & Algorithm

MSynth: Synthesizing Executable, Verifiable RL Tasks

Real agent tasks are complex (dozens of files, multiple valid solutions). Weak verifiers let speculative solutions exploit rewards; rigid verifiers reject correct code. RL amplifies these issues at scale. MiniMax built MSynth to generate tasks from real code repos, historical PRs, and online model failures. Each task comprises: goal , reproducible environment , and verifier . The system can target model weaknesses or convert real failures into training data. Every candidate task passes through Mill , an automated verification/repair pipeline where Author, Solver, and Reviewer roles check consistency among task description, reference solution, and verifier, filtering out tasks that cannot be reliably verified.

Forge & AFlow: Predictive Scheduling for Heterogeneous Rollouts

Agent runtimes vary wildly (minutes to hundreds of tool calls) with pauses for tests, installs, and execution. Fixed resource allocation leaves devices idle. AFlow tracks each session's state (interaction phase, tool calls, context) and predicts tool return time, remaining turns, and future token count. Forge 's scheduler uses these predictions to dynamically adjust Prefill/Decode resource split: early long-context phases get more Prefill; sustained generation shifts to Decode. Extremely long tasks are routed to a Fast MegaEngine low-latency decode channel . This predictive scheduling yields 51% higher effective rollout throughput vs. fixed Prefill/Decode split and 13% higher vs. reactive scheduling , directly increasing usable training trajectories per unit time.

CISPO Algorithm & Joint Length/Turn Constraints

M4 continues using MiniMax's CISPO as the base RL algorithm, adapted for low-precision training and long-horizon agents. The team found that penalizing only output length shortens per-turn replies but not interaction turns. M4 therefore jointly constrains output tokens and interaction turns . On DeepSWE v1.1 (mini-SWE-agent and OpenCode), this joint constraint achieves higher Pass@1 at all inference intensities while reducing output tokens ~20% .

Scale Out / Scale In: 28 Expert Models Merged via MOPD

MiniMax splits RL into 28 domain-specific expert training lines (coding, terminal/agent, office, computer operation, design, science, cybersecurity, finance, law, consulting, circuit engineering, etc.). Each line starts from the same SFT checkpoint, trains independently on its own task distribution, reward rules, and compute cluster — avoiding interference from heterogeneous tasks. This Scale Out strategy also enables better utilization of heterogeneous domestic compute.

After independent training, the 28 experts are merged into a single model via MOPD (Multi-Teacher On-Policy Distillation) — the Scale In phase. The unified student model acts on-policy; each domain expert evaluates the student's sampled tokens under the same context, computing per-token log-probability gaps as distillation signals. Experts only score student-generated tokens (no full demonstrations or full-vocab distributions). For long-horizon tasks, log-prob gaps concentrate in the early trajectory prefix ; later tokens diverge from expert distributions, risking systematic bias if full trajectories are used. MOPD therefore adopts progressive trajectory lengthening : start with short executions, stabilize early behavior, then gradually extend task length. On DeepSWE v1.1, ProgramBench, and AutomationBench, prefix training with only 10–15% of full-length GPU hours closes >80% of the expert-student gap ; ~40% of full-length GPU hours matches or slightly exceeds expert performance .

New domains can be added by training fresh experts and distilling them in, without full RL retraining. Early M4 versions already participate in their own and subsequent model development (data construction, infra optimization, training monitoring), creating a self-improving loop. This expert-training paradigm also offers a blueprint for enterprise customization: train domain experts on private data/knowledge/acceptance criteria, then merge via MOPD-like distillation.

Conclusion

M4 demonstrates that a 3T-class domestic LLM can reach new capability ceilings while running efficiently on domestic silicon, with RL scaling benefits showing no clear saturation. From MSA2 and MFlashKV reducing inference overhead, to MSynth and Forge enabling massive RL, to 28 experts merged via MOPD, MiniMax is converting every unit of available compute into model capability. For MiniMax, this means future R&D can lean more on domestic compute; for the Chinese LLM industry, M4 shows that even under high-end compute constraints, continuous architecture and system-efficiency improvements can unlock space for larger-scale reinforcement learning. The next round of LLM scaling will test not just compute scale, but how much value can be extracted from every unit of compute.

For attribution, corrections or content rights, contactadmin@besthub.dev

Report an issue with this article

Discussion 0

Write a comment

Sign in to join the discussion

No public comments on this page. Sign in to comment