Why LLMs Crash Without Early Tokens: The Attention Sink Explained
Large language models using sliding-window KV caches can produce garbled output if the first few tokens are evicted, a phenomenon researchers call an 'attention sink.' Because softmax attention must always sum to 100%, tokens with no strong key matches dump excess probability mass onto early sequence positions like BOS tokens or the word 'The.' These sink tokens develop near-zero value vectors so the model can park attention there without corrupting real outputs. The fix, central to the StreamingLLM approach, is to permanently pin roughly four initial sink tokens in the KV cache alongside the rolling window, keeping perplexity stable even across millions of tokens. Any cache eviction strategy — including H2O or quantized caches — must treat sink tokens as non-removable, or model accuracy degrades silently.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in