ProbMoE: Differentiable Probabilistic Routing for Mixture-of-Experts
Summary (Overview)
-
ProbMoE is a novel probabilistic routing framework for Mixture-of-Experts (MoE) models that models expert selection as a distribution over cardinality-constrained expert subsets, treating routing as probabilistic inference rather than a deterministic top-k operation.
-
The framework introduces ProbMoE Exact-k routing, which samples k-expert subsets in the forward pass and uses exact marginal probabilities as a tractable gradient surrogate in the backward pass, enabling informative router gradients while preserving sparse expert execution.
-
ProbMoE naturally generalizes to Dynamic-k routing, where both training and inference constrain routing cardinality to a predefined range , allowing adaptive expert allocation per token based on token-level complexity.
-
Empirical results show ProbMoE Exact-k achieves state-of-the-art performance across multiple benchmarks (GSM8K, Law, Translation, Summary) on both OLMoE-1B-7B and Qwen1.5-MoE-A2.7B backbones, with improved expert utilization and routing diversity.
-
ProbMoE Dynamic-k achieves comparable performance to Exact-k while activating fewer experts on average (75–84.5% of the maximum), demonstrating effective adaptive computation allocation.
Introduction and Theoretical Foundation
Background and Motivation
Mixture-of-Experts (MoE) architectures scale large language models while keeping computational costs manageable by activating only a small subset of experts per token. However, training remains challenging because top-k routing is discrete and non-differentiable. Standard approaches ignore the dependence of the top-k operator on router logits during backpropagation, propagating gradients only through softmax probabilities. This leads to:
- Highly concentrated routing distributions
- Poor expert utilization
- Unstable training dynamics
Theoretical Foundation
The paper formalizes why top-k selection poses fundamental challenges. For a MoE layer with experts, the router produces logits , converted to softmax weights:
The MoE output for a selected subset is:
Differentiating the routed output with respect to router logits reveals two paths:
The second term is non-differentiable because the indicator function is piecewise-constant. Conventional MoE training drops this term, limiting the learning signal.
Probabilistic Formulation
ProbMoE optimizes the expected loss under a router-induced distribution over feasible subsets:
For each expert , let be the Bernoulli selection probability. The exact-k distribution is:
with normalizing constant:
Theorem 4.1 (Ahmed et al., 2023): The normalizing constant can be computed exactly in time , with vectorized complexity under perfect parallelization.
Methodology
Forward Pass
ProbMoE samples an expert subset from the exact-k distribution:
This preserves sparse execution (only experts evaluated per token) while enabling stochastic exploration of alternative expert combinations. At inference, the Maximum-A-Posteriori (MAP) set is selected.
Backward Pass
The key insight is using conditional marginals as a differentiable surrogate. The marginal probability of expert is:
Since is computed exactly via dynamic programming, these marginals are exact.
Marginal-Integrated Routing Weights
ProbMoE combines the sampled forward mask, marginals, and soft routing weights via a straight-through estimator:
where is the k-hot sampled mask, are the marginals, and are softmax routing weights. In the forward pass, (preserving the sampled mask); in the backward pass, gradients flow through both and .
The resulting router gradient decomposes as:
Dynamic-k Extension
ProbMoE Dynamic-k conditions on a range constraint :
Theorem 5.1: The range-constrained normalizing constant can be computed in time.
The conditional distribution over subset sizes enables adaptive cardinality inference:
Proposition 5.2: The range-constrained marginal probability satisfies:
Empirical Validation / Results
Experimental Setup
- Models: OLMoE-1B-7B (64 experts/layer, top-8 activated) and Qwen1.5-MoE-A2.7B (60 routed + 4 shared experts/layer, top-4 activated)
- Baselines: Conventional, DenseMixer, Frozen Router, DefaultMoE, SparseMixer, ReMoE
- Tasks: GSM8K (math reasoning), Law (legal understanding), Translation, Summarization, MBPP (code generation), MMLU
Key Results (Table 1)
OLMoE Backbone (Top-k = 8):
- ProbMoE achieves best performance on GSM (50.19), Law (29.00), Translation (31.63), and Summary (39.29)
- Outperforms DenseMixer on most tasks while preserving sparse expert execution
Qwen Backbone (Top-k = 4):
- ProbMoE achieves best performance on Law (34.40), Translation (39.23), Summary (44.40), and MMLU Stem (53.82)
- Competitive on GSM (53.29) and MBPP (35.00)
Ablation Study
Four routing configurations were evaluated:
- ProbMoE (Sample + Marginal): 50.24% EM, σ ≈ 0.09
- Sample + Dense STE: 46.6% EM, σ ≈ 0.37
- Top-k + Marginal and Top-k + Dense STE: intermediate performance
This confirms gains stem from aligning probabilistic selection with marginal-based optimization.
Routing Diversity Analysis
- ProbMoE requires more experts to reach 99% cumulative routing probability mass, indicating broader routing support
- On Qwen, ProbMoE shows lower Top-4 mass and higher normalized entropy, indicating more even expert assignment
- This broader distribution mitigates expert collapse and improves specialization
Dynamic-k Results (Table 2)
| Dataset | OLMoE | Qwen1.5 |
|---|---|---|
| GSM | -1.82 (80.00%) | -4.29 (75.00%) |
| Law | -0.04 (84.50%) | +2.70 (75.00%) |
| Translation | +0.36 (82.00%) | +3.22 (75.00%) |
Dynamic-k achieves comparable performance with fewer activated experts, with Law consistently activating more experts than Translation, and GSM the fewest.
Token-Level Analysis
- Rare tokens receive more experts; frequent tokens receive fewer
- Higher-cardinality tokens include punctuation, morphological fragments, and context-sensitive symbols
- Lower-cardinality tokens are typically numerals or semantically concrete words
Training–Inference Mismatch (Table 3)
When evaluated under dynamic-k MAP inference, ProbMoE Dynamic-k achieves 44.50% EM with avg. k = 5.018, while DenseMixer (38.97%, k = 5.292) and Conventional (38.59%, k = 5.039) underperform despite similar cardinality, revealing that exact-k training produces peaked distributions that don't support flexible allocation.
Theoretical and Practical Implications
Theoretical Contributions
-
Principled routing formulation: Casting MoE routing as probabilistic inference over discrete subsets provides a mathematically grounded alternative to heuristic gradient approximations.
-
Tractable inference: The use of SIMPLE enables exact normalization and marginals for cardinality-constrained distributions, making probabilistic routing computationally feasible.
-
Unified framework: ProbMoE unifies exact-k and dynamic-k routing within a single probabilistic formulation, treating cardinality as a modeling choice rather than a fixed architectural constraint.
Practical Implications
-
Improved expert utilization: ProbMoE distributes routing probability more broadly, mitigating expert collapse and improving model capacity utilization.
-
Adaptive computation: Dynamic-k enables token-level compute allocation, reducing inference cost without substantial performance loss.
-
Architecture-agnostic: ProbMoE integrates with existing MoE architectures without modifying expert parameterization.
-
Preserved sparsity: Sparse expert execution is maintained at both training and inference, unlike DenseMixer which requires dense expert-side computation.
Conclusion
ProbMoE demonstrates that modeling MoE routing probabilistically provides a principled method for expert selection. Key takeaways:
- Exact-k routing improves expert utilization and routing diversity through probabilistic subset sampling and marginal-based gradients
- Dynamic-k routing achieves competitive performance with fewer activated experts, adapting naturally to token and task complexity
- The framework is tractable, architecture-agnostic, and preserves sparse execution
Future Directions
- Extending ProbMoE to pre-training scenarios
- System-level optimizations to fully exploit sparsity in the dynamic setting
- Further exploration of probabilistic routing for other discrete decision-making in large-scale models
Related papers
- Tail-Replay: Escaping the Curse of Linear Attention in Prefix Caching for Hybrid LLMs
Tail-Replay enables unconstrained token-level prefix caching in hybrid LLMs by replaying only a 5-10% recent suffix to reconstruct linear-attention states, preserving 92.8-99.9% quality while achieving up to 14.3x TTFT speedup.
- Benchmarking Data-Centric Research for Recursive Self-Improvement (RSIBench-Data)
RSIBench-Data isolates data-centric research from training infrastructure, revealing a discovery-reliability gap where agents improve initial attempts but regress in 78% of continued feedback-driven searches.
- Evolution or Illusion? Rethinking Evaluation in LLM Evolutionary Search
Single-point budget evaluations of LLM evolutionary search yield unreliable rankings, as optimal seed-iteration splits and even winner identities invert with budget.