LALatent SpaceOct 20, 2025· 1:03:40

⚡ Open Model Pretraining Masterclass — Elie Bakouch, HuggingFace SmolLM 3, FineWeb, FinePDF

Elie Bakouch, Hugging Face's pre-training lead and architect behind SmolLM, presents a five-pillar framework for model training spanning data quality, architecture, information extraction, gradient quality, and stability, while breaking down recent innovations in optimizers, Mixture of Experts, and data rephrasing. He explains that the field of optimizers is moving beyond AdamW with Muon and Shampoo, noting that speed-ups are often exaggerated due to undertuned baselines. He deep-dives into MoE architecture, showing that expert specialization requires load balancing at the global batch level, as demonstrated by Qwen's findings. He discusses the rephrasing revolution, where converting low-quality web data into QA format yields non-random MMLU performance even for small models. Elie also highlights Hugging Face's open science contributions: FinePDF (new PDF dataset), FineWeb-Edu2, and tools like Nanotron, Datahub, and Liteval.

  1. 0:00Intro
  2. 1:10Research Team
  3. 4:20Unified View
  4. 10:17Optimizer Innovation
  5. 21:15MoE Architecture
  6. 29:26Expert Specialization
  7. 33:09Sparsity Trends
  8. 40:20Data Quality
  9. 43:20Small LM Insights
  10. 53:56Open Source Tools
  11. 57:55Future Directions

Powered by PodHood

Transcript

Intro0:00

Alessio0:05

Hey, everyone. Welcome to the Latent Space Podcast. This is Alessio, founder of Kernel Labs, and I'm joined by Swyx from Cognition.

Swyx0:11

Yeah.

Alessio0:11

First time I introduce you at the new role.

Swyx0:13

We, we haven't, uh, figured out the official title yet. But yes, uh, uh, they-- we're recording this the day after we announced the Series C, and, uh, it's, uh, it's very good. Uh, you know, Alessio is also part of the Cognition family now.

We all, you know, had a, had a fun party at the house. But isn't-- today is not about us. Today we're talking about research, SmolLM, model training, all that stuffs with Elie from Hugging Face. Welcome.

Elie Bakouch0:38

Yeah. Thanks, uh, thanks a lot for the invitation, and, uh, I'm very glad to, to be here. And congrats again for the, for this new term.

Swyx0:46

Uh, so you, you, uh, obviously, I think, uh, I actually first reached out about SmolLM. I think that, you know, obviously SmolLM 3, one of the single best open source AI research papers I've read, I think probably in, like, a year, maybe two years.

Uh, I don't know. Like, yeah, it's very, very good. Uh, but, you know, I think, like, maybe let's, let's just get a high level, like, who are you-

Elie Bakouch1:08

Yeah

Swyx1:08

... what do you do at Hugging Face, uh, all that stuff.

Research Team1:10

Elie Bakouch1:11

Yeah. So I think, like, most of the people know Hugging Face for, like, the, the hub or, like, the transformer library. And we also have, like, this research team where we, we basically try to explore in the open all the, the, the science subjects.

It could be, uh, we have a team working on data, obviously, uh, with the FineWeb, uh, the recently released FinePDF, and we also have this team working on, uh, pre-training and training models such as SmolLM. Uh, and we are, we are basically a very small team of, uh, thirty people in average.

And, uh, we try to, to do some cool stuff that the community will love and will use to build on top of it and, and to contribute to, to the open science basically.

Swyx1:52

Yeah. While, while you mentioned, uh, s- uh, the FinePDF, uh, why don't you, you plug FinePDF a little bit. I think a lot of people know FineWeb.

Elie Bakouch1:59

Yeah.

Swyx1:59

But, uh, what's, what's good about FinePDF?

Elie Bakouch2:02

Yeah. I think I have, uh, some-

Swyx2:05

Oh, okay. It's already in your slides. Okay.

Elie Bakouch2:07

Yeah, it's already, uh, somewhere. I think, yeah, it's yeah.

Swyx2:10

Oh, wow.

Elie Bakouch2:10

And, uh-

Swyx2:11

That's very recent. Okay.

Elie Bakouch2:13

Yeah. That's, uh... I mean, I updated it today, so, so... And, uh, so it's basically cool because I think that we, we have a lot of high quality dataset, and the field of dataset people have been building some, some awesome stuff.

NVIDIA, uh, uh, Datalogy, they didn't release it yet, but this is pretty cool as well. Um, and one thing that was missing, uh, A2 also, of course, and one thing that was missing is, like, a new source of data, and PDF was, like, greatly underexplored.

So that's what, uh, like, uh, our team did. And, uh, you can see, like, the performance is pretty impressive. Like, if you take this curve, uh, like when mixed with, uh, with like, uh, other, other web datasets, not PDF one, it basically have a very, very, very good performance compared to this like Nemo-Trans CV2, which is, uh, very recent release from NVIDIA.

So it's pretty cool. And there is all the pipeline. So I didn't work on this. It's Eineck who mainly did a lot of great job on this. But there is all this pipeline where he benchmark a lot of, uh, PDF, uh, extractor, and, uh, we are cooking like a blog post where we'll explain basically, uh, all the, the step of the, this, uh, pipeline.

Swyx3:31

Yeah. Yeah. What, what is this refetch from internet step? What is that? Is that, like, a very common thing?

Elie Bakouch3:36

Uh, yeah. I think this is the-- so, like, the way-

Swyx3:41

To update it

Elie Bakouch3:41

... it work is that- Yeah. So sometime, like, I think the PDF from Common Crawl are not really well extracted, basically. So I think what, like, he did, uh, here is that he refetch it from, uh, internet to maybe have like a better version of it, if it's like more recent or, I don't know.

Swyx3:59

Yeah. Yeah. Okay.

Elie Bakouch4:01

And there's a lot of it, uh-

Swyx4:03

Yeah. Uh, so obviously the, you know, you, you, you get datasets. Uh, I actually previously talked with, uh, Hugo Larochelle of the s- the vision team.

Elie Bakouch4:14

Yeah.

Swyx4:14

And, uh, Ida Fixen, Obelix was really, was really cool, uh, for, for vision as well. You are on the training side. Uh, what is, what is this-

Unified View4:20

Elie Bakouch4:20

Yeah

Swyx4:20

... unified view of model training?

Elie Bakouch4:23

Yeah. So my-- Yeah, I didn't say that, but it's my job at, uh, Hugging Face is to be the guy that's, like, keep in touch with what's, like, the, the pre-training, uh, innovation are. And, like, my view of model training is basically you have, like, those different objectives that you-- that are somewhat orthogonal to each other, and you can, like, explore in parallel.

The first one is, like, the-- is basically maximize the, the relevance of the, the raw information, meaning, like, maximize the, the, the quality and the diversity of the data. This is probably, like, the most important one. It's not really the, the one that people are often the, the most excited about, but I think it's pretty well known now that, like, there is this garbage in, garbage out, uh-

Swyx5:08

Yeah

Elie Bakouch5:09

... thing that's-- it's basically super important to have very good data and, like, a very good diversity. But you can also optimize for other thing, and this is quite orthogonal to the dataset. So y- you need to have a team that build a very good dataset.

You also need to have a team that do research on model archati- architecture to basically have the, like, uh, construct the best model possible under certain constraints, and the constraint are, like, the, the efficiency. So you want a model, uh, that will be, uh, good at, at inference, uh, that will, like, fit on a certain number of GPU, that will have a certain, like, KG cache, uh, consumption and thing like that.

So this is like the, the, the model architecture part. And when you are-- it clicks like this, uh, dataset and model arch, you can also maximize the, like, the information you get from the data. So at each step, you basically want to maximize, like, how much you extract from the data.

One way to do that is to do this locate distillation. Uh, there is other way to do that. It's also related to, to the, to the architecture part, but there is this multi-token prediction which is very good, for example, for coding.

And yeah. And basically there is also other steps such as like maximize the quality of the gradient you get, meaning like when you, you do your update step, you need to, to maximize this, this quality of the, the, the dates.

So this is like different optimizer, uh, thing that will approximate the, the action matrix, for example. Or just like, uh, project into data space for learning. And when you have all of this, you, you, you want to have basically the, the right hyperparameters to make sure that your, uh, your, like, your training is not exploding because it happened quite a lot, especially when you scale it just like your gradient or your activation are doing, like, completely diverging.

