Mixture of Experts Separates Total and Active Parameters

Trace top-1 routing and keep total stored parameters, selected expert capacity, routing work, communication, capacity, and load balance distinct.

A mixture-of-experts (MoE) layer stores several MLP experts and uses a router to select a small number for each token. This can increase total parameter capacity without applying every expert to every token.

Trace a Top-1 Layer

For each token record xx:

  1. the router computes one score per expert;
  2. a routing rule chooses one expert;
  3. the token is dispatched to that expert;
  4. the expert MLP transforms it;
  5. the result returns to the token's original position.

The router and dispatch are real work. “One active expert” does not mean the other system costs vanish.

Keep a Parameter Ledger

Take dmodel=4d_{model}=4, dff=8d_{ff}=8, four experts, and two biased linear maps per expert. One expert has

4×8+8+8×4+4=764\times8+8+8\times4+4=76

parameters. A bias-free 444\to4 router has 16. Therefore:

QuantityCount
one dense MLP / one expert76
four experts plus router, total stored4(76)+16=3204(76)+16=320
active expert parameters per top-1 token76

The final row describes selected expert capacity, not complete per-token cost. It excludes routing, dispatch, gather, communication, capacity padding, dropped tokens, and load imbalance.

Capacity and Balance Can Fail

If many tokens choose one expert, that expert can become overloaded while others are idle. Implementations may cap expert capacity, drop or reroute tokens, and add load-balancing objectives. These choices affect training and serving behavior.

Q1. Separate total and active parameters

Three identical experts contain 50 parameters each. A top-1 router contains 12 parameters. Report total stored parameters and active expert parameters for one token, excluding router work.

Answer it first, then check.

Hint
Add every expert and the router for total storage; select one expert for the active expert count.
Solution
Total storage is 3(50)+12=1623(50)+12=162 parameters. A top-1 token selects 50 expert parameters, excluding the router and system overhead.
Not attempted
Review

Not marked done.

Switch Transformer studies one top-1 sparse expert design under stated models, data, precision, hardware, and tasks. Its measurements should retain those conditions.

Pause and reflect

In your own words, note what you understood, what remains unclear, or what you want to revisit. The note stays with this lesson.

0 of 1 exercises marked done

Review

Not marked done.

LLM PrimerMixture of Experts Separates Total and Active Parametershttps://llmprimer.com/transformers/variants-scaling-and-boundaries/mixture-of-experts-separates-total-and-active-parameters© 2026 LLM Primer