Scores all experts per token and activates only the top-k. Most of the model’s weights stay idle each step.
Introduced inJan 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer
In a mixture-of-experts layer the router is a small linear layer that scores every expert for the current token; only the top-k scorers actually run, and their outputs are combined with the router’s weights. This is how models grow to hundreds of billions of parameters while spending the compute of a much smaller dense model per token. Routers are trained with auxiliary objectives (or bias tricks) to keep expert load balanced.
Share of new models that have included an MoE router over time.
Open any of these on hfviewer to find this block in the interactive architecture graph.
Browse all 286 models with this in the catalog →
hfviewer renders the full architecture of 2,300+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.
Browse all model graphs →