On the Role of Discrete Representation in Sparse Mixture of Experts

Giang Do, Kha Pham, Hung Le, Truyen Tran

TL;DR

VQMoE replaces the traditional, often-unstable router in Sparse Mixture of Experts (SMoE) with discrete representations learned via Vector Quantization (VQ). This "router-less" approach effectively eliminates representation collapse, improves training stability, and enables a lightweight fine-tuning strategy that saves 28% in computational resources.

What Problem Does This Paper Address?

Sparse Mixture of Experts (SMoE) is a popular way to scale model capacity (like in Mixtral or Switch Transformers) without a linear increase in compute. However, SMoEs suffer from a notorious issue called representation collapse. This happens when the router—the component responsible for assigning tokens to experts—fails to specialize. Either a few experts get all the work (load imbalance), or all experts converge to producing nearly identical outputs, defeating the purpose of having multiple experts.

Current solutions usually involve adding complex auxiliary losses or regularizers to "fix" the router. The authors of this paper ask a more fundamental question: Is an explicit router necessary at all? They argue that traditional routers (often simple linear layers) are theoretically "inconsistent" and prone to instability because they are too simple to capture the complex clustering required for optimal expert selection.

Methods

The authors propose Vector-Quantized Mixture of Experts (VQMoE). Instead of a standard router, VQMoE uses Vector Quantization to learn a discrete codebook of input patterns.

  • Dual-Path Pre-training: During pre-training, the model uses two parallel paths: a standard continuous SMoE path and a new discrete path. The discrete path maps inputs to codebook vectors, which then point to specific experts via a deterministic hashing (modulo) operation.
  • Gating Mechanism: A learnable gating layer balances the contributions of the continuous and discrete representations.
  • Lightweight Fine-tuning: For downstream tasks, the model can drop the continuous path entirely, relying only on the discrete path. This significantly reduces the parameter count and compute required for adaptation.
Figure 1: Illustration of the proposed VQMoE architecture for Pre-training and fine-tuning. (a) At the Pre-training stage, VQMoE architecture learns simultaneously continuous and discrete representation at the Pre-training phase. The continuous representation is learned by the conventional SMoE, while the Vector Quantization block facilitates the learning of a discrete representation. The final output is then combined by a gate layer. (b) VQMoE learns a discrete representation that is capable of operating efficiently and robustly on downstream tasks. VQMoE computes the discrete representation only during the fine-tuning stage to achieve robustness and efficiency.

Datasets

The authors evaluated VQMoE across a wide variety of domains:

  • Language Pre-training: Character-level (enwik8, text8) and word-level (WikiText-103, One Billion Word/lm1b) modeling.
  • Language Fine-tuning: Sentiment analysis and intent detection (SST-2, SST-5, IMDB, BANKING77).
  • Vision Tasks: Image classification on CIFAR-10, CIFAR-100, STL-10, SVHN, and ImageNet-1K.
  • Real-world Application: Image segmentation on the ADE20K dataset.

Key Insights and Ideas

  • The Inconsistency of Linear Routers: The paper provides a theoretical proof (Theorem 4.3) showing that simple linear routers are inherently inconsistent. Because the input representations (from Multi-Head Attention) are far more complex than the router's linear projection, the router often fails to maintain stable clusters, leading to collapse.
  • Subspace Expansion: Through Jacobian analysis, the authors show that VQMoE increases the dimensionality of the output space compared to standard SMoE. This mathematical "breathing room" is what prevents experts from collapsing into a single representation.
  • Optimal Selection via Clustering: The authors demonstrate that if inputs are naturally clustered, assigning each cluster to a specific expert is the optimal selection strategy. VQ is a principled way to perform this clustering online during training.

Key Results

  • Superior Performance: VQMoE consistently outperformed state-of-the-art SMoE variants (like XMoE and StableMoE) across all language benchmarks. For example, on the One Billion Word dataset, it achieved significantly lower perplexity than the vanilla SMoE baseline.
  • Faster Convergence: As shown in the training curves, VQMoE converges faster and more smoothly than baseline models, indicating better training stability.
  • Efficiency Gains: By using only the discrete path during fine-tuning, VQMoE achieved a 28% reduction in computational resource usage while maintaining or exceeding the accuracy of full-parameter SMoE models.
  • Parameter Robustness: A VQMoE model with 20% fewer total parameters (by reducing hidden dimensions) still matched the performance of a full-sized standard SMoE.

Limitations and Future Work

  • Pre-training Overhead: While fine-tuning is more efficient, the dual-path architecture during pre-training requires learning a codebook, which involves a trade-off in initial computational resources.
  • Scaling Discrete-Only Training: The authors noted that while "discrete-only" training works well for small-scale models, larger models still benefit from the continuous path during the initial pre-training phase to reach peak performance.
  • Future Directions: The authors suggest that further advances in vector quantization techniques (like VQGAN or Residual VQ) could be integrated into VQMoE to further enhance performance and interpretability.

Summary updated

BibTeX
@article{do2025role,
  author = {Giang Do and Kha Pham and Hung Le and Truyen Tran},
  title = {{On the Role of Discrete Representation in Sparse Mixture of Experts}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=GTWKmojpI7},
}
Figure