There is all this field where you want it to be stable. You want to understand, uh, how to scale from a, a smaller model to a larger one and do this thing called feature learning, where basically you, you are at each step learning as much as possible from this, uh, gradient.

So this is kind of my view of, uh, model training. There is of course, some, some connection between all of them, but, uh-

Alessio7:20

And, and for these five steps, how do you think about which ones have the highest variability? I feel like some of them there's kinda like a meta of this is how you get the best results. What are like-

Elie Bakouch7:31

Yeah

Alessio7:31

... the parts that are like still very not figured out where, like, you feel like the most interesting research is being done?

Elie Bakouch7:36

So I think datasets is like the, the data is like-- is a bit unexplored because, uh, I think people don't find it very interesting. I mean, for, for a bit of time, like people were a bit underexploring like the dataset, especially since it's super important.

Uh, but we, we've seen like recent paper and, uh, recent trend to build better and better dataset, and so I'm, I'm confident that like, uh, hopefully people in the open will somewhat catch up with like the, the, the big models.

The rest of it, I think the model architecture, we, with like the Qwen, DeepSeek, uh, Kimi architecture, we're already at a point where this is already not optimal, but this is like pretty, pretty advanced. And there is all this, all this thing where basically you want to, to maximize, uh, like to, to, to do some new optimizer and to, to really, uh, have some good stability and scaling feature.

This is a bit unex-underexplored and especially like since Qwen and DeepSeek paper doesn't really detail all, all, all they do the stuff. I mean, we've left with a very few, uh, model provider, espe- even in the open that talk about all of this.

And for example, a good, uh, a good way to view that is that, uh, DeepSeek V3 is still using the same Adam parameter than, uh, Llama 2. I mean, there is something wrong with it. I don't know if it's just me, but I feel that like the, this, the, the hyperparameters for Llama 2 8B, for example, sh-shouldn't be the optimal one for, uh, this, uh, mega DeepSeek model with, uh, with it a lot of, uh, of parameter.

Alessio9:22

Yeah.

Swyx9:22

Yeah. I, I, I think like a lot of, uh-- it's almost weird, like I wonder if we've hit the peak big model, uh, craze, uh, because now I, do you expect, you know, ten trillion model releases, you know, one hundred trillion-

Alessio9:38

Yeah

Swyx9:38

... model releases? Probably not. I think we might have peaked at two. Um-

Elie Bakouch9:42

Yeah. I mean, I'm always curious to know like Claude, uh, Claude Opus, like GPT-5, like what's the scale of those very big model? I'm not sure it's like that crazy compared to the Kimi 1 or Qwen that will probably release soon.

Swyx9:57

Yeah, both are-- Yeah, both are one trillion models. Uh, yeah. I mean-

Elie Bakouch10:00

Yeah

Swyx10:01

... uh, all, all I will say is I, I have, I have no insider information, but I have a lot of rumors thrown at me, and it, it is in the range of like single digit trillions. Um-

Elie Bakouch10:11

Yeah.

Swyx10:11

So cool. Uh, I mean, and then the other, the other thing, uh, you know, I wanna-- we probably won't spend that much time on optimizer, but I think like optimizer-

Optimizer Innovation10:17

Elie Bakouch10:18

Yeah

Swyx10:18

... is actually like one of the low-key more interesting trends this year. Is everyone moving to Muon? Uh, I don't know if, I don't know if you have a strong view on this. Like, uh, basically like a-all, all of these five-

Elie Bakouch10:27

Yeah

Swyx10:28

... I don't know where you wanna spend the most time.

Elie Bakouch10:30

Uh, I really like all the optimizer parts. Uh, but that's-

Swyx10:34

Okay

Elie Bakouch10:34

... like more like a, a personal, uh-- I mean, I will not prob-probably talk about this, uh, a lot, but that's one of the, the thing that I find cool because it's very recent basically, and it's like using, uh, uh, some-- I mean, it's very recently that people start, uh, using something different than Adam.

Uh, we know for example, that like, uh, Google is using, uh-- I mean, we don't know, but like on like old paper, uh, Google are using like Adafactor, but recently before this, uh, Kimi K2, everyone was using, uh, Adam-

Swyx11:08

Yeah

Elie Bakouch11:08

... AdamW. And uh, recently there was the GLM pap- uh, paper. There is this, um, Kimi K2, of course, that is trying to do some new stuff with optimizer, and I find it pretty cool because it's like very deeply influence the learning process of the, the model.

Uh, this is actually quite a big of a change, I think.

Swyx11:27

Can you give an intuition on what's going on? Like, I think the basic insight of Adam, AdamW was mostly like momentum, right? Momentum care, uh-

Elie Bakouch11:34

Yeah

Swyx11:34

... matters. You trade off, you use more memory and like, uh, but in exchange you get, you get much better learning. Like, okay, fine. What is the core insight that, uh, that everyone's sort of like exploring?

Elie Bakouch11:43

I think for, uh-- So I actually have, uh, some stuff about it somewhere. Somewhere along, uh-

Swyx11:51

Somewhere along.

Elie Bakouch11:53

Yeah.

Swyx11:53

I love it.

Elie Bakouch11:53

Yeah.

Swyx11:53

This is like just your, your, your notes of all the papers.

Elie Bakouch11:57

Yeah. This is exactly my notes. It's very-- I didn't touch them, to be honest, so.

Swyx12:02

It's great

Elie Bakouch12:02

And this is like the, the, the new algorithm. So which is very simple, to be honest, and like the, the key part is this like Newton-Schultz method, which is basically taking this, like this matrix and making it better in a sense that it will be, uh, somewhat orthogonal, orthonormal, to be precise, I think.

And this will have, uh, the property of like basically spreading, uh, the learning in, in more dimension than with, uh, with this, uh, Adam, uh, Adam, uh, optimizer. And I think, uh, this is why, um, it's what they say.

Swyx12:41

It's so stable, I think. Yeah.

Elie Bakouch12:42

Yeah. It's, it's more stable. Uh, and also it encourage more to learn and explore new things, and, uh, this is pretty cool. And they, they did this Muon clip optimizer, which is pretty cool. And actually, it's quite simple.

They just track the-- this quantity, which is the max logit per head. And if it's-- this quantity is too large, they are basically saying, "Okay, that's, that's not good. I rescale after the backward my, my parameters, uh, by dissonance, uh, to, to make sure that they, they are-- they scale down, and they don't explode anymore."

And this is actually... it only have an impact in the, in the early step, and after it stabilize and basically don't do-- like it doesn't have any impact. At this point, you can, uh, deactivate the, the QK clip, and this will just, uh, work as well.

But this is pretty cool. And they define it by just looking at the-- their log, and they see this, this crazy maximal, uh, attention logits. And they are like, "Okay, there is something wrong, and I need to, to contain those, uh, attention logits."

And the method they choose is this QK clip stuff. There is actually different stuff to, to do that. There is like this, the Iden Z loss. There is the, the QK norm. There's a lot of stuff that kind of, uh, want to patch the same thing, but this one is quite elegant, to be honest, because it's very simple.

Swyx14:04

Yeah.

Elie Bakouch14:04

Yeah.

Swyx14:05

Yeah. Uh, cool. Uh, do, do you-- uh, just a side follow-up. Uh, did you actually follow the sort of, uh, schedule-free optimizer stuff from last year with Aaron Defazio? Anything came out of that?

Elie Bakouch14:15

I don't have a strong opinion. I tried it-

Swyx14:17

Yeah

Elie Bakouch14:18

... uh, like a few days after it, it was released because I was, uh-- we were writing a paper about the, the WSD schedule, and so this was kind of an alternative to it. And, uh, it didn't perform as well as like a simple Adam W.

Swyx14:34

Yeah.

Elie Bakouch14:34

And it was, uh, more sensible to some-- to the beta one and beta two. But I think like with this kind of stuff, you, you really need to have this, uh, this knowledge on how to optimize, uh, those hyper parameters for each optimizer to really get the best performance of each one.

And, uh, so I don't want to, to say something bad about it because basically, at nineteen percent-- uh, there is a ninety percent chance that it's just me that used the, the wrong hyper parameters. But yeah.

