mlsanityData to 7 Oct 2026

Leaner Transformers Can Easily Learn to Cluster

arXiv 2610.09760 ↗First posted 7 Oct 2026cs.LG stat.MLcited by 0

Not on the map. Why?

Abstract (arXiv)

Transformers have in-context learning capabilities, where some known learning algorithms can be executed in the forward pass through the model. Recent work shows that transformers can exactly perform Lloyd's algorithm for k-means clustering with n points in d dimensions with an embedding size d_textsfemb = d+k (thus, requiring attention projection matrices of size (d+k)2). In this work, we build upon this result in the following ways: First, we present an equally expressive but smaller transformer that executes Lloyd's algorithm with embedding size d_textsfemb = (d + lceil log2 k rceil). Next, we train these transformers to learn the clustering algorithms given a distribution of clustering tasks, and theoretically characterize and empirically validate the factors affecting the convergence and in-distribution generalization of learning algorithms based on stochastic gradients. Finally, we probe the general clustering abilities of these learned algorithms (in the form of transformers), and try to understand situations where they succeed and fail.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 8 of its 37 references that are in the map. First posted on arXiv 7 Oct 2026.

Builds on

8 of 37 references.

References · 8

  1. 2014Neural Turing Machinescited by 630
  2. 2015Train faster, generalize better: Stability of stochastic gradient descentcited by 547
  3. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  4. 2023A mathematical perspective on Transformerscited by 160
  5. 2023The emergence of clusters in self-attention dynamicscited by 133
  6. 2023In-Context Convergence of Transformerscited by 112
  7. 2022Formal Algorithms for Transformerscited by 70
  8. 2013Projection onto the probability simplex: An efficient algorithm with a simple proof, and an applicationcited by 65

Built on by

Not cited yet.