TextPurr Logo

TextPurr

Loading...
Loading...

How MiniMax M3 Was Built: Sparse Attention and Native Multimodality — Olive Song

AI Engineer
Most models learn text first and get vision bolted on later. MiniMax M3 learned both from the very first training step. Olive, who works on reinforcement learning research at MiniMax, goes inside MiniMax M3, an open-weight model with frontier-level coding and agentic ability, a 1 million token context window and native multimodality. She explains MSA, MiniMax's sparse attention design (about 9x faster prefill and 15x faster decoding than full attention): an index branch that picks which blocks matter and a sparse branch that attends only to those, and why existing designs like DeepSeek's DSA didn't fit grouped-query attention or GPU memory access. Then she covers training with text and vision from step zero, why adding vision later gave unstable results, what the attention maps show, and why 3D attention inside the vision transformer improves visual understanding. In this talk: • What makes MiniMax M3 different: agentic coding, 1M context, native multimodal • How MSA sparse attention works, and why DSA didn't fit • Block-level retrieval and kernels built for real GPUs • Why training on text and vision from step zero beats adding vision later SPEAKER Olive Song, RL Lead, MiniMax X: https://x.com/olive_jy_song LINKS MiniMax: https://www.minimax.io MiniMax M3 (GitHub): https://github.com/MiniMax-AI/MiniMax-M3 MiniMax M3 (Hugging Face): https://huggingface.co/MiniMaxAI/MiniMax-M3 MiniMax M3 tech report: https://arxiv.org/abs/2606.13392 MSA (GitHub): https://github.com/MiniMax-AI/MSA CHAPTERS 0:00 Intro 1:03 Meet MiniMax M3 1:37 1M token context 2:57 Sparse attention: index and sparse branches 4:17 Why not DeepSeek's DSA? 5:07 Problems with existing sparse attention 5:37 GPU memory access 7:01 MSA: what we changed 7:46 Block-level retrieval 8:21 Efficient kernels 9:01 Multimodal from step zero 9:46 Training strategies compared 11:45 What the attention maps show 13:10 3D attention in the ViT Recorded at the AI Engineer World's Fair 2026 in San Francisco. Subscribe for more talks from the engineers building with AI. AI Engineer: https://ai.engineer YouTube: https://www.youtube.com/@aiDotEngineer X: https://x.com/aiDotEngineer LinkedIn: https://www.linkedin.com/company/aidotengineer/ #MiniMax #MultimodalAI #AIEngineer
Hosts: Olive Song
📅October 10, 2026
⏱️00:15:03
🌐English

Disclaimer: The transcript on this page is for the YouTube video titled "How MiniMax M3 Was Built: Sparse Attention and Native Multimodality — Olive Song" from "AI Engineer". All rights to the original content belong to their respective owners. This transcript is provided for educational, research, and informational purposes only. This website is not affiliated with or endorsed by the original content creators or platforms.

Watch the original video here: https://www.youtube.com/watch?v=htod7Nv1cBc

00:00:12Olive Song

All right. Hi everyone, my name is Olive. I work at MiniMax on reinforcement learning research. Today, I'm going to talk a little bit about our new model, MiniMax M3, how we trained it natively multimodal from step zero, and how we trained it with MSA, which is MiniMax Sparse Attention.

💬 0 comments
00:00:36Olive Song

A little bit of introduction to our team: we are one of the few labs in the world that works across multimodalities, which means that we have published our LLM models before, we work on speech models, we have our own video generation models, and we have our coding agent models.

💬 0 comments
00:01:03Olive Song

Lately, we just released our MiniMax M3, which is open-weight with frontier performance. It is actually the first open-weight model to combine the following three frontier capabilities. The first one is what we call SOTA coding and agent capabilities. The model is able to do a lot of the agentic tasks that you imagine: it can do automatic task decomposition, it can work in your coding agents, and it can drop in for 90% of the coding work that you are currently doing.

💬 0 comments
00:01:40Olive Song

The second pillar is that the model has a 1 million context window, which is very long and unlocks basically all long user interactions, such as handling full codebases. We trained it with MSA (MiniMax Sparse Attention), so it achieves $9\times$ faster prefill and $15\times$ faster decode versus full attention.

