Auxiliary Balancing Loss › Key Parameters
Michael BrenndoerferNovember 17, 20251 min read
Language AI HandbookAll chapters Part 33 of 67Mixture of Experts
Auxiliary Balancing Loss › Key ParametersOne section · Sections in this chapter10 / 13 ↓
Sections in this chapter13
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The key parameters for the auxiliary balancing loss implementation are closely interrelated, and understanding how they interact helps you make informed tuning decisions rather than treating each as independent.
- num_experts: Number of experts in the MoE layer. More experts increase the potential for imbalance (more chances for collapse) but also increase the model's capacity for specialization. As
num_expertsgrows, you may need to be more careful with tuning. - aux_loss_coef: Coefficient scaling the auxiliary loss (typically 0.01-0.1). This is the primary tuning knob. Start at 0.01 and adjust based on the imbalance ratio you observe during training.
- k: Number of experts selected per token (top-k routing). Larger naturally improves balance because each token contributes to more experts' loads. With , the natural imbalance is typically lower than with , which means you can often use a smaller .
- expert_size: Hidden dimension size of each expert network. Larger experts cost more compute per token, making load imbalance more expensive in practice. With larger experts, the economic argument for good balancing becomes stronger.