TL;DR
While dense scaling laws like Chinchilla guide compute-optimal training for standard Transformers, they break down for Mixture-of-Experts (MoE) models where parameter counts, routing choices, and sparse activation interact non-linearly. By running 450 controlled pre-training runs, this paper introduces a unified, 5-factor MoE scaling law that models total size, active size, data volume, active expert count, and shared expert ratio. Crucially, the authors derive universal optimal configurations—showing that optimal expert granularity and shared expert ratios are mathematically decoupled from model and data size.
What Problem Does This Paper Address?
Mixture-of-Experts (MoE) architectures—which route tokens dynamically to a sparse subset of feed-forward networks (FFNs)—have become the standard design for large models like DeepSeek-V3, Qwen-MoE, and Kimi-K2. However, predicting how MoE models scale remains elusive:
- Multiplicity of Factors: Performance depends not only on total parameters ($N$) and data tokens ($D$), but also on activated parameters ($N_a$), number of active experts ($G$), and shared expert ratios ($S$).
- Coupling & Non-monotonicity: Expanding activated parameter size ($N_a$) or active expert count ($G$) does not monotonically decrease loss. Increasing $N_a$ while fixing total size $N$ forces individual experts to balloon and reduces total expert count, degrading combinatorial routing benefits.
- Incomplete Prior Laws: Previous MoE scaling studies focused on isolated components (e.g., just expert granularity or sparsity fractions) and failed to model structural interactions like shared experts.
Methods
The authors decompose MoE training into five parameters: data size $D$, total model size $N$, activated model size $N_a$, number of activated experts $G$ ($nk$ routed + $ns$ shared), and the ratio of shared experts $S = ns / G$.
Through 450 systematically controlled pre-training experiments (isolating each variable using precise parameter-scaling constraints):
- Total parameters ($N$) and tokens ($D$) were found to follow classical power-law dependencies.
- Activated size ($N_a$), active experts ($G$), and shared expert ratio ($S$) exhibit non-monotonic "hook" or quadratic behaviors.
- The authors synthesized these dynamics into a unified joint scaling law:
$$\mathcal{L}(N, D, N_a, G, S) = \left(eG + \frac{f}{G} + mS^2 + nS\right) \left(\frac{1}{N^\alpha} + \frac{k}{N_a^\alpha} + h\frac{N_a}{N}\right) + \frac{a}{N^\alpha} + \frac{b}{D^\beta} + \frac{c}{N_a^\alpha} + \epsilon$$
Using this formula, they analytically derived both theoretical optima (via first and second derivatives) and a practical "efficiency-aware" Pareto frontier.
Datasets
All empirical runs were pre-trained on subsets of the Dolma V1.7 open-source pre-training corpus (3 trillion token pool), varying training length from 10B to 50B tokens for fitting runs, and extending up to 100B tokens for validation runs. No new benchmarks were introduced.
Key Insights and Ideas
- Universal Active Expert Count ($G \approx 7$): Setting $\frac{\partial \mathcal{L}}{\partial G} = 0$ yields $G_{opt} = \sqrt{f/e} \approx 6.78$. Surprisingly, this optimal value is mathematically independent of $N$, $N_a$, and $D$. A practical range of $4 \le G \le 11$ produces near-identical loss (within $\le 0.001$), matching modern open weights designs (e.g., DeepSeek-V3 and Qwen use 8 or 9 active experts).
- Shared Experts are Essential ($S \approx 31\%$): Models that isolate shared knowledge into dedicated, constantly activated experts consistently beat architectures without them. The theoretical optimal ratio is $S_{opt} = -n / (2m) \approx 0.31$, with a robust operating window between $13\%$ and $31\%$ (e.g., 1–2 shared experts when $G=7$).
- Sparsity Must Increase with Scale: The optimal ratio of activated-to-total parameters $\left(\frac{N_a}{N}\right)$ shrinks monotonically as total parameters $N$ increase. Bigger models must be sparser.
- Theory vs. Efficiency in Sparsity: While purely loss-optimal models prefer $N_a / N$ around $20\% \text{–} 43\%$, diminishing returns set in early. The authors' practical efficiency-aware threshold ($\Delta \text{Loss} \le 0.005$) recommends an active ratio of $5\% \text{–} 9\%$, closely matching frontier models like DeepSeek-V3 ($5.5\%$) and Kimi-K2 ($3.2\%$).
Key Results
- Superior Fit Accuracy: On held-out validation settings, the joint scaling law achieved an average loss error of $0.0060$, significantly outperforming prior formulations like Krajewski et al. ($0.0193$) and Abnar et al. ($0.0170$).
- Extrapolation to Larger Scales: The law accurately predicted losses for MoE models up to 9B–30B total parameters, with routing setups spanning up to 256 total experts, 40 active experts, and 100B trained tokens.
Limitations and Future Work
- Architecture Scope: Validated specifically on standard Transformer MoE blocks using Top-$K$ routing. Alternative mechanisms (e.g., Expert Choice, probabilistic routing) were not evaluated.
- Non-FFN Scaling: The scaling law currently isolates the MoE feed-forward layers and ignores structural variations in attention layers (e.g., Multi-Head Latent Attention).
- Extreme Scales: Due to compute budgets, the primary parameter fit was established on models up to 3.4B (validated up to 30B), leaving direct fitting on 100B+ active-parameter systems to future work.
Summary updated