Auxiliary Balancing Loss › Key Parameters

Michael BrenndoerferNovember 17, 20251 min read
Language AI HandbookAll chapters
Part 33 of 67Mixture of Experts
Chapter 244Auxiliary Balancing Loss › Key Parameters
Reading section 10 of 13 · Key Parameters · 1 minSection 10 of 13 · 1 min

Book contents

Section 10 of 13 · 1 min read

Auxiliary Balancing Loss › Key ParametersOne section · Sections in this chapter10 / 13 ↓
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_experts grows, you may need to be more careful with α\alpha tuning.
  • aux_loss_coef: Coefficient α\alpha 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 kk naturally improves balance because each token contributes to more experts' loads. With k=2k=2, the natural imbalance is typically lower than with k=1k=1, which means you can often use a smaller α\alpha.
  • 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.