💬 0 comments
00:02:06Olive Song

The third one is that the model was trained natively multimodal from step zero. This means that from scratch, we combined visual understanding with language generation. The model understands both capabilities very well from the start so that we can build many more applications on top of that, such as computer-use agents.

💬 0 comments
00:02:35Olive Song

First, I'll briefly explain what sparse attention does. Our core design principle is that a simpler architecture can always lead to better scaling properties. This is the principle we have followed throughout the entire design. Our goal is to always pursue a cleaner and simpler architecture.

💬 0 comments
00:02:56Olive Song

The sparse attention consists of two branches. The first one is what we call the index branch, which performs a lightweight full attention computation. It uses four query heads and one key head, and it is trained with a KL loss to match the attention scores of the main branch. The index branch is used to identify the tokens with the highest attention scores. These selected tokens are then attended to by the main branch.

💬 0 comments
00:03:28Olive Song

In other words, the sparse branch does not attend to all of the tokens, but only to a subset of them. This subset is selected through the lightweight computation of the index branch. Then, the sparse branch uses the blocks selected by the index branch to determine which keys and values are needed for the attention computation.

💬 0 comments
00:04:04Olive Song

What I want to emphasize today is that our design is not purely algorithm-driven. Instead, we took an algorithm and infrastructure co-design approach. A good example to start with is DSA. DSA was a very strong design, but it is also highly optimized for DeepSeek's own architecture, especially the combination of MQA and a large head dimension.

💬 0 comments
00:04:34Olive Song

However, when we move to a more commonly used GQA architecture, directly applying the same design becomes less straightforward. It introduces several practical issues, especially from the infrastructure and implementation perspective. So this motivates our design choice: instead of simply borrowing an existing sparse attention design, we rethink the architecture under the constraints of GQA and real system efficiency.

💬 0 comments
00:05:07Olive Song

So, what are the issues if we directly apply the existing sparse attention architecture? First, from the algorithm perspective, GQA has multiple KV heads, which should ideally provide more diversity across different KV groups. However, if we directly reuse the same token selection strategy, multiple KV heads will end up attending to exactly the same selected tokens. This essentially cancels out the diversity that GQA is supposed to provide.

💬 0 comments
00:05:40Olive Song

Second, from the infrastructure perspective, this design is not very friendly to GPU memory access. GPUs are much more efficient when reading contiguous data. In the MQA setting, we can think of the KV layout as one KV head with a large head dimension, for example, $1 \times 512$. This is relatively contiguous and efficient to read.

💬 0 comments
00:06:06Olive Song

However, in GQA, the same total dimension may be split across multiple KV heads—for example, $4 \times 128$. These are no longer one single contiguous read. Instead, the GPU needs to perform multiple independent reads across different KV heads. This increases memory access overhead and reduces the compute-to-memory access ratio.

💬 0 comments
00:06:32Olive Song

Another issue here is the top-$k$ computation itself. To select the most important tokens, the indexer needs to compute top-$k$ scores over a large number of token-level candidates. However, top-$k$ has inherent data dependencies, so it is difficult to fully parallelize on GPUs. As a result, token-level selection introduces non-trivial computation and merging overhead.

💬 0 comments
00:06:59Olive Song

So, how did we address these issues in MSA? From the algorithm side, we remove the aggregation of the index branch outputs. In the original design, the results from all index branch heads are merged into a single set of selected tokens. But as we discussed earlier, this would remove the diversity brought by GQA. Instead, we keep the selection distinct across KV heads. Under our sparse attention design, when using GQA, different KV heads can attend to different sets of tokens. This helps preserve the diversity of GQA rather than forcing all heads to share the same sparse attention.

💬 0 comments
00:07:44Olive Song

On the infrastructure side, we move from token-level selection to block-level retrieval. Compared with token-level selection, block-level retrieval significantly reduces the number of candidates and lowers the overhead of top-$k$ computation and result merging. At the same time, block-level retrieval is more hardware-friendly. It improves memory access efficiency and increases the compute-to-memory access ratio. Importantly, we also show that this design does not introduce a significant performance drop.

