System Design
19. AI System Design and LLM InfrastructureAnimated
Mixture of Experts (MoE)
A model with many expert sub-networks, using a few per token.
The idea
A gating network sends each token to its top experts, so total parameters are huge but active parameters are few.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Not every question needs the biggest model.
- step:
- 1/4
- at:
- Request
1/9
The green dot is a request moving through the system.
Step by step
- 1The router scores experts for each token
- 2The top experts run
- 3Outputs are combined
- 4Other experts stay idle
Where it is used
Efficient large models.
Watch out for
All experts must still sit in memory, and load balancing matters.