Pick the statements that accurately describe how an MoE sublayer replaces a dense FFN
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.