Lune

ICML2026顶会

Transformer Circuits Can Realize Clustering Algorithms

Kenneth Clarkson, Lior Horesh, Takuya Ito, Charlotte Park, Parikshit Ram

摘要

Although transformers are most commonly optimized as statistical sequence models, it is unclear to what extent they can implement and learn exact algorithmic computations. Here, we specify a transformer implementation from first principles that executes a fundamental and widely used method for kk-means clustering: Lloyd's algorithm. We theoretically prove and empirically demonstrate that this implementation of a transformer architecture, which we term the kk-means transformer, exactly implements Lloyd's algorithm for kk-means clustering using the standard circuit mechanisms of modern transformers: attention block, residual connections, and feed-forward block. In learning experiments, we find that training this base architecture on kk-means clustering yields a generalizable clustering algorithm that surpasses Lloyd's algorithm in terms of clustering quality. Finally, we demonstrate that interpretable alterations (e.g., inclusion of layer normalizations) to this architecture yields diverse and novel variants of clustering algorithms, including soft kk-means, spherical kk-means, trimmed kk-means. Overall, our results show that transformer circuit mechanisms can instantiate exact algorithmic routines for clustering, while simultaneously providing an effective learnable model.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Transformers learn to implement preconditioned gradient descent for in-context learning 引用了 Transformers Learn In-Context by Gradient Descent
  • Transformers learn to implement preconditioned gradient descent for in-context learning 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Attention's forward pass and Frank-Wolfe 引用了 The emergence of clusters in self-attention dynamics
  • Transformers Learn In-Context by Gradient Descent 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

  1. Attention's forward pass and Frank-WolfeAlbert Alcalde, Borjan Geshkovski, Domènec Ruiz-BaletICML 2026

它引用的 Paper11

  1. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
  2. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用
  3. Transformers learn to implement preconditioned gradient descent for in-context learningKwangjun Ahn, Xiang Cheng, Hadi Daneshmand, Suvrit SraNeurIPS 2023 · 324 次引用
  4. The Expressive Power of Transformers with Chain of ThoughtWilliam Merrill, Ashish SabharwalICLR 2024 · 243 次引用
  5. The emergence of clusters in self-attention dynamicsBorjan Geshkovski, Cyril Letrouit, Yury Polyanskiy, Philippe RigolletNeurIPS 2023 · 163 次引用

相关 Paper

  1. On the Efficiency of K-Means Clustering: Evaluation, Optimization, and Algorithm SelectionSheng Wang, Yuan Sun, Zhifeng BaoVLDB 2021 · 34 次引用
  2. Fast kk-Means via Data-Aware Grouping and Gap-Optimized Lower BoundXiaogang Huang, Dan Zhuang, Jianbao Chen, Tiefeng Ma 等ICDE 2026
  3. Efficient Algorithms for Sum-Of-Minimum OptimizationLisang Ding, Ziang Chen, Xinshang Wang, Wotao YinICML 2024 · 7 次引用
  4. End-to-end Differentiable Clustering with Associative MemoriesBishwajit Saha, Dmitry Krotov, Mohammed J. Zaki, Parikshit RamICML 2023 · 14 次引用
  5. Heterogeneity for the Win: One-Shot Federated ClusteringDon Kurian Dennis, Tian Li, Virginia SmithICML 2021 · 212 次引用
黄昏的海面,两侧是细线勾勒的悬崖