On Linear Mode Connectivity of Mixture-of-Experts Architectures

Viet-Hoang Tran, Van-Hoan Trinh, Khanh Vinh Bui, Tan Minh Nguyen

Introduction

In the landscape of deep learning, the phenomenon of Linear Mode Connectivity (LMC) has emerged as a powerful tool for understanding the geometry of loss landscapes. LMC suggests that different models trained from different random initializations can be connected by a straight, low-loss path in parameter space, provided their symmetries—such as neuron permutations—are correctly aligned. While LMC has been extensively studied in standard dense architectures, its application to Mixture-of-Experts (MoE) models remains a frontier.

MoE architectures, which power state-of-the-art models like Mixtral and GPT-4, utilize a gating mechanism to route inputs to specific sub-networks or "experts." This modularity introduces complex symmetries that go beyond simple neuron shuffling. This paper investigates whether MoE models are part of the same solution basin and proposes a framework to uncover their hidden connectivity.

The Symmetry Challenge in MoE

Standard neural networks are invariant to the permutation of neurons within a layer. MoEs, however, possess additional layers of invariance. Specifically, a model's output remains unchanged if one swaps the positions of two entire experts or shifts the weights of the gating mechanism in specific ways.

Without accounting for these symmetries, averaging the weights of two independently trained MoE models results in a "loss barrier"—a significant spike in error along the linear path between them. To find a straight path of high performance, one must first align the models in a way that accounts for these unique MoE group actions.

Methodology: A Two-Stage Alignment Framework

The authors propose a two-stage matching algorithm designed to find the "winning permutation" that connects two MoE models:

  1. Expert Alignment: The algorithm first pairs experts from Model A with experts from Model B. This is framed as a Linear Assignment Problem and solved using the Hungarian algorithm. The researchers explored two primary matching criteria: matching based on the weights of the gating mechanism (how the model chooses to route data) and matching based on the internal weights of the experts themselves.
  2. Internal Weight Matching: Once experts are paired, the algorithm performs a second pass to align the individual neurons within each expert sub-network, utilizing existing weight-matching techniques developed for dense models.

Mathematically, the paper proves that for both dense and sparse MoEs, the functional equivalence is maintained under expert permutations and gating translations. Interestingly, empirical tests revealed that while gating translation is a theoretical symmetry, expert permutation is the dominant factor required to achieve LMC.

Experimental Results and Insights

The researchers validated their framework across diverse modalities, including vision (MNIST, CIFAR, ImageNet-1k) and language (WikiText103, One Billion Word dataset).

Near-Zero Loss Barriers

By applying the two-stage alignment, the authors successfully reduced the loss barrier to near zero across nearly all tested configurations. This suggests that the "Convexity Conjecture" holds for MoEs: once symmetries are resolved, the solutions found by Stochastic Gradient Descent (SGD) appear to reside within a nearly convex region of the loss landscape.

Gating vs. Expert Weights

A surprising finding was the effectiveness of gating-based alignment. Aligning experts based solely on how the gate perceives them was often as effective as looking at the experts' internal parameters. This implies that the gating mechanism captures a fundamental signature of the expert's role in the model.

Depth and Sensitivity

The study also explored the impact of MoE placement within Transformer architectures. The authors found that MoE layers placed early in the network (near the input) are significantly more sensitive to initialization than those placed in later layers. This suggests that early-layer experts perform foundational feature extraction that is harder to align across different training runs.

Architectural Robustness

The alignment method proved robust across various MoE flavors, including Sparse MoEs (SMoE) and the DeepSeekMoE architecture, which utilizes a combination of shared and routed experts. In large-scale language tasks, the proposed method consistently outperformed baseline approaches that ignore expert ordering.

Limitations and Future Directions

While the paper provides a robust framework for MoE connectivity, several areas remain for future exploration:

  • Top-1 Gating: The current analysis excludes MoEs that activate only a single expert ($k=1$), as this introduces a scaling symmetry that complicates the mathematical alignment.
  • Theoretical Bounds: The study is primarily empirical; establishing a theoretical upper bound on the loss barrier for MoEs remains an open challenge.
  • Expert Interactions: Future work could investigate the deeper interactions between gating symmetries and the internal symmetries of the experts to further refine the alignment process.

Conclusion

This research demonstrates that despite their complexity, Mixture-of-Experts models follow the same fundamental geometric principles as simpler architectures. By accounting for expert-level symmetries, we can see that these massive, modular models are not isolated islands but are part of a continuous, high-performing solution basin in the weight space.

Summary updated

BibTeX
@inproceedings{tran2025linear,
  author = {Viet-Hoang Tran and Van-Hoan Trinh and Khanh Vinh Bui and Tan Minh Nguyen},
  title = {{On Linear Mode Connectivity of Mixture-of-Experts Architectures}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=RF3miSqdXa},
}
Figure