Source-linked AI summary

MoE Lens -- An Expert Is All You Need

Marmik Chaudhari, Idhant Gulati, Nishkal Hundia, Pranav Karra, Shivam Raval

arXiv:2603.05806v1cs.LG

TL;DR

MoE inference and memory optimization are difficult because expert specialization and routing behavior remain insufficiently understood. The paper analyzes domain-specific routing and uses early decoding to track expert contributions in DeepSeekMoE, finding concentrated expertise and close agreement between a single top-weighted expert and the full ensemble. These findings support targeted expert pruning as a potential optimization direction.

  • Problem

    MoE models offer sparse parameter activation, but expert routing, specialization, and knowledge redundancy remain insufficiently understood for optimizing inference and memory costs.

  • Method

    The paper analyzes domain-specific routing across three domains and applies early decoding to compare individual expert contributions with weighted expert ensembles and residual-stream representations.

  • Results

    DeepSeekMoE relies predominantly on a few specialized experts, while a single top-weighted expert combined with the residual stream closely approximates the full ensemble output.

  • Takeaways & Limitations

    The concentrated expertise suggests potential inference sparsification by activating only the highest-weighted expert and pruning non-essential experts while maintaining comparable model performance.

  • Takeaways & Limitations

    The findings are demonstrated using DeepSeekMoE, and broader understanding requires examining additional MoE variants; the analysis also uses LogitLens rather than TunedLens.

Abstract

from arXiv · show

Mixture of Experts (MoE) models enable parameter-efficient scaling through sparse expert activations, yet optimizing their inference and memory costs remains challenging due to limited understanding of their specialization behavior. We present a systematic analysis of expert specialization in MoEs through two complementary approaches: domain-specific routing patterns and an early decoding framework that tracks expert contributions to output representations. Our analysis of the DeepSeekMoE model reveals that despite having 64 routed experts with 6 active for each layer's computation, the model predominantly relies on a few specialized experts, with the top-weighted expert's output closely approximating the full ensemble prediction. We quantitatively validate these findings through a systematic analysis of the token routing distribution, demonstrating that very few experts handle over 50\% of routing decisions across different specialized domains. Hidden state similarity between single and ensemble experts for every layer is extremely high, with some layers having cosine similarity as high as 0.95 and perplexity increasing by only 5\% when using a single expert across all three domains. Our results indicate that Mixture of Experts models exhibit concentrated expertise highlighting potential opportunities for inference optimization through targeted expert pruning while maintaining model performance and opening avenues towards studying localization of learned knowledge in these models.

1 INTRODUCTION

MoE models scale efficiently through sparse activation, but expert routing and specialization remain insufficiently understood. This paper analyzes domain-specific routing and expert contributions to identify concentrated expertise and potential inference savings.

  • MoE models activate only a subset of parameters per input, yet routing inefficiencies, training complexity, load balancing, and memory constraints remain challenges.
  • Expert specialization can produce branches or experts focused on distinct feature representations, concepts, linguistic patterns, or computational domains.
  • The paper analyzes routing distributions across three domains and uses early decoding to trace how individual experts contribute to residual-stream representations.

2 BACKGROUND

The paper defines expert specialization through domain-specific routing and studies MoE representations with early decoding. Extended LogitLens compares individual and weighted expert contributions after incorporating the residual stream.

  • MoE Layer: An MoE layer replaces a Transformer FFN with multiple structurally identical experts and a learned router assigning probabilities to each input token.
  • MoE Layer: The combined routed-expert output is a routing-probability-weighted sum over the selected top-k experts.
  • Expert specialization: Expert specialization is the fraction of tokens from domain D for which expert E_i is selected among the top-k experts.
  • Expert specialization: An expert is specialized when it processes significantly more domain tokens than the uniform routing baseline of 6/64 ≈9.4%.
  • Shared Experts: The shared expert is used for every token and is intended to capture common knowledge, so the analysis focuses primarily on routed experts.
  • Early decoding using Logit Lens: Early decoding projects intermediate hidden states through the pretrained unembedding matrix to approximate how predictions evolve toward the final output.
  • Early decoding using Logit Lens: Extended LogitLens adds an expert output to the post-attention residual stream and projects the result into vocabulary space to inspect expert-specific prediction updates.

3 EXPERIMENTS

