Clustering in Pure-Attention Hardmax Transformers and Its Role in Sentiment Analysis
SIAM Journal on Mathematics of Data Science · 30.09.2025 · 7 (3) · 1367-1393
DOI: 10.1137/24m167086x ↗Kurz gefasst
Fachartikel in der Zeitschrift SIAM Journal on Mathematics of Data Science, online erschienen am 18.08.2025. Verfasst von Albert Alcalde und 2 weiteren Autor:innen. Die Arbeit wurde bisher 5-mal zitiert (Crossref) und nennt 45 Literaturangaben. Gefördert von: Alexander von Humboldt-Stiftung, Horizon 2020 Framework Programme, Air Force Office of Scientific Research.
Abstract (Originalsprache)
Transformers are extremely successful machine learning models whose mathematical properties remain poorly understood. Here, we rigorously characterize the behavior of transformers with hardmax self-attention and normalization sublayers as the number of layers tends to infinity. By viewing such transformers as discrete-time dynamical systems describing the evolution of points in a Euclidean space, and thanks to a geometric interpretation of the self-attention mechanism based on hyperplane separation, we show that the transformer inputs asymptotically converge to a clustered equilibrium determined by special points called leaders. We then leverage this theoretical understanding to solve sentiment analysis problems from language processing using a fully interpretable transformer model, which effectively captures “context” by clustering meaningless words around leader words carrying the most meaning. Finally, we outline remaining challenges to bridge the gap between the mathematical analysis of transformers and their real-life implementation.
Förderung
- Alexander von Humboldt-Stiftung
- Horizon 2020 Framework Programme
- Air Force Office of Scientific Research
- COST Action MAT-DYN-NET
- Deutsche Forschungsgemeinschaft
- Ministerio de Economía, Industria y Competitividad, Gobierno de España
- Madrid Government-UAM Agreement fo the Excellence of the University Research Staff
Zitieren
APA
Alcalde, A., Fantuzzi, G., & Zuazua, E. (2025). Clustering in Pure-Attention Hardmax Transformers and Its Role in Sentiment Analysis. SIAM Journal on Mathematics of Data Science, 7(3), 1367-1393. https://doi.org/10.1137/24m167086x
Vancouver
Alcalde A, Fantuzzi G, Zuazua E. Clustering in Pure-Attention Hardmax Transformers and Its Role in Sentiment Analysis. SIAM Journal on Mathematics of Data Science. 2025;7(3):1367-1393. doi:10.1137/24m167086x
BibTeX
@article{Alcalde2025,
author = {Alcalde, Albert and Fantuzzi, Giovanni and Zuazua, Enrique},
title = {Clustering in Pure-Attention Hardmax Transformers and Its Role in Sentiment Analysis},
journal = {SIAM Journal on Mathematics of Data Science},
year = {2025},
volume = {7},
number = {3},
pages = {1367--1393},
doi = {10.1137/24m167086x}
}
EUVIMED