💬 0 comments
00:08:21Olive Song

Finally, we design efficient kernels for both training and inference. I won't go into the kernel details here today, but this is the system-level component that makes the sparse attention design practical and efficient. With this design, we were able to extend the training of our M3 model to 1 million context very efficiently.

💬 0 comments
00:08:56Olive Song

As we talked about earlier, the third pillar is native multimodality. Our model, MiniMax M3, was trained from scratch with multimodal data. What does that mean? Our model was trained with both text and vision understanding from step zero, which is a very different approach from current open-weight models.

💬 0 comments
00:09:19Olive Song

Our starting point is very clear: at the current stage, a standalone vision-language model has relatively limited application scenarios. But combining it with text understanding during training can be challenging. The key question and challenge was: how can we introduce multimodal capability without hurting the core text performance?

💬 0 comments
00:09:45Olive Song

To answer this, we explored several training strategies at scale. The first and most common approach is to add multimodal training after the pre-training decay stage, which is essentially a CPT-style approach. However, at that point, the model has already largely converged. Adding multimodal data at this stage tends to interfere with the learned text capability and causes degradation.

💬 0 comments
00:10:16Olive Song

Another approach is to introduce multimodal training before the pre-training decay stage—for example, after the model has already seen a certain amount of text tokens. We also tried this direction, but found that the results were highly sensitive to the data mixture and training hyperparameters, such as learning rate. In one setting, a smaller learning rate might reduce the performance drop, but this conclusion does not necessarily generalize to another run. More importantly, during large-scale pre-training, these parameters cannot be arbitrarily changed just for multimodal training.

💬 0 comments
00:10:58Olive Song

This led us to our final strategy: native multimodal training from scratch. In this setting, multimodal capability is introduced from the very beginning rather than being added after the text model has already formed its structure. Under the same text token budget, we find that this approach almost does not hurt text capability.

💬 0 comments
00:11:26Olive Song

We actually did many fun analyses during these experiments. One of them is this interesting observation from the attention maps. You can see from this picture that for CPT-style multimodal models, the text tokens often pay very little attention to visual tokens. The visual token regions are mostly dark in the attention map, which suggests that the multimodalities are not fully integrated.

💬 0 comments
00:11:58Olive Song

In contrast, with native multimodal training, the attention map looks much more integrated. We do not see a clear separation between text tokens and visual tokens here. This suggests that the model learns to fuse visual and textual information more naturally from the beginning. Overall, our training strategy is not just about adding vision capability; it is about integrating multimodality into the model while preserving its strongest text capabilities.

💬 0 comments
00:12:36Olive Song

Of course, we did many experiments on multimodal architecture choices. Our overall architecture is relatively standard: the image or video is processed by a ViT, which produces visual tokens. These visual tokens are then inserted into the language model input by replacing the original image placeholders in the text sequence. After that, the visual embeddings and text embeddings are fed together into the language model.

💬 0 comments
00:13:09Olive Song

One important finding is that applying 3D attention inside the ViT is very helpful for vision understanding. In a standard ViT setting, attention is applied within each individual image or frame. For video inputs, this means that visual patches from different frames do not directly interact at the ViT stage. But with 3D attention, patches across different frames can attend to each other directly. This gives the model stronger temporal and cross-frame visual modeling capability.

💬 0 comments
00:13:45Olive Song

We found that this improves visual understanding, and the benefit also transfers to some image benchmarks, suggesting that it strengthens the overall visual representation rather than only improving video-specific tasks.

💬 0 comments
00:14:03Olive Song

One practical detail is that we cannot simply extend 3D attention to an unlimited number of frames, because that would introduce additional system and load-balancing challenges. In our exploration, using four frames gave us the best trade-off between performance and efficiency.

💬 0 comments
00:14:24Olive Song

Overall, with our architecture design, with the training strategies that we explored throughout the stages, and with our analysis and ViT explorations, we were able to train the model from scratch with multimodal understanding. That concludes my presentation today. Thank you.

💬 0 comments
Video Player