The emergence of sparse attention: impact of data distribution and benefits of repetition

Nicolas ZucchetETH ZürichFrancesco D’AngeloEPFL, Andrew LampinenGoogle DeepMind, Stephanie ChanGoogle DeepMind · 2025

Read The emergence of sparse attention: impact of data distribution and benefits of repetition by Nicolas ZucchetETH ZürichFrancesco D’AngeloEPFL, Andrew LampinenGoogle DeepMind, Stephanie ChanGoogle DeepMind (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-17863.txt.

Introduction

Nicolas Zucchet and co-authors study how sparse attention emerges during transformer training, and what sets its timing. Their 2025 paper combines a toy model analysis with small transformers trained on a regression style task. Emergence, the sudden arrival of a new ability, is widely seen in large models but poorly timed by theory.

Sparse attention's arrival followed power laws in task structure, model design, and optimizer choice. Repeating data sped the arrival greatly. A second test, an in context recall task, confirmed the pattern. The authors pitch the framework as a grounded way to predict when a capability will switch on, by reading the data distribution and the training setup rather than waiting to be surprised.

Catalog record

CREATORNicolas ZucchetETH ZürichFrancesco D’AngeloEPFL, Andrew LampinenGoogle DeepMind, Stephanie ChanGoogle DeepMind
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE79 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-17863

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

The emergence of sparse attention: impact of data distribution and benefits of repetition Nicolas ZucchetETH ZürichFrancesco D’AngeloEPFL, Andrew LampinenGoogle DeepMind, Stephanie ChanGoogle DeepMind Abstract Emergence is a fascinating property of large language models and neural networks more broadly: as models scale and train for longer, they sometimes develop new abilities in sudden ways. Despite initial studies, we still lack a comprehensive understanding of how and when these abilities emerge. To address this gap, we study the emergence over training of sparse attention, a critical and frequently observed attention pattern in Transformers. By combining theoretical analysis of a toy model with empirical observations on small Transformers trained on a linear regression variant, we uncover the mechanics driving sparse attention emergence and reveal that emergence timing follows power laws based on task structure, architecture, and optimizer choice. We additionally find that repetition can greatly speed up emergence. Finally, we confirm these results on a well-studied in-context associative recall task. Our findings provide a simple, theoretically grounded framework for understanding how data distributions and model design influence the learning dynamics behind one form of emergence. Scaling has been central to the recent success of large language models [ 1 , 2 , 3 , 4 , 5 ] , with scaling laws [ 6 , 7 ] describing how increased model size, data, and training consistently improve average performance. However, beneath this macroscopic predictability, model performance on specific tasks often reveals capabilities that appear suddenly beyond critical scaling thresholds – a phenomenon known as emergence [ 8 , 9 , 10 , 11 ] . While recent studies have begun to characterize how emergence can appear after a critical training time [ 12 , 13 , 14 , 15 , 16 , 17 , 18 ] , a comprehensive scientific understanding remains elusive. This work explores sparse attention as a lens to understand emergence during training. The formation of sparse attention – where Transformers’ attention layers focus on a small subset of critical tokens – coincides with sudden performance improvements in many emergent behaviors, including in-context learning abilities [ 12 , 15 ] and factual recall [ 18 ] . We investigate why the development of sparse attention can lead to abrupt performance improvements and reveal how characteristics of the training data influence the speed of emergence. We make two key contributions: – We design a variant of linear regression that specifically requires Transformers to learn to focus on a few tokens within the context (Section 2 ). This analytically tractable task allows us to mathematically characterize, in a toy model, the mechanics behind the emergence of sparse attention and precisely quantify how shorter sequences and repetition accelerate emergence. – We apply our sparse attention framework to explain the emergence of in-context learning in an associative recall task (Section 3 ). Our theoretical predictions successfully account for how data influences the emergence speed of the induction head that solves this task. Overall, our results suggest that sparse attention may provide a unifying perspective for understanding seemingly diverse emergence phenomena in large language models. They additionally highlight the potential practical benefits of repetition for accelerating the formation of specific neural circuits. 1 Motivation Can emergence be predicted? Emergence in large language models not only challenges our scientific understanding of how they acquire new skills but also poses AI safety issues [ 19 ] due to its unpredictable nature, while additionally complicating frontier model development. To address this unpredictability, researchers have proposed several progress metrics under which scaling has more predictable consequences, including validation loss [ 20 ] , metrics that reward partial progress [ 21 , 22 ] , and those that employ mechanistic interpretability-motivated measures [ 23 ] . However, a significant limitation is that these metrics typically can only be derived post-emergence [ 24 ] . An alternative approach demonstrates that fine-tuned models’ performance on certain tasks can predict whether the ability to solve the task will emerge in larger models [ 17 ] . Our work explores predictability from a different angle: understanding how the data distribution influences the learning time at which emergence occurs. Is there a link between emergence and sparse attention? The driving hypothesis underlying this work is that learning of sparse attention patterns is particularly prone to produce sharp transitions in behavior during training – i.e., the sudden emergence of new capabilities. There is a statistical argument behind this intuition: when the target a Transformer has to predict depends only on a few tokens within the context, these tokens initially have very low weight in the prediction of the model, as attention typically starts uniform. Initial progress is therefore slow and the more targeted (thus sparse) attention is, the faster learning becomes. Multiple empirical observations strengthen our hypothesis. The induction head [ 12 ] , whose formation coincides with the sudden emergence of certain in-context learning abilities, fundamentally relies on the combination of two attention layers with sparse patterns. Similarly, the mechanisms underlying factual recall in large language models [ 23 , 25 ] demonstrate sparse attention properties and show emergent learning dynamics [ 18 ] . These specific emergent phenomena appear to be linked to the development of sparse attention mechanisms, suggesting the existence of a potential causal relationship between the two. The intriguing interplay between repetition and emergence. While data diversity is generally considered a gold standard in machine learning, a growing body of evidence suggests that repetition can actually accelerate emergence over training. Chan et al. 2022 demonstrated that showing some tasks more often favors the emergence of in-context learning. Charton and Kempe 2024 revealed that repeating a subset of examples more frequently than others dramatically accelerates Transformers’ ability to solve certain arithmetic tasks. This pattern extends beyond mathematical reasoning, as Zucchet et al. 2025 (and to some extent Allen-Zhu and Li 2023 ) showed that repeating biographies of specific individuals speeds up the development of circuits critical for factual recall from model parameters. Collectively, these results establish repetition as a fundamental property of data distributions that can systematically influence emergence timing, thus justifying integrating it in our model to better understand its role. 2 Theoretical insights on an attention-based linear regression task To illustrate how emergence can arise from sparse attention learning, we introduce a variant of linear regression that additionally requires selecting a relevant token from the input sequence. We introduce this task alongside a minimal attention-based toy model for solving it (Section 2.1 ), theoretically analyze its learning dynamics both without (Section 2.2 ) and with repetition (Section 2.3 ), and empirically show that our findings extend to more realistic Transformers (Section 2.4 ). 2.1 The single-location linear regression task We consider the following supervised learning task. We are given an input sequence (x_{t})_{t=1}^{T} of length T in which each token x_{t}\in\mathbb{R}^{d} is drawn i.i.d. from a zero-mean normal distribution with variance 1/d and aim to predict the target y^{*} given by y^{*}=W^{*}x_{T} (1) Here, the target weight matrix W^{*}\in\mathbb{R}^{d\times d} is a predetermined matrix and y\in\mathbb{R}^{d} . To successfully solve this task, an attention-based model must learn to attend to the last token only and learn the ground-truth target weights W^{*} . We deliberately incorporate a sparse attention target mechanism

Read the complete text