Learning Mixtures of Experts with EM

Quentin Fruytier, Aryan Mokhtari, Sujay Sanghavi · DOI

Abstract

Mixture of Experts (MoE) models have become a fundamental architecture for scaling deep learning models through conditional computation. While Gradient Descent (GD) is the standard optimization tool, the Expectation-Maximization (EM) algorithm offers a classical alternative for latent variable models. This paper establishes a formal mathematical equivalence between EM and Mirror Descent (MD) for MoE models. By demonstrating that EM is a projected MD step with a unit step size and a Kullback-Leibler (KL) divergence mirror map, we provide new convergence guarantees and empirical evidence that EM outperforms GD in both convergence speed and final accuracy.

Introduction

Mixture of Experts (MoE) models scale model capacity without a proportional increase in computational cost by partitioning the input space among specialized "expert" sub-networks. A "router" or gating network determines which expert processes a given input, effectively treating the expert assignment as a latent variable. Despite their success, training MoE models remains challenging due to the highly non-convex nature of the objective function.

Traditionally, these models are trained using Gradient Descent (GD). However, the Expectation-Maximization (EM) algorithm is specifically designed for models with hidden variables. While EM's properties are well-understood for simple generative models like Gaussian Mixtures, its behavior in the conditional setting of MoEs has lacked rigorous theoretical grounding. This research bridges that gap by framing EM within the context of modern optimization theory.

The Equivalence: EM as Mirror Descent

The core contribution of this work is the proof that for MoE models where the conditional distribution belongs to an exponential family, the EM update is mathematically equivalent to a Projected Mirror Descent step.

In this framework:

  • The Mirror Map: Unlike Gradient Descent, which moves through parameter space based on Euclidean distance, EM utilizes the geometry of the probability simplex. The "distance" regularizing the update is the Kullback-Leibler (KL) Divergence.
  • Step Size: EM effectively performs a Mirror Descent step with a fixed unit step size ($\eta = 1$). This explains why EM often converges faster than GD, which requires carefully tuned, often smaller, learning rates.
  • Projection: For general MoE architectures, an "expectation moment projection" is required to ensure parameters remain within the feasible set. However, for specific cases like Symmetric Mixtures of 2-Experts (Linear or Logistic), this projection is unnecessary, making EM a pure Mirror Descent algorithm.

Theoretical Insights

By viewing EM through the lens of Mirror Descent, we gain several key insights into its performance:

  1. Statistical Geometry: EM's reliance on KL Divergence allows it to respect the underlying statistical structure of the model. This geometry is often better suited for latent variable problems than the flat Euclidean geometry of standard GD.
  2. Hyperparameter-Free Optimization: Because the unit step size is inherent to the EM formulation, it eliminates the need for the tedious learning rate tuning that characterizes GD-based training.
  3. Convergence and SNR: The speed of EM's convergence is intrinsically linked to the Signal-to-Noise Ratio (SNR) and the Missing Information Matrix (MIM). In scenarios where experts are well-separated (high SNR), EM exhibits rapid linear convergence to the ground-truth parameters.

Empirical Results

The researchers validated these theoretical findings across synthetic and real-world datasets:

  • Synthetic Recovery: In 10-dimensional linear expert mixtures, EM required significantly fewer iterations than GD to recover ground-truth parameters, demonstrating superior efficiency in high-SNR regimes.
  • Modified Fashion MNIST: To simulate a mixture problem, the authors used a dataset where images were randomly inverted. While a single logistic expert failed (10% accuracy), a 2-expert MoE trained with EM achieved 78.5% accuracy, significantly outperforming the 62.4% achieved by Gradient Descent after 100 iterations.
  • Complex Architectures: Appendix results using Grayscale CIFAR-10 with 5-component MoEs further supported the robustness of the EM approach in more complex settings.

Discussion and Limitations

While the theoretical bridge to Mirror Descent provides a powerful new way to analyze EM, several challenges remain for large-scale implementation:

  • Computational Overhead: Each "M-step" in EM requires solving a minimization problem. Although this can be approximated with inner-loop gradient steps, the per-iteration cost is higher than a standard SGD step.
  • Stochastic Scaling: The "unit step size" of EM does not naturally align with standard mini-batch scaling laws. Developing a truly stochastic version of EM-as-Mirror-Descent is a critical path for future work.
  • Sparse MoE: Modern Large Language Models utilize Sparse MoE with thousands of experts. While the authors provide a theoretical formulation for Deep and Sparse MoE, empirical validation at the scale of trillion-parameter models is still required.

Conclusion

This work provides the first non-asymptotic convergence rates for EM in general MoE settings by identifying the conditions of local average-convexity. By proving that EM is secretly Mirror Descent, the authors not only unify two disparate fields of optimization but also provide a principled path forward for designing more efficient training algorithms for the next generation of MoE-based models.

Summary updated

BibTeX
@inproceedings{fruytier2025learning,
  author = {Quentin Fruytier and Aryan Mokhtari and Sujay Sanghavi},
  title = {{Learning Mixtures of Experts with EM}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=wjZcCbTvrU},
}
Figure