Mixture-of-experts routing
A small gate network scores every expert for a token, only the K highest-scoring experts run, and their outputs are combined using the gate's weights.
(curly G, the gate) gives one score per expert. keeps the best, for example 8 of 64 in a fine-grained design, or 2 of 16 in a coarser one. is the weight for chosen expert 's output. is the total number of experts. The parameter count grows with the number of experts, but the compute per token grows only with .
The difficulty is balance. Left alone, the gate tends to send most tokens to a few favorite experts. The auxiliary loss sums over experts, where is the fraction of tokens sent to expert and its average gate probability. That sum is smallest when tokens are spread evenly.
Where the course uses it
Related terms
- Ceiling, floor, round⌈x⌉ reads "ceiling of x" and rounds up. ⌊x⌋ reads "floor of x" and rounds down. The mixed ⌊x⌉ rounds to the nearest whole number.
- 𝓛 — the lossRead "L" or "the loss". The curly L is the single number that measures how wrong the model is. Training adjusts the weights to make it small.
- FFN — the feed-forward networkRead "F F N of x". It is a small two-layer neural network applied to each token's vector on its own, with the same weights for every token.