MiniMax M4: The Intelligence Frontier Under Compute Constraints
It is not down in any map; true places never are. — Herman Melville, Moby-Dick
Allow us to introduce MiniMax M4. Natively multimodal with 2.74 trillion total parameters, 66 billion active parameters per token, and a 1-million-token context window, it is the most intelligent model we have ever trained. Across most tasks we observed—including coding, domain knowledge, RSI, chip design, finance and business, design (3D modeling, gaming, and video production), and computer use—M4 stands at the intelligence frontier of both Chinese and open-source models.



Maximizing Compute
Scaling up model size unlocks the ability to solve more complex, frontier-level problems, yet persistent compute constraints make training ultra-large models extra difficult.
Through innovations across model architecture, training algorithms, and infrastructure, we have charted a technical path that continuously scales reinforcement learning while making full use of diverse chip ecosystems.
We followed three core design principles:
- Enable the model to run efficiently across different chip families, maximizing our cumulative available compute;
- Push compute utilization across heterogeneous chips to the limit through hardware-software co-design;
- Inference efficiency and training efficiency are equally important, because reinforcement learning and evaluation account for 30–40% of total R&D compute.
Across most stages of M4's development—including pre-training, reinforcement learning, and inference—we hit maximum utilization on multiple chip platforms.
MSA2 & MFlashKV: Reducing Reliance on HBM Capacity to Maximize Compute Efficiency
HBM capacity limits have been a primary constraint on fully utilizing compute during our R&D—especially as context lengths continue to grow and given the relatively limited HBM resources available domestically. While maintaining training stability, we iterated towards a design that dramatically reduces per-token HBM requirements. We're proud to introduce our new attention mechanism MSA2 and its companion system MFlashKV.
All 68 attention layers of M4 adopt our newly proposed sparse attention mechanism, MSA2 (MiniMax Sparse Attention 2). Through KV-sharing Multi-Query Attention, fine-grained block-sparse attention, compressed multi-head indexing, and two-layer lookahead index prediction, per-token KV cache requirements are reduced by 4× compared with the previous version, while prefilling and decoding throughput increase by 4.48× and 8×, respectively.
We designed MFlashKV to work alongside MSA2. During actual decoding, we offload the vast majority of the KV cache to SSDs, keeping only hot blocks and indices in HBM. For KV cache blocks that must be read from SSD in real time, our lookahead mechanism completely hides index computation and loading behind the computation of the preceding layer. This enables us to substantially reduce HBM usage during decoding without introducing additional overhead.
Through these designs, M4 makes full use of domestic chips, including Huawei's 950DT and T-Head's Zhenwu M890 SuperNode.

