On the effectiveness of discrete representations in sparse mixture of experts

Giang Do, Kha Pham, Hung Le, Truyen Tran · OpenReview

Abstract

Sparse mixture of experts (SMoE) is an effective solution for scaling up model capacity without increasing the computational costs. A crucial component of SMoE is the router, responsible for directing the input to relevant experts; however, it also presents a major weakness, leading to routing inconsistencies and representation collapse issues. Instead of fixing the router like previous works, we propose an alternative that assigns experts to input via indirection, which employs the discrete representation of input that points to the expert. The discrete representations are learnt via vector quantization, resulting in a new architecture dubbed Vector-Quantized Mixture of Experts (VQMoE). We provide theoretical support and empirical evidence demonstrating the VQMoE's ability to overcome the challenges present in traditional routers. Through extensive evaluations on both large language models and vision tasks for pre-training and fine-tuning, we show that VQMoE achieves a 28% improvement in robustness compared to other SMoE routing methods, while maintaining strong performance in fine-tuning tasks.

Introduction

Scaling Transformer models to trillions of parameters is the current frontier of AI, but it is prohibitively expensive. Sparse Mixture of Experts (SMoE) is a popular solution: instead of running the whole model for every token, a "router" selects only one or two "expert" subnetworks to handle the input.

However, SMoEs have a "router problem." Traditional routers are often inconsistent and prone to representation collapse, a phenomenon where either only a few experts are used (leaving others idle) or all experts converge to doing the same thing. Most researchers try to fix this with complex auxiliary losses or regularization. This work asks a more radical question: Is an explicit router necessary at all?

The VQMoE Architecture

VQMoE (Vector-Quantized Mixture of Experts) replaces the traditional, often unstable "router" in sparse models with a discrete representation learned via vector quantization.

Routing via Indirection

Instead of a dedicated router network predicting which expert to use, the model maps input tokens into a discrete codebook (a set of learned vectors). Each codebook entry then points to a specific expert. This indirection ensures that discrete latent variables naturally cluster similar inputs. By forcing the model to pick a "symbol" (a codebook vector) for an input, the model is incentivized to develop specialized experts for specific types of data patterns.

Dual Pathways and Fine-tuning

During pre-training, the model uses both a continuous path (standard SMoE) and a discrete path (VQ-based). This ensures no information is lost while the discrete structure is being learned. For downstream tasks, the continuous path can be discarded, using only the discrete path. This makes the model much more efficient to adapt to new data.

The VQMoE architecture during pre-training and fine-tuning stages.

Theoretical and Empirical Support

The paper provides a Jacobian analysis demonstrating that VQMoE's gradient space is significantly larger than traditional SMoEs ($N+K+2$ dimensions vs. just $N$). This mathematically explains why VQMoE is less likely to suffer from representation collapse. Empirical results show that VQMoE reaches lower perplexity (better performance) faster than baselines like StableMoE or XMoE.

Perplexity (PPL) comparison across different MoE architectures during training.

Key Results

The authors evaluated VQMoE across a massive range of benchmarks, including language pre-training (enwik8, WikiText-103), fine-tuning (SST-2, IMDB), and vision tasks (CIFAR, ImageNet-1K).

  • Robustness Boost: VQMoE achieved a 28% improvement in robustness compared to other SMoE routing methods.
  • Efficiency Gains: During fine-tuning, VQMoE saved 28% of computational resources by utilizing only the discrete pathway while maintaining or exceeding baseline accuracy.
  • Vision Superiority: On ImageNet-1K, VQMoE (Large) achieved 71.3% accuracy, outperforming both the dense Vision Transformer (71.1%) and SoftMoE (68.2%).
  • Zero-Shot Performance: When compared against the state-of-the-art OLMoE-1B-7B on the MTEB benchmark, VQMoE showed a relative improvement of 4.6% across 19 different datasets without any additional training.

Conclusion

VQMoE addresses the fundamental instability of traditional SMoE routers by leveraging discrete representations. By replacing explicit routing with vector quantization, the model achieves superior robustness and efficiency. Future work includes exploring more advanced vector quantization techniques and scaling the architecture to trillion-parameter regimes.

Summary updated

BibTeX
@article{do2025effectiveness,
  author = {Giang Do and Kha Pham and Hung Le and Truyen Tran},
  title = {{On the effectiveness of discrete representations in sparse mixture of experts}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=GTWKmojpI7},
}
Figure