mlsanityData to 7 Oct 2026

Clustering in pure-attention hardmax transformers and its role in sentiment analysis

arXiv 2407.01602 ↗First posted 26 Jun 2024cs.CL cs.LG math.DScited by 15

Not on the map. Why?

Abstract (arXiv)

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 textitleaders. 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.

Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). Builds on 28 of its 46 references that are in the map. First posted on arXiv 26 Jun 2024.

Builds on

28 of 46 references.

References · 28

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  5. 2023GPT-4 Technical Reportcited by 18,132
  6. 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
  7. 2021Zero-Shot Text-to-Image Generationcited by 4,276
  8. 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,094
  9. 2022Robust Speech Recognition via Large-Scale Weak Supervisioncited by 3,972
  10. 2018Neural Ordinary Differential Equationscited by 3,733
  11. 2020Taming Transformers for High-Resolution Image Synthesiscited by 3,229
  12. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
16 more
  1. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  2. 2020Generative Language Modeling for Automated Theorem Provingcited by 379
  3. 2018Molecular Transformer - A Model for Uncertainty-Calibrated Chemical Reaction Predictioncited by 225
  4. 2023A mathematical perspective on Transformerscited by 160
  5. 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
  6. 2023The emergence of clusters in self-attention dynamicscited by 133
  7. 2019Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of Viewcited by 108
  8. 2019Deep Learning via Dynamical Systems: An Approximation Perspectivecited by 78
  9. 2021Neural ODE control for classification, approximation and transportcited by 56
  10. 2023Sumformer: Universal Approximation for Efficient Transformerscited by 30
  11. 2019Effects of padding on LSTMs and CNNscited by 22
  12. 2022On the infinite-depth limit of finite-width neural networkscited by 22
  13. 2019Infinitely deep neural networks as diffusion processescited by 21
  14. 2022Turnpike in optimal control of PDEs, ResNets, and beyondcited by 10
  15. 2020Doubly infinite residual neural networks: a diffusion process approachcited by 4
  16. 2021A deep language model to predict metabolic network equilibriacited by 3

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 8; 2026: 5.

15 papers.

Sort:

By area: