Skip to main content
QUICK REVIEW

[Paper Review] Mixture-of-Experts with Expert Choice Routing

Yanqi Zhou, Tao Lei|arXiv (Cornell University)|Feb 18, 2022
Stochastic Gradient Optimization TechniquesComputer Science58 citations
TL;DR

Introduces expert choice routing for sparsely activated Mixture-of-Experts (MoE) models, where each expert selects top-k tokens, achieving perfect load balance and variable per-token compute, leading to over 2x faster training and improved fine-tuning performance over prior gating methods.

ABSTRACT

Sparsely-activated Mixture-of-experts (MoE) models allow the number of parameters to greatly increase while keeping the amount of computation for a given token or a given sample unchanged. However, a poor expert routing strategy (e.g. one resulting in load imbalance) can cause certain experts to be under-trained, leading to an expert being under or over-specialized. Prior work allocates a fixed number of experts to each token using a top-k function regardless of the relative importance of different tokens. To address this, we propose a heterogeneous mixture-of-experts employing an expert choice method. Instead of letting tokens select the top-k experts, we have experts selecting the top-k tokens. As a result, each token can be routed to a variable number of experts and each expert can have a fixed bucket size. We systematically study pre-training speedups using the same computational resources of the Switch Transformer top-1 and GShard top-2 gating of prior work and find that our method improves training convergence time by more than 2x. For the same computational cost, our method demonstrates higher performance in fine-tuning 11 selected tasks in the GLUE and SuperGLUE benchmarks. For a smaller activation cost, our method outperforms the T5 dense model in 7 out of the 11 tasks.

Motivation & Objective

  • Address load balancing and under-utilization in conventional token-choice MoE routing.
  • Propose heterogeneous MoE where experts select tokens (expert choice) to balance load and allocate compute.
  • Demonstrate training efficiency gains and strong downstream performance across scales.
  • Explore optional constraints to limit per-token expert count and assess impact on performance.

Proposed method

  • Propose expert choice routing where each expert selects the top-k tokens, ensuring fixed bucket size and balanced load.
  • Define token-to-expert affinity scores S = Softmax(X W_g); select top-k tokens per expert to form I (indices), G (gating weights), and P (one-hot routing).
  • Compute expert inputs X_in via P and apply per-expert GeLU-then-linear transformations with W_1[i], W_2[i].
  • Aggregate outputs to X_out using a weighted sum over P and G, enabling variable numbers of activated experts per token.
  • Optionally regularize routing with entropy-based linear programming to cap per-token expert counts, solved via Dykstra’s algorithm.
  • Adopt Transformer architecture with interleaved MoE and dense layers, using per-layer relative positional bias and GELU activations within MoE feeds.

Experimental results

Research questions

  • RQ1Does expert choice routing improve training efficiency compared to top-1/top-2 gating in Switch Transformer and GShard?
  • RQ2How does varying the number of experts (scaling) affect training perplexity and downstream fine-tuning performance?
  • RQ3What is the impact of allowing a variable number of experts per token on GLUE/SuperGLUE task performance?
  • RQ4How does capacity factor (per-token compute) influence convergence and accuracy relative to fixed-token-k gating?
  • RQ5What is the effect of regularizing the per-token expert count on accuracy and load balance?

Key findings

  • Expert choice with capacity factor 2 (EC-CF2) yields over 2x faster training convergence than GShard top-2 gating on comparable compute.
  • Increasing the number of experts while keeping expert size fixed improves training perplexity across scales.
  • EC-CF2 consistently outperforms Switch Transformer top-1 and GShard top-2 across 11 GLUE/SuperGLUE tasks in fine-tuning, averaging >2 percentage points accuracy gains in 8B/64E settings.
  • Dense baselines are surpassed by EC-CF2 at 8B/64E, with average accuracy gains around 3.4 points on a subset of tasks.
  • Allowing a variable number of experts per token improves performance; restricting to 2 or 3 experts per token marginally reduces performance compared to unconstrained expert choice.
  • Hash Layer routing underperforms expert choice in average accuracy and variance, indicating load balancing alone is insufficient for best results.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.