Interpreting the Repeated Token Phenomenon in Large Language Models
Itay Yona, Ilia Shumailov, Jamie Hayes, Federico Barbero, Yossi Gandelsman
TL;DR
The paper investigates why large language models sometimes fail to faithfully repeat a single input token, identifying the attention-sink mechanism as the root cause. Through mechanistic interpretability, it uncovers a two-stage neural circuit in which the first attention layer marks the initial token and a later MLP neuron amplifies its hidden state to create a high-norm sink that attracts subsequent attention; this sink is erroneously triggered by sequences of repeated tokens, causing divergence. The authors demonstrate this via cross-model evidence and formalize how the first attention layer cannot distinguish a single token from long repeats, leading to the observed behavior; they also introduce a cluster-attack that induces sinks without repetition. A targeted patch to sink-mediating neurons mitigates the divergence with minimal impact on unrelated tasks, highlighting how mechanistic insights can guide secure and reliable improvements to LLMs. Overall, the work links fluency-driven attention dynamics to a concrete vulnerability and proposes a principled defense strategy grounded in neural-circuit understanding, with implications for interpretability-driven model hardening.
Abstract
Large Language Models (LLMs), despite their impressive capabilities, often fail to accurately repeat a single word when prompted to, and instead output unrelated text. This unexplained failure mode represents a vulnerability, allowing even end-users to diverge models away from their intended behavior. We aim to explain the causes for this phenomenon and link it to the concept of ``attention sinks'', an emergent LLM behavior crucial for fluency, in which the initial token receives disproportionately high attention scores. Our investigation identifies the neural circuit responsible for attention sinks and shows how long repetitions disrupt this circuit. We extend this finding to other non-repeating sequences that exhibit similar circuit disruptions. To address this, we propose a targeted patch that effectively resolves the issue without negatively impacting the model's overall performance. This study provides a mechanistic explanation for an LLM vulnerability, demonstrating how interpretability can diagnose and address issues, and offering insights that pave the way for more secure and reliable models.
