DirMoE: Dirichlet-routed Mixture of Experts
Amirhossein Vahidi, Hesam Asadollahzadeh, Navid Akhavan Attar, Marie Moullet, Kevin Ly, Xingyi Yang, Mohammad Lotfollahi
TL;DR
DirMoE introduces a fully differentiable Dirichlet-based router for Mixture-of-Experts that separates per-token expert selection from per-expert contribution. It uses a spike-and-slab factorization on the simplex, with a Gumbel-Sigmoid gate for activation and an implicit reparameterization of the Dirichlet for mass allocation, enabling end-to-end gradients and explicit sparsity control through a sparsity knob $\lambda$. The approach yields calibrated, sparse routing without balancing losses, achieving competitive zero-shot performance and improved expert specialization on large-scale language tasks with a 185M-parameter backbone. Empirically, DirMoE demonstrates scalable training, controllable sparsity via the Dirichlet concentration, and robust specialization across domains on The Pile-based pretraining, making it practical for large sparse MoE deployments.
Abstract
Mixture-of-Experts (MoE) models have demonstrated exceptional performance in large-scale language models. Existing routers typically rely on non-differentiable Top-$k$+Softmax, limiting their performance and scalability. We argue that two distinct decisions, which experts to activate and how to distribute expert contributions among them, are conflated in standard Top-$k$+Softmax. We introduce Dirichlet-Routed MoE (DirMoE), a novel end-to-end differentiable routing mechanism built on a Dirichlet variational autoencoder framework. This design fundamentally disentangles the core routing problems: expert selection, modeled by a Bernoulli component, and expert contribution among chosen experts, handled by a Dirichlet component. The entire forward pass remains fully differentiable through the use of Gumbel-Sigmoid relaxation for the expert selection and implicit reparameterization for the Dirichlet distribution. Our training objective, a variational ELBO, includes a direct sparsity penalty that precisely controls the number of active experts in expectation, alongside a schedule for key hyperparameters that guides the model from an exploratory to a definitive routing state. Moreover, our DirMoE router matches or exceeds other methods while improving expert specialization.