Swyx15:03

Yeah. You're holding it wrong. Cool. Uh, I mean, I'm happy to zoom out. Uh, sorry, I, I feel like I, I sort of zoomed in on optimizers just 'cause you're, you're one of the few people that we have-

Elie Bakouch15:11

Yeah

Swyx15:11

... on the podcast that can talk about it. Um.

Elie Bakouch15:13

Yeah, I mean, and there is a lot more to that. Uh, there is Muon, but there is also Shampoo, Soap. There is bunch of series of optimizer that are important.

Swyx15:21

If you-

Elie Bakouch15:21

Yeah

Swyx15:21

... do you want to keep going? Yeah, I, I, I was, uh-

Elie Bakouch15:24

I don't-- I, I'm not sure I have theee, the slide for Shampoo and Soap. I, I like this slide. This is from my previous set of slide. Basically, I was like, uh, looking at, uh, what the lab are like using, and I, I, I basically saw that every open model are-- were using Adam.

Swyx15:44

Yeah.

Elie Bakouch15:44

It was kind of crazy. And, uh-

Swyx15:46

It's pretty validated at this point

Elie Bakouch15:48

... and since then-

Swyx15:48

Yeah.

Elie Bakouch15:48

Yeah. And since then, there is this new Muon trend. There is this recent paper talking about the, the different optimizer. And, uh-

Swyx15:55

Wait, this is this week

Elie Bakouch15:56

... this basically... Yeah, this is this week.

Swyx15:59

Wow, these slides are super live. Oh, shit.

Elie Bakouch16:02

Yeah.

Swyx16:03

Okay.

Elie Bakouch16:05

Yeah. This is this week, and this is basically saying that... So there was a lot of papers that claim, claim some X, uh, spi- speed up and things like that. And what they find, uh, is that the speed up is greatly, greatly exaggerated, and mostly because, uh, often people v-- like undertune the Adam W baseline.

And this is like something which is pretty, pretty, uh... Like we-- There is always this problem where people have a new architecture. For example, they are, they are under, under, like the, the baseline of the transformer is often under optimized.

And so they, they basically say that when you increase the model size, the speed up is decreasing. But to be honest, uh, even the author, I think, say that this point, they didn't really optimize the hyperparameters. They just like do some, um, let's say that, do some extrapolation, and like extrapolation can be a bit tricky.

So this, maybe we can forget this one, but I think the, the, the speed up between the one point two and one point three is pretty fair. And yeah, there, there is a lot of insights, such as like if you don't do weight decay, you can get, uh, those, those kind of curve.

And if you, for example, take a look at like, uh, step, uh, uh, ten, uh, ten thousand, you, you can conclude that, uh, the, the one with, uh, weight decay equal zero is the best. But in fact, at the end, it's, it's not at all.

So early curve can be, can be a lot-- like can mislead-

Swyx17:32

Wow

Elie Bakouch17:33

... a lot the, the, the interpretation. So it's... Yeah. And also like y-you see here, if you, you don't tune, uh, enough your pa- hyperparameters, for example, uh, this is the true value they, they take for Soap. And in one case, it's very bad.

It even had like this spike, which is not great at this scale. And, uh, in the other scale, it's like beating the, the large optimizer. So, yeah, it's pretty, it's pretty complicated to do a lot of that, but yeah.

Alessio17:58

Is there any value in the early curve? Like, even if it's like, you know, not predictive of like the whole training-

Elie Bakouch18:05

Yeah

Alessio18:05

... like seeing kind of like the-

Elie Bakouch18:06

So-

Alessio18:06

... a faster slope in the beginning

Elie Bakouch18:09

Yeah. So what I look, uh, when I, when I look at the early curve is mostly the spike. If there is some spike early on, it never a good sign for the, for the, for the rest of your training.

There is some, um... For example, if you compare different datasets, the early curve can be, can have-- can give some information. It also depends on the, the schedule you are-- the learning schedule you are doing. Uh, we, we often use this WSD schedule, which means that basically you, you, you do this, like, as at our grow, there is this stable phase.

And why it's great is because you can basically decay, uh, whenever you want. And so you do one run, uh, one big run with, for example, a fixed set up, and then you decay, uh, at different points, and then you can get, uh, this performance without doing like a different cosine schedule for, uh, for all of them.

Swyx19:01

Oh, yeah.

Elie Bakouch19:02

But, uh, overall, uh, it's like especially when doing, um, optimizer ablation, you, you never want to, to, to look at early curve and you want to like wait for, uh, the long rate to, to have fully decay and like the learning to be, to be to zero or whatever value.

Swyx19:22

Wow. This actually is a, is a really good paper. I, I... Like, there's a lot of insights and experiments in there.

Elie Bakouch19:25

Yeah, it's, it's a great one. And, uh, the people who are doing it is like the Mind Project at Stanford. They're really great, and they are doing some amazing open source stuff, so I really encourage people to, to check out, uh, what they do.

Swyx19:40

Awesome. Um-

Elie Bakouch19:41

Yeah.

Swyx19:42

Okay. Uh, anything else on the opt-optimizer world that's going on that's like, uh, interesting to you?

Elie Bakouch19:48

Uh, yeah. There is this, uh, this plot from the, the Asian Solar AI paper about Muon. And, uh, the, the idea of this plot is basically saying that you can use Muon P to... I mean, you can use some technique to, to do hyperparameter sweep, and it's working with Muon, for instance.

And there is this idea where, uh, you... So in this, in this paper, they only did, uh, one D, uh, hyperparameter sweep. So they fixed everything, and they just changed the learning rate, for example. But, uh, for instance, there is some connection between the learning rate and the weight decay or learning rate and batch size.

But you always want to sweep together, uh, some of the hyperparameters, and this is what they, they, they do here, for example. They, they, they sweep both the, the learning rates and the weight decay together to, to find the, the optimal one for, for their training.

So-

Swyx20:41

Yeah

Elie Bakouch20:42

... and I think it's all optimized now. Yeah.

Swyx20:44

I just realized this is a four-dimensional chart.

Elie Bakouch20:47

No, a three-dimensional one and that-

Swyx20:48

It's 3D, but then-

Elie Bakouch20:50

And then there's this one. Yeah

Swyx20:51

... you see, you see this? That's the fourth dimension. Yes, correct.

Elie Bakouch20:53

Yeah.

Swyx20:54

Uh, very interesting.

Elie Bakouch20:56

Yeah.

Alessio20:57

What else comes to mind for you? I, I think like, you know, we're kind of on the model consumer's side, and so there's some of these things like, you know, that get to the engineer side and we think are really interesting.

Swyx21:09

Yeah. Like, like, like sparsity matters to us, like, uh, efficiency-

Elie Bakouch21:12

Yeah

Swyx21:13

... uh, you know, speed.

MoE Architecture21:15

Elie Bakouch21:15

I think the, the MoE is definitely something that is interesting to understand, and it's definitely i-interesting to understand how powerful it is. So for instance, like the, the first, uh, graph are basically saying that, uh, you get better performance for the, the same number of ops.

But there is this problem and, uh, it's basically that, for example, here you, you get like, uh, a, a 3x, uh, performance boost. But, yeah, you... If you, if you look at the training times, you only get like a 2x, uh, performance boost.

And this is mainly because, uh, MoE are faster to train, but this is depending a lot on your code base. And there is actually some very small detail, uh, that can, uh, completely make your MoE, MoE very bad.

I think one is this, um... Is this one, is like the... This is from Qwen, and they are basically saying that... So I don't know if I, I, I need to explain, but like the, the load balancing is basically saying like you, you have your different experts, and you want all of the expert to get approximately the, the same number of token at each batch or a-at the end.

Because if you only have like two expert that, uh, activates, uh, every time, it basically like the, the others parts, uh, will, will basically be, be useless. Uh, so one of the, the very important part is this load balancing.

And what they find in Qwen, uh... So there is different way to do load balancing. Uh, I can talk about this later. But, uh, what, what they find is basically you need to compute, uh, those two statistic, which is, uh, at each step you look at how many token act-actually selected by, uh, each expert, and you look at the probability that, uh, is affected by, um, by, for-- by the router, basically.

