Training Dynamics of In-Context Learning in Linear Attention
Yedi Zhang, Aaditya K. Singh, Peter E. Latham, Andrew Saxe

TL;DR
This paper provides a theoretical analysis of how in-context learning abilities develop during gradient descent training of linear attention models, revealing different dynamics based on key-query parametrization.
Contribution
It offers a detailed theoretical understanding of the training dynamics of linear attention models for in-context learning, including fixed points and loss trajectories.
Findings
Merged key-query parametrization shows abrupt loss drops.
Separate parametrization exhibits saddle-to-saddle dynamics.
Models implement principal component regression during training.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsNeural dynamics and brain function · Neural Networks and Applications
