Mixture of Experts (MoE)
A Mixture-of-Experts model contains multiple expert networks, but a router activates only a subset for each token. This creates high total parameter capacity without executing every parameter for every token.
type Score = { expert: string; score: number };
function topKExperts(scores: Score[], k: number) {
return [...scores].sort((a, b) => b.score - a.score).slice(0, k);
}
New engineering problems
MoE adds router balance, expert capacity, communication overhead and distributed expert placement. A model may have a very large total parameter count while activating far fewer parameters per token.
Serving implications
Expert parallelism and interconnect bandwidth become important. Memory must often hold many experts even though only some execute for a token.
Practice
- Why can MoE increase parameter capacity without proportional FLOPs per token?
- What is expert routing?
- What happens if the router sends too many tokens to one expert?
- Why can MoE serving require different distributed strategies from dense models?