And when you compute this, um, this statistic, you, you are like doing that at the micro batch size, uh, level. So this means that, for instance, when you do training on multiple GPUs, uh, let's say you just replicate the m-the model on all the GPUs.

You have this global batch, um, you have this global batch, so it means that you, for example, you, you give a hundred document to, to your, to your model. And if you have t-five GPU, you, you give like, uh, twenty to each of them because you want to parallelize, uh, this process.

And then after you, you gather all the result together and, and you do the backprop pass. And the fact that there is als- the, the, the statistic is compute at the, the mini batch size is like pretty, pretty important for the model.

You can s-- I think the, the most, uh, important plot is this one. So basically, this is saying that- The model is not really activated for code. Like, there is no expert that are specifically activated for code. Uh, same for math, same for literature.

So this is like, uh, um, all of this is like the, the local batch. And if you do it at the global batch, so meaning that you give, uh, at, at, at each step, you, you give like enough token basically, so that the statistic is meaningful.

You get this, uh, very good and, uh, uh, like this is basically a sign of, uh, of good health for them. We need to have all those, uh, activated, like specific activate-- a-activation for each domain. And they find that, for example, in the, the Megatron, uh, code base, uh, this wasn't the case.

This was done as the local batch, um, I think. So it basically means that everyone that is using uh, Megatron, uh, at the time of the paper, uh, I, I mean, it wasn't even a paper, it was just a blog.

But they, they had this... They, they were in this regime, basically, where, uh, where the, the MoE were not, like very specialized. And this is super important for end, uh, end usage because, uh, you, you want to have, like a specialized expert so that they really learn something different from each other.

Even after, for example, you can do some pruning, and if you want to model only on code, for example, you can just, uh, prune out some, some of the English literature experts and just keep the one that are activated for code.

And then you can initialize your MoE with those and like bootstrap them. So there is like, uh, endless possibility here. And, uh, and yeah. But this is like a very small detail, and this will have a huge impact.

Swyx25:45

Pretty crazy.

Alessio25:45

You mentioned is something that, you know, personally, I never trained a model. How easy-

Elie Bakouch25:50

Yeah

Alessio25:50

-is it to divide the skills? So when you say, you know, literature, math, and code, what-- Can you maybe run people through the process of like, how do you kinda like funnel these things and different experts? And then is it just as easy as you said to like, "I'll just delete the liter-literature part," or is there some sort of like codependence-

Elie Bakouch26:09

Well-

Alessio26:09

-between them?

Elie Bakouch26:10

Yeah, there is some codependence, definitely. So there is other way to basically limit this codependence, but there is definitely some codependence. And when you do pruning, I, I don't know if people are doing that. I think that's interesting to explore.

But, uh, like at least in the open, people are not really like pruning, for example, the, the English literature. That was just some, some research idea that could be called in the future. But, uh, but yeah. But the, the specialization is actually done in the, the outer layer of your MoE, and this is pretty important basically because this is like the, the, the step where you will learn, like each token will learn to which, uh, expert to go depending on like the, the, the meaning of each expert.

And, uh, and you can even have some fancy stuff. So this is like, uh, from t-t-two weeks ago, this long cat flash from the, the DoorDash of China, uh, paper that released-- uh, the company that basically released like a state-of-the-art model, which is pretty crazy.

Swyx27:10

This is, this is the most recent presentation I've ever seen.

Elie Bakouch27:13

Yeah.

Swyx27:15

This is all like happened in the last two weeks.

Elie Bakouch27:17

So, yeah, I mean, uh, I'm trying to, to, to stay in, uh, in touch with, uh, what's happening. And they, that is this dual communication expert, which I find pretty cool. I think it's the first time I see it in like a big model.

I mean, I'm pretty sure it's the first time. And like it allow the, the model to basically say, "This token doesn't, uh, um, like this token is like, uh, for example, very easy to predict, so I should not, uh, have, uh, like allocate a lot of flops to it.

But this, uh, this token, which is, for example, for, uh, to, to, to answer a MMLU question is very hard, so I will activate more of the, of the real experts." But those are like just residual connection, basically.

And, uh, it's the first time I've seen that. I mean, it's great, but I mean, they, they have a very strong team because my guess is that it's pretty hard to, to like balance it, uh, and to make the, the training stable.

And they also have this change also, which is... I, I mean, I'm not sure I understand why they do that. I think I understand, but it's, it's pretty novel as well. It's basically replacing the shared expert with some, some double attention layer.

Yeah, I mean, it's, it's pretty crazy. And there is a lot of question for MoE, basically. Do you want to, to have shared expert or not? A GP2SS Qwen3 doesn't have shared expert, but like the, the Qwen3 next, which is like a, which is like a...

I mean, they didn't release it yet, but they submit the, the Pierre to Transformer. And they-

Swyx28:53

This is literally last night.

Elie Bakouch28:56

This is... This is not last night. This is like, uh, four hours ago, I think.

Swyx28:59

Oh my-

Elie Bakouch29:00

But, uh-

Swyx29:01

Oh my God

Elie Bakouch29:02

... but, uh, and, and they basically have shared expert this time. So this is interesting. I think shared expert are pretty important to... Uh, they basically act like as, like the, the knowledge that you don't want. Like you, you want your expert to be very specialized, and you want the shared expert to be just like the basic stuff and anything like that.

That's the intuition behind it, and I think DeepSeek is using that as well.

Expert Specialization29:26

Alessio29:27

What do you see as like the even more granular MoE future? You know, I, I think it makes sense for people to say, "Hey, it's like code and math and literature." Do you see a future-

Elie Bakouch29:37

Yeah

Alessio29:37

-in which the MoE model is like, you know, front-end expert? Like, uh, you know, if it's like a TypeScript code base, it's like, oh, this, uh, expert, like the routes is an expert at, you know, the component, is an expert at the test writing.

Like, is that something that makes sense? Are we bottlenecked by the data, or what are people doing there?

Elie Bakouch29:58

So my intuition, uh, uh, I don't really know, but my intuition is that, for instance, between math and, I don't know, all the history, uh, like the Greek history, for instance. No, not really the Greek because it's related to math.

But let's say code and Greek history. There is not a lot in common, except, uh, just the, the fact that the, the language is the, the same. But between like, for example, I don't know, TypeScript and JavaScript or Python and, and I don't know what language, there is more similarity.

So I'm not sure, uh, if it's- Like there is, there is maybe more transfer learning, meaning that, uh, a model trained on like Python and JavaScript will benefit from the JavaScript, uh, data as well. I'm not sure it's the case for even, but for Python great history.

Swyx30:47

Yeah. I think like the, the question of semantic experts is always, uh, something that people are wanting to have intuitively, but the machine in-

Elie Bakouch30:55

Yeah

Swyx30:55

... machine learning terms, it never works out that way. Uh, I actually feel like people are moving towards more semantic experts. It's, it's like somewhat started by Apple, uh, because they want like sort of downloadable lores and stuff.

Uh, I remember-- Oh, Gemini three nano, 3N, uh, also had this, where they had-

Elie Bakouch31:15

Oh

Swyx31:15

... sort of like dow-downloadable, offloadable weights. This is like a really severe-

Elie Bakouch31:18

Oh, you mean the Gemini 3N?

Swyx31:20

Gemma, Gemma, Gemma. Yeah, yeah, yeah.

Elie Bakouch31:21

Yeah. Yeah.

Swyx31:23

I see, I see some moves. I, I don't, I don't know how serious this is, this thing is, but like if you're, if you're going-

Elie Bakouch31:28

Yeah

Swyx31:28

... to the point of having a router for different models, like semantic experts at some point makes sense.

Elie Bakouch31:34

Yeah. Yeah, and what I like is I think, uh, there is this recent trend where OpenAI like basically saying that, uh, they, they want like a router for a user to be, to, to, to have like some... And I think it's great for-

Swyx31:48

Yeah

Elie Bakouch31:49

... you might as well. Uh, yeah, and, and this is kind of the same principle but in-baked inside the model. So I find it pretty cool because it's basically saying, uh, if my m-- if the request that I have is easy, I will just not allocate and I will basically in-- do inference with, uh, fewer expert, which is the equivalent of GPT-5 Mini, for example.

