AI Engineer Code 2025
Minimax M2
Read the talk
MiniMax M2: Training for the Environment Around the Model
Useful coding agents need more than strong benchmark scores: they must learn from developer feedback, recover from tool failures and keep working when their surrounding scaffold changes.
From a talk by Olive Song
Before you start: Familiarity with language-model tool calling and the basic idea of reinforcement learning will help you follow the training mechanisms.
Building a model developers can work with
What does a coding model need to learn to become useful inside a developer’s everyday workflow? At MiniMax, part of the answer comes from building both foundation models and the applications that use them. Olive Song, who works on reinforcement learning and model evaluation, describes a portfolio spanning text, vision-language, Hailuo video generation, speech and music generation, alongside in-house agent applications. Researchers and application developers work side by side, giving the model team firsthand feedback about what developers need.
MiniMax M2 is the open-weight model built around that feedback, with coding and workplace agentic tasks as its targets. Song emphasizes its 10 billion active parameters and cost efficiency. The active count matters: the official repository describes a mixture-of-experts model with 230 billion total parameters, so “10 billion active” does not mean a 10-billion-parameter model’s storage or memory requirements.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Scores and everyday use
A high-scoring model can still perform poorly when plugged into a particular development environment. Song presents M2 as a leading performer on intelligence and agentic benchmarks, tentatively placing it at the top of open models, but does not name scores in this discussion. Her practical concern is what happens after the benchmark: whether developers actually want the model in their workflow.
Song reports that M2 had the most downloads in its first week and reached the top three for token usage on OpenRouter. The download claim comes without a platform or comparison set; the OpenRouter statement is a historical adoption claim without a specified aggregation window. These signals motivate the rest of the presentation, which connects four characteristics to training choices: coding experience, long-horizon state tracking, generalization across agent scaffolds and multi-agent scalability.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Scaling environments and expert feedback
A coding agent needs practice in the languages and workflows developers actually use. MiniMax builds training environments from real internet data so that, during reinforcement learning, the model can act, observe the environment’s response and learn against verifiable coding goals. Scaling this process requires both more environments and the infrastructure to run them efficiently. The accompanying slide makes the inputs concrete: real GitHub repositories, issues and tests, supported by high-concurrency infrastructure.
Song attributes M2’s full-stack, multilingual capability to this combination of data construction and reinforcement learning. But environments are only one source of feedback. MiniMax also brings in expert developers as reward models: people who help determine which problems are worth solving and what a good solution looks like.
Their involvement starts with problem definition, including bug fixing and repository refactoring. It continues through judgments about behavior: whether the model works in a way developers enjoy, find reliable and can trust. Finally, experts evaluate and reward both the process and the delivered result.
| Feedback source | What it contributes |
|---|---|
| Coding environment | Observable responses and verifiable goals |
| Expert developer | Task definition, behavior judgments and deliverable evaluation |
Passing a check and being a useful collaborator are distinct training targets. The expert feedback gives the training cycle a way to account for the latter. Song reports strong results across multiple languages in real use, without supplying language-specific measurements here.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Reason again after the tool responds
Long tasks introduce another requirement: the model must keep reasoning while it interacts with a complex environment. M2’s approach combines reinforcement learning with interleaved thinking. In the baseline sequence Song describes, the model receives tool information, a system prompt and a user prompt; reasons; calls one or more tools, potentially simultaneously; receives their responses; and then produces final reasoning and an answer.
That sequence is insufficient when a tool fails or returns something unexpected. Real environments are noisy and dynamic. A useful agent must inspect the feedback before deciding whether to continue with its original plan. Interleaved thinking repeats that decision inside the same user interaction:
- Reason about the next action and call a tool.
- Inspect the returned information, including errors or unexpected results.
- Decide whether the information is sufficient to complete the task.
- If it is not, choose another action or tool and repeat.
The critical step is reassessment: a tool response changes what the agent should do next.
Song describes tens to 100 tool-calling turns within a single user interaction. That is a description of the intended interaction pattern, not a measured completion rate. MiniMax’s accompanying interleaved-thinking guidance adds an integration detail: carry reasoning state forward between tool calls. Its November 2025 API examples are historical guidance, rather than verification of a current API contract.
Repeated reassessment lets an agent switch tools or decisions when a response is suboptimal. Song gives Gmail, Notion and Terminal as examples of tools that could participate in one automated workflow with minimal human intervention. Her description of initiating the work with one model call is best understood at the user-interaction level; the talk does not specify how the application orchestrates requests across the full tool loop.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A changing market as an environment
To illustrate adaptation, Song turns to a trading example inspired by the New York setting. She describes stock-market perturbations roughly in the preceding week and says M2 continued to perform stably as new information arrived. News and other trading policies appear as examples of changing environmental inputs. The illustration extends the tool-error problem: an agent may need to reconsider its actions even when its tools are working, because the world they describe has changed. No trading setup, stability metric or quantitative outcome is supplied, so the example supports the discussion of adaptation without establishing an investment-performance result.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
More tools did not solve scaffold changes
MiniMax initially approached agent generalization as a tool-scaling problem. Train on enough tools—varied tools, new tools, even invented tools—and the model should learn to handle unseen ones. That worked initially. Then the team changed the agent scaffold, the surrounding system that packages prompts, tools and interactions, and the model failed to generalize. Familiarity with many tools had not made it robust to the system around them.
The broader target became adaptation across the model’s entire operational space. MiniMax’s agent-generalization account describes the same shift. In the talk, Song identifies the dimensions that the data pipeline must vary:
- Tool information: the descriptions and interfaces the model receives.
- System and user prompts: the instructions and requests framing the task.
- Chat templates: the structure used to present the interaction.
- Environments and tool responses: the conditions the agent acts in and the feedback it receives.
MiniMax designs and maintains perturbation pipelines across these inputs. The goal is to prevent successful behavior from depending on one particular presentation of the task.
A small Python fixture illustrates one such perturbation: preserve the user’s task while changing how the environment reports a failed command. This constructs two evaluation inputs; it does not represent an agent completing the repair.
python
from copy import deepcopy
baseline = {
"user": "Fix the failing tests in this repository.",
"tool": "terminal",
"command": "pytest -q",
"response": {
"exit_code": 127,
"stderr": "pytest: command not found",
},
}
perturbed = deepcopy(baseline)
perturbed["response"] = {
"status": "error",
"message": "The command pytest is unavailable.",
}
cases = [baseline, perturbed]
assert cases[0]["user"] == cases[1]["user"]
assert cases[0]["response"] != cases[1]["response"]
Both responses report the same obstacle. An evaluation can then ask whether the agent recognizes it in either format and chooses an appropriate next action. This is one concrete dimension of the broader perturbation strategy, which also varies prompts, templates and environments.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Multiple copies working in parallel
The fourth characteristic is multi-agent scalability. Song connects M2’s small active parameter count and stated cost efficiency to the feasibility of running multiple copies for long tasks. In videos of MiniMax’s in-house agent application, she describes copies doing research, analyzing findings, writing a report and producing a frontend illustration. These activities can run in parallel, allowing the application to distribute work instead of assigning every step to one sequential agent. The demonstration also offers a QR code for trying the application.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Memory, context and the next models
M2 brings together environments, algorithms, data, expert judgments, architecture, inference and evaluation. The training story is therefore larger than any one technique: interactive environments supply feedback, experts shape useful behavior, repeated reasoning supports long tasks, and perturbations broaden the conditions under which those behaviors work.
For M2.1 and M3, Song looks toward better coding, memory, context management, proactive workplace AI and vertical experts. MiniMax’s existing audio and video generation models also suggest possible multimodal integration. These are prospective directions in the presentation, not a list of capabilities already delivered by M2.
The closing invitation returns to the developer feedback loop that shaped the model. MiniMax wants to combine these resources into models the community can use, and Song asks developers to contribute feedback about that use. The commitment is both to learn from the community and to share the resulting models with it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
Official project repository for the 230B-total, 10B-active mixture-of-experts model built for coding and agentic workflows.
Further reading
The original M2 launch announcement, introducing its coding and agent capabilities and launch-time positioning.
MiniMax's explanation of reasoning-state preservation between tool calls, with benchmark ablations and historical integration guidance.
Explains why training on more tools was insufficient and how perturbing the wider agent environment shaped M2's post-training.
Updates since the talk
A later account of M2.1 training, covering software-engineering environments, expert-driven app development and long-horizon task synthesis.
Read the complete timestamped transcript
- 0:00
[on-hold music] Hi.
- 0:21
Hi, everyone. Um, I'm Olive. It's my great honor here today to present on our new model, MiniMax M2. Um, I actually lived in New York City for six years, so it feels great to come back, um, but with a different role.
- 0:35
Um, I currently study reinforcement learning and model evaluation at MiniMax. Um, let me just get a quick sense of the room. Who here has heard or have tried of MiniMax before?
- 0:47
Oh, a couple of there. Yeah. Not everybody, but I, I guess, yeah. But here's the value, right? Of me standing here today. Um, so we are a global company that works on both foundation models and applications.
- 1:02
We develop multi mo- m- modality models, including text, um, vision-language models, our video generation model, Hailuo, and speech generation, music generation stuff. And we also have, um, many applications, including agents and stuff, um, in-house.
- 1:20
So that, that's the specific thing that's different from the other labs for other companies. So we both develop foundation models, um, and applications. So we have research and developers sitting, uh, sitting side by side working on things.
- 1:36
Um, so our difference would be that we have first-hand experience from, uh, uh, our, um, in-house developers into developing models that developers would really need in the community. And here, I want to introduce our MiniMax M2, um, which is an open-weight model, very small, with only 10 billion active parameters, um,
- 2:01
that was designed specifically for coding, uh, workplace agentic tasks. It's very cost efficient.
- 2:09
Um, let me just go over the benchmark performance 'cause people care about it. So, uh, we, uh, rank very top in both, um, intelligence benchmarks and also agentic benchmarks.
- 2:23
Uh, we-- I think we're on the top of the open source models. But then numbers don't tell everything because sometimes you get those super high number models, you plug into them, um, into your environment, and they suck, right?
- 2:38
So we really care about the dynamics in the community. And in our first week, we had the most downloads,
- 2:46
and also we climbed up to top three token usage on OpenRouter. So we're very glad that people in the community are really loving our model, um, into their development cycle.
- 2:58
So today, what I wanna share is how we actually shape these main model characteristics that made M2 so good in your coding experience. And I'm gonna present to you, um, the training be-behind it that supports each one of them, from coding experience, to long-horizon state tracking tasks, um, to robust generalization
- 3:23
to different scaffolds, to multi-agent sca- uh, scalability.
- 3:28
So first, let's talk about code experience, which we sca-- uh, which we supported with, um, scaled environments and scaled experts.
- 3:38
So, um, developers need a model that can actually work in the language they use and across the workflow that they deal with every day. So which means that we need to utilize the real data from, from the internet and then, um, scale the number of environments so that the model, when during training, for example, during reinforcement learning,
- 4:00
it can actually, um, reacts to the, uh, environment, it can actually target verifiable coding goals and to learn from it. So that's why we scaled both the number, uh, of environments and also our, um, infrastructure so that we can perform those training very efficiently.
- 4:20
So, um, with data construction and reinforcement learning, we were able to train the model so that it's very strong, um, it's full stack multilingual.
- 4:33
And what I wanna mention here is that besides scaling environment that everybody talks about, we actually s-scale something called expert developers, um, as reward models. So as I mentioned before, uh, we have a ton of, um, super expert developers in-house that could give us feedback to our model's performance.
- 4:54
So they participated closely into the model development and training cycle, including problem definition, for example, um, bugs, bug fixing, for example, um, repo refactoring and stuff like that. And also, they identify the model behaviors that developers enjoy, and they i-identify what's reliable and, uh, what developers would trust.
- 5:18
And they give precise reward and evaluation to the model's behaviors to the final, um, deliverables so that, um, it is a model that developers really want to work with and that can add efficiency to the developers.
- 5:34
So with that, we were able to lead in many, um, languages in real use.
- 5:40
And the second characteristic that MiniMax M2 has is it, it, it performs good in those long-horizon tasks, uh, those long tasks that require interacting with complex environments, that requiring, um, using multiple tools with reasoning.
- 5:59
And we supported that with the interleaved thinking pattern, um, and reinforcement learning.
- 6:07
So what is interleaved thinking? Um, so with a normal reasoning model that can use tools, it, it normally works like this. You have the tools information given to it, you have the system prompts, um, you have user prompts, and then the model would think, and then it calls tools.
- 6:26
It can be a couple of tools at the same time. And then they get the tool response from the environment, and then it performs a final thinking and deliver a final content.
- 6:37
But, but here's the truth, right? In real world, the environments are often noisy and dynamic. You can't really perform this one test just by once. You can get, um, tool errors, for example.
- 6:50
You can get, um, unexpected results from the environment and stuff like that. So, um, what we did is that we imagine how humans interact with the world. We, we, we look at something, we get feedbacks, and then we think about it.
- 7:06
We think if the feedback is good or not, and then we make other actions, make other decisions, and that's why we did the same thing with our M2 model.
- 7:15
So if we look at this, um, chart over a diagram on the right, so instead of just stopping, um, after one round of t- tool calling, it actually thinks again and reacts to the, uh, reacts to the environments to see if the information is enough for it to, uh, get what, what it wants.
- 7:38
So basically, we call the interleaved thinking, or people call it interleaved thinking because the interleaved thinking with tool calling, um, a couple of time, it can be, you know, uh, tens to 100, um, turns of tool calling within just one user interaction turn.
- 7:57
So it helps, um, adaptation to environment noise. For example, uh, just like what I mentioned, the environment is, is, is not stable all the time, and then something is suboptimal, and then it can choose to use other tools or do other decisions.
- 8:13
It can focus on long horizon tasks, um, it can automate your workflow, um, using, for example, Gmails, Notions, um, Terminal all at the same time. You just need to, uh, maybe make one model call without minim- with minimal, um, human intervention.
- 8:31
It can do it all by itself. A- and here's a cool illustration on the right. Because it's New York City, I feel the vibe of, you know, trading and marketing.
- 8:41
Um, so you can see that there was some, um, there was some perturbations in the stock market, uh, I think last week, and then our model was able to keep it stable.
- 8:53
So just like I said, there's, like, environment noise, there's n- new information, there's, like, yeah, news. It looks like there, there's, like, other trading policies and stuff like that, but our model was able to, uh, to perform pretty stably in these kind of environments.
- 9:12
And the third characteristic is our robust, um, generalization to many agent scaffolds, which was supported by our perturbations in the data pipeline.
- 9:24
So we want our agent to generalize, but what is agent generalization? At first, we thought it was just tool scaling. We train the model with enough tools, various tools, kind of new tools.
- 9:37
We invent tools. Um, and then it would just perform good on unseen tools. Well, that was kind of the truth. It worked at first, uh, but then we soon realized that if we perturb the environment a little bit, for example, we change another agent scaffold, then it doesn't generalize.
- 9:55
So what is agent generalization? Well, we conclude that, um, it's adaptation to perturbations across the model's entire, uh, operational space. If we, uh, think back, what's the model's, um, operational space that we talked about, it can be tool information, it can be system prompts, it can be user prompts.
- 10:19
They can all, all be different. They can be the chat template. They can be the environment. They can be the tool response. So what we did is that we designed and maintained perturbation pipelines of our data so that, um, our model can actually gen- generalize to a lot of agent scaffolds.
- 10:40
And the fourth characteristic that I want to mention is the multi-agent sca- scalability, um, which is very possible with M2 because it's very small and cost-effective.
- 10:54
I have a couple of videos here. Um, this is M2 powered by our own MiniMax agent, uh, app. Uh, we actually have a QR code down side, so i- if you want, you can just scan and try it.
- 11:07
So it's like an agent app we, we, we developed, and here we can see different copies of M2, right? It can do research. Um, it can write the, uh, write the research results and analyze it and put it in a re- report.
- 11:22
It can put it in some kind of front end i- illustration, and they can work in parallel. So because it is so small, um, and so cost-effective, it can really, um, support those long-run agentic tasks and tasks that maybe, um, require some kind of parallelism.
- 11:42
So what's next, right? For MiniMax M2, from what I've introduced, we gathered environments, um, algorithms, data, expert values, model architecture, inference, evaluation, all this stuff to build a model, um, that was, you know, f- fast, that was, uh, intelligent, that could use tools, that generalizes.
- 12:06
What's next? For, um, M 2.1 and M3, we're in the future. We think of better coding, maybe memory work, context management, proactive, AI for workplace, vertical experts, and because we have those great audio generation, video generation, uh, models, maybe we can integrate them.
- 12:30
But all our mission is that we're committed to bring all these resources, whatever is on the screen and maybe more, uh, yeah, and values, and put them all together to develop models for, uh, the community to use.
- 12:45
So, um, we really need feedback from the community if possible, because we want to build this together and, you know, this is kind of a race that e- everyone needs to participate.
- 12:57
And then, um, we com- we are committed to share it with the community. Yeah.
- 13:05
And that's all the insights for today. Um, we really hope, again, we really hope you to try the model 'cause it's pretty good, and then we can contact, contact us up there.
- 13:17
You can try the models by scanning the QR code. Yeah, basically, that's it. Thank you all for listening. [upbeat music]