TL;DR
- Current attention weights act as a strong filter during backpropagation, creating a positive feedback loop in which certain keys can gain exponentially more attention.
- This feedback can lock in early differences in attention.
- This leaves some semantically relevant keys weakly attended to; we construct an oracle to identify them.
- Different heads within a layer have mostly compatible attention patterns, suggesting less specialized coordination between routing and value representations than we might naively expect.
- We formulate a method to democratize the backward pass using a natural-gradient approach.
- We find that the new gradient broadens attention patterns and gives previously weakly attended keys more weight, but worsens validation loss, suggesting that the dynamics concentrating attention on a few winners may also support learning.
One Attention Head's Forward Pass
Fix an attention head within a transformer, and let be token 's attention score during token 's forward pass.
We can express the output of the attention mechanism as
Let be the loss and let be the gradient at the head output:
Backpropagation through the head gives the following formulas for the gradients:
Notice that all of these gradients contain factors of . This implies that if we ever end up in a situation where the attention scores get very small, then the resulting gradients also become small, killing the gradient flow during backpropagation.
Denote the input to the attention layer as , and let be the set of all indices . Also, denote the , , and weight matrices by , , and , respectively. Now, we can just compute the attention scores :
Using , the chain rule gives us
For ,
This is the first way attention allocates credit. For source activations of similar norm, ten times more attention means roughly ten times more gradient to .
To obtain the query gradient, apply the chain rule through the attention weights.
We call the advantage. Shifting a fraction of the current attention distribution toward key changes the head output to , giving
We compare the spreads of attention and advantage within each query using
We measured them in every head of Qwen2.5-1.5B base over 65,536 tokens for 5.33 million layer–head–query comparisons.
Attention is far more uneven than advantage
Two regimes of attention–advantage imbalance
If we look at the attention factor in Equation (12), we notice that it can play two very different roles.
- It can be an instrument of calibration on a known axis.
- It can prevent a useful but weakly attended key from exerting enough influence to be attended to significantly more.
So let us call the first regime calibrated prioritization. Suppose key 1 receives much more attention than key 2, while key 2 has the larger advantage:
Here, the query update prioritizes key 1 because attention outweighs the difference in advantage. This pressure pushes us toward the optimal position on a known axis.
Such axes correspond to an aleatoric noise floor where hard CE and soft teacher CE are at odds. This means the current attention distribution is already optimal, but a single token would prefer to shift it. Oftentimes, these axes appear when attention is split between the first token and retrieved content.
See Appendix A for the experimental design and full results.
The second case is a softmax deadlock. To see what we mean, consider a 2D query–key space with
and attention weights
Let the hidden third key have a large negative advantage:
If we require the other two advantages to be equal, we obtain
Since , we know that
Softmax deadlock
Output space
Query space
The query does shift in the direction of the useful key, but at a snail's pace due to the softmax lock.
The probe in Appendix A finds that gradients averaged over possible next tokens are often much smaller than the observed token's gradient, suggesting substantial cancellation. Arbitrarily changing gradient magnitudes based on the sampled token's advantages could upset that cancellation and push case 1 away from calibration. An invertible linear reweighting based only on the current attention geometry applies the same transformation across possible next tokens. This preserves case 1's zero expected gradient at a calibrated optimum without forcing case 2's nonzero signal to vanish.
The attention Jacobian and its empirical spectrum
In Equation (12), we derived the query gradient as a weighted sum of the keys. If we look at it more closely, we can see that it can be written as a nice Jacobian transpose vector product
where
This weighted sum is highly anisotropic and effectively low rank (only a small set of directions are transmitted strongly) because are spiked so sharply. The Jacobian is therefore an information bottleneck during backpropagation. Any component of in the nullspace of is ignored and contributes nothing to .
To see this effect, we measured this Jacobian directly in the pretrained Qwen2.5-1.5B base model. See Table 1 for details of the probe.
Table 1. Qwen attention-Jacobian probe.
| Model | Qwen2.5-1.5B base |
|---|---|
| Head sites | Head 0 at layers 2 (early), 14 (middle), and 26 (late) |
| Data and sample | 56 FineWeb validation sequences of 1,024 tokens, positions 32–1,023, 55,552 Jacobians per head and 166,656 total |
| Jacobian | post-rotary matrix in fp64, spectrum from the eigenvalues of |
| Validation | Relative error of against an autograd Jacobian |
The main effective rank statistic actually uses squared singular weights,
whose distribution we can see in Figure 3.
Table 2. Per-head summaries of the Jacobian spectrum.
(early) | (middle) | (late) | ||
|---|---|---|---|---|
| Effective rank using normalized | Median, effective modes | 10.94 | 3.23 | 13.28 |
| Participation ratio | Median, effective modes | 2.74 | 1.19 | 1.78 |
| Modes with | Count at median token | 20 | 7 | 26 |
| Modes with | Count at median token | 45 | 14 | 70 |
The main result is very simple. In every head, at least 99% of tokens have squared-spectrum effective rank below 10, and no token went above 19. The middle-layer head is the most concentrated, which is consistent with its median top-1 attention weight of 0.75.
Per-token effective-rank distribution
Mean relative singular spectrum
Training Attention Routing Follows a Positive Feedback Loop
Each key's contribution to the gradients of the value matrix () and query matrix () is proportional to its attention weight . Since softmax makes attention ratios exponential in score differences, these weights can span orders of magnitude, making it plausible for early attention patterns to become self-reinforcing during training.
Consider gradient descent on the value matrix and attention scores, with positive learning rates and . Define the signed advantage of source as .
In this example, we apply the gradient update to the value matrix while holding the input and attention scores constant and measure the change in advantage. The loop below showcases how positive feedback can arise in this setup.
The attention credit loop
Equation (27) measures the size of the gradient matrix; Equation (28) applies the matrix itself. The Frobenius norm has not been canceled. With the input fixed, the intervening step is
The next step must account for the changing mixture. Summing the value updates for this query gives , using from Equation (10). Consequently,
Subtracting these changes and taking their inner product with yields Equation (29). Its sign is not necessarily positive: a source must improve relative to the mixture to gain advantage. For orthogonal unit inputs, it reduces to , which can favor an already strongly attended source. Recomputing , changing the inputs or attention, or adding other queries' gradients introduces further effects.
Finally, positive advantage increases a logit in this local model, but the attention odds in Equation (31) grow only when . The exponential describes the dependence on the score gap; it does not by itself establish exponential growth over training time.
Empirically, attention patterns differ far more cross-run than within a run. By as early as step 1000, a run is more similar to its final state (step 10000) than the endpoints of different runs are to each other.
Within-run stability, cross-run drift
Within runSteps 1,000 → 10,000
ln a (A, 1k)
Across runsHeads matched at step 10,000
ln a (A, 10k)
Buried Keys Are Measurable
We rank each key by advantage in Qwen2.5-1.5B for a fixed query.
For a fixed query, each head picks its top keys by absolute advantage, . We select a key if at least heads pick it and agree on whether to increase or decrease attention to it. To rank qualifying keys, we divide each head's advantages by their root mean square across keys for that query, then sum the normalized magnitudes over agreeing heads.
Cross-head agreement at layer 25
Input: is now completed and posted on Vimeo. Watch parts 1 - 3
Source context: …. From popcan earrings to oil paintings of beach scenes, you may not need to head anywhere…
For the Vimeo query, the top keys by absolute advantage for heads 3, 6, 7, 8, and 9 were “out,” “bean,” “6,” “Health,” and “beach,” respectively. The consensus metric selected “3,” with six heads agreeing on a negative advantage: they favor less attention to this source. The selected “food” source and the leading “3” source in the food-code example also have negative coalitions. The Dembski example's “…” sources have positive coalitions. In the “suction” and “is” rows, no tokens pass the cross-head gate.
The consensus metric finds coordinated advantages even for keys with attention ranks as high as 600. This gives us a way to inspect potentially relevant sources that current attention largely excludes.
Heads are not simply separate probability budgets
At a high level, each head is a selection rule (, ) and a representation of what we write into the residual stream when selected (). Naively, we'd expect that the rules and representations are matched pairs which may not be permuted. This is largely not the case.
Fix a layer, and replace all pre-softmax attention scores with their average across heads.
We perform this operation for each of Qwen2.5-1.5B's 28 layers separately.
With shared attention, the value paths combine into a single map. Let be head 's block of the output projection and . Then
- Median
- 0.000195 nats
- 90th percentile
- 0.411 nats
- 99th percentile
- 1.35 nats
These upper-tail losses include continuations of names, places, and multi-token identifiers. Table 4 shows examples from the later layers, where sharing attention barely affects the median token.
Qwen2.5-1.5B · 28 LAYERS
Transformer surgery
… Amy Andrews Gossip Girl by Amy Andrews
Layer 14
Loading recorded Qwen tensors…
- Loss change
- 0 nats
- Probability / original
- 1
Table 4. Loss increase on the bold token when all heads at the listed layer use the same attention weights, compared with the unmodified model.
| Layer changed | Text being scored (target token in bold) | Extra loss (nats) |
|---|---|---|
| 1 | … submit their pictures as massive synths. MWAHAHAHAHAHAA! | +9.3 |
| 6 | … Find More Posts by laurlynn. Tallahassee, | +5.9 |
| 14 | … Amy Andrews Gossip Girl by Amy Andrews. | +7.9 |
| 15 | … garbage can jailhouse ambiance, wouldn't you agree? ORLANDO, Fla | +13.9 |
| 22 | … Former Nickelodeon star Amanda Bynes arrested for drug | +6.6 |
| 26 | … the players and coaches have insisted Rainey's big | +5.2 |
| 27 | … that was all the opening Denmark needed to strike | +6.6 |
Ramapuram et al. (2024) show that, with appropriate normalization and initialization, elementwise sigmoid attention can replace softmax across language, vision, and speech tasks. Combining this with head averaging yields the following approximation:
where is a fixed scalar bias. Here is the effective value map and represents the combined scoring function.
At this level of approximation, multiheaded attention, with all its justifications about distinct probability distributions and selection rules, collapses into this inelegant filtration mechanism. Its ability to nearly block out values deemed unimportant makes the rule powerful, but also leads to the ratchet effect.
NATQ: Changing the Query Gradient
We know that carries a factor of , so a small query movement changes attention only weakly for keys that already receive little attention. In regular gradient descent, we constrain parameter movement to an ball around the current point in parameter space and hence are constrained to an ball around the query vector . Writing , this gives
Natural gradient instead bounds movement in attention-distribution space: the new attention row must lie within a KL ball around the current row. Let denote the full attention distribution for query , with the keys held fixed. For small query movements, the KL divergence and its constraint are locally approximated by
The resulting local geometry is given by the attention row's Fisher information matrix . For one head and query , define
For invertible , minimizing the linearized loss under the local KL constraint gives the inverse-Fisher descent direction:
Under the KL constraint, equal-length query movements along larger-eigenvalue directions of are more costly because they change the attention distribution more strongly. Movements along smaller-eigenvalue directions cost less. The inverse-Fisher direction therefore gives those weaker directions relatively more weight.
In our experiments, we use NATQ: a damped version of this direction with the incoming gradient's norm restored. Damping limits amplification along directions with small eigenvalues, while norm restoration keeps the query-gradient magnitude unchanged. For , the NATQ gradient is
where is the identity matrix and damps the inverse. The scaling ensures . For , we explicitly set , avoiding division by zero.
Because norm restoration depends on the gradient, NATQ is nonlinear in and does not inherit the cancellation guarantee of a fixed linear reweighting.
A Weaker Ratchet, a Worse Model
Validation loss at the best tested settings
Wider attention does not find more useful content
| Statistic | Control | NATQ |
|---|---|---|
| Mean attention entropy (nats) | 3.75 | 4.69 |
| Mean top-key attention | 0.238 | 0.149 |
| Mean attention within eight tokens | 0.383 | 0.209 |
| Heads with local attention mass above 0.7 | 8 | 1 |
| Heads with entropy above 4.5 nats | 7 | 48 |
Higher attention entropy means attention is spread more evenly across keys. NATQ roughly halves the weight given to self-attention and the local token window. In layers 4–7, tokens with attention weights below 0.1% in the control receive 67% of the increase.
Attention under NATQ
Control vs NATQ
ln a (Control, 5k)