And, uh, if I have like a very strong question, I will basically activate all the experts. But they, they do it at a scale where it's basically varying between, uh, I think it's like there is the, the variance is like four billion parameters, so it, it's not a lot.

And GPT-5 Mini and, and the, the big ones are-

Swyx32:31

Yeah

Elie Bakouch32:31

... don't have the, the same number of parameter at all. But this is, this is cool to see those behavior cooked and baked into the, into, into the model.

Swyx32:41

Yeah. Amazing.

Elie Bakouch32:42

Yeah. I don't know. I can talk about, uh, MoE, uh, or other stuff. What do you want?

Swyx32:49

Uh, yeah. Guide, guide it however you like. Uh, you know, I think the other, the other trend, uh, what, what definitely was more granular, um, um-

Elie Bakouch32:57

Yeah

Swyx32:57

... uh, experts, uh, it was going up to like a hundred and twenty or something. I don't know if you have a chart here. Okay, it looks like some kind of efficiency.

Elie Bakouch33:04

Yeah.

Swyx33:05

Yeah, go ahead.

Elie Bakouch33:06

Exactly. And this is like basic... I think Que... So this is like the actual number of parameter here and the total number of parameter here.

Sparsity Trends33:09

Swyx33:14

I see. I see total. Yeah, yeah.

Elie Bakouch33:15

So this is basically the, the MoE sparsity. And you see that so those are like the kind of old model and they are like not really great in terms of sparsity. But if you look at the new one, uh, they are even the, like this communicator is pretty, pretty insane as well.

I think we keep like the, the, the new FineWeb they will release will be somewhere here, I think, if I'm not wrong, if I read it well. So this will be Qwen, uh-

Swyx33:42

Qwen, Qwen max or Qwen next. Yeah.

Elie Bakouch33:44

Qwen3. Qwen next?

Swyx33:47

Yeah.

Elie Bakouch33:47

Yeah. I think this could beee-

Swyx33:48

Uh, yeah, I w- I would say from what I've heard, Gemini Flash is also pretty, pretty strong around-

Elie Bakouch33:53

Yeah

Swyx33:53

... around this. Yeah.

Elie Bakouch33:54

Yeah. I mean, MoE like, uh, we are this kind of pioneer in this MoE field. I think MoE is, is from them as well, so, so they-

Swyx34:03

Of course. Yeah

Elie Bakouch34:05

... everything is from him, so.

Swyx34:07

Everything is from him. I, I think like what, what was the difficulty for being this sparse before, right?

Elie Bakouch34:14

Yeah.

Swyx34:14

Like, is it just stability or training?

Elie Bakouch34:15

So this is definitely one thing. Also, I think like training code base, uh, you, you really need to have an optimized, uh, infrastructure and optimized training code base to, to have this, the good sparsity. Because the way it work is that you basically are distributing, uh, the expert on different GPUs.

And in the MoE layer, they basically need to sync, uh, before because like the, the router is dispatching the weight to, uh, the, the token to, to the different experts. And basically, the more granular it is-- I mean, the more granular it is, the more this, this step can be, can be costly in term of communication.

So this is one of the reason why it wasn't really good. For example, we tried, uh, we are training, uh, MoE currently at Hugging Face, and we'll train soon. We start the training soon.

Swyx35:06

Yeah.

Elie Bakouch35:06

Uh, and, uh, we tried with Megatron and we, we benchmark here like for example, the Mistral architecture with the, the, the Qwen3, uh, this one. And at the start before any optimization, like the Mistral one was very fast and have very good throughput, and the, the Qwen3 was, uh, very slow to train.

But we basically with the new, uh, the new kernel, the, the new all this new stuff, uh, it like became feasible to train. And there is also this, uh, sparsity, uh, this like it can basically make the training sometimes a bit less stable and it's kind of a big thing.

I, I don't know if, uh... For example, this OlMoE paper, they basically benchmark, uh, this number of experts, so sixty-four and thirty-two, and they didn't find like much difference between them. But if you look at like a, a more recent sparsity scaling law, you'll find that there is like this is basically, uh, uh, the, the different, uh, sparsity coefficients, and you find that there is actually quite some improvement.

And of course, there is like diminishing return, but, uh, you, you can increase the sparsity quite well. And it's very good at inference. I think that's the main arguments. That that inference is very good because you can have very fast inference because there is only a very small subset of the parameter that is activated.

Swyx36:31

Yeah. I, I think o-one of those things that's kind of interesting as a pattern is like MoEs as a, as a production artifact, but not as a training-

Elie Bakouch36:38

Yeah

Swyx36:38

... target. So the training target-

Elie Bakouch36:41

Yeah

Swyx36:41

... you, you just have the d- the dense model, and then you distill to the MoE model. Yeah, I think, like, I, I-

Elie Bakouch36:46

Yeah

Swyx36:46

... think this is the pattern for every frontier lab now, and I'm just not sure, like, you know, obviously, uh, everyone's-- why, why don't you just train the, the MoE directly, uh, is because of stuff like this.

Elie Bakouch36:57

Yeah. Yeah. I mean, yeah. I think they also train MoE, uh, from the start, but maybe less sparse, you know. They basically do some more sparsity on the production model than for the, the one that it use, uh, to distill, uh, from.

Actually, distillation is, like, quite a big thing that people in the open are not really, really doing yet, I think. But, uh, but yeah. I mean, I think that's it for, uh, firmly.

Swyx37:27

Nice, nice check. Uh, I think the, the, the other thing, you know, uh, w-- especially you mentioned the GPT-5 router, is this-

Elie Bakouch37:34

Yeah

Swyx37:34

... difference because, like, MoEs have routers, then we're putting a router on top of another router. Like, it's-

Elie Bakouch37:40

Yeah

Swyx37:40

... ridiculous, right? Like- ... okay, what is-

Elie Bakouch37:43

And-

Swyx37:43

... the future of routers, right? Like, is there a fat router that is basically its own LLM? What does that look like? If you, if you just extrapolate, like what, what does it look like in the future?

Elie Bakouch37:52

Like the future of the router?

Swyx37:54

I-if we're, if we're going to the point of, like, putting a router on top of a router-

Elie Bakouch37:57

Yeah

Swyx37:57

... isn't that the same job?

Elie Bakouch38:00

Yeah, and, uh, I'm actually-- I don't have it in, in here yet, but let me screenshot something quickly from a local copy. Yeah, if I go back, yeah. There is this, um, this NSA, which is like the, the new DeepSeek attention.

And-

Swyx38:16

Mm-hmm

Elie Bakouch38:17

... it's basically a router inside attention. So-

Swyx38:20

Whoa

Elie Bakouch38:20

... you can see it as like a, a router inside attention, basically. Because so there is this compression part, there is this sliding window attention part, so yeah, let's say. And there is this, this part where you are basically selecting which attention block is interesting for the specific token.

So you are routing, uh, the attention of the token to some specific, uh, block of the, uh, previous one. Uh, you have also some routing inside attention happening with those new sparse, uh, architecture. There is also many SPM that have a, uh, very similar, uh, similar attention mechanism.

But yeah, I think it's interesting because basically, like, like the more router you have, the more parameter efficient your model is. I think that's the intuition, yeah, at-- especially at inference, because you only activate a, a subset of it.

And that's like the same logic for, uh, the, the model router basically, because you, you are selecting the model with like fewer a-activity slots, for example, GPT-5 mini compared to the big one. For MoE, you are basically saying, uh, "I, I'm only selecting a fewer token, or I'm only selecting a subset of it."

And, and you also have this same logic into attention also now.

Swyx39:36

Yeah.

Elie Bakouch39:36

But yeah, this is pretty cool.

Swyx39:38

Yeah.

Elie Bakouch39:38

I mean, uh-

Yeah, I

mean,

yeah,

I think to, to answer also on the question, I think like the, the goal of, of like, uh, ML researcher is basically to, to cook the, the best model possible so that the user don't have to do much with it.

Data Quality40:20

Elie Bakouch40:35

Uh-

Swyx40:36

Yeah, out of the box, zero shot.

Elie Bakouch40:38

Yeah. That, that's I think pretty cool. And obviously, a big part of it is like the dataset. Uh, there is this recent paper, like the Beyond Web from the-

Swyx40:48

Yeah

Elie Bakouch40:48

... the Datology, uh-

