Zhang, Yedi;
Singh, Aaditya K;
Latham, Peter E;
Saxe, Andrew M;
(2025)
Training Dynamics of In-Context Learning in Linear Attention.
In:
Proceedings of the 42nd International Conference on Machine Learning.
(pp. pp. 1-41).
PMLR
Preview |
Text
Training Dynamics of In-Context Learning in Linear Attention.pdf - Published Version Download (1MB) | Preview |
Abstract
While attention-based models have demonstrated the remarkable ability of in-context learning (ICL), the theoretical understanding of how these models acquired this ability through gradient descent training is still preliminary. Towards answering this question, we study the gradient descent dynamics of multi-head linear self-attention trained for in-context linear regression. We examine two parametrizations of linear self-attention: one with the key and query weights merged as a single matrix (common in theoretical studies), and one with separate key and query matrices (closer to practical settings). For the merged parametrization, we show that the training dynamics has two fixed points and the loss trajectory exhibits a single, abrupt drop. We derive an analytical time-course solution for a certain class of datasets and initialization. For the separate parametrization, we show that the training dynamics has exponentially many fixed points and the loss exhibits saddle-to-saddle dynamics, which we reduce to scalar ordinary differential equations. During training, the model implements principal component regression in context with the number of principal components increasing over training time. Overall, we provide a theoretical description of how ICL abilities evolve during gradient descent training of linear attention, revealing abrupt acquisition or progressive improvements depending on how the key and query are parametrized.
Type: | Proceedings paper |
---|---|
Title: | Training Dynamics of In-Context Learning in Linear Attention |
Event: | International Conference on Machine Learning |
Location: | Vancouver, Canada |
Dates: | 13th-19th July 2025 |
Open access status: | An open access version is available from UCL Discovery |
Publisher version: | https://openreview.net/forum?id=aFNq67ilos |
Language: | English |
Additional information: | © The Authors 2025. Original content in this paper is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) Licence (https://creativecommons.org/licenses/by-nc/4.0/). |
UCL classification: | UCL UCL > Provost and Vice Provost Offices > School of Life and Medical Sciences UCL > Provost and Vice Provost Offices > School of Life and Medical Sciences > Faculty of Life Sciences UCL > Provost and Vice Provost Offices > School of Life and Medical Sciences > Faculty of Life Sciences > Gatsby Computational Neurosci Unit |
URI: | https://discovery.ucl.ac.uk/id/eprint/10210585 |
Archive Staff Only
![]() |
View Item |