Pick the statements that accurately describe how an MoE sublayer replaces a dense FFN
MoE swaps the dense FFN for N expert FFNs plus a tiny router; attention and the block scaffolding are untouched.
Imagine a transformer block as a factory with two stations. The first station (attention) lets every item see every other item. The second station used to be one big general-purpose machine (the dense FFN); MoE replaces it with eight smaller specialist machines plus a clerk who decides which machine each item should visit. Most items only go to one or two of the eight, so the factory runs about as fast as before; but the total floor space (parameters) is eight times bigger, which means the factory now stores eight times as much know-how. Llama 4 Maverick takes this to 128 specialists, with each item visiting just one.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: name the swap (FFN only), describe the router, give the param/FLOP arithmetic with a real model (Mixtral or Maverick), mention load-balancing loss.
| Block component | Dense block | MoE block |
|---|---|---|
| Attention sublayer | Standard MHA/GQA/MLA | Unchanged (same MHA/GQA/MLA) |
| Pre-norm placement | Before each sublayer | Unchanged |
| Residual wrap | x + sublayer(norm(x)) | Unchanged |
| FFN sublayer body | One MLP, all tokens | N expert MLPs + router, k per token |
| FFN params per block | ~135M (Llama-7B sized) | ~135M × N (e.g., 128× for Maverick) |
| Active FLOPs per token (FFN) | 1× dense FFN | k × dense FFN (k=1 or 2) |
Real products, models, and research that use this idea.
- Llama 4 Maverick uses 128 experts with top-1 routing in every FFN sublayer; attention is standard GQA, block scaffolding is pre-norm + residual just like Llama 3.1.
- Mixtral 8x7B (Mistral AI) uses 8 experts per layer with top-2 routing; the '8x' in the name refers to the FFN expansion, not to 8 separate models.
- DeepSeek V3 uses fine-grained expert routing (256 experts, top-8) with shared-expert routing (one always-on expert plus seven sparse ones) keeping attention unchanged.
- Qwen2.5-MoE uses an FFN-local MoE swap with load-balancing loss; the attention sublayer uses standard GQA identical to dense Qwen models.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy doesn't MoE replace attention as well as the FFN?
QWhat happens to the auxiliary load-balancing loss after training?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming MoE touches attention or replaces the block recipe. The swap is local to the FFN sublayer; everything else (residual wrap, pre-norm, attention) is identical to a dense block.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.