Auxiliary losses and routing biases can control MoE load balance, but their effects and scope must be distinguished.
Expert selection and uneven load
Sparse mixture-of-experts (MoE) models execute only selected experts for each token. Score-based routing can concentrate tokens on particular experts. Uneven load affects device utilization and training.
Implementations that cap token capacity also need an overflow policy. Not every MoE drops excess tokens. The DeepSeek-V3 report states that its training and inference do not use token dropping.
The role of auxiliary loss
Switch Transformer, published in JMLR 2022, describes an auxiliary loss using selection frequency (f_i) and mean routing probability (p_i) for top-1 routing. With (N) experts and coefficient (\alpha), its form is:
Adding this term to language-modeling loss introduces a balancing gradient into router training. Its coefficient affects the interaction between balance and the primary task. It is not a law that larger coefficients always reduce quality in every model.
| Observation | Measurements |
|---|---|
| Balance | Tokens per expert and device waiting |
| Primary task | Validation loss and downstream quality |
| Capacity policy | Overflow handling and actual token dropping |
Add bias to selection scores
Auxiliary-Loss-Free Load Balancing places the balancing signal in routing selection scores. The subsequent DeepSeek-V3 technical report describes its use in a trained model. This article uses the published mechanism, not early small-model improvement percentages as general performance evidence.
Per-expert bias is added only for top-K selection. The original scores determine the selected experts' output weights. Lower the bias of overloaded experts and raise it for underloaded experts, as illustrated by this simplified pseudocode.
# Use bias only for selection
selected = top_k(scores + bias)
output = weighted_expert_outputs(selected, original_scores=scores)
# Aggregate batch load, then adjust bias for subsequent selection
for expert in experts:
if load[expert] > target_load:
bias[expert] -= update_rate
elif load[expert] < target_load:
bias[expert] += update_rateNot backpropagating the bias as an auxiliary loss does not leave the entire training path unchanged. Different expert selection changes which parameters receive a token's learning signal. The bias therefore does not eliminate every effect on gradients.
flowchart LR
T["Token scores"] --> B["Selection scores plus bias"]
B --> K["Top-K selection"]
K --> L["Aggregate expert loads"]
L --> U["Update bias"]
U --> B
K --> O["Weight outputs with original scores"]
The scope of DeepSeek-V3
DeepSeek-V3 uses bias for its main balancing mechanism and retains a small sequence-wise auxiliary loss against extreme imbalance within a sequence. It therefore does not remove all auxiliary losses from the model. Distinguish batch-level balance from sequence-level constraints.
| Component | Where it acts | Scope |
|---|---|---|
| Selection bias | Expert selection | Adjust selection boundaries from batch load |
| Complementary auxiliary loss | Training objective | Reduce extreme sequence imbalance |
| Serving placement and communication | Execution system | Handle device load under deployed traffic |
The released model provides evidence that the method was implemented in training. It does not prove convergence for arbitrary update rates and changing scores. Evaluate update rate, aggregation scope, and primary-task quality together.
Measure inference-time imbalance separately. Training balance does not guarantee balanced deployment traffic or communication latency. A training algorithm and a serving scheduler are not the same solution.
Summary
Auxiliary loss adds balance signals to the training objective, while loss-free bias adds them to expert-selection scores. DeepSeek-V3 combines bias with a small sequence-wise auxiliary loss. Changing selection also changes learning paths, so gradients are not completely unaffected. This implementation evidence does not establish general convergence or quality improvements for every MoE.