Glossary · Feed-forward and experts

Mixture of experts (MoE)

Also: MoEexpertsrouteractive parametersshared expertstop-k routingsparse model

Read it at the depth you need: one sentence · a paragraph · the math · in the models here

1In one sentence

An FFN split into many expert FFNs, of which a router picks a few per token: the model stores all of them but runs only the chosen ones, so total and active parameters differ.

2In a paragraph

In a mixture of experts the feed-forward layer of each block is replaced by E smaller FFNs (experts) and a router, a small linear layer that scores the experts for each token. Only the top k run. A model can then have hundreds of billions of parameters but spend the compute of a much smaller one on each token: that is the difference between total and active parameters. The catch is memory: every expert has to be loaded, because the next token may pick different ones. Many designs also keep one or more shared experts that every token uses, and some keep the first few layers dense.

3The math, shapes and parameters

g = softmax(Wr x) (or sigmoid)  → keep the top k: S
MoE(x) = Σe∈S ge · FFNe(x) + FFNshared(x)

Parameters per MoE layer: the router E × d, plus E × 3 × d × fe for the experts (fe is moe_intermediate_size), plus any shared experts. Active per token:

active = total − (MoE layers) × (E − k) × 3·d·fe

Training needs the experts to be used evenly: an auxiliary loss, or (DeepSeek-V3) a per-expert bias added only for routing (e_score_correction_bias). Memory follows the total, speed follows the active count, which is why a 30B-A3B model needs the memory of a 30B but generates about as fast as a 3B.

Term by term on Notation Decoder, the sister site: Softmax · argmax and top-k

4In the 96 models on this site

The 30 mixtures of experts here. "Per token" counts routed experts plus shared ones; memory at 4-bit is for every expert.

ModelExpertsPer tokenExpert FFNTotalActiveActive share4-bit weights
DeepSeek-V2-Lite646 + 21,40815.7B2.66B16.9%7.9 GB
gpt-oss-20b3242,88020.9B4.19B20.0%10.5 GB
Gemma 4 26B-A4B128870425.2B3.82B15.1%12.6 GB
Qwen3 30B-A3B128876830.5B3.35B11.0%15.3 GB
Nemotron 3 Nano 30B-A3B1286 + 11,85631.6B3.58B11.3%15.8 GB
Qwen3.5 35B-A3B2568 + 151234.7B3.45B10.0%17.3 GB
Phi-3.5 MoE1626,40041.9B6.64B15.9%20.9 GB
Mixtral 8x7B8214,33646.7B12.9B27.6%23.4 GB
Qwen3-Next 80B-A3B51210 + 151279.7B3.87B4.9%39.8 GB
GLM-4.5-Air1288 + 11,408107B13.4B12.6%53.4 GB
Llama 4 Scout (17B-16E)161 + 18,192108B17.2B15.9%53.9 GB
gpt-oss-120b12842,880117B5.71B4.9%58.4 GB
Nemotron 3 Super 120B-A12B51222 + 12,688121B12.8B10.6%60.3 GB
Qwen3.5 122B-A10B2568 + 11,024122B9.77B8.0%61.1 GB
Mixtral 8x22B8216,384141B39.2B27.8%70.3 GB
MiniMax M225681,536229B11B4.8%114 GB
Qwen3 235B-A22B12881,536235B22.2B9.4%118 GB
Inkling-Small2566 + 22,048264B12B4.6%132 GB
GLM-4.51608 + 11,536353B33.6B9.5%176 GB
Qwen3.5 397B-A17B51210 + 11,024396B17.3B4.4%198 GB
Llama 4 Maverick (17B-128E)1281 + 18,192401B17.2B4.3%200 GB
Nemotron 3 Ultra 550B-A55B51222 + 15,120549B56.1B10.2%275 GB
DeepSeek-V32568 + 12,048671B37.6B5.6%336 GB
DeepSeek-R12568 + 12,048671B37.6B5.6%336 GB
DeepSeek-V3.12568 + 12,048671B37.6B5.6%336 GB
DeepSeek-V3.22568 + 12,048672B38.4B5.7%336 GB
GLM-5.22568 + 12,048743B41.3B5.5%372 GB
Inkling2566 + 23,072947B41.1B4.3%474 GB
Ling-1T2568 + 12,0481000B51.1B5.1%500 GB
Kimi K23848 + 12,0481.03T32.9B3.2%513 GB

Introduced in Shazeer et al., “Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer” (2017).

Related

Feed-forward network (FFN) · SwiGLU · Parameters · Quantization · every term