IN THIS BREAKDOWN · 10 SECTIONS
You can read 20% of this breakdown.
The paper in one minute
Neural networks absorb more knowledge as they get more parameters, but in an ordinary network every parameter does work on every input. Doubling the model doubles the cost of every example, and with growing datasets, training cost rises roughly with the square of scale. Conditional computation, running only part of the network per example, was the obvious answer, and earlier attempts had not shown large gains in practice. GPUs are slow at branching, conditional parts see small batches, network bandwidth limits what can be split across machines, and gates tend to favor a few paths.
Shazeer and colleagues built a layer that made it work. A mixture-of-experts (MoE) layer holds n experts, each a small feed-forward network, and a gating network that, for each token, computes a score per expert, adds Gaussian noise scaled by a learned amount, keeps the top k scores and softmaxes them. Only those k experts run, and their outputs are summed with the gate weights. With k = 4 and 4,096 experts, 99.9% of the layer is idle for any given token.
Three engineering pieces made it efficient. The experts live on separate devices while the rest of the model runs data-parallel, so each expert receives tokens from every device's batch at once. The MoE is applied to all time steps of the previous LSTM layer together, enlarging its batch again. And a loss term penalizes uneven expert use, because otherwise the gate settles on a few experts that then train faster and get chosen even more.
The payoff was large. A 4-billion-parameter MoE language model using 6% of the compute of the best LSTM of the day beat it, a 68-billion-parameter one cut perplexity 39%, and an 8.7B-parameter MoE translation model beat Google's production GNMT system.
Research notes: the problem, approach and results
increase in model capacity with only minor losses in computational efficiency (abstract)
parameters in the largest MoE layer, 131,072 experts, applied between stacked LSTMs (Section 5.2)
of the per-timestep compute of the best published LSTM for the low-budget MoE model that beat it (Table 1)
Model quality kept improving with parameters, but in a dense network every parameter is used for every example, so training cost grows with both model size and data. Conditional computation, using only part of a network per example, had been proposed for years but never delivered large gains on real hardware.
Insert a mixture-of-experts layer between LSTM layers: up to thousands of feed-forward experts plus a trainable gate that adds noise to its scores, keeps the top k, and softmaxes over them. Fix the small per-expert batches by combining data-parallel batches at the MoE layer, and add a loss that keeps experts equally used.
On the 1-Billion-Word benchmark, a 4-billion-parameter MoE model needing 8.9 million ops per timestep beat the best published LSTM (151 million) on perplexity at matched epochs. On 100 billion words, 65,536 experts (68B parameters) cut perplexity 39%. On WMT'14 translation, BLEU rose 1.34 (En-Fr) and 1.12 (En-De) over GNMT.
Why it matters to an FDE
Most frontier and many open models today are mixtures of experts. This paper explains the trade they make, and that trade shows up in every deployment conversation.
Compute follows active parameters, memory follows total parameters. An MoE model's cost per token depends on the k experts it runs, but every expert's weights must sit in GPU memory. A model can be cheap per token and still need several GPUs just to hold it. Size hardware by total parameters and estimate throughput by active ones.
Batching works differently. Each expert only sees the tokens routed to it. At low traffic, experts receive tiny batches and GPUs run inefficiently; at high traffic, an unlucky expert can become a hot spot. Serving MoE well needs enough concurrent load and expert placement across devices.
Routing is learned, and it can be lopsided. The paper's own ablation shows an unbalanced gate sending nearly 18 times the average load to one expert. When a customer asks why an MoE model's latency varies with input type, uneven expert load is a likely place to look.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 297 more papers.
- 03Key takeawaysNoisy top-k gating, the shrinking-batch fix, the balancing losses, the results and two misreadingsFree account
- 04How it worksThe gate's equations, how experts are placed on devices, the two balancing losses, and the hierarchyPremium
- 05The numbers that matterLanguage-modeling tables, the 100B-word scaling run, translation results and the balancing ablationPremium
- 06Try it yourselfRecheck the tables, compute per-expert batch sizes, and watch a toy router collapsePremium
- 07Where it breaksLSTM-era results, memory and communication cost, too much sparsity, and fragile routingPremium
- 08Using it on a deploymentSizing hardware for an MoE model, keeping experts busy, and watching for hot expertsPremium
- 09Interview anglesFive questions this paper prepares you for, with answer hintsPremium
- 10Read nextWhere to go from here on this sitePremium