---
title: Sink Tokens in Transformer Models
url: https://www.emergentmind.com/topics/sink-tokens
type: topic
---

# Sink Tokens in Transformer Models

Attention sinks, also termed "sink tokens," are a recurring architectural and representational phenomenon in Transformer-based models where a small subset of tokens—most commonly the first position in a sequence—accumulate a disproportionately large fraction of attention mass across layers and heads, irrespective of semantic content. This phenomenon is universal across large language models (LLMs), vision-language models, and multimodal transformers, and has significant functional, algorithmic, and practical implications for model training, inference, compression, and design [2410.10781].

## 1. Formal Definition and Quantitative Characterization

Attention sinks are defined per attention head and layer as the token positions receiving a much larger mean attention weight than all others. In standard multi-head self-attention, for a head $h$ at layer $l$, the attention weights are computed as
$$
\alpha_{ij}^{(l,h)} = \mathrm{Softmax}_j\left(\frac{q_i k_j}{\sqrt{d_h}}\right)
$$
where $q_i$, $k_j$ are the query and key projections. The sink token is any position $j^*$ such that
$$
\alpha_{ij^*}^{(l,h)} \gg \mathbb{E}_{j\neq j^*} [\alpha_{ij}^{(l,h)}]
$$
across most query positions $i$.

A widely used measurement is the *sink rate*:
$$
\mathrm{SinkRate}(\epsilon_s) = \frac{1}{L} \sum_{l=1}^L \frac{1}{H} \sum_{h=1}^H \mathbb{1}(\alpha_1^{l,h} > \epsilon_s)
$$
where $\alpha_1^{l,h}$ is the average attention assigned to the first token (often bos) in head $h$, layer $l$ [2504.20966, 2410.10781].

Empirically, in large-scale pre-trained models, up to 90–99% of heads at high layers will assign $>0.3$ mass to the first token. Sinks also exist in small models once trained on sufficient data (≥500M tokens for 60M Tiny-LLaMA), and are tightly correlated with the loss function, data distribution, and architecture [2410.10781].

## 2. Mechanistic Origins: Softmax Normalization and Positional Anchors

Attention sink formation is primarily driven by the normalization constraint enforced by softmax attention. The sum-to-one property causes any persistent logit gap in the dot-product scores to result in a "dumping" of excess attention onto the dominant key token. In practical LLMs with relative positional encodings (e.g., RoPE), the first token often maintains a higher alignment to the queries across the sequence, even with a small norm. This establishes the first token as a reference anchor or coordinate frame—a geometric attractor in the model's representational space [2508.02546].

Mitigating or removing attention sinks is possible with alternative attention kernels that do not enforce normalization (e.g., unnormalized sigmoid, ELU+1, identity), where softmax is replaced with a rectified non-sum-to-one operation such as Softpick, leading to sink rates approaching 0% [2504.20966, 2410.10781].

## 3. Roles in Information Flow and Model Dynamics

Attention sinks play a dual role in information propagation. Theoretically, they act as "no-op" or "reference" tokens, limiting pathological over-mixing or rank collapse in deep, wide-context Transformers by absorbing excess attention mass and thereby gating the exponential spread of information through the network layers [2504.02732].

This mechanism provides a method for stability: perturbations or spurious information are attenuated by being routed to the sink, maintaining sharper representational distinctions across tokens and avoiding collapse into low-rank spaces. Consequently, removing or disrupting sink tokens during inference causes abrupt performance degradation, especially in long-context regimes.

Empirical studies confirm that the presence of strong attention sinks sharply reduces sensitivity to upstream input changes beyond the first few layers and that this property becomes more pronounced with model scale and context size [2504.02732, 2410.10781].

## 4. Variations: Primary and Secondary Sinks, and Multimodal Generalizations

Primary attention sinks are global anchors that emerge in the first or second layer and persist throughout the model. Secondary sinks—lesser-known but statistically significant—can arise in middle layers, often triggered by high-norm outputs from specific MLP modules. These secondary sinks are transient, can occupy non-initial positions, and their emergence compensates for phases when the primary sink temporarily weakens, forming complex attention dynamics referred to as "sink levels" in scaling studies [2512.22213].