At an output speed of 100 TPS, M4 deployed on Huawei's 950DT delivers 3× the throughput of Kimi K3.1 deployed on NVIDIA's most advanced GB300 (Kimi benchmark data cited from SemiAnalysis), even though the 950DT has only 50% of the GB300's HBM capacity and 13% of its compute. This throughput advantage enabled by our model architecture allows us to advance reinforcement learning post-training at massive scale and low cost.
RL Infrastructure & Algorithms
To scale model capabilities and generalization across open-world and real-world tasks, we spent the equivalent of 20% of pre-training compute on M4's reinforcement learning. At this scale, stability, efficiency, and correctness simultaneously become the core priorities of both infrastructure and algorithm design. To achieve this, we built fault tolerance across our training/inference engines, compute clusters, and agent sandboxes, ensuring that single-point failures across million-scale sandboxes, heterogeneous multi-chip deployments, and ultra-long-horizon tasks no longer interrupt training. At the same time, we co-optimized the underlying training/inference engines and RL scheduling, bringing overall RL efficiency to the forefront of the industry.
On the algorithmic side, we continued using our previously introduced CISPO algorithm to ensure stability and correctness during large-scale training. We trained specialist models across 28 distinct domains and ultimately merged them into a single unified model. Compared with the SFT baseline, reinforcement learning substantially raised the upper bound of model performance, with particularly pronounced gains in specialized domains and long-horizon tasks. We also observed that model capabilities continue to grow as RL compute scales. In future versions, we plan to increase RL's share of compute further to 50%.
Across specialized domains, we invited many domain experts to join model development, in some cases directly leading the training of specialist models.
During M4's development, hallmark capabilities representative of leading overseas frontier models also began emerging within MiniMax:
- RSI (Recursive Self-Improvement): Pre-training and mid-training for M4 were completed 50 days ago; since then, our R&D efforts have focused on post-training for the current M4 release, online serving and inference systems, and pre-training and mid-training for subsequent versions. Throughout this process, early versions of M4 have played a vital role—directly participating in RL data construction and continuous iteration, RFT, infrastructure optimization, training monitoring and analysis, and other R&D workflows. Across M4's post-training R&D, compute used to leverage early versions of M4 to drive both its own iteration and that of future models accounted for roughly 15% of total R&D compute, and this proportion continues to rise. On Posttrain Bench v1.2, which evaluates post-training capabilities, M4 scores 38.2, steadily approaching the level of proprietary frontier models. We are beginning to see improvements in model capability not only elevate the model's own performance, but also translate into productivity for building the next generation—gradually forming a virtuous cycle between model capability and R&D efficiency.
- Security: During M4's development, we observed the following capabilities: first, breaking multiple peer-reviewed modern cryptographic schemes with no previously published attacks; second, going beyond known vulnerabilities during reinforcement learning and evaluation to uncover a large number of previously unknown high-severity vulnerabilities in production-grade open-source codebases; and third, chaining multiple vulnerabilities to escape sandboxes, obtain host privileges, and launch attacks against company infrastructure, all of which prompted us to harden our own infrastructure. Given the potential risks of these capabilities, we have attenuated certain cybersecurity capabilities in the publicly released general-purpose version, and will separately offer a dedicated Cyber edition to compliant security research institutions.
To learn more about the technical details of M4, please read our technical report: https://github.com/MiniMax-AI/MiniMax-M4
Pricing
Backed by these architectural advantages, we offer the most competitive pricing among flagship models, paired with the fastest possible inference speed at this price level.
API pricing is $0.80 per million input tokens, $3.10 per million output tokens, and $0.05 per million cached input tokens.

