Router
A learned projection scores experts for each token. Top-k gating selects a small subset and supplies combination weights.
Sparse Mixture-of-Experts layers activate only a few expert networks per token. Change routing, capacity, balancing, and noise to see specialization collide with throughput.
Open the routing floorA learned projection scores experts for each token. Top-k gating selects a small subset and supplies combination weights.
Each expert accepts a bounded number of token assignments per batch. Overflow is dropped, rerouted, or sent through a shared fallback.
A balancing loss discourages routing collapse, where a few experts receive nearly every token and become throughput bottlenecks.
Routing to more experts can improve capacity and gradient coverage, but increases communication, memory traffic, and active FLOPs per token.
Distributed MoE inference waits for loaded devices. Balanced counts are not merely aesthetic; the slowest expert can determine layer latency.
When capacity is exceeded, dropped assignments skip expert transformation or use fallback behavior. Track drop rate by token type, language, and sequence position.
Sometimes clusters emerge, but specialization can be distributed, overlapping, and difficult to label. Expert IDs are not guaranteed semantic modules.
Noise encourages exploration and can improve load distribution during training. Too much noise destabilizes specialization and routing consistency.
Per-token compute can be lower relative to total parameters, but communication, memory, batching, and serving utilization determine actual cost.
Shazeer et al. (2017) introduced sparsely gated MoE layers at scale. Switch Transformers studies top-1 routing and capacity. GShard scales conditional computation with sharding. ST-MoE studies stable transfer and routing design.