Towards a Comprehensive Scaling Law of Mixture-of-Experts

Guoliang Zhao, Yuhan Fu, Shuaipeng Li, Xingwu Sun, Ruobing Xie, An Wang, Weidong Han, Zhen Yang, Weixuan Sun, Yudong Zhang, Cheng-zhong Xu, Di Wang, Jie Jiang · OpenReview

Abstract

Mixture-of-Experts (MoE) models have become the consensus approach for enabling parameter-efficient scaling and cost-effective deployment in large language models. However, existing scaling laws for dense models are inapplicable to MoE models due to the multiplicity of influencing factors and the non-monotonic nature of their performance impacts. In this work, we perform a systematic decomposition of MoE settings, identifying five key factors: data size ($D$), total model size ($N$), activated model size ($N_a$), number of active experts ($G$), and the ratio of shared experts ($S$). Through 446 controlled experiments, we construct a comprehensive joint MoE scaling law. Our results demonstrate that optimal settings for $G$ and $S$ are largely independent of architecture and data size, while the optimal activation ratio $N_a/N$ becomes sparser as $N$ scales.

Introduction

In the development of Large Language Models (LLMs), scaling laws—such as the Chinchilla law—serve as a critical roadmap, predicting the data and parameters required to achieve specific performance targets. While these laws are well-defined for dense models, where every parameter is utilized for every token, they fail to capture the nuances of Mixture-of-Experts (MoE) architectures. MoE models are sparse by design, possessing a massive total parameter count ($N$) but only activating a small fraction ($N_a$) per token. This structural complexity necessitates a new, fine-grained scaling law that accounts for expert routing and shared knowledge components.

The Five Factors of MoE Scaling

To build a robust mathematical framework, we decomposed MoE performance into five primary variables:

  1. $D$: Training data size (total tokens).
  2. $N$: Total model size (all parameters).
  3. $N_a$: Activated model size (parameters used per token).
  4. $G$: Number of activated experts per layer.
  5. $S$: Ratio of shared experts to total activated experts.

Scaling with Data and Size

Our experiments confirm that MoE models still obey fundamental power-law relationships regarding total model size and data volume. When holding structural variables constant, the validation loss decreases linearly in log-log space as $N$ and $D$ increase. This suggests that the foundational principles of scaling remain intact, even as the architecture becomes more complex.

Log-log linear relationships for total model size (N) and data size (D) in MoE models.

Non-Monotonicity and the "Hook" Effect

A key discovery of this research is that MoE performance is non-monotonic. Unlike dense models, where more parameters typically lead to lower loss, MoE models exhibit a "hook-like" behavior regarding activated parameters ($N_a$) and the number of experts ($G$). If $N_a$ is increased too much without a corresponding increase in total size $N$, the individual experts become too small, leading to structural distortion and performance degradation. This indicates a "sweet spot" for activation that researchers must target for maximum efficiency.

Validation loss exhibits a non-monotonic 'hook' behavior as the activated parameter size (Na) increases across the entire range.

Key Insights and Optimal Configurations

By analyzing the results of 446 controlled experiments, we derived several universal constants for MoE design:

  • Optimal Active Experts ($G$): The theoretically optimal number of activated experts is approximately 7. This finding aligns with the design choices of state-of-the-art models like DeepSeek-V3 and Qwen3, which utilize 8 or 9 experts.
  • Optimal Shared Expert Ratio ($S$): Shared experts are essential for capturing universal knowledge. The data suggests an optimal ratio of roughly 0.31 shared experts relative to total activated experts.
  • Sparsity Trends: As the total model size ($N$) grows, the optimal architecture should become increasingly sparse. Specifically, the ratio $N_a/N$ should decrease as the model scales up.
  • Predictive Accuracy: Our joint scaling law achieved an average validation loss error of only 0.0059, a significant improvement over previous MoE scaling attempts which typically saw errors between 0.015 and 0.017.

Efficiency-Aware Scaling

While theoretical optima provide a mathematical target, practical deployment often requires balancing performance with compute costs. For a massive 671B parameter model, while the theoretical optimal activation ratio is 22%, we find that a "practical efficiency-aware" range of 5% to 9% captures the majority of performance gains with significantly lower computational overhead.

Conclusion

This comprehensive MoE scaling law provides a precise GPS for designing the next generation of sparse LLMs. By identifying the universal constants for expert count and shared ratios, and characterizing the non-monotonic nature of activation, we offer a framework that facilitates more predictable and cost-effective model training. Future work will involve extending these laws to frontier-scale models (100B+) and exploring more diverse routing strategies.

Summary updated

BibTeX
@misc{zhao2025towards,
  author = {Guoliang Zhao and Yuhan Fu and Shuaipeng Li and Xingwu Sun and Ruobing Xie and An Wang and Weidong Han and Zhen Yang and Weixuan Sun and Yudong Zhang and Cheng-zhong Xu and Di Wang and Jie Jiang},
  title = {{Towards a Comprehensive Scaling Law of Mixture-of-Experts}},
  year = {2025},
  eprint = {2509.23678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.23678},
}
Figure