In multimodal transformers and vision-language models, analogous phenomena are observed. Visual tokens with large feature-norm (often corresponding to background or structural patches) act as ViT-origin attention sinks, attracting high attention but carrying little content information [2510.08510, 2603.00510]. These sinks are nearly invariant across inputs and can be effectively pruned or down-weighted without affecting performance [2603.00510, 2503.03321].

## 5. Algorithmic Exploitation: Streaming, Compression, and Efficient Inference

Exploitation of attention sinks is a foundational technique for streaming language and video models. KV cache optimizations such as StreamingLLM achieve effective generalization to infinite contexts by retaining only the initial sink tokens in memory; all remaining past tokens are discarded. For standard LLM deployments, as few as four first tokens (or one learnable sink token after specialized pretraining) suffice to maintain perplexity and accuracy at long contexts, yielding substantial memory and speed gains—up to 22× faster per token at fixed cache [2309.17453, 2512.05081].

SF-Attn and variants in SinkLoRA and Deep Sink architectures generalize this strategy to local/global mixtures, using a small set of learnable sink tokens as global communicators in otherwise windowed sparse attention setups. These mechanisms recover the modeling power of dense attention at near-sparse time and memory cost [2406.05678, 2512.05081].

In token and neuron pruning, sink-aware methods penalize unstable or context-dependent sinks (critical in diffusion LMs where anchor stability is poor), reallocating compute to consistently useful tokens and improving accuracy–sparsity trade-offs [2602.17664].

## 6. Risks, Failure Modes, and Mitigation Strategies

While attention sinks are functionally useful, they also introduce vulnerabilities and training pathologies. Security risks include their exploitation as backdoor triggers during LLM unlearning; placing malicious triggers at sink positions magnifies the backdoor effect and enables restoration of supposedly "forgotten" knowledge [2510.17021]. In continual learning, over-reliance on common sink tokens (such as [SEP] in BERT/RoBERTa) induces over-smoothing and cross-task interference, harming task transfer [2410.05648]. In mixture-of-experts (MoE)-like native attention forms, excessive sink use causes head collapse, whereby a few attention heads monopolize computation. Sink-aware load balancing mitigates this effect, improving head utilization and overall accuracy [2602.01203].

Effective mitigation strategies include:
- Replacing softmax with unnormalized or rectified kernels (e.g., Softpick) [2504.20966, 2410.10781];
- Introducing explicit, learnable key-only biases to decouple sink behavior from real tokens [2410.10781];
- Scaling down positional encoding biases or distributing anchoring load across multiple tokens [2508.02546];
- Pre-scaling or entropy-based regularization to enforce attention diversity, especially in continual learning [2410.05648];
- Careful architectural design of KV caching and window masking to control sink formation and impact [2309.17453, 2406.05678].

## 7. Broader Implications and Research Outlook

Understanding and controlling attention sinks is foundational for robust and efficient deployment of Transformers in long-context, streaming, continual learning, and multimodal tasks. They are deeply intertwined with architectural choices—especially normalization, positional encodings, masking, and objective formulation—and with emergent behaviors such as massive activation, over-mixing avoidance, and cross-modal alignment [2603.05498, 2512.22213].

Current research continues to investigate the interplay between attention sinks, sparsity, structural redundancy, and implicit gating. Softmax normalization remains a key driver of sink formation, and alternative attention architectures are an active area of development for both efficiency and improved interpretability. The dynamic between primary \& secondary sinks, and their role in scaling behavior and model specialization, signals a rich avenue for future mechanistic and theoretical analysis.

**References:**  
- [2410.10781], [2504.20966], [2504.02732], [2512.22213], [2309.17453], [2512.05081], [2406.05678], [2508.02546], [2510.08510], [2603.00510], [2503.03321], [2601.19657], [2602.01203], [2507.03865], [2410.05648], [2510.17021], [2602.17664], [2603.05498], [2508.03668]

Source: https://www.emergentmind.com/topics/sink-tokens