Routers in Vision Mixture of Experts: An Empirical Study

Tianlin Liu, Mathieu Blondel, Carlos Riquelme, Joan Puigcerver · DOI

Abstract

Mixture-of-Experts (MoE) models have emerged as a primary method for scaling neural network capacity without a proportional increase in computational cost. While MoEs are widely adopted in Large Language Models (LLMs), their application in Computer Vision has lacked a standardized comparative framework. This study provides a comprehensive empirical evaluation of routing strategies in Vision MoEs. By introducing a unified mathematical formulation for MoE layers, we compare six distinct routing strategies across large-scale vision tasks. Our findings demonstrate that Expert Choice and Soft MoE routing significantly outperform traditional Token Choice methods, offering superior accuracy-to-compute trade-offs.

Introduction

The core principle of Mixture-of-Experts (MoE) is a "divide and conquer" strategy: instead of activating every parameter for every input, MoE layers route data (tokens) to specific sub-networks, or "experts." The component responsible for this decision-making process is the router. While the router is the "brain" of the MoE, its design has historically been fragmented, with many vision models simply adopting routers originally designed for natural language processing.

This paper addresses the lack of standardization by providing the first rigorous head-to-head comparison of routing strategies specifically for vision. We investigate whether the success of various MoE architectures stems from their underlying routing logic or specific architectural tweaks, ultimately identifying the most efficient paths for scaling vision models.

A Unified Framework for Routing

To facilitate a fair comparison, we propose a unified mathematical formulation for MoE layers using two primary routing tensors:

  1. Dispatch Tensor ($D_X$): This tensor defines the mapping of input tokens to specific expert slots.
  2. Combine Tensor ($C_X$): This tensor determines how the outputs from the experts are weighted and integrated back into the model's main representation flow.

By defining routing through these two tensors, we can categorize and compare disparate routing logics—from discrete assignments to fully differentiable mappings—within a single experimental pipeline.

Comparative Analysis of Routing Strategies

Our study evaluates three primary categories of routers:

  • Token Choice: The traditional approach where each token selects its top-$k$ experts. While intuitive, this often leads to "expert underutilization," where certain experts are overloaded while others remain idle.
  • Expert Choice: A reversed logic where each expert selects a fixed number of tokens. This ensures full expert utilization and allows a single token to be processed by multiple experts simultaneously without complex load-balancing losses.
  • Soft MoE: A fully differentiable approach that avoids discrete assignments. Instead of routing a whole token, it passes a weighted combination of all tokens to each expert slot, effectively bypassing the "sorting" bottlenecks of sparse MoEs.

Additionally, we introduce Sinkhorn Expert Choice, which utilizes optimal transport theory to refine the Expert Choice logic, ensuring a more mathematically grounded distribution of tokens.

Empirical Evaluation

We evaluated these routers using a high-capacity training pipeline:

  • Pre-training: Models were trained on the JFT-300M dataset, containing 305 million images.
  • Evaluation: Performance was benchmarked using 10-shot transfer learning on ImageNet-1k, measuring how effectively pre-trained features generalize to new categories with minimal data.

Key Results

The empirical data reveals a clear hierarchy in routing effectiveness:

  • Soft MoE Dominance: In the B16 architecture, Soft MoE achieved 50.00% accuracy on JFT-300M, a substantial improvement over the standard Softmax Token Choice, which reached only 46.35%.
  • Expert Choice Efficiency: Transitioning from Token Choice to Expert Choice in the B32 architecture improved accuracy from 41.23% to 43.83% with negligible changes in computational overhead.
  • The Softmax Combine Trick: We discovered that for routers using Sinkhorn logic, using Sinkhorn for dispatching but a simple Softmax for combining results improved accuracy by approximately 1%. This stabilizes gradients by bypassing optimal transport algorithms during the backward pass.

Insights and Discussion

Our analysis yields several critical insights for future MoE development:

  1. Allocation Over Affinity: The specific algorithm used to allocate tokens (the routing logic) is significantly more impactful than the mathematical function used to calculate the similarity (affinity) between tokens and experts.
  2. The Advantage of Differentiability: Soft MoEs provide the best "accuracy per TPU-day." By replacing discrete sorting with matrix multiplications, they are often faster to train and more stable than sparse alternatives.
  3. Expert Choice as a Default: For sparse MoE architectures, Expert Choice should be considered the new baseline, as it naturally solves the load-balancing issues that plague Token Choice models.

Limitations and Future Work

While Soft MoE shows great promise, we observed training instabilities when scaling to the largest architectures (L16) at high capacities. This suggests that further research into initialization and normalization is required for extreme-scale soft routing. Furthermore, while this study focuses on image recognition, the applicability of these routing strategies to generative vision tasks and dense prediction (e.g., segmentation) remains a vital area for future exploration.

Summary updated

BibTeX
@article{liu2024routers,
  author = {Tianlin Liu and Mathieu Blondel and Carlos Riquelme 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