Swyx40:51

Yeah, we just had the Datology episode, I think last week.

Elie Bakouch40:53

Yeah, I saw this.

Swyx40:54

And, uh-

Elie Bakouch40:54

But it's pretty cool. Yeah.

Swyx40:56

So this is super recent again. I'm not used to talks being this recent.

Elie Bakouch40:59

Yeah.

Yeah. So I, I mean, I, I've read it-- I mean, I've read it, uh, fully, but I didn't spend that much time on it. But if, if I had to, to recap a bit the, the paper, the, the interesting plot are, are this one.

And so this is like I think the, the, the interesting one is that you basically want to rephrase, um-- so this is about rephrasing. So basically, you have-- So when you-- Like there is the, the web dataset is, is shit, to be honest, like there is a lot of very bad content in it.

And there is one approach, and what we do in, uh, FineWeb-Edu, for example, that is basically filtering some, some educational content or some subset of the internet, which is, uh, often higher quality. And the question is like, what do you do with the lower quality data?

I think that's how I see it. That's not exactly what they say in the paper. That's, uh, more my thought. But I think, uh, an interesting result is this, uh, is this, um, is this graph. And basically, this is like the curve between low-quality web and high-quality web.

So this is the web, basically. And if you only, uh, rephrase the low-quality parts, you get this curve, uh, the light blue one, which is kind of close to, to the one where you also rephrase. I know it's not that, but it's like it gives you a, a big boost.

And I think I'm not sure if they do the ablation here, but I'm not-- Yeah. Okay. So that's what they do. They, they also try to, to rephrase, like in the, the high-quality subsets, and they also repeat, uh, the dataset they rephrase on.

And there is only a small difference. Then you could think it's because of the repeat. I'm not even sure it's because of that, to be honest. And the, the, the, the thing that you, you need to understand from it is like, uh, it's very good to rephrase the low-quality data, uh, to have like just better, uh, better benchmark and better performance.

And, and yeah. And rephrasing is, is a bit, uh, is a bit tricky to do. Uh, I think a lot of it is making basically the right prompt.

Swyx43:11

Mm.

Elie Bakouch43:11

And one of the, the good prompt-- I mean, the good style that the, the model learn, the model like, especially because the benchmark are constructed, uh, this way, is the conversational, uh, data. So the Q&A, for example, uh, answer.

Small LM Insights43:20

Elie Bakouch43:25

Uh, for example, MMLU. So this is from SmolLM two, uh, uh, training, so which is, uh, one point seven B, I think.

Swyx43:36

Yeah. I know.

Elie Bakouch43:38

I don't think.

Swyx43:40

Very small.

Elie Bakouch43:40

And, uh, yeah, very small. And this is basically until, like six point five trillion of tokens, which is a lot, to be honest. Until this amount of token, the MMLU in the QA formats, meaning that the, the, the model have to select, uh, which answer is...

The model have to output, for example, the, the right answer is A or B or C or D. And this is random. Like, for six trillion tokens, it's random. So this is a big deal. And it only learn after like six trillion token to, to, to basically answer question in a QA format.

And this is because we, we didn't do at the time a lot of, uh... We didn't include a lot of QA, uh, Q&A, uh, data in our training set. And this is also from, uh, a blog post from Datology.

And you see that their training sets, uh, like the, the, the data set is, is very good at MMLU. Uh, and this is, this is like mainly because of the formats. Like all of the data set are random because they don't have like QA formats, and I don't-- uh, they don't disclose it, I think, but, uh, maybe they do, to be honest.

But this like the, the fact that they gain accuracy on MMLU and it's not random is because there is some Q&A, uh, formats, uh, inside the data set. So you see like if you just look at the benchmark, uh, you could say, uh, for example, like, uh, this CLM is very bad or it's very bad quality data or I don't know.

But with a very light rephrasing and, uh, uh, let's say a style rephrasing, so you take the document from whatever data set and you, you put it in QA format, you would have like non-random performance on MMLU.

Swyx45:19

Right.

Elie Bakouch45:19

This is, this is very-

Swyx45:22

You're very, very sure it's not training for test, right? Like, uh-

Elie Bakouch45:25

Yeah.

Swyx45:26

This is obviously the, the, the problem.

Elie Bakouch45:29

Yeah. There is obviously some contamination that's, uh... I mean, thirty percent is not that much, to be honest. I mean-

Swyx45:37

Yeah

Elie Bakouch45:37

... it's, it's great, but, uh, it's not like hundred percent or something like that. But I'm not sure it's contamination. It's more like QA, Q&A formats and, uh, and that's what they, they also find here is that you basically have better performance where you, you put some conversational data into the, into the training, and it's basically plateau at twenty percent, which is, uh, still good to know.

Swyx46:02

Yeah. Okay. And, uh, you know, one of the reasons I, I obviously I think we've been following the rephrasing the web research for a while.

Elie Bakouch46:09

Yeah.

Swyx46:09

I think one of the reasons that like I was a little bit anxious about this is that now the data set is too clean. It's too perfect, right?

Elie Bakouch46:18

Yeah.

Swyx46:18

I paste in a lot of shit in my data set, in my prompts. Right?

Elie Bakouch46:22

Yeah.

Swyx46:22

So can it recognize my typos? Because if it's never seen a typo-

Elie Bakouch46:26

Yeah

Swyx46:26

... in its life, it's not gonna be u-understanding typos, right? Typos are just one simple form of mistake. There's grammatical mistakes, but then there's also-

Elie Bakouch46:33

Yeah

Swyx46:34

... mild conceptual mistakes, all of which gets cleaned up with, with, uh, rephrasing, and-

Elie Bakouch46:39

Yeah

Swyx46:39

... sometimes that's bad.

Elie Bakouch46:40

Yeah, I totally agree with you, and especially since like all the benchmark we have, uh, we don't have like typos, uh, benchmark, I think. There is no, no such things. Uh, I mean, there, there probably is, to, to be honest, but I don't...

Like people don't usually benchmark a-against that. Um, obviously, the, the, the data set innovation and the, the model innovation like always are biased towards like maximiz-maximizing performance on some specific set of benchmark. And you, you kind of miss those use case, as you said, which is, uh, real case, real like user, um, like the, the thing that user care about, to be honest.

And, uh... But I'm not that worried because I think the, the solution is just to include some bad data as well. And the model will just learn, just learn on it. And you can probably include-

Swyx47:31

The original data. Yeah

Elie Bakouch47:31

... there is probably some, some scientific, uh, ablation to make on that. But you train on so much trillion of token data that, to be honest, I think the model have time to learn, uh, that sometime a user are typing, uh, bad stuff into, into their prompts.

Swyx47:47

Yeah. Uh, you know-

Elie Bakouch47:48

Yeah

Swyx47:48

... I, I still see-- I, I feel like there, there will be some trade-off somewhere because like, you know, obviously you're-- you have much, much more... much, much fewer typos. I'm not just talking about typos, right? I'm talking about like-

Elie Bakouch47:58

Yeah

Swyx47:58

... I'll copy and paste like website data and, and I just throw shit in there. Like because the pre-training data is bad, I actually have confidence that-

Elie Bakouch48:06

Yeah

Swyx48:06

... you can handle bad data because I'm gonna paste in that bad data.

Elie Bakouch48:10

Yeah.

Swyx48:10

Um, anyway, so, so separately, uh, I also wanted to mention, uh, do you know... Do you cover the ten cent, uh, trillion persona paper? Because like persona rephrasing-

Elie Bakouch48:19

Yeah

Swyx48:19

... billion persona, trillion persona. Basically, persona rephrasing is a very interesting way of doing multiple epochs.

Elie Bakouch48:25

Yeah.

Swyx48:25

And you never repeat yourself, but it's actually kind of the same content. It's just you're rephrasing.

Elie Bakouch48:29

So I think that's kind of what they did in, uh, Qwen-K2 ablation.

Swyx48:34

They did, yeah.

Elie Bakouch48:35

Yeah. Uh, I'm not sure. I didn't read the, the paper. I will read, uh, probably after this.

Swyx48:39

It's, it's basically role play, right? Like, uh, you're a doctor-

Elie Bakouch48:42

Yeah

Swyx48:43

