Exact Quantile Balancing and Load-Error Injection for Mixture-of-Experts

Pit Neitemeier, Jiaze Li, Alessio Serra, Philipp Scholl, Sohir MaskeyarXiv 2026

TL;DR

This paper introduces two complementary techniques for balancing expert workloads in Mixture-of-Experts (MoE) models: Exact Quantile Balancing (EQB) for precise global balancing with minimal communication, and Load-Error Injection (LEI) for efficient local microbatch balancing. Together, they significantly reduce hardware load imbalances and improve downstream model performance compared to existing methods like the GShard auxiliary loss.

What Problem Does This Paper Address?

Sparse MoE models scale up parameter capacity efficiently by routing tokens to only a few active experts. However, to maximize hardware efficiency, workloads must be balanced across experts at two distinct scales:

  1. Global balance: Measured across an entire optimizer step to prevent routing from persistently concentrating on a small subset of experts.
  2. Local balance: Measured within a single microbatch to avoid load skew and idle hardware during expert-parallel execution.

Existing global methods approximate quantiles across distributed data-parallel ranks, leading to partition-dependent inaccuracies or resolution limits. Meanwhile, local balancing methods like the GShard auxiliary loss rely on soft surrogates that couple experts together through normalized probabilities, which can change without actually fixing the hard top-K routing decisions.

Methods

The authors decouple global and local load balancing into two novel mechanisms:

  • Exact Quantile Balancing (EQB): Instead of approximating global quantiles, EQB computes the exact global-batch empirical quantile across distributed ranks. It adapts a two-pass radix selection algorithm over the 16-bit BF16 routing margins (one pass for the high byte, one for the low byte). This requires only two 256-bin all-reduces per layer, keeping communication costs low and entirely independent of the token count.
  • Load-Error Injection (LEI): To address local microbatch imbalances, LEI bypasses normalized routing probabilities. Instead, it directly injects each expert's local load error into its router-score gradients using a constant, diagonal Jacobian derived from unnormalized scores. To prevent training instability (runaway attention logits), a tanh-based normalization step bounds the injected gradient while preserving its direction.

Datasets

The authors evaluated their methods by training a 7.5B-parameter decoder-only MoE model (0.5B active parameters per token, 256 experts, top-6 routing) on up to 500 billion tokens. Downstream performance was evaluated using standard benchmarks: MMLU, ARC, HellaSwag, TriviaQA, GSM8K, HumanEval, and MBPP, alongside their German-translated counterparts (e.g., MMLU-DE, ARC-DE).

Key Insights and Ideas

  • Global $\neq$ Local Balance: Microbatch-level imbalances can cancel out when aggregated over an entire optimizer step. Therefore, achieving global balance does not inherently imply local balance, necessitating separate control mechanisms.
  • Exact Global Quantiles are Cheap: Exact global quantiles can be computed across distributed ranks with negligible communication overhead using radix selection, eliminating the need to choose between partition-dependent averages or low-resolution histograms.
  • Decoupling Gradients Improves Signal: Injecting load errors directly into unnormalized router gradients (LEI) provides a cleaner, more direct optimization signal than GShard's approach, which couples expert corrections through normalized probabilities.
  • Stability Requires Bounding: Unbounded auxiliary gradients can destabilize attention logits during training. Bounding the injected residuals via a tanh function preserves balancing performance while maintaining model stability.

Key Results

  • EQB vs. Naive QB: Replacing rank-averaged quantiles with EQB reduced Global Max Violation (MaxVio) from 0.92 to 0.74 and Local MaxVio from 5.96 to 5.38, while consistently improving downstream benchmark scores.
  • LEI vs. GShard: At 100B tokens, combining EQB with normalized LEI reduced Local MaxVio to 3.52, significantly outperforming the EQB + GShard combination (4.71) at comparable model quality.
Table 1: 100B-token ablation. Full benchmark results are in Appendix E.2.
  • Long-horizon Scaling: At 500B tokens, EQB + normalized LEI reduced Local MaxVio from 5.14 to 4.15 and increased average downstream accuracy from 48.25% to 48.56% compared to EQB alone.
Table 2: 500B-token EQB vs. normalized LEI. Full benchmark results in Appendix E.3

Limitations and Future Work

  • The evaluation is limited to a single model scale (7.5B parameters) and a single random seed, meaning variance across runs wasn't fully estimated.
  • LEI and GShard require separately tuned coefficients because they produce vastly different router-gradient magnitudes.
  • The local balance metric used (Local MaxVio) serves as a proxy for dispatch cost rather than a direct measurement of actual expert-parallel hardware throughput.

Summary updated

BibTeX
@misc{neitemeier2026exact,
  author = {Pit Neitemeier and Jiaze Li and Alessio Serra and Philipp Scholl and Sohir Maskey},
  title = {{Exact Quantile Balancing and Load-Error Injection for Mixture-of-Experts}},
  year = {2026},
  eprint = {2609.28053},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.28053},
}
Figure