The emergence of sparse attention: impact of data distribution and benefits of repetition
Nicolas Zucchet, Francesco d'Angelo, Andrew K. Lampinen, Stephanie C. Y. Chan
TL;DR
This work investigates when sparse attention emerges during Transformer training and how data distribution and repetition shape that timing. It develops a tractable attention-based linear-regression toy model to derive explicit learning-dynamics, revealing a plateau followed by abrupt emergence and power-law scaling with sequence length and dimension; it also shows repetition accelerates emergence, with formulas linking burstiness and repetition probability to shorter plateaus. The theory is extended to more realistic Transformers and an in-context associative recall task, demonstrating data-driven predictions of emergence speed and highlighting the role of sparse attention in in-context learning. The findings offer a unifying perspective on emergence phenomena and suggest practical active-learning strategies that modulate data diversity to optimize learning trajectories.
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.