The experiments analyze DeepSeekMoE expert specialization across domains and layers using routing distributions, extended LogitLens projections, hidden-state similarity, and perplexity.

  • Model: Experiments use DeepSeekMoE with 2 shared and 64 routed experts, activating top-k = 6 experts per token.The model uses expert-level and device-level balance losses during pretraining.
  • Datasets: The datasets span code, English books, French reading comprehension, mathematics, Chinese educational text, scientific articles, and grade-school math problems.The experiments use curated subsets of seven datasets.
  • Experiments: The study evaluates English, Code, and French next-token prediction through specialization, early decoding, and single-versus-ensemble comparisons.It compares individual expert outputs, weighted top-k outputs, and final layer outputs.
  • Measurements: Cosine similarity compares the top-weighted expert plus residual representation with the residual representation formed from all top-k experts.Perplexity is also measured as the number of active experts changes.

4 RESULTS

Results show concentrated routing and strong agreement between the top-weighted expert and the full routed ensemble across layers and domains.

  • Expert specialization: Only a small number of experts show strong domain specialization, while most experts demonstrate minimal domain-specific activity.Specialization is assessed relative to uniform routing frequency.
  • Early decoding: The top-weighted expert plus residual stream decodes to roughly the same next-token prediction as the layer output across layers and domains.This indicates that the top-weighted expert contributes most to shaping the final output representation.
  • Perplexity: Perplexity moderately increases when reducing the number of active routed experts from top-k = 6 to 1.The result supports close alignment between the single-expert representation and the full layer output.

5 CONCLUSIONS AND FUTURE WORK

The conclusions identify concentrated expert contributions in DeepSeekMoE and suggest that selective inference sparsification may reduce resource use while preserving comparable performance.

  • Conclusions: A single top-weighted expert combined with the residual stream closely approximates the full ensemble output across multiple data domains.This supports the paper’s central finding about concentrated expertise.
  • Inference optimization: Activating only the highest-weighted expert and pruning non-essential experts could significantly reduce computational costs and memory requirements while maintaining comparable model performance.The proposed opportunity is selective inference sparsification.
  • Scope and future work: The findings are demonstrated using DeepSeekMoE as a representative MoE architecture.The paper proposes examining additional MoE variants and TunedLens in future work.

A.1.1 DEEPSEEKMOE

Figures 4 and 5 visualize domain-dependent routing across DeepSeekMoE’s 64 experts under top-k = 6 selection, using uniform routing as the reference.

  • Expert routing: The figures show how frequently tokens from different domains are routed to each of the 64 experts across layers.The routing setting is top-k = 6.
  • Reference baseline: The y-axis reports routing percentage per expert, with a red dashed line marking the uniform routing baseline of approximately 9.4%.The baseline corresponds to 6/64 routing.

A.1.2 QWEN 1.5 MOE

These figures show how frequently tokens from different domains are routed to 60 Qwen 1.5 MoE experts across layers, using top-k = 4 routing. Routing percentages are compared against an approximately 6.67% uniform-routing baseline.

  • Routing percentages are shown per expert for tokens from different domains across various Qwen 1.5 MoE layers.The visualization covers 60 experts and uses top-k = 4 routing.
  • The figures provide an approximately 6.67% uniform-routing baseline for interpreting expert routing frequencies.The red dashed line marks this baseline.

A.1.3 OLMOE

These figures visualize routing frequencies across experts and layers for OLMoE and provide LogitLens views of routed-expert predictions for French and English inputs. The visualizations encode expert routing or prediction confidence rather than reporting a numerical outcome in the supplied passages.

  • OLMoE routing visualizations show domain-token frequencies across 64 experts using top-k = 8 routing.The y-axis reports routing percentage per expert, with an approximately 12.5% uniform-routing baseline.
  • A second OLMoE visualization describes routing frequencies across 66 experts using top-k = 8 routing.Its y-axis reports routing percentage per expert and its baseline is approximately 12.5%.
  • The French LogitLens visualization shows top-1 predictions after “le” across layers for layer outputs and routed experts at various top-k values.Color intensity indicates prediction confidence, while subscripts and superscripts encode expert indices and weights.
  • The English LogitLens visualization shows top-1 predictions after “this” across layers for layer outputs and routed experts at various top-k values.Color intensity indicates prediction confidence.
Loading 2603.05806v1…