Available via:
- API: https://platform.minimax.io/docs/pricing/overview
- M Plan: https://www.minimax.io/m-plan
- MiniMax Code: https://code.minimax.cn
Individual developers can enjoy multiple times the usage on the same budget with M Plan, plus a limited-time 2× off-peak night bonus in MiniMax Code—with no 5-hour usage cap on the new model or new tiers. Coding, office productivity, and creation, all in one place.
Showcase
Systems-Level Software Engineering
Modern web browsers are among the most complex systems in software engineering. We gave M4 a 24-hour engineering window and an empty directory, and asked it to build a graphical desktop browser from scratch without Chromium, WebKit, Gecko, V8, or any other existing engine.
Over more than 4,000 tool calls, M4 coded continuously and debugged against its own rendered output, writing 120,000 lines of pure Rust. It independently implemented HTML5 parsing, CSS3 Flexbox and Grid layout, SVG and Canvas rendering, and a native desktop UI. Its zero-dependency JavaScript engine alone spans 32,000 lines and supports core language features through ES2022. The resulting browser scores 100/100 on the Acid3 compatibility test, renders mainstream websites accurately, and runs dynamic web apps built with modern front-end frameworks such as React 18 and Redux.
Code to Everything
Give M4 an idea, and it can use code to produce animations, 3D models, playable games, and production-ready websites. Driving Blender, CAD software, Three.js, and WebGL, it brings concept art, 3D assets, and code together into finished work. M4 can write rendering pipelines and shaders from scratch, render millions of 3D elements in the browser in real time, construct articulated assemblies through parametric modeling and kinematic simulation, and verify outputs programmatically, frame by frame, pixel by pixel.
Code to Video
M4 can produce an entire short film in code: building scenes, choreographing camera moves, generating assets and music, and rendering and compositing the final cut. Because camera paths, lighting, and pacing all live in code, every frame can be precisely controlled and refined.
M4 built this 64-second, seven-scene short documentary entirely in code, covering visuals, camera effects, music, and sound design. For the opening shot, it choreographed 100,000 particles to converge into Alan Turing's portrait, with each particle taking on the portrait's true color and lighting as it settles.
M4 rendered this 30-second brand film frame by frame in pure code. It locked every cut to the soundtrack's beat, generated all eight visual sequences (from a block city to a wall of numbers), and wrote custom post-processing for film grain, glow, and light leaks.
M4 generated 3D landscapes for all 24 solar terms, then wrote a custom renderer to turn them into ink-wash paintings complete with brush-like outlines, ink bleed, and paper texture. For the finale, the scenes dissolve into 147,000 colored points that converge to form the five-character Chinese title.
Game Development
M4 can develop complete games in Unreal Engine 5 using C++, Python, and Blender across genres including racing, FPS, and action. It covers the full pipeline, from procedural environments, vehicle physics, gunplay, and combat systems to AI opponents and cutscenes. After each round of changes, it writes automated tests to verify gameplay feel, hit detection, and frame rate.
M4 built this Unreal Engine 5 shooter from scratch, implementing movement, aiming, and gunplay in C++ while generating the entire street in Blender. To keep the facades from looking flat, it wrote a script to detect painted window textures and carve them into recessed 3D frames for realistic parallax.
In Unreal Engine 5, M4 built a complete martial arts combat system featuring combos, dodges, parries, finishers, and a boss cutscene. It kept two-character finishing moves tightly synchronized and extended enemy heavy-attack wind-ups to give players a clear window to counter.
M4 built a playable Unreal Engine 5 racing game from scratch, scripting Blender to generate the entire 8 km mountain course. It tuned the drift physics to adjust rear-wheel grip dynamically for wide, controlled slides and programmed AI rivals with live race rankings.
3D Modeling
M4 can build precise 3D models from photographs, technical drawings, and public documents, ranging from a single screw to an entire cathedral. It scripts Blender and CAD tools for parametric modeling so parts can move and disassemble, then brings the finished models into the browser with Three.js for real-time exploration and interaction.
Working from historical photos and archival records, M4 reconstructed Dublin's Long Room as an interactive 3D space in the browser. It generated all 40 bookcase bays, the vaulted ceiling, rows of books, and 48 sculpted busts in code, with natural sunlight streaming through the windows, shifting realistically by date and time.
M4 modeled this robot dog in CAD with over 3,000 individual parts, including 302 screws, 22 joints, and enclosed internals such as the battery pack and knee linkages, which it sized and generated in code. It then imported the assembly into Blender and animated every piece disassembling and reassembling.
Using CAD floor plans to establish accurate scale and alignment, M4 wrote 4,800 lines of Blender scripts to reconstruct St Paul's Cathedral. It generated the sweeping arches, organ pipes, and choir lamps in code, then seamlessly integrated real-world 3D scans for intricate architectural details.
Working from NASA's public documentation, M4 built an interactive 86-part model of the Hubble Space Telescope for the browser. It animated the bay doors to swing open on accurate hinges, rigged the science instruments to slide out along their servicing paths, and simulated starlight reflecting through Hubble's actual optical system.
Interactive Websites
M4 builds immersive, interactive websites with Three.js, WebGL, and Canvas where scenes respond in real time as you scroll, click, or explore. Entirely in code, it writes GLSL shaders for light and materials, uses Gaussian splatting to render lifelike environments from millions of points, procedurally generates meadows and cities, and adds physics and character animation.
M4 built this scroll-driven 3D expedition to run live in the browser with over 50,000 particles. It modeled how light filters through translucent ice, programmed fractures to branch outward wherever you strike, and simulated 160 ice shards shattering on impact.
In 19,000 lines of code, M4 drew a 68-story tower filled with over 1,100 rooms and hundreds of animated people, surrounded by nearly 1,900 neighboring buildings. It even built the perspective renderer from scratch, letting you glide smoothly from rooftop to street level as you scroll.
M4 built this explorable 3D campus from nearly 4.5 million Gaussian splats, generating tens of thousands of blades of grass and wildflowers in code. It modeled props like the pool's rubber duck in Blender, then converted them into lightweight splats so the entire scene renders smoothly in the browser.
Open Source and What's Next
Following the completion of internal and third-party safety evaluations, we will continue to open-source the model weights. We hope to complete this within the next few weeks.
We believe we are still at the starting line on the journey toward greater intelligence. Objectively, we identified many areas for significant improvement during development, and a substantial gap remains compared with the very best overseas models. We hope to bring stronger future versions to everyone even faster.
Intelligence with Everyone



