Introduction
Mixture-of-Experts (MoE) models have emerged as a primary strategy for scaling Transformer architectures to billions of parameters without a proportional increase in computational overhead. By replacing dense feed-forward layers with a collection of specialized "experts" and activating only a subset for each input token, MoE models achieve high capacity with sparse computation. However, the efficiency of these models is often hampered by the dynamic nature of their routing mechanisms. This paper introduces StableMoE, a novel training strategy designed to address the "routing fluctuation" problem, leading to faster convergence and state-of-the-art performance.
The Challenge: Routing Fluctuation
In traditional MoE frameworks, the router—the component responsible for assigning tokens to experts—is trained alongside the rest of the model. Because the router's decisions are based on the model's internal hidden representations, which are constantly evolving during training, the assignment of a specific token (e.g., the word "apple") to a specific expert is highly unstable.
The authors identify this as routing fluctuation. Their analysis reveals that even halfway through the training process, nearly 30% of tokens have not settled on a consistent expert. This instability prevents experts from specializing effectively; an expert may spend thousands of iterations learning the nuances of a specific linguistic pattern, only for the router to suddenly redirect those tokens elsewhere. This "moving target" problem results in significant computational waste and suboptimal model performance.
The StableMoE Framework
StableMoE solves this by decoupling the routing decision from the evolving hidden states of the backbone model. The authors propose a two-stage training pipeline:
Stage 1: Learn and Distill
In the initial phase, the model utilizes a standard MoE approach enhanced by a sigmoid gating mechanism and a balance loss to ensure cohesive and well-distributed expert assignments. Simultaneously, the model distills these routing decisions into a separate, lightweight Distilled Router. Unlike the primary router, this distilled version makes decisions based on simple word embeddings rather than deep hidden states. This ensures that the routing logic is grounded in the semantic essence of the input rather than the fluctuating internal state of the Transformer.
Stage 2: Stable Training
Once the routing strategy is distilled, the Distilled Router is frozen. For the remainder of the training process, token-to-expert assignments remain fixed. This stability allows experts to specialize deeply on a consistent set of inputs. The authors found that allocating approximately 10% of the total training steps to Stage 1 provides the optimal balance between learning a robust routing strategy and allowing sufficient time for stable expert specialization.
Experimental Results
StableMoE was evaluated against several prominent MoE variants, including Switch Transformer, BASE Layer, and Hash Layer, across two major benchmarks:
- Language Modeling: Using a 100B token corpus, StableMoE achieved a test perplexity of 18.93, outperforming the Hash Layer (19.25) and other sparse models.
- Multilingual Machine Translation: On the WMT dataset (32.5 million parallel sentences across 10 language pairs), StableMoE achieved an average BLEU score of 30.32. This represents a 1.22-point improvement over the dense baseline while only increasing FLOPs by 9.3%.
Beyond raw performance, StableMoE demonstrated superior training efficiency. By fixing the routing early, the model reached lower perplexity levels in significantly fewer wall-clock hours compared to models with dynamic routing, proving that stability is a key driver of convergence speed.
Conclusion and Future Work
StableMoE demonstrates that routing stability is essential for the effective training of sparse models. Qualitative analysis confirms that the frozen router naturally learns semantic clustering, with specific experts specializing in distinct linguistic categories such as adjectives, punctuation, or specific topical nouns.
While the current implementation relies on a simple word-embedding-based router, future research may explore more sophisticated feature extractors or attempt to achieve this stability in a single-stage training process. Additionally, extending the StableMoE philosophy to other domains, such as computer vision, remains a promising avenue for further exploration.
Summary updated