- Rating
- 3
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
This paper proposes a compact Transformer architecture with an embedding dimension of capable of precisely executing the Lloyd -means clustering algorithm, reducing the parameter count by up to 75% compared to existing $ d+k$-dimensional constructions. It systematically investigates the convergence and generalization of learning this algorithm end-to-end via a smoothed regularization objective, theoretically characterizing how the embedding scheme, regularization penalty, and attention temperature influence optimization difficulty. Experimental results validate the model's multi-step iterative performance and cross-distribution generalization capabilities, though a fundamental failure is observed on heavy-tailed Cauchy distributions.
Strengths and weaknesses
Strengths:
-
The embedding dimension is reduced from to , resulting in fewer parameters and faster inference.
-
The theory fully characterizes the relationship between the Lipschitz constant and factors such as the embedding scheme, regularization, and attention temperature; experimental results align with theoretical predictions.
-
It was discovered that re-embedding at each step enables a single-step trained model to achieve multi-step optimization, offering high practical utility.
Weaknesses:
-
The model is tied to specific values and cannot generalize to different dimensions or numbers of clusters, resulting in poor flexibility.
-
It fails completely with the Cauchy distribution; the gap in the smoothness upper bound is excessive, rendering it unsuitable for heavy-tailed scenarios. It may only be appropriate for simple distributions and entirely inapplicable to complex ones.
-
While the theory requires , practical implementation uses a finite softmax; furthermore, the Lipschitz bound depends exponentially on temperature, leading to gradient explosion when is large.
Questions
-
The core contribution of the paper is reducing the embedding dimension from to . However, this improvement offers significant advantages only when is large; in practice, clusters are often not that large. If is small (e.g., or ), does this improvement offer any other benefits? When is small and is large, the convergence speed of BN is significantly slower than that of OH, consistent with theoretical predictions, yet the paper offers no solution to improve optimization while maintaining parameter efficiency. In other words, the paper trades convergence speed for parameter efficiency, and the cost of this trade-off is theoretically exponential. For practical applications, this implies that a smaller model might require exponentially more training steps to achieve the same performance, potentially negating the computational gains derived from the reduction in parameters.
-
The construction in Theorem 1 requires an inverse temperature of (i.e., hardmax/argmax attention), whereas actual training employs standard softmax with a finite temperature . The construction theoretically proven to execute Lloyd's algorithm exactly serves only as an approximation in practice. The paper states on page 6, "we use standard softmax attention for our learnability analysis and experiments"; what is the magnitude of the error bound introduced by this approximation?
-
The Lipschitz constant derived in Theorem 2 (and Theorem 5 in Appendix I) includes an exponential term. When is even moderately large, the Lipschitz constant explodes, leading to gradient instability. Is this consistent with the phenomenon observed in Figure 15d, where OH experiences a gradient explosion at ? Is there a solution to this problem?
-
The paper trains a "single-step clustering" model but attempts multi-step iteration during evaluation. A key finding is that directly applying iterative attention updates leads to divergence (Figure 6, left), whereas only "re-embedding" at each step works (Figure 6, right). This effectively suggests that the learned models did not truly capture the iterative structure of Lloyd's algorithm; instead, the performance gains observed over multiple steps stem primarily from the "re-embedding" engineering trick rather than the model actually learning iterative optimization. This contradicts the implication of the paper's title, "Leaner transformers can easily learn to cluster"; what the models actually learned resembles a "high-quality single-step initialization" rather than the full clustering algorithm. If the model merely learned a good initialization, then the baselines used for comparison are inappropriate, and the experimental setup should have included various initialization methods.
-
The paper frequently compares the learned models against "single-step Lloyd" . However, Lloyd's algorithm typically requires multiple iterations to converge, making single-step Lloyd an inherently weak baseline. Although the paper presents a multi-step comparison in Figure 6, its primary conclusions still rely on this weak baseline.
Limitations
yes
Paper formatting concerns
NA
Final justification
The improvements proposed in this paper only yield benefits when is very large, but in real-world datasets, $ k$ is often not particularly large, thus reducing the paper's contribution. Furthermore, comparing the methods, such as with a single-step Lloyd's algorithm, is unfair; after reading the authors' responses, it seems more like an experiment and comparison designed specifically for the proposed method. A single-step Lloyd's algorithm is almost equivalent to random assignment, which is impractical in practice. Other reviewers have also raised similar questions. The authors' responses do not address the concern of why a worse baseline (one iteration) was deliberately used.
Please see our response to [pqBH-W3] for Reviewer pqBH.
We aimed to thoroughly evaluate the training procedure and thus considered multiple families of distributions (normal, log-normal, Gumbel, Cauchy, Laplace). We explicitly highlighted the failure with Cauchy, and tried to understand why it fails, thus identifying the main cause as the gap in the smoothed upper bound. We do not propose any solution to this specific failure yet, and any solution would probably require novel research in regularized argmax that can handle center-to-point pairwise distance distributions induced by mixture of Cauchy distributions.
Please see our response to [pqBH-W2] for Reviewer pqBH.
Thm 1 uses γ=∞ as the focus there is to show that the transformer architecture with BN token embeddings is able to express Lloyd's algorithm for clustering. When training the models, the goal is to learn to cluster --- that is, to explicitly minimize the k-means clustering objective. We are not training the models to exactly emulate Lloyd's algorithm; that would be a different learning objective. Thus in all our training experiments, we use γ=1/demb which is standard in transformer training.
As a separate analysis, one can study the difference (between the model output and Lloyd's algorithm) if the construction in Thm 1 uses a finite γ instead. For a set of n points in [0,1]d in d dimensions being clustered into k clusters, one can roughly bound the difference between Lloyd's center updates, and the updates via theoretical construction at finite γ with a term which is O(exp(−γΔ)(n+k)d), where Δ>0 is the smallest margin between distance to the closest center and the second closest center (and usually grows with d). Section 2.3 in Clarkson et al (2025) already empirically studies this approximation.
In Thm 2, α∼O(exp(γ)), and in all our experiments, we use the standard value in transformer training of γ=1/demb. This is in contrast to Thm 1, where we require γ→∞, but this focuses on showing that the transformer architecture (with the BN token embedding) can express Lloyd's algorithm for k-means clustering; Thm 2 is related to training convergence and generalization.
Regarding the unfavourable convergence in Fig 15d with k=25, 3/10 random trials for OH (with NE and L2 loss regularization) experience some intermediate numerical issues which throws the model off, and the training does not recover in the allotted 104 steps. We would like to note a couple of things here:
First, we want to clarify that, once training is completed, the trained models (and Lloyd's algorithm) are evaluated on new clustering tasks not seen during training (generated from different task distributions to evaluate different forms of generalization), and both the models and Lloyd's algorithm get the data X and the same initial centers C(0) as input. It is not clear to us what the reviewer refers to as "single-step initialization", and would appreciate clarification. In the following, we explain what we mean by "single-step clustering" (during training) vs "multi-step clustering".
For a clustering task with data X and initial centers C(0), T iterations of Lloyd's algorithm (Alg 2) does the following:
With a trained model Fγ(⋅,⋅;Θ) which uses token embeddings (OH/BN) and attention based updates (eq 4), we perform T iterations of "multi-step clustering" as follows:
This follows the iterative nature of Lloyd's algorithm, with Fγ(⋅,⋅;Θ) replacing the assign/update step in each iteration. This is what is evaluated in Fig 6 (right), 7, 8, 12. With "single-step clustering", we refer to the fact that, during training, this model is executed on each training clustering task for only 1 step, and the training loss is computed with C(1), the output of the one-step update. This makes the training extremely efficient as we are training a single transformer layer without any recursion. However, we see that this model learns some clustering mechanisms as we can reapply it for T iterations, and progressively improves clustering quality, much like applying the "assign/center-update" step in Lloyd's algorithm iteratively.
Fig 6 (left) is ablating the role of the token embedding in Fγ by evaluating an alternate form of "multi-step clustering" that only applies the attention updates in (4) iteratively as follows:
The result in Fig 6 (left) shows that just applying the attention updates recursively does not improve the clustering quality, and both the token embeddings (ON/BN) and the attention updates (eq 4) in the trained model Fγ(⋅,⋅;Θ) are essential for the trained transformer to successfully cluster iteratively.
We will improve our current presentation to better explain this.
Please see our response to [zXnc-W4] for Reviewer zXnc.