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

Nicolas Zucchet, Francesco D'Angelo, Andrew Kyle Lampinen, Stephanie C.y. Chan

Introduction

Large Language Models (LLMs) often exhibit "emergence"—the sudden mastery of a task after long periods of negligible progress. While these jumps in performance are well-documented, the underlying mechanisms that trigger them have remained largely a "black box." This research investigates a specific mechanistic driver of emergence: the formation of sparse attention. By analyzing how models learn to focus on relevant signals amidst noise, the authors demonstrate that emergence timing follows predictable power laws and can be significantly accelerated through strategic data repetition.

The Mechanism of Emergence

The core challenge in many emergent tasks is for a Transformer to identify a single "signal" token within a large context of "noise." Initially, attention is uniform, providing a weak learning signal and resulting in a performance plateau. Emergence occurs when a feedback loop forms between the model's weights and its attention mechanism: slight alignment in the weights creates a signal that allows attention to become more sparse (focused), which in turn provides a cleaner signal for further weight improvement.

To study this, the authors utilize a "single-location linear regression" task where the target is a transformation of only the final token in a sequence. As shown in the dynamics below, the model remains in a high-loss state until the attention mechanism suddenly "locks on" to the relevant token.

Figure 1: Overview of the single-location linear regression task and its learning dynamics. (a) Loss curves show a distinct plateau before sudden convergence. (b) Emergence coincides with the weights w and attention α entering a feedback loop. (c) The plateau length follows a predictable scaling law relative to dimension d and context length T.

Scaling Laws and Predictable Timing

The duration of the initial plateau is not random. For the toy model, the time to escape the plateau scales according to the square root of the input dimension ($d$) and the context length ($T$). Specifically, the empirical results for Transformers show a scaling law $T_{plateau} \propto T^{0.986} d^{0.486}$, indicating that longer sequences and higher-dimensional data make the "needle in the haystack" harder to find, thereby delaying emergence. Interestingly, the choice of optimizer also plays a role; Adam was found to not only speed up training but also fundamentally alter these scaling exponents compared to SGD.

Accelerating Emergence through Repetition

Data distribution significantly impacts the speed of emergence. The authors explored two types of repetition:

  1. In-context repetition (Burstiness): Repeating the relevant token multiple times within a single sequence effectively reduces the "search space" for the attention mechanism, speeding up emergence by up to 4x.
  2. Cross-sample repetition: Increasing the frequency of specific tokens across the training set allows weights to learn faster in those directions, indirectly helping the attention mechanism focus sooner.
Figure 2: Impact of in-context repetition (B) and cross-sample repetition (p) on learning speed and plateau length.

Conclusion and Future Directions

This work suggests that emergence is a predictable phenomenon driven by the transition from uniform to sparse attention. While the study focuses on simplified tasks, the principles of the weight-attention feedback loop likely underpin more complex emergent behaviors like induction head formation in associative recall.

The findings also point toward potential improvements in training efficiency. Since low data diversity (repetition) accelerates initial emergence while high diversity is required for final generalization, a curriculum-based approach—starting with repetitive data and transitioning to diverse samples—may offer a more efficient path to training powerful emergent models.

Summary updated

BibTeX
@inproceedings{zucchet2025emergence,
  author = {Nicolas Zucchet and Francesco D'Angelo and Andrew Kyle Lampinen and Stephanie C.Y. Chan},
  title = {{The emergence of sparse attention: impact of data distribution and benefits of repetition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=jMhRbV47pS},
}
Figure