Summary
The paper tries to tackle an important and relevant problem in LLM training: whether in-context learning properties can be explained by a form of gradient descent?
For the setting, the authors have chosen to focus specifically on the linear transformer with a single or multiple layers with an input that is given by the data generated using a linear model. Within this setting, the authors were able to show a series of results for various specially constructed transformers.
Specifically, they look at a (1) single-layer transformer, (2) multi-layer with sparse parameters and (3) multi-layer with more general parameters. For (1), they have provided a characterization of the unique global optimum of a single-layer transformer with linear attentions. They showed that foer the optimal parameters found, the transformer implements a single step of preconditioned gradient descent. For (2), they have shown that global minimizers of the training objective of a two-layer linear transformer over isotropic regression instances. For the most general scenario (3), they found that certain critical points implement preconditioning using inverse-data-covariance of the input.
Experimentally, the authors have confirmed using a toy-example that optimizing a three layer model indeed results in a minimizer that converges to an inverse of a covariance matrix.
Strengths
The paper provides an interesting analysis that can be useful to understand the intriguing properties of in-context learning. It studies a series of transformer models, ranging from a simple single layer to a more general multi-layer ones and shows that for all the settings the in-context learning implements the preconditioned gradient descent. While by no means comprehensive, this paper can be useful as a stepping stone for any researcher that wants to further study intriguing properties of in-context learning.
The paper is easy to read and easy to understand. The assumptions and the math mainly seem to check out.
Weaknesses
Generally, the paper restricts itself to a very narrow setting of a specific data that is centered at zero, linear model generating the labels, linear transformer, specific sparsity of the parameter matrix.
The transformers that they study are linear with a single head only. While I do appreciate the value of the analysis and I understand that this is just a step of many, it would be great to include a short paragraph outlining what the authors think about generalization of the proposed approach when the assumptions are removed.
Also, given the series of the assumptions, I would make sure that they are stated early on in the abstract and introduction.
I also think that the experimental validation can be slightly improved by considering different choice of layers, dimension of x, conditioning factor of the input etc. It would also be great to have an empirical plot demonstrating how close A is to the Gram matrix as the number of points increase (the results from the end of section 3)
Questions
The equations for the gradient do not immediately pop out from the eq 7. I would encourage the authors to expose the equations for the gradient to the reader (maybe after eq 5) so that the connection between the gradient and the preconditioner would become more apparent.
What are the properties of A in sections 3 and 4? Can a transformer find a positive definite matrix through training?
For the evaluation of the Theorem 4 and 5, it is a bit hard to interpret the numbers, since the used distance metric is close to zero, but not exactly zero. The obtained value of ~0.1-0.2 is quite hard to interpret, apart from the fact that it is smaller that the distance with respect to the identity.
Also, the metric that the authors are using involves the minima over the space of scalars $\alpha$. It would be interesting if the authors can actually provide the scalars $a_i$ from Theorem 4 that they have found empirically. Do these scalars remain the same over multiple restarts of the algorithm?
How come the same $\Sigma$ matrix is used for both data and the weights (theorem 4 and 5)? It doesn't sound very realistic that the data and the weights use the same covariance matrix.
Would be great to add more information to Section 4.1 about adaptive coordinate-wise step sizes. If I understood correctly, Theorem 3 talks about the existence of the global minimizer under certain conditions. How exactly does adaptive coordinate-wise step sizes help find this solution?
I would encourage the authors to add a simple table at the end of the introduction clearly stating the assumptions that each section has. As written, It is quite hard to understand, especially when the notation change from section to section.
Small comments:
- Typo l.5: “Can transformers can”
- L.83: dimension of Z doesn’t match the dimension of W_k, and W_q in eq (1).
- In Lemma 2 z^(1) etc are mentioned, but not properly defined nor used.
- Gamma_k in l.155 plays a similar role to a_i from l.184. Maybe call both of these variables gamma?
- In fig.1 (d) the log(loss) converges to -1.0, which is not a zero value, as the text suggests in l.213.
- How come the authors choose L-BFGS as an optimizer? It is a fairly specialized algorithm that is not often used these days. What properties of L-BFGS are desirable in the settings that authors used it for? Can the same results be achieved with SGD or Adam?
Rating
7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.
Confidence
4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.
Limitations
It would be important to highlight limitations of the analysis. E.g. same covariance matrix, singe-head linear attention...