6.1.6 · D5Scaling & Efficient Architectures

Question bank — Load balancing in MoE

1,900 words9 min readBack to topic

Before anything else, a quick shared vocabulary so every question below stands on defined ground:


True or false — justify

The auxiliary loss is minimized when both and are uniform, treated as an unconstrained dot product.
False. Under only and , the raw dot product is smallest at a corner — dump all -mass on the smallest- expert (see the intuition callout above). Uniformity is a training fixed point, not the analytic minimizer of the bare product.
Making larger always improves the final model.
False. Too large an over-weights balance versus the task loss , forcing near-uniform routing that ignores which expert is actually best for a token, hurting quality. It's a trade-off, hence typical .
Gradients flow through to fix the imbalance.
False. is a hard indicator count and is treated as constant; . The correction happens entirely through the differentiable , scaled by the measured load .
At a perfectly balanced fixed point the auxiliary loss reaches zero.
False. It settles to a small positive constant : with and , each of the terms is , so . Balance minimizes it, it does not zero it.
The total loss should be written .
False. The is already inside . Writing it again applies twice — the correct form is simply .
Increasing the capacity factor removes load imbalance.
False. sets each expert's buffer size (); a larger drops fewer tokens but does nothing to make the router choose experts evenly. It hides imbalance's symptom, not its cause.
Expert collapse is caused by a bug in the softmax.
False. It's a natural feedback loop: a slightly-better expert attracts more tokens, gets more gradient, improves faster, attracts even more. The softmax is behaving correctly — the dynamics need a counter-force (the aux loss).
If , lowering for a busy expert automatically raises it for idle ones.
True. Softmax outputs are a probability distribution summing to 1, so mass removed from an overloaded expert must reappear across the others. How it redistributes depends on the pre-softmax logits — softmax spreads the freed mass proportionally to the other experts' exponentiated scores, not equally, so idle-but-slightly-favoured experts gain the most.
Using alone would be a valid balancing loss.
False. is a non-differentiable hard count, so has zero gradient through the router — it can't teach anything. You need the differentiable in the product.

Spot the error

" is an anti-correlation objective that symmetrically pushes and apart."
Wrong framing. Here anti-correlation would mean the loss symmetrically rewards making and disagree (big paired with small and vice-versa) on both variables. But is frozen as a scaling constant and only moves: the gradient pushes down in proportion to current load — a one-sided feedback controller, not a symmetric anti-correlation objective.
"Since and here , we must have for a batch of 8 tokens."
Error: confusing tokens with the constraint. because is a fraction (divided by ); each token contributes picks spread over the fractions, summing to , not .
"We drop tokens because we ran out of GPU memory."
Error: wrong reason. Dropping is a deliberate capacity constraint creating back-pressure — over-routed experts overflow, those tokens skip the expert (pass as residual), and the resulting worse performance discourages over-routing. It's a training signal, not an OOM handler.
"The router output uses the raw ."
Error: it uses the renormalized . After picking Top-K, weights are re-normalized so the chosen experts' gating scores sum to 1; the raw over all experts do not sum to 1 within the selected set.
"Load balancing loss replaces the task loss."
Error. It's an auxiliary term added to . The router optimizes both simultaneously — good task routing plus balanced load — never one instead of the other.

Why questions

Why couple (hard load) to (soft probability) instead of using alone?
regularizes only the router's confidence, ignoring the actual dispatched load — which is what causes hardware and compute imbalance. The cross term lets the measured imbalance scale the corrective push on the differentiable .
Why does the gradient magnitude on scale with ?
Because : the more overloaded an expert (bigger ), the harder the loss pushes its probability down. The correction is exactly proportional to how badly balanced that expert is.
Why is perfect balance the target rather than ?
Each token picks experts, so total dispatch fraction is , spread evenly gives per expert. For Top-2 of 8 experts that's , not .
Why does capacity factor trade off against performance when set too low?
A low shrinks each expert's buffer, so more tokens overflow and get dropped; dropped tokens skip their best expert and get a worse representation, degrading accuracy. Typical balances balance versus dropping.
Why do the idle experts fail to recover on their own without balancing?
Starved experts receive almost no gradient signal, so they never improve, so the router never finds a reason to send them tokens — a self-reinforcing dead zone the aux loss must break.

Edge cases

With Top-1 routing and 4 experts, what is ?
Exactly , since each token is a single pick and are fractions of the batch. This is independent of batch size.
What would and the aux loss mean in the degenerate case (no expert picked)?
With every token skips all experts, so every and the loss is . There's nothing to balance because nothing is dispatched — a vacuous, non-functional MoE layer, which is why real routing always uses .
If a batch routes every token to expert 1 (full collapse), what does the aux loss look like relative to balanced?
Much larger: concentrates the whole product on the busiest expert's , and the gradient slams down hard — the loss is maximally above the balanced floor of .
What happens to the aux loss at the ideal fixed point with , ?
It settles to (e.g. for ) — a small nonzero constant, since balance minimizes but never zeros the term.
If , what happens?
The auxiliary term vanishes entirely, the router optimizes only , and the collapse feedback loop is left unchecked — a few experts typically dominate.
If an expert is at exactly its capacity and one more token arrives, what happens to that token?
It overflows and is dropped for that expert — its representation passes through as a residual, bypassing the expert computation entirely for that token.
Does raising fix a collapse that has already fully happened mid-training?
Not instantly and not guaranteed — collapsed experts are hard to revive because they carry no useful gradient; balancing works best as a preventive force applied from the start, alongside capacity-based back-pressure.
Recall One-line self-test

The corrective gradient on equals what, and what does that tell the router to do? ::: — push probability down for currently overloaded experts, which softmax redistributes (proportionally) to the others.

Prerequisite threads: Top-K Routing in MoE, Switch Transformer, GShard, Expert Capacity and Token Dropping, MoE Training Dynamics, Gradient Routing in MoE, Mixture of Experts (MoE) Architecture.