Zenaique

Why not just retrain models to eliminate attention sinks entirely?

Short answer·Medium·4.0 · 0·~3 min·Asked atFlowiseInfosysPinecone·Relevant atAnthropic
Attempt it

Attention sinks force a lot of softmax weight onto the first token. A teammate proposes 'just retrain the model without sinks',why does that not actually solve the underlying problem, and what does fix it?

Free · 2 AI evals / day
TL;DR

Sinks come from softmax-must-sum-to-1. Retraining without sinks just promotes the next-best token. The fix is explicit register or sink tokens that absorb the no-op weight.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine every painter in a workshop has to spend exactly one full tube of paint per painting, even when the painting only needs half a tube. With no designated waste bucket, the painters discover that the corner of every canvas is a fine place to dump the leftover paint, so every painting ends up with a weird blob in the corner. If you ban using the corner, the painters do not stop having leftover paint; they just dump it somewhere else on the canvas, and the new dump spot ruins a real part of the picture. The fix is to put a waste bucket next to every easel. That is what register tokens do for attention.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

The teammate's intuition is reasonable but wrong, and the reason it is wrong reveals a deep property of the softmax operator. Attention sinks are not a training-time accident the model picks up because of bad data; they are an emergent consequence of forcing every attention row to sum to exactly 1. Any retraining strategy that leaves the constraint intact will simply relocate the sink rather than eliminate it.

This deep dive walks the structural argument, explains why the first token is the natural sink, traces what happens when you try to penalize it during training, and lays out the three classes of real fixes: register tokens, softmax variants that relax the constraint, and inference-time mitigations like StreamingLLM.

Mental model: sinks are softmax's exhaust. You cannot turn off exhaust by removing the pipe. You install a vent (register tokens) or rebuild the engine to not exhaust (softmax-1).

Why softmax forces a no-op dump

Every attention row in a standard transformer is the output of a softmax over keys. The softmax operator imposes two constraints:

  • w_j >= 0 for every key j.
  • sum_j w_j = 1.

This is the probability simplex constraint. The crucial point is that there is no zero vector on the simplex, the row cannot say 'no key matters'. It must allocate all of its probability mass somewhere.

The no-match scenario

Most attention heads, most of the time, do not have a strong content match in the current context. Specialized heads exist (induction heads, copy heads, name-tracking heads, syntactic heads), but they fire only when their pattern is active. When a head's pattern is not active, the row's mass still has to go somewhere.

The convenient dump

The model discovers during training that there is a stable, content-light position available in every sequence: the first token, usually BOS. Routing no-op mass there has three useful properties:

  • BOS is present in every sequence at a predictable index.
  • BOS's embedding is content-light, so adding sink mass to its value vector does not distort meaningful representations.
  • The post-attention output for sink mass is approximately the (content-light) BOS value, which contributes ~0 to the residual stream.

So the model converges to a sink-on-BOS pattern. That is what attention sinks are.

Key insight: the sink is not a bug the model produced; it is an optimal solution to 'where do I dump the mandatory mass that my row sum imposes?'

What goes wrong if you try to retrain the sink away
The real fixes
Inference-time mitigation: StreamingLLM
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Xiao et al. 2023 (StreamingLLM): keeps the first few tokens permanently in the KV cache because dropping them causes long-context serving to collapse.
  • Darcet et al. 2024 (Vision Transformers Need Registers): adds learned register tokens to ViT and demonstrates smoother attention maps and fewer outlier features.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does softmax-1 (adding +1 to the softmax denominator) eliminate the need for sinks, and what does it cost?
A

Softmax-1 computes w_j = exp(s_j) / (1 + sum_k exp(s_k)). The denominator's +1 absorbs the no-op probability, so the weights are no longer constrained to sum to 1, they can sum to anything in [0, 1]. The cost is that you cannot retrofit it onto a pretrained model; gradients flow differently and the model has to be trained with it from scratch. Some Gemma variants and a few research models adopt it; most production LLMs still use standard softmax.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Trying to train sinks away by deleting the BOS token or penalizing first-position attention. The next-best token just becomes the new sink, often a content token whose representation gets distorted.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Why softmax's row sum to 1 constraint forces probability mass somewhere

  • Why the first token (BOS) is the natural sink position

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Explain scaled dot product attention.
Short answer·Medium