An expert is a specialized neural subnetwork within a mixture-of-experts architecture. Different experts can specialize in distinct tasks or input characteristics, while routing activates only the relevant subset for each input. section 3.5
In a transformer, expert networks usually replace the feed-forward network after self-attention. Instead of one large FFN processing every token, multiple smaller expert FFNs share the layer’s workload. section 3.5.1
An MoE layer combines:
- A set of expert networks, commonly implemented as separate feed-forward subnetworks. section 3.5.1
- A gating network, or router, that scores experts from each token’s hidden representation. section 3.5.1
- Sparse activation, typically selecting the top one or two experts per token to reduce computation while retaining a larger parameter pool. section 3.5 section 3.5.1
Top-k routing
A sparse gate applies a learned linear transformation to token representations, selects the highest-scoring experts with top-k, and normalizes their selected scores with softmax. A GShard-style variant extends this pattern with top-two routing, capacity controls, load balancing, and optional random routing.
Figure 3.4 Simplified MoE architecture. Only a few experts are active per input, making inference more efficient.
Use the architecture figure to trace how a token is routed to only a few active experts. section 3.5.1
