English

The Asymptotic Behavior of Attention in Transformers

Artificial Intelligence 2025-09-26 v2 Machine Learning Systems and Control Systems and Control Dynamical Systems Optimization and Control

Abstract

The transformer architecture has become the foundation of modern Large Language Models (LLMs), yet its theoretical properties are still not well understood. As with classic neural networks, a common approach to improve these models is to increase their size and depth. However, such strategies may be suboptimal, as several works have shown that adding more layers yields increasingly diminishing returns. More importantly, prior studies have shown that increasing depth may lead to model collapse, i.e., all the tokens converge to a single cluster, undermining the ability of LLMs to generate diverse outputs. Building on differential equation models for the transformer dynamics, we prove that all the tokens in a transformer asymptotically converge to a cluster as depth increases. At the technical level we leverage tools from control theory, including consensus dynamics on manifolds and input-to-state stability (ISS). We then extend our analysis to autoregressive models, exploiting their structure to further generalize the theoretical guarantees.

Keywords

Cite

@article{arxiv.2412.02682,
  title  = {The Asymptotic Behavior of Attention in Transformers},
  author = {Álvaro Rodríguez Abella and João Pedro Silvestre and Paulo Tabuada},
  journal= {arXiv preprint arXiv:2412.02682},
  year   = {2025}
}