Attention sinks: where does unused attention go?
What could a token that appears in every sentence learn to contribute?
Something the sentence does not need to say
In “the old rabbit”, attention lets rabbit gather information from old. That contribution depends on the tokens in the sentence.
But what if the head could also learn a background contribution, available whatever the sentence says?
Imagine giving it an extra token that appears at the beginning of every context. Training could shape its key and value into something the head can always draw on.
Its value acts a little like a bias: a learned contribution that does not need to come from the sentence’s content.
The amount is still flexible. Different queries can give that same token different attention weights, taking more or less of its value.
A token that is always there
We already have a convenient token for this: the start marker. It is present before the sentence, and every later token can attend to it.
It cannot read the tokens that follow, so its representation can stay the same across different sentences. The model can learn to use it as that background contribution.
This also helps when the sentence has no useful answer to a head’s question. Softmax must still assign all its attention somewhere; the start token provides a familiar place to direct it.
This is an attention sink. In the map, it appears as a bright first column.
Compare No adjective with A sink pattern. Instead of mixing unrelated tokens, the head leans on the always-available start token.
A bright first column need not mean the start marker has an important meaning in the sentence. It can be doing this background job.
Then the window moves
In a sliding window, old tokens eventually leave the cache.
But when the start token leaves, we also remove a background contribution the head learned to rely on. Its attention is redistributed over the remaining tokens.
We could keep the first few tokens while the recent window moves on. That is the idea behind StreamingLLM.
The cache stays bounded: a small fixed beginning, plus the recent tokens. The middle still drops out; this does not preserve everything said earlier.
What if it contributes nothing?
The start token has a value the model can learn to use. Another design gives softmax an extra place to put attention, but deliberately supplies no background value.
Add a learned score alongside the token scores and pair it with a zero vector.
The weights for the actual tokens can now add up to less than one. The remaining share contributes nothing to the weighted sum.
That changes the attention calculation itself. There is another place we could intervene: after the head has collected its information. Could the model decide how much of that result to use?
Continue with attention gating.
Sources
- Efficient Streaming Language Models with Attention Sinks, Xiao and colleagues: initial-token sinks, retaining them with a rolling cache, and experiments with dedicated sink tokens.
- StreamingLLM project: how retaining the initial tokens stabilises streaming inference.
- When Attention Sink Emerges in Language Models: the first token’s bias-like contribution and the role of softmax normalisation.
- gpt-oss reference implementation: learned per-head sink scores join the logits before softmax; their weights are removed before multiplying by the token values. This is equivalent to a zero-valued extra slot, rather than an extra cached token.
The background diagram scales the same value vector by two attention weights calculated with softmax. The map calculates causal softmax rows. Its three views separate a useful match, a diffuse row, and a sink pattern. The window comparison gives both caches five slots. The extra-slot figure includes the sink in the softmax denominator and assigns it a zero value.