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:
- 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.
- 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 = ALLto 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).
- 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.
- 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.
Limitations and Future Work
The authors note several limitations in their study:
- 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.
- Metric Dependency: The study relies almost exclusively on cosine similarity for parameter and behavior measurements.
- 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