Name what wraps the attention sub-layer in every transformer block.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Every transformer block wraps attention in two things: a normalization (LayerNorm or RMSNorm) on the input and a residual skip that adds the attention output back to the original input.
Picture a really long assembly line where each station does something to a product, but the product is also carried past every station on a conveyor belt. Each station gets to see the product, do its little adjustment, and then add that adjustment to whatever was on the belt. If the station messes up, the original product still arrives at the end. That conveyor belt is the residual stream. And before any station touches the product, an inspector standardizes its size so the station gets predictable input, that is the normalization. Both wrappers exist because without them deep stacks of stations would either break the product completely or fail to train at all.
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.
Name the two wrappers, distinguish pre-norm and post-norm, explain why the residual is load-bearing for depth, note LayerNorm vs RMSNorm, give modern LLM examples.
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.
Forgetting the residual or treating it as 'just nice to have'. Without the residual, gradients vanish across stacked layers and the network does not train.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.