The update pattern
A residual connection adds a sublayer output to the state that entered it. The sublayer can contribute a correction without reconstructing the full representation. Later attention heads and MLPs read the accumulated stream and add their own updates.
x' = x + attention(norm(x))
x'' = x' + MLP(norm(x'))
streamnormattentionaddMLPadd
Why residuals help
The identity path carries information and gradients around each nonlinear transformation. A sublayer can learn a small useful update while the original signal remains available.
Attention writes context
Queries select weighted combinations of value vectors from other positions. The resulting update can copy, route, or combine contextual information.
MLPs write features
The feed-forward network expands, activates, and projects the current position. It can detect combinations of features and write a transformed result back.
Normalization sets scale
LayerNorm or RMSNorm standardizes the input seen by a sublayer. Placement changes optimization behavior and the scale trajectory of the residual stream.