LearnQuestion bank

What is a mixture-of-experts transformer, and what changes for training and serving compared with a dense model of similar quality?

Applied LLMTechnicalHard

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Router sends each token to top-k expert MLPs; active compute follows active params, total params are much larger
  • Memory footprint tracks total resident parameters; throughput gains are strongest at scale, small-batch decode can remain bandwidth-bound
  • Training needs load balancing, capacity factors/token dropping, and expert parallelism with all-to-all communication
  • Fine-tuning and serving need router stability, per-expert quantization, and deliberate adapter placement

In full

A mixture-of-experts transformer replaces the dense feed-forward layer with many expert MLPs and a learned router that sends each token to the top-k experts, so per-token compute follows the active parameters while the model still stores far more total parameters. That lets it reach dense-like quality with lower active compute, but training changes: you need load-balancing losses or bias-based balancing so experts are used evenly, capacity factors to bound tokens per expert with overflow dropped or bypassed, and expert parallelism with all-to-all token exchange rather than one dense matmul. Serving also changes: memory footprint is closer to total parameters because all experts must be resident, throughput benefits are strongest at scale, and small-batch decode can still be bandwidth-bound from fetching many expert weights plus routing overhead. Fine-tuning needs care that the router stays stable and does not collapse or drift, and quantization/adapters must be placed deliberately, since per-expert precision and shared versus expert-specific adapters are not the same as a single dense weight matrix.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • A router picks top-k expert MLPs per token; compute per token follows active parameters while total parameters are much larger
  • Memory footprint = total parameters (all experts resident); throughput benefits at scale; small-batch decode can still be bandwidth-bound
  • Load-balancing losses or bias-based balancing; capacity factors and token dropping; expert parallelism needs all-to-all communication
  • Fine-tuning/serving quirks: router stability, quantising experts, adapter placement

Common mistakes

  • Sizing memory from active parameters
  • ignoring communication overhead of expert parallelism