Agents at Scale: Inside MiniMax's Model and the Infrastructure Behind It — Dan Fu and Olive Song

AI Engineer · 20 min · 252 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:12This is a discussion that I'm particularly excited about because the field is moving so fast and we have two people that that kind of have this unique vantage point on the field and what I want to do is kind of ask questions to see if we can learn from that.
  2. 00:26So I want to start off with intros, talk a little bit about your role, what you're thinking about, what you're working on.
  3. 00:31Maybe Dan if you can go first.
  4. 00:33Uh hey everyone.
  5. 00:34I'm Dan.
  6. 00:34I'm the VP of Kernels Together AI.
  7. 00:37I lead inference, GPU optimization, trying to figure out how to use GPUs most effectively to serve AI models.
  8. 00:45Yeah.
  9. 00:45So one of the things that I wanted to dive in with Dan about is like you model drops, what are what is everything that goes on behind the scenes
  10. 00:53to serve it so that everybody here there's a lot of builders here that can use it.
  11. 00:57Olive I want to throw it over to you to talk about your role and what you're focusing on.
  12. 01:01Yeah.
  13. 01:01I'm Olive and I am the research lead of RL at MiniMax and I am responsible for the final training of the model and the shipping of the model.
  14. 01:09So basically everything before the inference, right?
  15. 01:12Okay.
  16. 01:13Awesome.
  17. 01:13Um so maybe I wanted to start off this panel is focusing on open source.
  18. 01:18I wanted to start off with this is your strongest model yet, MiniMax M3.
  19. 01:23Why open source it?
  20. 01:24What's the kind of the the idea behind that as a company as you're releasing these models?
  21. 01:29We do believe that the open source community as a whole is very strong and powerful.
  22. 01:35While we open source the model, everyone can use it.
  23. 01:38So it aligns with our mission that we want to have intelligence with everyone and also different developers can contribute to the model through feedbacks, through their own PRs and we can build the models even stronger.
  24. 01:50And also like for example, Dan you you will be able to optimize on our open weight model and make it inference faster and then serve better for everyone.
  25. 02:00Yeah.
  26. 02:01Yeah, we're we're big believers in open source that together and yeah, I think when we we've been you know, following you guys for for a while.
  27. 02:08I think from way old old older MiniMax models.
  28. 02:11So seeing M3 and seeing how far it's come is is really impressive and really great.
  29. 02:16So I wanted to kind of pick on this a little bit more.
  30. 02:20Can you explain so we've got the model creators themselves MiniMax.
  31. 02:23We've got experts on the inference side of things.
  32. 02:26How did this partnership come to be?
  33. 02:27So they launch an open source model and we're now distributing it.
  34. 02:31I I checked this morning.
  35. 02:32We have the lion's share of token usage for MiniMax M3.
  36. 02:36How does this partnership come to be and how do we serve a model like this at scale?
  37. 02:41Yeah, yeah, great question.
  38. 02:42So at together, I think one of the things that that we're really interested in is how do you make intelligence abundant?
  39. 02:49So how do you get more tokens to more people to do more useful things and and and get get all these capabilities into more people's hands.
  40. 02:58So we follow all the open models very closely.
  41. 03:02I I don't remember when exactly we we started part.
  42. 03:04Oh, actually I think I do know this.
  43. 03:06We had a car event in Las Vegas sometime last year.
  44. 03:10And with someone from MiniMax came and there he was like, guys, you really got to serve our next model.
  45. 03:14It's going to be really really great.
  46. 03:16So I think from there we we started talking.
  47. 03:18We were serving MiniMax 2.5 and I think 2.7 for for a while and then when leading up to the launch of of M3, we were we were quite excited about it.
  48. 03:30I think we we're seeing the the usage and what people were doing with it was it was really quite exciting and and so from there that's really where we partner.
  49. 03:39We start working on the model.
  50. 03:41The architecture, optimizing it, figuring out you know, what's the best way to serve inference on it and and all those great pieces.
  51. 03:49Yeah.
  52. 03:49I wanted to actually get into more on the model side of things.
  53. 03:52And so as the creator of a model, as as somebody who's like post-training this thing, the model lands and all the builders that are here start using it.
  54. 04:01From your perspective, um what are the kind of the unique capabilities that you love to see people use it for?
  55. 04:07And what are maybe some of the hidden gems that you haven't You thought, "Oh, people would love to build this."
  56. 04:11but you haven't seen a little bit.
  57. 04:12Could you shed more light on that?
  58. 04:14Mhm.
  59. 04:14Mhm.
  60. 04:15So, MiniMax M3, which was different from the M2 series, was that it was actually multi-modal So, it not only understands text and it not only writes code, it also understands videos and images.
  61. 04:27So, we did see a lot of applications on a gen tech multi-modal agents, which is very cool.
  62. 04:33Um and I would say there are a couple that we can highlight, right?
  63. 04:36For example, computer uses.
  64. 04:38The model can is able to navigate through a computer and then do some pretty good creations with the tools that they they can utilize.
  65. 04:47And also, um you can develop games with the model.
  66. 04:50Um it's very fun that I I don't I think that's one of the hidden gems is that we actually worked on um game development.
  67. 04:58So, the model can help you develop a real cool games.
  68. 05:01Um yeah.
  69. 05:02Yeah, one So, when the when the blog dropped and then the paper dropped, one of the things I noticed was that you guys highlighted SVG bench, you guys highlighted kernel bench, you also touched on OS world.
  70. 05:14Can you talk more about Like, what does it take to post-train, especially for those particular domains?
  71. 05:18Mhm.
  72. 05:18Mhm.
  73. 05:19Uh I would say it's the very important thing is the data and how we define the problems.
  74. 05:26Um it could be very different from different tasks.
  75. 05:28For example, let's say the kernel one, right?
  76. 05:30The It would be very important to design the environments of the data so that we can deliberately train reinforcement learning in those very complex environments and let the model to optimize the kernels themselves
  77. 05:43and iteratively improve the performance.
  78. 05:47And one one aspect that I wanted to talk to you about on the kernel development side of things, um where are you seeing open models when it comes to kernel development?
  79. 05:56You recently released a benchmark specifically for this.
  80. 05:59So, I was wondering if you could talk on that a little bit as
  81. 06:01Yeah, yeah, it's a it's a great question.
  82. 06:02So, I think we're seeing all sorts of models of the closed frontier models and the open models get increasingly better at writing kernels.
  83. 06:11So, we use models all the time when we are developing kernels and and and writing the optimization frameworks.
  84. 06:18I think the the interesting thing that we are starting to look at is this benchmark that that we recently released called um parallel kernel bench.
  85. 06:26So, it actually has a bunch of unsolved problems in it.
  86. 06:29So, we went around surveyed all the different ways they can serve model inference.
  87. 06:35And one of the interesting things that we found is that there's a lot of things that we can think of that would actually speed models up that there don't exist good kernels for.
  88. 06:43So, one of the reasons that we put that benchmark out was, you know, one thing that people worry about is like bench maxing or or overfitting to particular benchmarks.
  89. 06:51One of our intentions with this benchmark was that if you overfit to it, that's great cuz we'll go take those kernels and use them to to to accelerate the
  90. 06:59the the the inference and the development.
  91. 07:01Yeah, this is a really interesting point.
  92. 07:02A lot of people have problems with bench maxing, but the way I think about it is if researchers like you put all the really useful benchmarks out and we bench max on all of them and everything is in distribution,
  93. 07:13then that's a perfect world, right?
  94. 07:14That's a very useful model that we can then use.
  95. 07:17Um Okay, cool.
  96. 07:18So, I wanted to touch on the inference side of things now as well.
  97. 07:22So, like a new model drops like this, what does it take Could you take me like behind the scenes at the inference stack?
  98. 07:29And what does it take to go from day zero launch and then optimizing it week over week, month over month?
  99. 07:34Yeah, yeah, great question.
  100. 07:35So, when we partner with someone like MiniMax, we will get some early model details.
  101. 07:39So, for M3, for example, there are things like the minimax sparse attention and and some of those choices that were a little bit different from any model that's out there.
  102. 07:48And I think if you look at any of the open models now, they are all quite different from each other in different ways.
  103. 07:53So, there's different attention, different MOE choices, differences in quantization and and all these pieces.
  104. 07:59So, as soon as we get those details, we start writing kernels, benchmarking, figuring out is there existing kernels that work for it?
  105. 08:07Do we need to modify something?
  106. 08:09Do we need to write something from scratch?
  107. 08:12And then so day zero, we're trying to think about things like quality.
  108. 08:15So, when this model launches, is it going to have the quality that we all expect?
  109. 08:21Are we going to be able to provide the right the the right user experience?
  110. 08:26And then from there, as soon as it launches that day zero, we have a long list of things that we know, hey, we have to do this with the KV cache, we have to do this with the attention kernels, we have to do
  111. 08:37we're going to look at this part of the quantization, and things like that.
  112. 08:40So, we we we have that list and then we start working on it and start optimizing over the course of weeks so that when you use these models, they actually get faster
  113. 08:50between day zero and day seven and day 14 and etc.
  114. 08:55Yeah, I was just talking to Ingrid actually yesterday and I and I asked her, have we been improving the performance of M3?
  115. 09:01And I meant over the last month and she said, oh, did you mean from last night?
  116. 09:04And this is the pace at which these guys work.
  117. 09:06So, it's very real.
  118. 09:09One aspect that I wanted to touch on with this is we're seeing the workloads shift.
  119. 09:13We're going from kind of predominantly chat workloads where you have turns coming in now to agentic workloads where you've got this thing sitting inside a harness and you're doing hundreds and hundreds of multi-turn tool calls.
  120. 09:26Yeah.
  121. 09:26Does that change the way you build the inference stack?
  122. 09:29Yeah, it definitely does.
  123. 09:30So, these agentic turn-based workloads, they go into everything from informing your KV cash, your prompting, your pieces like this.
  124. 09:40So, it it informs what part of the stack you want to go optimize because now I think when we're in the chat chat chat world, you have a system prompt of a few thousand,
  125. 09:50and then you just have the the chat logs.
  126. 09:52Now, with the coding base agentic workflows, you'll upload your whole code base to the model, and that's a very different optimization and routing and kernel challenge than than just the the chat base workload.
  127. 10:03So, yeah, we're we we follow these work codes very closely.
  128. 10:05It's really interesting to see how they evolve and and how to adapt the inference stack and the inference engines to to really take to really serve them well.
  129. 10:14Not only do you have agentic workloads, but you've also got multimodal workloads in there.
  130. 10:18So, what I like to do often with these coding agents is get them to optimize a web app and then get it to use it and then do a feedback loop.
  131. 10:27So, one thing that I wanted to come to you all the four is Minimax M3 is multimodal, M2.7, all the ones before that were not multimodal.
  132. 10:36And like, can you talk a little bit about the optimizations and how you trained it for that aspect?
  133. 10:41And then also, I want to get into the architecture of it afterwards as well.
  134. 10:44Right.
  135. 10:45Definitely.
  136. 10:46So, what's different from before was that it was trained multimodal from scratch.
  137. 10:51So, from step zero, we trained not only text data, we also trained image data.
  138. 10:56And it was normal for many other labs that the model would collapse after training a little bit, and we managed to solve that problem.
  139. 11:05And what we found was actually that with this kind of training from scratch, if you look at the attention map, it actually the visual of the the text tokens would attend to the visual tokens.
  140. 11:16So, that they are naturally combined together, they naturally understand each other.
  141. 11:20So, for example, we are developing, for example, websites, right?
  142. 11:25It is better if we train with both modalities.
  143. 11:29Also, like, for example, it can look at the website, it can understand how it looks, and then better optimize for it.
  144. 11:35Like for example, during reinforcement learning.
  145. 11:38Um so yeah, I think that is pretty cool.
  146. 11:42So one one thing that kind of stuck out with this model for me was the fact that it introduced a lot of new things.
  147. 11:49The multi-modality, the increase of context to 1 million, um the fact that you have a sparse attention now.
  148. 11:56Um so if you go to the inference side, it's almost a a nightmare, isn't it?
  149. 11:59You get You get this new model and there's so many things that you could optimize to speed up inference.
  150. 12:04Um practically, what are the things that you focus on?
  151. 12:07There's like a thousand things that you could optimize, but where do you get the most bang for your buck?
  152. 12:11I mean, you focus on a thousand and one things, yeah.
  153. 12:14Like you just you just go and you keep you keep doing it.
  154. 12:16You find every edge that you can, um and and you go and and you push on it.
  155. 12:21Um so yeah, I think there there's there's no there's no stone that you leave unturned and you just uh keep keep going at it.
  156. 12:27If someone tells me you can't do the thousand first thing, yeah, like I don't know, try harder.
  157. 12:32Yeah.
  158. 12:33And then get up a little later.
  159. 12:35Yeah, like go ahead.
  160. 12:36No, I know.
  161. 12:38So the other thing that I wanted to ask is there's a whole kind of um zoo of open source models.
  162. 12:43As you're talking about speeding up inference, are there things that are there lessons that you can take from one model and apply it to MiniMax M3?
  163. 12:51Um or or do you have to like restart from scratch as you're thinking about the inference engine, the kernels, like how does that work?
  164. 12:58Right.
  165. 12:58Um yeah, so there there's definitely things that you learn from optimizing one model that you take to another.
  166. 13:03Um so I think sparse attentions are something that have become quite popular now.
  167. 13:08So the MiniMax sparse attention is a little bit different from the uh from the deep seek and the and and and those and the and the ones that you find in JLM.
  168. 13:18Um but the they're still similar lessons that you can take from that optimization process and that kernel writing process that you can then bring to to the new sparse attentions.
  169. 13:27And you know, we've been in in some form or or another I've been thinking about this problem for for many years.
  170. 13:35So going all the way back to my PhD.
  171. 13:37So it's it's it's great to see some validation that that folks can now train it at scale and people are using it and and it's and it's it's going pretty well.
  172. 13:46Yeah.
  173. 13:46Yeah, one of the interesting things especially about open source is you've got all these labs that are learning from each other kind of taking the wins from each other, right?
  174. 13:55So if if if one lab figures out that Minimax does this really well, then that gets becomes the golden standard.
  175. 14:02Um one of the things on model launch that I in the blog post that you guys go into is that this model was actually able to replicate a 12-hour run where it could reproduce an ICLR paper.
  176. 14:14And so somebody who's training this model to do this thing, how do you actually go about that?
  177. 14:18Cuz that seems like a pretty ludicrous task.
  178. 14:21Right.
  179. 14:21So letting the model to do cool stuff like replicating papers, optimizing kernel frameworks and stuff like that is always exciting for us researchers because it's like very related to our job.
  180. 14:35But training it can be very tricky because it's very long horizon and like the task itself would require GPUs.
  181. 14:44It has hardware constraints.
  182. 14:46So it's very interesting to train tasks like that and I would say the key there is still the environments and the data and how you formulate the problem, how you formulate the rewards, how you formulate the environment
  183. 14:59and how you change the reinforcement learning algorithm a little bit so that it's trained more efficiently so that you can see cool things emerging through the the iterations of RL runs.
  184. 15:11Mhm.
  185. 15:13Can you talk maybe if I keep pulling on this thread a little bit?
  186. 15:15How do you do evaluation over these longer longer scale runs?
  187. 15:19So if you're if you want the thing to do a 12-hour task, yes, it might or might not do it at the end, but are there like a intermediate
  188. 15:26things that you can also look at?
  189. 15:28Yes, we do.
  190. 15:29For these tasks, they are there are iterations, right?
  191. 15:32So, the model can submit several times, and we would evaluate each of them.
  192. 15:37Some of them some of the times the models would hack, and we do do like validation and test with for it to test if it's really improving on the performance or it's hacking.
  193. 15:48And also, we design our internal evaluations.
  194. 15:51So, for example, for the release of 2.7, we touched a bit on self-evolution, right?
  195. 15:57So, we're actively using the model to improve the speed of development internally, which like out of it out of it we can build our own evaluations that are closely related to our own work that we can evaluate the models on.
  196. 16:11Yeah.
  197. 16:12When So, when we start talking about these long horizon tasks that are 12 hours long, we gave an entire workshop on this on Monday, but what I wanted to come to you, Dan, for is
  198. 16:22KB cache.
  199. 16:23So, if let's say you you have concurrent requests that are 500 to a million thousand context length long, how do you deal with the KB cache that just keeps on growing, and how does the infrastructure deal with that?
  200. 16:33Yeah, so there there's a lot of different pieces that that you put there.
  201. 16:37Like in in some sense, it's like recreating a distributed file system.
  202. 16:41So, we we're in some sense building something like that or a very big database.
  203. 16:47It's it's pretty simple in theory.
  204. 16:49It's like the type of thing that you should have done in your third year of undergrad or something like that, but most of us actually skipped that class, so now we're rediscovering it live in in industry.
  205. 16:59But it's it's all about where do you store that cache?
  206. 17:02How do you know Have you have you seen this before?
  207. 17:05How do you fetch it?
  208. 17:05How do how do you send it from one place to another?
  209. 17:08So, yeah, it's it's a it's it's not that complicated, but you you do have to make sure that that you do a good job.
  210. 17:15Yeah, one thing I noticed you you gave a a um a lecture at Stanford recently and one thing that stood out was that if you fast forward like 2 3 years, 2 3 years is is is a long time in AI.
  211. 17:26And if you look back you said that we'll realize that how um how early we are right now.
  212. 17:32Yeah.
  213. 17:32So, from your vantage point, where 3 years out, what do you think we'll look back on be like, "Why were we doing it this way?"
  214. 17:38Great question.
  215. 17:39Um uh some things that I hope for, so I think we underutilize our GPUs a lot right now.
  216. 17:45Um you know, SpaceX said they would have like 10% flop utilization or something like that.
  217. 17:50I hope in 3 years, well, they they should already be embarrassed about it, but I hope in 3 years they're extra embarrassed by it.
  218. 17:56Um so, certainly training should be should be pretty um should be pretty good.
  219. 18:00I think at Anthropic we can do a lot better with the hardware that we're using uh that we have today, so I hope uh in a few years we'll we'll say
  220. 18:08uh we'll we'll have seen the light on on some of those pieces.
  221. 18:12Um and I think there'll be a lot more models, there'll be a lot better.
  222. 18:15Um I I hope finally by then we've put uh put to bed this question about the open models.
  223. 18:21You know, there's every few months there's someone like, "Oh, Anthropic OpenAI, they're so ahead, yada yada."
  224. 18:27Um but I think uh we're we're seeing with models like M3 and GLM and Kimmy and and all those models that um the open-source frontier really can catch up.
  225. 18:36Um and and it's it's not even that far behind, so so I think that that's quite exciting.
  226. 18:41Yeah.
  227. 18:42I I wanted to throw that same question over to you, Olive, but you mentioned that you it for for the M2 series and the M3 series, you're using this idea of self-evolution,
  228. 18:50where the model is building its own harness, and then it's training inside of that, and then you get the next checkpoint.
  229. 18:55Um if you look back 3 years uh out and then you say like, "What in RL or post-training um do you think uh made the biggest difference?"
  230. 19:04What do you think that is from this vantage point?
  231. 19:06Um great question.
  232. 19:08But, 3 years ago I was still in in
  233. 19:11[laughter]
  234. 19:12I actually didn't start this industry yet.
  235. 19:14Yeah.
  236. 19:14So I wouldn't have imagined what's happening right now today.
  237. 19:17So it's really exciting.
  238. 19:19But I can see how models that were developed are were already improving the speed of development maybe a year ago or even further than a year ago.
  239. 19:28So I could see how this speed is actually accelerating.
  240. 19:32How the development is accelerating.
  241. 19:34And that's how like open weight models can really catch up with frontier labs and Yeah, that's how we think we are more mission to bring this model to everyone
  242. 19:47so that everyone can use it.
  243. 19:49Yeah.
  244. 19:50Awesome.
  245. 19:50Thank you guys.
  246. 19:51Thank you Dan.
  247. 19:51Thank you Thank you Olive.
  248. 19:53Thank you guys so much.
  249. 19:54Have a great day.
  250. 19:55Very cool.
  251. 19:55Thanks so much.
  252. 20:11[music]