Abstract
Standard Mixture-of-Experts (MoE) models utilize TopK routing, which assigns a fixed number of experts to every token regardless of its complexity. This rigid allocation is inefficient, as linguistic tokens vary significantly in difficulty. We introduce SeqTopK, a parameter-free routing strategy that shifts the expert budget from the individual token level to the sequence level. By dynamically allocating more experts to "hard" tokens and fewer to "easy" ones, SeqTopK achieves superior performance across multiple benchmarks, including math and coding tasks, with zero additional parameters and minimal computational overhead.
Introduction
Mixture-of-Experts (MoE) architectures have become a cornerstone for scaling Large Language Models (LLMs) efficiently. By activating only a subset of experts for each token, these models maintain manageable inference costs while increasing total parameter counts. However, the conventional TopK routing mechanism treats all tokens as equally demanding. Whether processing a simple punctuation mark or a complex technical term, the model activates exactly $K$ experts. This "one-size-fits-all" approach fails to account for the natural heterogeneity of language, where some tokens require significantly more computational resources than others.
Methodology: Sequence-Level Routing
The core innovation of this work is Sequence-level TopK (SeqTopK). Instead of a fixed budget of $K$ experts per token, SeqTopK enforces a global budget of $T \cdot K$ experts across a sequence of length $T$.
Global Selection and Constraints
During training, the model evaluates expert scores for all tokens in a sequence and selects the top $T \cdot K$ entries. This allows "hard" tokens—those with high scores across multiple experts—to capture a larger share of the total budget. To maintain stability and prevent the model from ignoring specific tokens, the authors implement "Token-level Bounds," ensuring every token receives at least one expert while capping the maximum per token (e.g., $K+2$).
Online Inference
For autoregressive inference, where future tokens are unknown, the authors introduce an Expert Cache. This mechanism tracks the scores of preceding tokens to make sequence-aware routing decisions in real-time, effectively bridging the gap between global sequence knowledge and causal generation.
Experimental Results
The researchers evaluated SeqTopK using models like OLMoE-1B-7B and Qwen1.5-MoE-A2.7B across diverse datasets, including GSM8K (math), MBPP (coding), and ARC (reasoning).
Key Findings
- Performance Gains: SeqTopK consistently outperformed standard TopK. On the OLMoE model, it provided an average performance boost of 5.9%.
- Efficiency in High Sparsity: The benefits of SeqTopK are most pronounced in ultra-sparse regimes. For instance, when activating only 2 out of 128 experts, SeqTopK nearly doubled the performance of standard TopK on certain benchmarks.
- Difficulty Correlation: The study found a strong correlation between token entropy (uncertainty) and the number of experts activated by SeqTopK. High-entropy tokens, such as the start of a mathematical formula, naturally attract more computational resources.
- Seamless Integration: SeqTopK requires zero new parameters and introduces less than 1% computational overhead. It is also compatible with existing pretrained MoE models via short fine-tuning.
Conclusion and Future Work
SeqTopK demonstrates that sequence-level resource allocation is a more effective strategy for MoE models than token-level routing. By addressing the "easy token tax," it allows models to focus their capacity where it is needed most. Future research will focus on closing the performance gap between global and online routing and exploring the scalability of this method for extremely long sequences.
Summary updated