passdrill
AI & LLM Engineering · How LLMs Work: Transformers & Training · Card 011/012 hard

Shazeer et al. (2017), "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer," introduced a technique now used in some large language models to scale model capacity without a proportional increase in per-token compute. How does a sparsely-gated mixture-of-experts (MoE) layer achieve this?

  1. A gating network activates every expert sub-network for every input and averages their outputs, providing an ensembling effect at the cost of proportionally higher compute
  2. A trainable gating network routes each input to a sparse subset of expert feed-forward sub-networks, letting total parameter count scale far beyond what would be affordable if every expert were computed for every input
  3. Each expert is a full independent copy of the entire transformer stack, and the gating network selects which single copy runs the whole forward pass for a given input
  4. The gating network is fixed at random initialization and never trained, relying purely on random routing to balance load across experts
Next card → Shuffle