- Rating
- 5
- Clarity
- 4
- Confidence
- 3
- Originality
- 2
- Quality
- 3
- Significance
- 3
Read review
Summary
The paper studies the ability of a softmax self-attention module to perform PCA on independent Gaussian tokens. In the infinite-prompt limit, the authors leverage the fact that softmax self-attention converges to a linear operator on tokens. The authors prove in the infinite-prompt setting that gradient flow converges to global minimizers which recover the top eigenvector of the data covariance matrix up to sign; they also show in this setting that, at global minimizers, the self-attention operator projects tokens onto the top eigenvector of the data covariance matrix. In the finite-prompt setting, the authors recover the same results up to finite sampling error.
Strengths and weaknesses
Strengths:
- The mathematical theory of transformers is a central topic in learning theory, and results for unsupervised learning tasks such as PCA are heavily underdeveloped compared to those on regression/classification.
- The paper is very well-written. It is easy to understand the central contributions of the paper and the broader context in which they exist.
- The paper seems to require some nontrivial mathematical results, particularly the concentration results for softmax attention, due to correlations between the context and query.
Weaknesses:
- The main weakness is that the core results of the paper hold for Gaussian tokens generated from a static covariance matrix. That a softmax attention module can succeed at this task is not very surprising since, as the authors prove, the attention weights learn the top eigenvector of a specific covariance ,instead of encoding a generic rule to perform PCA. While I appreciate the authors acknowledging this limitation with the spiked covariance model in Section 4, these results are analogous to the static case since the attention weights learn the unit vector that defines the scale matrix in the Wishart distribution. Thus, I think the paper still leaves many questions open about the mechanistic abilities of transformers performing PCA.
Questions
-
Does the linearity of softmax in the infinite prompt limit extend to multi-layer models? My initial guess is, since linear maps preserve Gaussianity, that compositions of softmax attention on Gaussian data are also linear in the infinite prompt setting. However, this seems counterintuitive, as it suggests that deep softmax models are not much more expressive than shallow ones.
-
Have you considered studying linear attention models, which may have valid infinite prompt limits for non-Gaussian data?
-
If you instead parameterize as a rank matrix with do you expect the optimal attention parameters to be a projection onto the top eigenvectors of ?
Limitations
Yes
Paper formatting concerns
None
Final justification
The author response led me to raise my score. The current work is an impressive study of the representation learning capabilities of softmax attention for a tractable unsupervised learning task. Extensions to in-context learning and algorithmic learning constitute important directions for future work, but I no longer feel that a lack of such results undermines the paper's contribution. I also appreciate the additional experiments by the authors and their thoughtful responses to my questions.
Weaknesses. We thank the reviewer for this thoughtful comment.
Our objective is indeed not to show that a Transformer learns a universal algorithm for PCA from data. Rather, our goal is to understand, in the simplest mathematically tractable setting, the optimization objective implicitly solved by a single attention layer when trained under an unsupervised reconstruction loss.
From this perspective, our main contribution is to establish that the optimization dynamics of rank-one attention are intrinsically connected to spectral methods: the global minimizers coincide with the leading eigendirection, the gradient flow converges to these minimizers, and, in the infinite-prompt regime, the dynamics reduce to a generalized version of Oja's flow. To the best of our knowledge, this provides the first explicit optimization-theoretic connection between softmax attention and PCA.
We fully agree that this does not yet explain how deep Transformers could implement a generic PCA algorithm capable of adapting to arbitrary covariance matrices. In fact, we view this distinction as an important conceptual point: the present work studies representation learning, whereas algorithmic in-context PCA would require the attention parameters to infer the covariance from each prompt and adapt online. This is a substantially different problem and constitutes an exciting direction for future work.
Regarding the spiked Wishart model, we also agree that the learned parameter ultimately aligns with the latent direction defining the covariance distribution. Our intention in Section~4 was therefore not to claim a fundamentally different mechanism, but rather to demonstrate that our analysis extends beyond a single deterministic covariance matrix to a distribution over covariance matrices. Moreover, this framework removes the distinct-eigenvalues assumption required in the deterministic setting. We will clarify this motivation more explicitly in the revised manuscript.
Q1. This is an excellent observation.
Indeed, under the assumptions of our paper, the answer is essentially yes. Since the infinite-prompt attention operator is linear on Gaussian measures, its output remains Gaussian. Consequently, the next attention layer again operates on Gaussian inputs and therefore also reduces to a linear operator. By induction, a stack of infinite-prompt attention layers without additional nonlinearities (without MLPs) remains globally linear.
Rather than being paradoxical, we believe this highlights the specificity of the Gaussian setting. The expressive power of deep Transformers arises not only from attention itself, but also from finite-prompt effects, feed-forward nonlinearities, normalization layers, residual connections, positional encodings, and, more fundamentally, from the fact that real data are not Gaussian. Once these ingredients are incorporated, the overall architecture is no longer expected to remain linear.
We will add a discussion of this point in the revised manuscript, as it illustrates both the strength and the limitations of the Gaussian infinite-prompt approximation.
Q2. Yes. In fact, we analyze a simplified linear attention model in the appendix as a warm-up before studying softmax attention.
More generally, we believe linear attention provides an attractive framework for extending the analysis beyond Gaussian distributions. Unlike softmax attention, whose infinite-prompt limit depends on the moment-generating function of the data, linear attention depends only on first- and second-order moments, making it considerably less tied to Gaussianity. This suggests that analogous PCA-type results may hold under substantially weaker assumptions.
While such a setting departs from current attention-based architectures, it offers a mathematically appealing framework for extending the analysis beyond the Gaussian regime and toward more general data distributions.
Q3. Yes, this is our current expectation, and it is supported by new numerical experiments.
Replacing the rank-one parameterization μμ⊤ by a matrix factorization Q⊤Q, where Q∈Rk×d, naturally leads to a higher-rank attention mechanism. In the Gaussian infinite-prompt regime, the attention operator remains linear, suggesting that the corresponding population objective depends on the positive semidefinite matrix Q⊤Q. Since Q⊤Q is invariant under left multiplication of Q by an orthogonal matrix, the optimization is naturally expected to recover the principal k-dimensional eigenspace of the covariance matrix.
To investigate this setting, we performed additional numerical experiments using this higher-rank parameterization together with a simple regularization encouraging the rows of Q to become orthogonal, namely ∑i<j⟨qi,qj⟩2 where qi and qj denote rows of Q. Across numerous randomly generated Gaussian covariance matrices, the optimization consistently converged to solutions whose normalized rows were strongly aligned with the first k principal eigenvectors of the covariance matrix, up to permutation and sign. These experiments therefore provide strong empirical evidence that the higher-rank formulation successfully recovers the leading principal eigenspace while empirically selecting one representative basis.
From a theoretical perspective, however, this extension introduces several new mathematical challenges. The parameter space becomes matrix-valued, the objective exhibits rotational symmetries leading to non-isolated minimizers and flat directions, and the finite-prompt concentration analysis must be generalized to matrix-valued derivatives. Characterizing the complete optimization landscape therefore appears substantially more difficult than in the rank-one case and remains an interesting direction for future work.
We thank the reviewer for these insightful questions. We believe they identify precisely the next theoretical challenges beyond the present work, and we will revise the manuscript to better distinguish the representation-learning setting studied here from the broader question of whether deep Transformers can implement a generic PCA algorithm.