Residual and MLP Writes Change the Running Record

Trace attention and MLP additions to the residual stream and compare their norms without confusing magnitude with direction, output alignment, or causal importance. Separate MLP hidden activations from their writes.

Each pre-normalized decoder block adds two writes to the residual stream:

r=r+a,rnext=r+u,r^{\prime}=r+a,\qquad r^{next}=r^{\prime}+u,

where aa is the attention write and uu is the MLP write. Recording all three vectors shows what changed at a position without pretending that the residual stream performs a separate hidden operation.

Compare Magnitudes at the Final Position

For the clean prompt:

Layerr2\lVert r\rVert_2 beforea2\lVert a\rVert_2u2\lVert u\rVert_2rnext2\lVert r^{next}\rVert_2
12.51210.24250.95112.1260
22.12601.53020.45721.5367

Layer 2's attention write has a larger norm than its MLP write. This does not prove that attention is more important. Norm measures magnitude, not direction, alignment with the output readout, redundancy with another component, or effect under intervention.

Vector Addition Can Reduce a Norm

The final residual norm after layer 2 is smaller than the incoming norm even though nonzero vectors were added. If an update points partly against the current residual, cancellation reduces the resulting magnitude.

For example:

r=[1,1],a=[0.5,0.5],u=[0.25,1],r=[1,-1],\quad a=[0.5,0.5],\quad u=[-0.25,1],

so

r+a+u=[1.25,0.5].r+a+u=[1.25,0.5].

The component norms alone cannot reconstruct this direction.

MLP Activations Are Not MLP Writes

For one position, the first MLP layer creates eight preactivations, ReLU keeps positive entries, and the second linear layer maps them back to four residual features:

u=W2ReLU(W1LN(r)+b1)+b2.u=W_2\operatorname{ReLU}(W_1\operatorname{LN}(r^{\prime})+b_1)+b_2.

A large hidden activation may have a small, opposing, or shared output effect depending on its column in W2W_2 and the other active units.

Q1. Interpret a component norm

Layer 2 has attention-write norm 1.5302 and MLP-write norm 0.4572. What may you conclude without another test?

Choose one

Select one choice, then check.

Hint
Do not turn vector length into a claim about direction or output effect.
Solution
The attention write has the larger recorded L2L_2 magnitude at this position. An output metric or intervention is needed for an importance claim.
Not attempted
Review

Not marked done.

The Residual Stream Is a Useful Accounting Interface

Elhage et al. (2021) develop the view that Transformer components read from and write to a shared residual stream. Their circuit framework is valuable vocabulary for additive paths and head composition, but its attention-only simplifications and research status must remain visible when applying it to this decoder with MLPs and normalization.

Pause and reflect

In your own words, note what you understood, what remains unclear, or what you want to revisit. The note stays with this lesson.

0 of 1 exercises marked done

Review

Not marked done.

LLM PrimerResidual and MLP Writes Change the Running Recordhttps://llmprimer.com/transformers/inspecting-and-interpreting-transformers/residual-and-mlp-writes-change-the-running-record© 2026 LLM Primer