... blah, blah, blah. You're a physician, blah, blah. And then like it's slightly-

Elie Bakouch48:46

Yeah

Swyx48:46

... different.

Elie Bakouch48:47

Yeah, I totally agree with you. I think that's pretty much... that's pretty important. Um- And, you know, there is this paper from, um, actually from people at Hugging Face at the time that is saying that you, you basically can repeat your data, uh, like up to, to three epoch before seeing diminishing gain, uh, uh, before seeing diminishing return.

Swyx49:10

Four is what I remember, but yeah.

Elie Bakouch49:11

Four. Yeah. I, I don't remember exactly the number, but I don't think they do, uh, ablation on like the different dataset. So with, uh, with Luma, uh, which is Luma Benal, uh, at Hugging Face-

Swyx49:24

Yeah. She spoke at my, uh, conference last year. Yeah.

Elie Bakouch49:27

Yeah, yeah. I was there, by the way.

Swyx49:29

Oh, yeah. Nice.

Elie Bakouch49:29

Was in the public.

Swyx49:31

We're, we're gonna do that again at NeurIPS, San Diego.

Elie Bakouch49:33

Oh, so at NeurIPS?

Swyx49:35

Yeah. Are you, are you coming? San Diego?

Elie Bakouch49:36

Uh, probably yes. I, I'm not sure. I didn't book my flight, but, uh, but, uh, I think we book it. And yeah, and I think this is like heavily dependent on, uh, on the dataset, and this is very underexplored.

For example, uh, we have like the, the FineMath dataset, which is very high quality math datasets. We also have like the, the, the StackEdu one. And I'm pretty sure that if we repeat more time the, the FineMath datasets, this number of, uh, three X, we probably-- we can probably repeat more of high quality dataset because it contains like more information.

And what you said is like with rephrasing, you can pretty much get probably, uh, like, uh, something-- I don't know. I didn't do ablation, but you can probably do like this, this ten X factor when you can repeat your data by rephrasing it a bit, uh, a lot.

Uh, like you can repeat, uh, repeat it quite a lot. And, uh, I think this is quite underexplored and I would love to, to see some papers or, or maybe I would do it, uh, myself. I don't know.

But, uh, but this is pretty cool and this is kind of good old, uh, data augmentation that we-- people were doing like during the time of computer vision, uh, with basically, uh, I don't know what they were doing, but they are like shifting the image or zooming out, zooming in, uh, adding some bit of noise, stuff like that.

And they, they, they had better generalization, meaning that the training test loss were a bit better. So yeah, I think this is still an open question, at least in the open, uh, at least from my knowledge, and this is pretty, a pretty important one.

Swyx51:16

I think the, the last dataset piece question I have, then I'm happy to change topics, is, uh, one of the lessons that we had from the Datology episode was that effectively what we're doing was removing the post-training data into the pre-trained data, right?

Elie Bakouch51:29

Yeah.

Swyx51:29

Uh, that's-- You have the-- You talked about this conversational rephrasing. That's instruction tuning going in.

Elie Bakouch51:35

Yeah. I mean, there is all this mid-training stuff that's-- I mean, you, you can, uh, inject the data during post-training, mid-training, uh, pre-training, whatever. I think the, the-- what matter is that you-- I think the what matter is like the model see your data and post-training should be very to, to very like, to, to basically sharpen the distribution of your model to-

Swyx52:01

Yeah

Elie Bakouch52:01

... to very specific topic. And so it's, for me, it's good and that's what people do nowadays. Like GLM, uh, I think they train on-- I don't, I don't remember exactly, but I think it's like eight trillion, uh, token at the mid-training state.

Can you, can you call it mid-training? I'm not sure, to be honest. Uh-

Swyx52:20

You can call it whatever you want.

Elie Bakouch52:21

It's pretty crazy. Yeah. Eight trillion token is like... I mean, and they, they train only on code and math, and they do some rephrasing as well. And, uh, and yeah, I think, uh, I think that's basically what a lot of people are doing now.

And we are doing this as well. We are, we are basically introducing higher quality data like, um, I don't know where it is. But if you look at the, uh, our different phase, we are basically adding more code and math, uh, through the, the training and less web data.

Swyx52:56

Yeah.

Elie Bakouch52:56

But we're only doing it like one point four trillion token, which is maybe-

Swyx53:02

Yeah. By, by the way, oh yeah, this, this chart, we haven't pulled it up yet, but like this chart I was-

Elie Bakouch53:06

Yeah

Swyx53:06

... uh, was, was what wowed me on the SmolLM 3. I was like, "This might be the most open paper I've ever seen."

Elie Bakouch53:12

That, that's what we try at least to be, to be as open as possible. We also release like all the checkpoints, the intermediate checkpoints we have. I mean, we didn't release it all, but every ten billion token I think or-

Swyx53:24

Mm-hmm

Elie Bakouch53:24

... no, I think fifty billion. Uh, I don't remember exactly what I pushed to run. But every like fifty billion token, uh, I think there is some checkpoints. And, uh, yesterday I was talking about, uh, some stuff about pre-training and someone was saying, "I hope like it would be cool if you release the, the, the intermediate checkpoint because I need to do some analysis about the, the pre-training, uh, dyn-dynamics into SmolLM 3."

And I, I mean, it's here, you can use it. But this, this is pretty cool, and I think, uh, that's what we try to do. We also open source all the code base. So there is the Nanotron which is the-- doing the large scale training.

Open Source Tools53:56

Elie Bakouch54:00

There is the Datahub which is doing the, the data filtering. I think this one is very underrated. Um, and it's-

Swyx54:05

Okay

Elie Bakouch54:06

... it's very good. That's, that's what we use to, to do FineWeb and, uh, FinePDF, yeah.

Swyx54:11

Uh, should we talk about that? Let's, let's, uh, let's open it up. I, I've never seen this, never heard of it.

Elie Bakouch54:14

Yeah. Datahub? I mean, I mean, it's just a library that's, that do data filtering and tokenization at scale. So you basically-- It's very efficient to, to do this on-- We do it on CPU mainly. And there is also no-- I think we are doing, uh, some pipeline for doing rephrasing also inside the, the Datahub library.

We also have the Liteval one to do evaluation.

Swyx54:36

Mm-hmm.

Elie Bakouch54:36

And, uh, we are, we have a lot of stuff there.

Swyx54:38

Yeah, Liteval, I mean, I think a lot of people are like trying to move from the Hugging Face harness and, uh-

Elie Bakouch54:44

Yeah. The, the ending of our harness, yeah.

Swyx54:48

Yeah, yeah, yeah. Um, is Liteval the, the new standard now? Is-- Should I-- Should everyone be running that? Like-

Elie Bakouch54:52

I mean, the... Yeah, I think it's pretty good. The Datology, the Beyond web paper, they use Liteval, I think.

Swyx54:59

Yeah.

Alessio55:00

I, I think the community should have one. Uh, it's just that everyone is like-- Even, even the Hugging-- Even the OpenAI evals framework was so heavy that they, they had to op-- they had to release, like, "Okay, here, our, our main framework is too heavy.

Here's the simple evals." And then, and then they don't even use that.

Elie Bakouch55:13

Yeah.

Alessio55:13

So I'm like, "I don't know what to use, man."

Elie Bakouch55:15

There is the eval framework, uh, every day .

Alessio55:19

Yeah.

Elie Bakouch55:19

Yeah, I think there is a lot of, uh, of stuff. But, uh, but I'd like to think that, uh, the Strike ML one is, is great. And I think, uh, one thing which is cool at working at Hugging Face is that we, we, we are this multimodal team which is doing like the SmolVLM.

Alessio55:33

Mm-hmm.

Elie Bakouch55:33

We have the robotic team. To be honest, I'm not really involved in that, but the, the-- they are doing the, the SmolVLM, uh, model. Uh, SmolVLA, sorry, which is like the, the vision language, uh, action stuff.

Alessio55:44

Action. Yeah.

Elie Bakouch55:44

But it's pretty cool to, to have like all those people working with the... We are like our SmolLM model as a backbone and then building some, some stuff around it, even inside, uh, uh, our team at Hugging Face, so this is pretty cool.

Alessio55:58

Yeah. So many memes.

Elie Bakouch56:01

