The Output Projection Restores the Model Width
The weighted values may have width d_v, so W_O maps them back to the model width expected by the rest of the network. Calculate this projection, count its parameters, and test identity, zero, and learned alternatives.
The weighted values form
This is a valid attention result, but it does not yet have the promised layer interface when . The output projection completes the layer:
The operation changes feature coordinates independently at every position. It does not mix positions; that mixing already happened in .
Continue the Numerical Trace
The final row of the four-token attention trace was
Choose a non-identity output projection
Then
The attention weights did not change. changed how the resulting value features were expressed in model-width coordinates.
Three Ablations Clarify Its Role
An ablation removes or changes one component while holding the rest of the setup fixed. Comparing the resulting computation helps identify what that component contributes.
| Output projection | Result | What the comparison shows |
|---|---|---|
| when widths match | no feature remapping | |
| this attention layer writes no signal onward | ||
| learned non-identity | mixes value features | the layer can choose how attention output is expressed |
The zero ablation does not prove that a trained model never needed attention; in a complete network, other residual paths may partially compensate. It does give an exact statement about this forward pass: the attention branch contributes a zero update.
Count the Parameters
Without bias vectors, a single head contains
parameters: one query matrix, one key matrix, one value matrix, and one output matrix. If , the count is .
Some implementations add bias vectors to one or more projections. The formulas in this subject omit them unless a lesson states otherwise. A parameter count is meaningful only after such conventions are explicit.
Projection Cannot Recover Discarded Information
can remix the coordinates in , but it cannot recover separate source values after they have been combined into the same weighted sum. If two different sets of values produce the same , multiplying both by the same still produces the same .
This limit matters when interpreting attention. The output projection can change or cancel features, but it cannot reveal which source decomposition was the uniquely intended one when the weighted sum itself is ambiguous.
Q1. Project one attention reading
Let and
What is the second coordinate of ?
Compute it first, then check your number.
Hint
Solution
Preserve the Layer Contract
When checking an attention implementation, do not stop at the weighted values. Verify that the output projection returns the final feature axis to . That invariant is what allows later Transformer blocks to reuse one model width across many residual updates.