Skip to content
AI & Machine Learning

Mixture of Experts (MoE)

Definition

Mixture of experts is a model design in which the network is split into many smaller expert sub-networks and a router sends each token to only one or a few of them. The model can hold far more parameters than it uses for any single token, so it gains capacity without a matching rise in computation.

Diagram

How a mixture-of-experts layer routes a tokenA token goes to a router, which picks 2 of 8 expert sub-networks. Only those 2 run; their outputs are combined into the layer’s output. The other 6 hold parameters but do no work for this token.tokenRouterExpert 1Expert 2Expert 3 (runs)Expert 4Expert 5Expert 6 (runs)Expert 7Expert 8combined
Only 2 of the 8 experts do any work for this token, so it costs about a quarter of the computation of running them all. The next token may go to different experts. All of them still have to be held in memory, which is why a mixture-of-experts model can be fast but still need large servers.

Case study

Worked example