1 00:00:01,000 --> 00:00:09,300 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:09,300 --> 00:00:38,075 [Hal Turing] Today we're covering Scaling Laws for Fine-Grained Mixture of Experts. The first author is Jakub Krajewski, with Jan Ludziejewski, Sebastian Jaszczur and colleagues. It comes from the University of Warsaw and IDEAS NCBR, with co-authors from IPPT PAN, TradeLink and Nomagic. We're reading the early arXiv version from February 2024. The claim is that mixture-of-experts models beat dense Transformers at every compute budget, and by a margin that grows with scale. 3 00:00:38,075 --> 00:01:15,474 [Dr. Ada Shannon] That claim contradicts earlier work. Artetxe and colleagues at Meta, in their 2022 paper on large-scale language modeling with mixtures of experts, found the MoE advantage shrinking as models grew. Clark and colleagues at DeepMind, in Unified Scaling Laws for Routed Language Models, also from 2022, saw returns diminish too. Krajewski's group says both studies hid two assumptions: a fixed training duration and a fixed expert size. Their question is whether MoE follows a clean scaling law once you add expert size as a third axis next to model size and tokens. And if it does, is the standard expert size almost never the best choice? 4 00:01:15,474 --> 00:01:21,500 [Hal Turing] Let's build up to that. What's in a dense Transformer block that MoE changes? 5 00:01:21,500 --> 00:01:42,075 [Dr. Ada Shannon] The feed-forward layer. After attention, each token goes through two big matrices, usually with a hidden width of four times the model dimension. That layer holds most of the block's parameters and most of its FLOPs. MoE replaces it with many parallel feed-forward networks, called experts, plus a small router. The router sends each token to only a few experts. 6 00:01:42,075 --> 00:01:48,250 [Hal Turing] So it's a hospital. You don't see every doctor, you get routed to a couple of specialists. 7 00:01:48,250 --> 00:02:03,850 [Dr. Ada Shannon] Roughly. The limit is that these experts aren't designed to be domain specialists the way doctors are. They end up specializing in whatever training finds useful. The payoff is that total parameters grow while per-token compute stays about flat. 8 00:02:03,850 --> 00:02:07,275 [Hal Turing] Which makes "model size" ambiguous. 9 00:02:07,275 --> 00:02:36,250 [Dr. Ada Shannon] Yes, so the paper separates two numbers. Active parameters are the non-embedding parameters one token actually uses, excluding the router. Total parameters count every expert. They write a model as E times N-active. A model called 64 by 3M has 3 million active parameters and 64 times the feed-forward capacity, about 129 million total non-embedding parameters. Here E is the expansion rate, the total expert parameters relative to the dense feed-forward layer. 10 00:02:36,250 --> 00:02:39,825 [Hal Turing] Now the scaling-law part. Where does that start? 11 00:02:39,825 --> 00:03:02,575 [Dr. Ada Shannon] With Kaplan and colleagues at OpenAI in 2020, who showed that loss falls as a smooth power law in parameters, data and compute. Then Hoffmann and colleagues at DeepMind, the Chinchilla paper in 2022, ran over four hundred models. They found that parameters and tokens should grow together, roughly twenty tokens per parameter, and that many big models were undertrained. Their form is loss equals c plus a over N to the alpha plus b over D to the beta. 12 00:03:02,575 --> 00:03:04,975 [Hal Turing] Unpack the three terms. 13 00:03:04,975 --> 00:03:23,825 [Dr. Ada Shannon] The c is irreducible loss, the entropy of the data. The N term is the penalty for a small model. The D term is the penalty for too little data. Compute-optimal means fixing a FLOP budget and picking the model size and token count that minimize loss. For this paper, granularity joins that choice. 14 00:03:23,825 --> 00:03:26,550 [Hal Turing] And where does Clark's law fall short? 15 00:03:26,550 --> 00:03:44,200 [Dr. Ada Shannon] Clark fit routed models at a fixed 130 billion tokens. If the best token count changes with model size, which Chinchilla says it does, then a fixed budget quietly undertrains the big models. The authors argue that this alone could produce the apparent reversal at scale. 16 00:03:44,200 --> 00:03:47,625 [Hal Turing] Fine. Now granularity. What's the knob? 17 00:03:47,625 --> 00:04:09,225 [Dr. Ada Shannon] Granularity G is the dense feed-forward width divided by the expert width. At G equals one, each expert is as large as the dense layer, which is the standard layout. At G equals four, each expert is a quarter the size, there are four times as many, and each token goes to four times as many. Active parameters and FLOPs stay the same, but the token has far more possible combinations of experts. 18 00:04:09,225 --> 00:04:11,800 [Hal Turing] Give me numbers on that. 19 00:04:11,800 --> 00:04:25,875 [Dr. Ada Shannon] Top-2 of 8 experts gives 28 combinations. Top-8 of 32 gives about ten and a half million. The number of experts is G times E. The main fit holds E at 64, following Clark. 20 00:04:25,875 --> 00:04:29,375 [Hal Turing] So why was G equals one the default? 21 00:04:29,375 --> 00:04:43,925 [Dr. Ada Shannon] Convention. Someone swapped the dense layer for copies of itself, and the width came along. It was never derived as optimal. The paper's argument is that this inherited choice is a free design variable nobody had scaled. 22 00:04:43,925 --> 00:04:46,625 [Hal Turing] That's the pitch. What's the catch? 23 00:04:46,625 --> 00:05:06,400 [Dr. Ada Shannon] The evidence. The law is fit on small models, 3 million to 85 million active parameters. The headline claims reach a trillion active parameters and compute budgets many orders of magnitude beyond the runs. Whether a seven-parameter fit can bridge that gap is the question to keep in mind as we go into how they built it. 24 00:05:06,400 --> 00:05:11,250 [Hal Turing] So the claim is that a clean law exists. How did they get there? 25 00:05:11,250 --> 00:05:44,900 [Dr. Ada Shannon] In steps, and the order matters. First the setup. Over a hundred decoder-only Transformers trained on C4, with the GPT-2 tokenizer, half-million-token batches, AdamW and a cosine schedule. Expansion rate fixed at 64, granularity from 1 to 16, active size from 3 million to 85 million parameters, and 16 to 130 billion tokens. The grid is ragged. G=16 only goes up to the 49-million model, and the 85-million model is only run at G of 1 to 4, at 33 billion tokens. 26 00:05:44,900 --> 00:05:48,526 [Hal Turing] And the routing? Every token picks its experts? 27 00:05:48,526 --> 00:06:08,701 [Dr. Ada Shannon] Not here. They use Expert Choice routing, which flips it. Each expert picks its top tokens from a group, in their case 256 tokens. Every expert gets the same load, so there's no auxiliary balancing loss. They also add an extra layer norm, which they say is crucial once G is above 1. Every result is conditional on this router. 28 00:06:08,701 --> 00:06:11,876 [Hal Turing] Then walk me through the derivation. 29 00:06:11,876 --> 00:06:50,551 [Dr. Ada Shannon] Step one: at fixed model size and token count, the log of loss minus a constant is roughly linear in log G. That gives a power law in G plus an offset. Step two: at fixed G, loss follows the Chinchilla form in N and D. Step three: those two have to agree, so they must describe the same surface. Step four: they argue the constant c, the entropy floor, can't depend on architecture. Step five: they argue there's no interaction between G and D, because in Figure 3c the gain from longer training looks nearly the same across granularities. Step six: they assume the model-size exponent alpha doesn't depend on G, so only its coefficient gets a G term. 30 00:06:50,551 --> 00:06:55,151 [Hal Turing] Which of those did the data test, and which did they just assume? 31 00:06:55,151 --> 00:07:10,901 [Dr. Ada Shannon] Steps one and two are observed on the grid. Step five is supported by a plot at small scale. Steps four and six are partly argument. Alpha being independent of G follows from the polynomial form they chose. The data doesn't force it. 32 00:07:10,901 --> 00:07:12,951 [Hal Turing] What's the final shape? 33 00:07:12,951 --> 00:07:31,577 [Dr. Ada Shannon] Loss equals c plus a numerator over N to the alpha, plus b over D to the beta, where the numerator is a G-dependent term, g over G to the gamma, plus a. They keep the plain a because without it, infinite granularity at small N would hit the entropy floor, which the authors consider implausible. 34 00:07:31,577 --> 00:07:33,727 [Hal Turing] How well does it fit? 35 00:07:33,727 --> 00:07:55,702 [Dr. Ada Shannon] The typical miss is about 0.015 in loss, on runs whose loss sits roughly between 2.8 and 3.8. Then they withhold the best twenty percent of runs and refit. The miss rises only to about 0.019 and the coefficients barely move. That's a decent test, but those held-out runs are the lowest-loss ones, not the largest. And they report only RMSE, no uncertainty on the coefficients. 36 00:07:55,702 --> 00:07:57,852 [Hal Turing] What do the exponents say? 37 00:07:57,852 --> 00:08:18,827 [Dr. Ada Shannon] MoE beta is 0.147 against 0.127 for dense, so it gains more from extra tokens. MoE alpha is 0.115 against 0.126, so it gains less per total parameter, which makes sense because only a subset is active. So you can't compare at equal total parameters. You have to compare at equal compute. 38 00:08:18,827 --> 00:08:25,477 [Hal Turing] And compute isn't just six times parameters times tokens, since routing costs something. 39 00:08:25,477 --> 00:08:43,877 [Dr. Ada Shannon] Right. Their FLOP formula adds a routing term that grows linearly in G, with a routing constant of 14 against 6 for the feed-forward pass. So higher granularity isn't free. They assume model width scales with depth, then solve the constrained optimization in one dimension with Brent's method. 40 00:08:43,877 --> 00:08:45,852 [Hal Turing] So what comes out? 41 00:08:45,852 --> 00:09:15,802 [Dr. Ada Shannon] The headline. At ten to the twenty FLOPs, a compute-optimal MoE matches a dense model given about twenty times more compute. Beyond ten to the twenty-five, they say over forty times. Those multipliers are read off a plot, not tabulated. Optimal G climbs with budget, from 8 up to 64. In Table 2, a 64-by-1-billion model wants G=16. The 64-by-1-trillion row, where the trillion is active parameters, wants G=64 and about 8 trillion tokens. 42 00:09:15,802 --> 00:09:19,352 [Hal Turing] So how does that square with Clark's reversal? 43 00:09:19,352 --> 00:09:38,702 [Dr. Ada Shannon] Their account is that Clark fixed the data at 130 billion tokens, so large models were undertrained. Let training length float and MoE keeps its edge. That's a plausible reading. But only the twenty-times figure sits anywhere near measured territory. The forty-times figure is the fitted model's prediction. 44 00:09:38,702 --> 00:09:41,728 [Hal Turing] Does more granularity ever hurt? 45 00:09:41,728 --> 00:10:02,878 [Dr. Ada Shannon] Yes, and it's the useful counterexample. At 64 by 7 million with 66 billion tokens, G=8 trains best on A100 wall-clock. At G=16 routing cost eats the gain. And in Section 7, G=64 with a model width of 256 actually degraded, when routing parameters outgrow the active expert parameters. 46 00:10:02,878 --> 00:10:08,653 [Hal Turing] That's a ceiling, and the extrapolated optimum is G=64. 47 00:10:08,653 --> 00:10:30,378 [Dr. Ada Shannon] We'll come back to that. First, their uncertainty claim. They resample eighty percent of the points a hundred times, refit, and report the tenth-to-ninetieth percentile spread of optimal tokens and G. For 64 by 1 billion, tokens span roughly 21 to 41 billion, G is 16 at both ends. For the trillion-parameter row, tokens span 5.3 to 16.9 trillion, G is 64 at both ends. 48 00:10:30,378 --> 00:10:33,153 [Hal Turing] And the robustness check on E? 49 00:10:33,153 --> 00:10:55,253 [Dr. Ada Shannon] Appendix D redoes the fit with E=16. The coefficients shift a lot: gamma goes from 0.58 to 0.986, the data exponent beta to 0.169, and g to 1.18. The intervals widen. The trillion row now allows G from 32 to 128 and tokens from 3.6 to 28.2 trillion. The authors attribute it to fewer, shorter runs. 50 00:10:55,253 --> 00:11:12,628 [Hal Turing] That E=16 result bothers me more than the paper lets on. If the granularity exponent jumps from 0.58 to nearly 1 when you change the expansion rate, how much should I trust the G=64 rows at E=64? 51 00:11:12,628 --> 00:11:32,803 [Dr. Ada Shannon] Less than the tables suggest. Within the tested range, the paper shows that granularity above one helps at equal active parameters, and a power law in G fits well. The 40x multiplier, the 64x1T configuration and an optimal G of 64 are a different kind of claim. They come from solving the fitted law, not from any run. 52 00:11:32,803 --> 00:11:37,053 [Hal Turing] How far is that extrapolation, in plain numbers? 53 00:11:37,053 --> 00:11:59,503 [Dr. Ada Shannon] The paper doesn't tabulate trained-run FLOPs, so this is our own back-of-envelope. Take six times active parameters times tokens. The 85-million-parameter runs at 33 billion tokens come to about 1.7e19 FLOPs. The headline row is near 5e25. That's roughly six orders of magnitude. And the largest G ever trained was 16, only on small models, while the headline wants 64. 54 00:11:59,503 --> 00:12:08,003 [Hal Turing] But the bootstrap says G is 64 to 64 for the 300B and 1T rows. That looks like certainty. 55 00:12:08,003 --> 00:12:40,078 [Dr. Ada Shannon] It's certainty about the estimator, not about the model. Resampling 80 percent of the same small runs measures how much the fit moves when you drop some points. It can't detect that the functional form is wrong at a scale none of the points reach. And the optimal G is pinned by a power law in G against a linear routing cost, so it can only move with gamma and the routing constant. The token intervals stay wide, over 3x at the trillion row, and the E=16 fit reaches G=128. That's the better picture of the uncertainty. 56 00:12:40,078 --> 00:12:42,203 [Hal Turing] So what would settle it? 57 00:12:42,203 --> 00:12:53,928 [Dr. Ada Shannon] Held-out runs at larger size and larger G. Or a bootstrap over functional forms, not just over data points. Their 20 percent holdout doesn't withhold the largest models. 58 00:12:53,928 --> 00:13:03,278 [Hal Turing] The law has no model-width term, yet their own discussion shows G=64 degrading at width 256. 59 00:13:03,278 --> 00:13:23,153 [Dr. Ada Shannon] Right. G enters only as g over G to the gamma, added to the model-size coefficient, with no interaction with tokens. That last assumption rests on one plot at small scale. If the benefit depends on width or tokens per expert, the optimum moves, and the law can't see that. So I'd call the G of 64 a hypothesis. 60 00:13:23,153 --> 00:13:26,153 [Hal Turing] And the cost side? FLOPs only? 61 00:13:26,153 --> 00:13:52,903 [Dr. Ada Shannon] FLOPs, with a hand-set routing constant of 14. The paper says plausible values run from 6 to 20 and that the conclusions are robust to that. It shows no sensitivity table. I'd accept that for the general point that G above one helps. For the specific optimal G or the multipliers, nothing is shown. And the wall-clock plot at one small model already has G=16 losing to G=8, which suggests the FLOP model is optimistic even at small scale. It also ignores memory and all-to-all communication. 62 00:13:52,903 --> 00:13:58,503 [Hal Turing] Then there's Expert Choice. Most deployed models use token-choice top-k. 63 00:13:58,503 --> 00:14:33,053 [Dr. Ada Shannon] Yes. Expert Choice, from Zhou and colleagues at Google in 2022, balances load by construction, which removes a real source of trouble. The cost is the awkward fit with autoregressive decoding. DeepSeekMoE, by Damai Dai and colleagues at DeepSeek-AI in 2024, is the closest outside test. It came out concurrently, with fine-grained experts plus shared experts and token-choice routing at larger scale. So it's a real check on whether granularity gains survive outside Expert Choice and small-scale C4. I can't tell you from these sources how shared experts or token choice shift the optimal G. 64 00:14:33,053 --> 00:14:36,978 [Hal Turing] And a Mixtral-style layout, with eight big experts? 65 00:14:36,978 --> 00:14:55,228 [Dr. Ada Shannon] Not tested here. The claim that G=1 is almost never optimal compares G=1 against finer experts at E=64. Mixtral, from Jiang and colleagues at Mistral in 2024, uses far fewer experts. The E=16 study hints the answer depends on E, but it's a thin check. 66 00:14:55,228 --> 00:15:01,303 [Hal Turing] Anything that tackles memory? Sixty-four times the parameters is a lot to hold. 67 00:15:01,303 --> 00:15:25,003 [Dr. Ada Shannon] The same group's Joint MoE Scaling Laws paper, by Ludziejewski, Pióro, Krajewski and others in 2025, adds memory constraints. The ICML 2024 version and later work also treat expansion rate jointly. I can't cite their numbers, so check how the headline multipliers moved before using them. Also remember the loss here is smoothed training loss on C4, with no downstream evaluation, so a compute saving in loss isn't yet a saving in task accuracy. 68 00:15:25,003 --> 00:15:28,078 [Hal Turing] So what does a practitioner do with this? 69 00:15:28,078 --> 00:15:46,028 [Dr. Ada Shannon] Use it as a method and a direction. Fit size, tokens and granularity jointly. Charge routing cost explicitly. Don't default to experts the size of the feed-forward layer. Then run your own pilots, on your own router and hardware, before trusting a G of 32 to 64. 70 00:15:46,028 --> 00:15:58,103 [Hal Turing] The paper names its own gaps too: expert initialization and router changes for very high G, a unified law over size, tokens, G and E, and costs beyond FLOPs. 71 00:15:58,103 --> 00:16:05,403 [Dr. Ada Shannon] Yes, and serving cost belongs on that list. A training-FLOP optimum says nothing about inference cost. 72 00:16:05,403 --> 00:16:22,728 [Hal Turing] So the takeaway is this. Within small-scale, FLOP-matched runs, finer experts beat the default, and the fitted law is a good way to see why. The giant-scale numbers are what that law predicts, not what anyone measured. Thanks for listening, everyone. See you next time.