Which sublayer of a dense transformer block carries more parameters, attention or FFN?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
In a standard dense transformer block, the FFN holds roughly two-thirds of the parameters and attention holds one-third.
Picture a transformer block as a workshop with two big machines. One machine, attention, takes every word's data and lets it talk to every other word. The other machine, the FFN, takes each word one at a time and reshapes it in a much wider workspace before squeezing it back to size. Now count the wires (the parameters). Attention has four boxes, each the same size as the input. The FFN has two boxes, but each one is four times wider than the input. So the FFN's two big boxes have more wires than attention's four small boxes. About two-thirds of the workshop's wiring lives in the FFN. The diagrams in papers always show attention as the headline feature, but the parameters live mostly in the FFN.
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.
3 min: do the arithmetic, name the 2/3 rule, explain why it surprises people, mention how GQA and MoE shift the ratio further toward FFN dominance.
| Sublayer | Matrices | Parameter count (d_model = 4096, 4x FFN) | Share of block |
|---|---|---|---|
| Attention Q, K, V, O | 4 matrices, each d_model x d_model | 67.1M | ~1/3 |
| FFN up, down (ReLU) | 2 matrices, d_model -> 4d_model and back | 134.2M | ~2/3 |
| FFN gate, up, down (SwiGLU at 8/3 ratio) | 3 matrices, d_model x 2.67*d_model | ~134.2M | ~2/3 |
| Block total | (all of the above) | ~201M | 100% |
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.
Believing attention dominates the parameter count because it dominates the diagrams. Attention dominates the *FLOPs* at long context, but the *parameters* live mostly in the FFN.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.