Mixture of a Million Experts: Scaling Routing with Product Keys

Xu Owen He (Google DeepMind) · arXiv, 4 July 2024 · PEER: Parameter Efficient Expert Retrieval
arXiv:2407.04153 Interactive Visualization

The routing wall formula-derived

Scoring every expert costs N·d; product keys cost about (√N + k²)·d. Drag N (k = 16, as in PEER).

N = 2^

Which routers scale and learn?

Hash routers scale but are fixed. Learned routers stall near ~128 experts. PEER targets both.

Product-key retrieval, step by step Illustrative scores

Toy 8×8 grid (N = 64) with random scores. PEER uses 1,024 × 1,024 sub-keys. Score = half-score A + half-score B.

k =

One PEER layer

Click a stage or step through the pipeline.

1,048,576experts (1,024 × 1,024)
8 × 16heads × experts per head
128active neurons (granularity h·k)
256gathered rows (u and v each)

What a retrieved slot holds

Same retrieval, different payload.

Perplexity at equal FLOPs Reported

Lower is better. Each cell is a single run; no seeds or error bars. Budget 6e18 FLOPs.

PEER lead over dense on C4 Reported, approx.

Lead shrinks from about 13% to about 10% as budget grows. Two budgets are not a trend.

Is the million-way router collapsed? Reported

Query-network BatchNorm off vs on. Zero-based axes.

Ablation directions Illustrative, no values

Paper reports direction only in the episode: bigger pool or more active experts helps, with saturation.

What the evidence covers

Hover or tap a row.

Select a row for detail.

Granularity: two definitions

FLOPs vs hardware Illustrative layout

Same 256 highlighted cells: contiguous tile vs scattered lookups in a huge table. Not to scale.

References

  1. Mixture of A Million Experts — He, 2024
  2. Scaling Laws for Fine-Grained MoE — Krajewski et al., 2024
  3. Unified Scaling Laws for Routed Language Models — Clark et al., 2022
  4. DeepSeekMoE — Dai et al., 2024
  5. Large Memory Layers with Product Keys — Lample et al., 2019
  6. Transformer Feed-Forward Layers Are Key-Value Memories — Geva et al., 2021
  7. MoE with Expert Choice Routing — Zhou et al., 2022
  8. Memory augmented LMs through mixture of word experts — dos Santos et al., 2023
  9. Fast Feedforward Networks — Belcak & Wattenhofer, 2023
  10. Approximating Two-Layer Feedforward Networks — Csordás et al., 2023
  11. Lifelong-MoE — Chen et al., 2023
  12. Outrageously Large Neural Networks — Shazeer et al., 2017