Expert Race: A Flexible Routing Strategy for Scaling Diffusion Transformer with Mixture of Experts

Yike Yuan, Ziyu Wang, Zihao Huang, Defa Zhu, Xun Zhou, Jingyi Yu, Qiyang Min

Abstract

Diffusion models have emerged as the mainstream framework in visual generation. Building upon this success, the integration of Mixture of Experts (MoE) methods has shown promise in enhancing model scalability and performance. In this paper, we introduce Race-DiT, a novel MoE model for diffusion transformers with a flexible routing strategy called Expert Race. By allowing tokens and experts to compete together and select the top candidates, the model learns to dynamically assign experts to critical tokens. Additionally, we propose per-layer regularization to address challenges in shallow layer learning and a router similarity loss to prevent mode collapse, ensuring better expert utilization. Extensive experiments on ImageNet validate the effectiveness of our approach, showcasing significant performance gains while promising scaling properties.

Introduction

Scaling up Diffusion Transformers (DiT) represents the current frontier for high-quality visual generation. However, the computational cost of training and deploying these large-scale models is immense. While Mixture of Experts (MoE) has successfully scaled Large Language Models (LLMs) by activating only a sparse fraction of the model for any given input, applying MoE to the visual domain presents unique challenges.

Standard MoE routing strategies, such as Token-Choice (where each token selects a fixed number of experts) or Expert-Choice (where each expert selects a fixed number of tokens), are often too rigid for visual data. Visual information is inherently spatially redundant—for instance, a clear blue sky requires significantly less "expertise" to generate than a complex human face. Furthermore, the diffusion process is temporally varied; predicting noise at the initial stages is a different task than the fine-grained reconstruction required at the end. Existing MoE methods struggle to shift resources dynamically between these varying levels of complexity.

The Race-DiT Framework

To address these limitations, we propose Race-DiT, which introduces a highly flexible routing mechanism designed to follow the complexity of the data.

Expert Race Routing

Instead of forcing a fixed assignment per token, the Expert Race routing treats all token-expert combinations within a training batch as competitors in a global "race." Only the top-$k$ combinations with the highest affinity scores are activated. This global competition allows the model to allocate more computational power to "hard" tokens (which may be processed by multiple experts) while "easy" tokens might utilize only one or even none.

To bridge the gap between batch-based training and single-sample inference, we employ an Exponential Moving Average (EMA). This learns a stable "winning threshold" during training, allowing the model to maintain its dynamic allocation properties during inference without needing a full batch for comparison.

Optimization Strategies

To ensure the MoE architecture reaches its full potential, we introduce two additional optimization techniques:

  1. Router Similarity Loss: A common failure mode in MoE is "mode collapse," where multiple experts learn redundant features. This loss function minimizes the correlation between different experts' selection patterns, encouraging specialization and ensuring the model utilizes its full capacity.
  2. Per-Layer Regularization (PLR): In deep architectures, shallow layers often suffer from diminished gradients or "washed out" contributions. PLR introduces auxiliary prediction heads to these early layers, forcing them to learn useful, discriminative features from the start of training.

Experimental Results

We evaluated Race-DiT on the ImageNet 256×256 benchmark for class-conditional image generation, comparing it against dense DiT baselines and existing MoE-based diffusion models.

Efficiency and Speed

Race-DiT demonstrates remarkable training efficiency. The model reaches the same training loss as a dense DiT-XL model 7.2× faster in terms of total iterations. This suggests that the dynamic allocation of experts allows the model to converge much more rapidly by focusing compute where it is most effective.

Generation Quality

In terms of image quality, the RaceDiT-XL/2-4in32 configuration (activating 4 experts out of a pool of 32) achieved a Fréchet Inception Distance (FID) of 2.06. This significantly outperforms the standard dense DiT-XL/2, which achieves an FID of 2.27, despite Race-DiT using similar levels of activated compute during the forward pass.

Scaling Properties

Our experiments show that performance improves consistently as the number of candidate experts increases or as the "hidden split" (fine-grained expert segmentation) is refined. This indicates that Race-DiT possesses strong scaling laws, providing a clear path for developing even larger and more capable generative models.

Discussion and Future Work

Visualization of the routing patterns confirms our hypothesis: the model naturally learns to assign more experts to the center of images (where primary objects are typically located) and to the later stages of the denoising process where fine-grained details are reconstructed.

While Race-DiT offers a significant leap in efficiency, challenges remain. There is still a slight mismatch between batch-based training and single-sample inference thresholds, and the communication overhead of MoE on distributed hardware remains a practical hurdle. Future work will explore extending the Expert Race strategy to high-resolution video generation and 3D asset creation, where spatial and temporal redundancies are even more pronounced, offering even greater potential for sparse computation.

Summary updated

Abstract

Diffusion models have emerged as mainstream framework in visual generation. Building upon this success, the integration of Mixture of Experts (MoE) methods has shown promise in enhancing model scalability and performance. In this paper, we introduce Race-DiT, a novel MoE model for diffusion transformers with a flexible routing strategy, Expert Race. By allowing tokens and experts to compete together and select the top candidates, the model learns to dynamically assign experts to critical tokens. Additionally, we propose per-layer regularization to address challenges in shallow layer learning, and router similarity loss to prevent mode collapse, ensuring better expert utilization. Extensive experiments on ImageNet validate the effectiveness of our approach, showcasing significant performance gains while promising scaling properties.
BibTeX
@inproceedings{yuan2025expert,
  author = {Yike Yuan and Ziyu Wang and Zihao Huang and Defa Zhu and Xun Zhou and Jingyi Yu and Qiyang Min},
  title = {{Expert Race: A Flexible Routing Strategy for Scaling Diffusion Transformer with Mixture of Experts}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=9W3CSuHoFA},
}
Figure