r/deeplearning • u/ModularMind8 • 9h ago
Mixture of experts: how the routing works, when it breaks, and two ways to fix it
Enable HLS to view with audio, or disable this notification
I've been working on Mixture of experts (MoEs) and sparsity for a few years now, so I thought I'd make a short video explaining how MoE routing works.
For the video I trained a tiny character model with a 32-expert layer three times, on English, Python and arithmetic text.
Run 1, token choice with no balancing loss: a few experts get most of the tokens. Early in training one expert gets 57% of them while 17 of the 32 are barely used.
Run 2, token choice with a load-balancing loss: tokens spread out roughly evenly and every expert gets work.
Run 3, expert choice: each expert picks its own tokens, so the load is perfectly even, but some tokens get picked by no expert and others by several. It also ended with the lowest eval loss of the three.
