Why do LLMs attend to the first token?

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Barbero, Federico, Arroyo, Álvaro, Gu, Xiangming, Perivolaropoulos, Christos, Bronstein, Michael, Veličković, Petar, Pascanu, Razvan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915427745005568
author Barbero, Federico
Arroyo, Álvaro
Gu, Xiangming
Perivolaropoulos, Christos
Bronstein, Michael
Veličković, Petar
Pascanu, Razvan
author_facet Barbero, Federico
Arroyo, Álvaro
Gu, Xiangming
Perivolaropoulos, Christos
Bronstein, Michael
Veličković, Petar
Pascanu, Razvan
contents Large Language Models (LLMs) tend to attend heavily to the first token in the sequence -- creating a so-called attention sink. Many works have studied this phenomenon in detail, proposing various ways to either leverage or alleviate it. Attention sinks have been connected to quantisation difficulties, security issues, and streaming attention. Yet, while many works have provided conditions in which they occur or not, a critical question remains shallowly answered: Why do LLMs learn such patterns and how are they being used? In this work, we argue theoretically and empirically that this mechanism provides a method for LLMs to avoid over-mixing, connecting this to existing lines of work that study mathematically how information propagates in Transformers. We conduct experiments to validate our theoretical intuitions and show how choices such as context length, depth, and data packing influence the sink behaviour. We hope that this study provides a new practical perspective on why attention sinks are useful in LLMs, leading to a better understanding of the attention patterns that form during training.
format Preprint
id arxiv_https___arxiv_org_abs_2504_02732
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Why do LLMs attend to the first token?
Barbero, Federico
Arroyo, Álvaro
Gu, Xiangming
Perivolaropoulos, Christos
Bronstein, Michael
Veličković, Petar
Pascanu, Razvan
Computation and Language
Large Language Models (LLMs) tend to attend heavily to the first token in the sequence -- creating a so-called attention sink. Many works have studied this phenomenon in detail, proposing various ways to either leverage or alleviate it. Attention sinks have been connected to quantisation difficulties, security issues, and streaming attention. Yet, while many works have provided conditions in which they occur or not, a critical question remains shallowly answered: Why do LLMs learn such patterns and how are they being used? In this work, we argue theoretically and empirically that this mechanism provides a method for LLMs to avoid over-mixing, connecting this to existing lines of work that study mathematically how information propagates in Transformers. We conduct experiments to validate our theoretical intuitions and show how choices such as context length, depth, and data packing influence the sink behaviour. We hope that this study provides a new practical perspective on why attention sinks are useful in LLMs, leading to a better understanding of the attention patterns that form during training.
title Why do LLMs attend to the first token?
topic Computation and Language
url https://arxiv.org/abs/2504.02732