A Closer Look into Mixture-of-Experts in Large Language Models

Ka Man Lo, Zeyu Huang, Zihan Qiu, Zili Wang, Jie Fu

TL;DR

While Mixture-of-Experts (MoE) architectures have become the de facto standard for scaling Large Language Models efficiently, their internal mechanics have largely remained a black box. This paper opens the hood on four prominent MoE models (Mixtral 8x7B, Mixtral 8x22B, DeepSeekMoE, and Grok-1), revealing that individual neurons act as fine-grained experts, routers naturally favor experts with larger output norms, and expert diversity increases with layer depth—except for the very last layer, which acts as a homogeneous outlier.

What Problem Does This Paper Address?

MoE models achieve impressive performance by sparsely activating only a subset of parameters (experts) for each incoming token, keeping computational costs manageable while dramatically increasing model capacity. However, a fundamental question remains: does the MoE framework truly create a modular combination of specialized, heterogeneous experts, or is it merely an ensemble of homogeneous units doing similar work?

Understanding whether and how knowledge is distinctively distributed across experts is crucial for improving router design, expert allocation, and overall efficiency. The authors tackle this gap by conducting a comprehensive static (parametric) and dynamic (behavioral) analysis of open-source MoE LLMs.

Methods

The authors evaluate four major open-source MoE models along with a dense baseline (Mistral 7B) using two main analytical lenses:

  1. Static Parameter Analysis: They measure the cosine similarity of the expert weight matrices ($W_{up}$, $W_{act}$, and $W_{down}$) at both the matrix level (using Principal Component Analysis for dimensionality reduction) and the neuron level. To account for position-dependent variations, they utilize the Jonker-Volgenant algorithm to optimally reorder neurons before calculating similarity. They also analyze the correlation between gate embeddings ($W_g$) and expert weights.
  2. Dynamic Behavioral Analysis: The authors feed text sequences into the models and record the actual outputs of all experts. Crucially, during a secondary evaluation pass, they set Top-k = ALL to observe how non-selected experts would have responded to the same input. They track the relationship between the $L_2$ norm of expert outputs and the corresponding router gate scores.

Finally, to validate their architectural insights, they train six custom 3.6B-parameter MoE models from scratch, systematically replacing one MoE layer with a standard dense FFN layer at different depths.

Datasets

The dynamic behavior experiments utilize:

  • Short inputs: A brief prompt template to track token-by-token expert selection.
  • Long inputs: 10 sequences from the WikiText-103 test set (~1,100 tokens).
  • Robustness verification: Larger datasets including GSM8K (84K tokens) and Magicoder-Evol-Instruct-110K (188K tokens).

The custom validation models are trained on approximately 120 billion tokens and evaluated across standard benchmarks: HellaSwag, MMLU, GSM8K, and C-Eval.

Key Insights and Ideas

  • Neurons as "Tiny" Experts: The similarity patterns of the gate embedding matrix ($W_g$) strongly correlate with the activation matrix ($W_{act}$). Because $W_g$ dictates expert selection and $W_{act}$ controls neuron activation, this implies that individual neurons function as fine-grained experts within the larger expert blocks.
  • The "Last Layer" Anomaly: Across the models, expert parameters and outputs become increasingly diverse (less similar) in deeper layers. However, the very last layer reverses this trend completely, showing a sudden spike in homogeneity where experts behave similarly to one another.
  • Upcycling vs. Training from Scratch: Mixtral models (which are widely suspected to be "upcycled" from dense checkpoints) exhibit much higher parameter similarity between experts. In contrast, models trained from scratch like DeepSeekMoE and Grok-1 show matrix-level similarities close to zero, suggesting that training from scratch promotes much healthier expert diversity.
  • Norm-Driven Routing: For Mixtral and DeepSeekMoE, the routing gate consistently assigns the highest scores to experts that produce feature vectors with the largest $L_2$ norms.

Key Results

  • Parametric Similarity: Matrix-level similarities for Mixtral experts hover between 0.2 and 0.4, while DeepSeekMoE and Grok-1 experts sit near 0.0, highlighting the impact of their training schemes.
  • Gate and Activation Correlation: Quantitative linear regression confirmed a strong positive correlation between gate embeddings and $W_{act}$ similarities, particularly in DeepSeek and Mixtral (averaging an $R^2$ up to 0.40).
Figure 1: Matrix-level similarity heat maps of expert weight matrices. Each layer contains three heat maps, corresponding to Wup, Wact, and Wdown, respectively. The tick numbers refer to the expert indices. “F” denotes the Mistral FFN.
  • Routing Behavior: Dynamic testing clearly demonstrated that the top-1 selected expert almost always corresponds to the highest output norm, validating the idea that norm-based routing is an inherent property of trained MoE gates.
Figure 4: The experts’ L2 norms and the gate scores of the short input. Each token’s k experts are shown on top of each heat map. Each number in the horizontal axis refers to an expert index.
  • Layer Allocation Experiment: In their custom-trained models, the authors found that replacing an MoE layer with a dense layer hurts performance progressively more in deeper layers. However, replacing the MoE layer in the very last position actually yielded a slight performance recovery, confirming that multiple experts are redundant at the output boundary.
Figure 5: Normalized model performance across benchmarks for the dynamic expert numbers experiment. Solid line rep- resents lower is better, while dashed line represents higher is better. “Bench avg” refers to the average performance over the four benchmarks evaluated.

Limitations and Future Work

The authors note several limitations in their study:

  1. Routing Scope: The analysis focuses primarily on standard Top-2 and Top-6 routing configurations, leaving other strategies like Top-1 routing or architectures with alternating MoE/dense layers unexplored.
  2. Metric Dependency: The study relies almost exclusively on cosine similarity for parameter and behavior measurements.
  3. Pre-training vs. Fine-tuning: The evaluations were conducted strictly on pretrained base models. The authors note that investigating how expert specialization and routing behaviors shift during instruction fine-tuning or RLHF remains an open and promising direction for future research.

Summary updated

Abstract

Mixture-of-experts (MoE) is gaining increasing attention due to its unique properties and remarkable performance, especially for language tasks. By sparsely activating a subset of parameters for each token, MoE architecture could increase the model size without sacrificing computational efficiency, achieving a better trade-off between performance and training costs. However, the underlying mechanism of MoE still lacks further exploration, and its modularization degree remains questionable. In this paper, we make an initial attempt to understand the inner workings of MoE-based large language models. Concretely, we comprehensively study the parametric and behavioral features of three popular MoE-based models and reveal some intriguing observations, including 1) Neurons act like fine-grained experts; 2) The router of MoE usually selects experts with larger output norms; 3) The expert diversity increases as the layer increases, while the last layer is an outlier, which is further validated by an initial experiment. Based on the observations, we also provide suggestions for a broad spectrum of MoE practitioners, such as router design and expert allocation. We hope this work could shed light on future research on the MoE framework and other modular architectures. Code is available at https://github.com/kamanphoebe/Look-into-MoEs.
BibTeX
@inproceedings{lo2025closer,
  author = {Ka Man Lo and Zeyu Huang and Zihan Qiu and Zili Wang and Jie Fu},
  title = {{A Closer Look into Mixture-of-Experts in Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=ZZmrjV8xIe},
}
Figure