Routers in Vision Mixture of Experts: An Empirical Study

Tianlin Liu, Mathieu Blondel, Carlos Riquelme Ruiz, Joan Puigcerver

Abstract

Mixture-of-Experts (MoE) models offer a path toward scaling model capacity without a proportional increase in computational cost. Central to this architecture is the router, which determines how feature embeddings (tokens) are assigned to specific sub-networks (experts). This paper presents a comprehensive empirical study of routing strategies within vision-based MoEs. We introduce a unified formulation that characterizes MoEs through two parametric tensors—Dispatch and Combine—covering both sparse and soft routing variants. Our evaluation of six distinct router types reveals that routers originally designed for language modeling are highly effective for vision, and that Expert Choice and Soft MoE architectures consistently outperform traditional Token Choice methods in both efficiency and accuracy.

Introduction

As deep learning models scale, the computational burden of dense architectures becomes a bottleneck. Mixture-of-Experts (MoE) layers address this by activating only a subset of parameters for any given input. While MoEs have seen significant adoption in Large Language Models (LLMs), their application in Computer Vision has often relied on routing strategies inherited directly from Natural Language Processing (NLP). This study investigates whether these "borrowed" strategies are optimal for visual data and explores the performance trade-offs between different routing paradigms under fixed compute budgets.

A Unified MoE Formulation

To facilitate a head-to-head comparison, we propose a unified mathematical framework for MoE layers. In this framework, the routing process is defined by two primary operations:

  1. Dispatch Tensor ($D_X$): This determines how input tokens are distributed across the available experts.
  2. Combine Tensor ($C_X$): This determines how the processed outputs from the experts are weighted and merged to form the final representation.

This formulation allows us to categorize routers into two broad families: Sparse MoEs, which use discrete assignments (often involving top-k selection), and Soft MoEs, which utilize fully differentiable, soft assignments of weighted token combinations.

Routing Strategies Evaluated

We evaluate six routing variants across the Sparse and Soft categories:

Sparse MoE Variants

  • Token Choice: The traditional approach where each token "chooses" its top-$k$ experts. While intuitive, this often leads to load-balancing issues where some experts are over-utilized while others remain idle.
  • Expert Choice: A reversed approach where each expert "chooses" the top-$C$ tokens it will process. This inherently ensures a perfectly balanced workload across all experts and allows for flexible token processing—some tokens may be processed by multiple experts, while others (potentially less informative ones) may be skipped.
  • Sinkhorn Routers: These utilize optimal transport theory (the Sinkhorn algorithm) to achieve balanced matching between tokens and experts without the need for auxiliary load-balancing losses.

Soft MoE

Unlike sparse methods, Soft MoE avoids hard assignments. It passes weighted linear combinations of all input tokens to the experts. This approach is fully differentiable, avoids the computational overhead of sorting or ranking, and is highly optimized for modern hardware acceleration.

Experimental Setup

We conducted experiments using the Vision Transformer (ViT) architecture in various sizes (B/32, B/16, and L/16). Models were pre-trained on JFT-300M, a massive dataset of 305 million images, and evaluated on ImageNet-1k using 10-shot transfer learning to measure downstream adaptability.

Key Findings

1. Expert Choice Outperforms Token Choice

In the sparse MoE category, letting experts choose tokens is superior to the inverse. Expert Choice naturally resolves the "expert bottleneck" problem common in Token Choice models. By guaranteeing that every expert is fully utilized, the model achieves better parameter efficiency and higher accuracy.

2. The Superiority of Soft MoE

Soft MoE emerged as the most efficient architecture. By bypassing discrete top-k operations, it achieves a better trade-off between training time and accuracy. For example, on the JFT-300M benchmark with a B/16 backbone, Soft MoE achieved 50.53% accuracy, significantly outperforming the standard Softmax Token Choice at 48.86%.

3. Cross-Domain Robustness

Our results indicate that routers developed for NLP (such as Sinkhorn-based routers) are remarkably robust when applied to vision tasks. However, the "Sinkhorn Trick"—using a Sinkhorn-normalized matrix for dispatching but a standard Softmax for combining—was found to be particularly effective for stabilizing vision training.

4. Downstream Performance

The advantages observed during pre-training translated consistently to few-shot transfer tasks. In 10-shot ImageNet evaluation (B/32), Soft MoE reached 67.85% accuracy, while the leading Token Choice variant trailed at 65.91%.

Conclusion

This study demonstrates that the choice of router is a critical factor in the performance of Vision MoEs. While sparse Token Choice routers are the current standard, our findings suggest a shift toward Expert Choice or Soft MoE architectures for better scaling and compute efficiency. Future research should explore whether these insights hold at the scale of trillions of parameters and across diverse tasks such as object detection and segmentation.

Summary updated

BibTeX
@article{liu2024routers,
  author = {Tianlin Liu and Mathieu Blondel and Carlos Riquelme Ruiz and Joan Puigcerver},
  title = {{Routers in Vision Mixture of Experts: An Empirical Study}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=aHk3vctnf1},
}
Figure