Yeah. I mean, I did not make all the meme yet, but, uh, I have so much. Like, this one was like-- So this was for SmolM3, and I was doing, uh, ablation for, uh, on Optimizer. And basically, I, I was like...

I mean, when I, when I fell asleep, it was like here, so there was no spike at all. And I woke up, and my graph looked like this, and I was like literally crying-

Alessio56:26

Ahhh

Elie Bakouch56:26

... because all my training was diverging.

Alessio56:28

This is the quantum observer effect on training runs. When you're watching it, nothing happens. Um-

Elie Bakouch56:34

Yeah. And, and when you, you fell asleep, like you, you woke up the, the, the like the day after and i-it's a nightmare. But, uh, we solved the bug. I think i-it was a bug, uh, in our code base, and this was the, the, the main reason for the spike.

And, uh, there is some fun stuff. Like, for instance, uh, when I was doing ablation on Muon, I was looking at like the Grad Norm, and the, the Grad Norm was doing this like, uh, M shape. And I was going a bit crazy because like this is like the, the M of Muon, I was saying to people.

So it's always funny like, uh, on the Slack that people are... I think that's like one of the, the great thing at Hugging Face, that people are, are like having fun, uh, by doing all those ablation. Yeah.

Alessio57:18

All right. I know we're getting to time. Um, you gotta go back to updating this with all the news from the last one hour- ... that you've been here, just to make sure it's up to date. Any parting thoughts on SmolLM, especially?

I think there's, you know, obviously, even when GPT-4 OSS came out, a lot of excitement about-

Elie Bakouch57:35

Yeah

Alessio57:36

... open models, local models, blah, blah, blah. And then I think, you know, maybe the reality is that there's not as much adoption as people would like. Is there anything you wish people would do more of? Maybe like, uh, you know, underrated use cases for which you think these smaller models are like just as good as the frontier ones that people are not taking advantage of.

Elie Bakouch57:55

Yeah. I think even I, to be honest, I'm mainly using a closed model because it's easier, basically. Uh, it's like the same interface when I'm like, uh, for example, researching, uh, very deep on papers and when I'm, for example, doing like translation stuff, I want to translate something from English to French.

Future Directions57:55

Elie Bakouch58:13

But I know some of the heavier user are using the SmolLM three, for example, for translation. There is also obviously all the on-device application which are super important. Uh, there was this Apple keynote, uh, a few hours ago where they, they, they, they have said the word AI a thousand times probably .

And yeah, so obviously on-device, uh, application are super important. And, and yeah, for the future of SmolLM, I think our goal is basically to build the model that the community don't have and need. So we are super open to feedback.

Uh, don't hesitate to, to tag me on, uh, X or, uh, any place or whatever. If you, if you have like, uh, some... If you think that there is like some gap in the, the, like what the all the open source model are today and you, you wish there was smaller, for example, very small model like under one billion parameters or something like that, yeah, I think we, we are pretty open on what to do next.

We want to train our MoE because it's fun and everyone is doing that. And also, I think there is a lot of, uh, different direction, and it's all very good, um, in terms of science to... Because basically the, the, the, the, the Qwen three or even DeepSeek, they don't release, release all the ablation they do.

And I know as a researcher that that's something super important. And, uh, so when we do model training, we, we try to be as open as possible and obviously, uh, it's often appreciated by the community and yeah. And so that's, that's one thing we want to explore with, with this, uh, MoE.

And we, yeah, also have a project to do, to do some distributed training across like different data center, like, uh, Pinecone did, for example. And, uh, and, and yeah, this is, this is a project I'm looking forward as well.

Alessio1:00:06

Awesome. Yeah, I, I do hope that there will be an easier way to just use these SmolLM models through API.

Elie Bakouch1:00:13

Yeah.

Alessio1:00:13

Um, I found that a little clunky right now, just to find something that is token-based because the Hugging Face API charges by the hour, which-

Elie Bakouch1:00:21

Yeah

Alessio1:00:22

... kinda when you run it, it ends up costing the same as some of the other models. Like, uh, I have this like, uh, MCP client I built and we use Llama-

Elie Bakouch1:00:29

Yeah

Alessio1:00:29

... um, AB for like a conversation naming, you know. I feel like that's like a great use case for like a five hundred million parameter model. But there's no simple API to use it. I feel like that's another...

I-i-- In a way, it's almost like it's not economical to serve these models because they're so small . And so I think that's where they, they get stuck. You know, it's like who, who's really serving the five hundred million to a billion parameter models, you know?

I think that's why. Ho-hopefully Hugging Face can do more there too.

Elie Bakouch1:00:56

Yeah, that's, that's very true. I think, uh, we should do some stuff, yeah. Yeah, yeah

Alessio1:01:02

But thanks so much for the time and the masterclass. I don't know, i-is this file online anywhere? I, I think this might be the most valuable

Elie Bakouch1:01:10

Yeah. I mean, it's not online yet, but I will probably share, uh, maybe a, a much, a more polished version of it. Like this is literally my draft, so...

Alessio1:01:21

This is probably like the most valuable TL Draw file ever. Like I think the, the, th-this file, this canvas is probably worth millions of dollars of insights-

Elie Bakouch1:01:30

Yeah.

Alessio1:01:30

-from, from your talk. So, um, excited to see the final product, and we'll link it.

Elie Bakouch1:01:35

Yeah.

Alessio1:01:35

We'll, we'll make sure to release this maybe once the talk is also out, so that then people can see the full slides.

Swyx1:01:41

J-just a, uh, parting question-

Elie Bakouch1:01:42

Yeah

Swyx1:01:42

... because I, I s- I see that you, you know, you care a lot about, uh, training, optimizing and all that and, and, and multi-data center and probably like multiple architecture. Like, you know, if you've got some AMD, you, you wanna use that.

Uh, have you looked at Modular at all?

Elie Bakouch1:01:53

Exactly.

Swyx1:01:53

Like, is that interesting to you? How have... Why-

Elie Bakouch1:01:56

So your podcast is the-

Swyx1:01:59

I'm just wondering, like, you know, what, what, uh, what's the state of that if you, if you took a serious look at it? If you haven't, if you haven't, then I'm just checking.

Elie Bakouch1:02:05

You mean like Modular the, the language or the just training on different architecture?

Swyx1:02:10

Yeah. M-l-language and runtime, right? Basically, like they're, they're basically offering like a superset of Python that should be good for you espec-

Elie Bakouch1:02:17

Yeah

Swyx1:02:17

... you specifically. You are the target audience for this. And if y- you know, and I'm just ki- trying to hear about like feedback or like...

Elie Bakouch1:02:25

Yeah. I'm not very knowledgeable about it, but like the, like, uh, like the pre-training code base is something that you, you basically build, uh, through training and you, you iterate on it. So like changing some, uh, some like heavy stuff in it are always like a big deal for a researcher, I think.

Uh, especially that everyone, um, is like their own preference and stuff like that. So yeah. But I, I didn't really... I'm not really knowledgeable about all of that, and I need to watch your podcast with them. Uh, it's actually on my, uh, on my, uh, on my-

Swyx1:03:00

Yeah, sure

Elie Bakouch1:03:00

... to watch list.

Swyx1:03:01

Look-

Elie Bakouch1:03:01

So yeah

Swyx1:03:02

... uh, yeah, you know, I, I see, I see Rust in your code base. I see Python. I see, you know, you're m-experimenting-

Elie Bakouch1:03:06

Yeah

Swyx1:03:06

... different optimizers. Like, uh, you know, I, I'm not like the perfect ICP for them, but like you are, and so I'm... be curious to, to hear like, uh, you know, someone who doesn't work for them-

Elie Bakouch1:03:15

Yeah

Swyx1:03:16

... like what's, what's your opinion, you know? Um, cool.

Elie Bakouch1:03:18

And I never tried, but, uh, but I will. I'll take a look.

Swyx1:03:20

It's hard to try things. Yeah, you have a thing that works. Like it's... Yeah. Cool. Well, thanks so much for your time.

Elie Bakouch1:03:25

Yeah, thanks a lot for the invitation, and see you in Paris, uh-

Swyx1:03:29

See you in Paris

Elie Bakouch1:03:30

... sure, sure, yeah. Yeah.

Swyx1:03:31

Yeah. Awesome.