paper-with-me

Papers

Exact Learning Dynamics of In-Context Learning in Linear Transformers and Its Application to Non-Linear Transformers

2025-04-17 · Nischal Mainali, Lucas Teixeira

Transformer models exhibit remarkable in-context learning (ICL), adapting to novel tasks from examples within their context, yet the underlying mechanisms remain largely mysterious. Here, we provide an exact analytical characterization of ICL emergence by deriving the closed-form stochastic gradient descent (SGD) dynamics for a simplified linear transformer performing regression tasks. Our analysis reveals key properties: (1) a natural separation of timescales directly governed by the input data's covariance structure, leading to staged learning; (2) an exact description of how ICL develops, including fixed points corresponding to learned algorithms and conservation laws constraining the dynamics; and (3) surprisingly nonlinear learning behavior despite the model's linearity. We hypothesize this phenomenology extends to non-linear models. To test this, we introduce theory-inspired macroscopic measures (spectral rank dynamics, subspace stability) and use them to provide mechanistic explanations for (1) the sudden emergence of ICL in attention-only networks and (2) delayed generalization (grokking) in modular arithmetic models. Our work offers an exact dynamical model for ICL and theoretically grounded tools for analyzing complex transformer training.

📄 PDF Abstract BibTeX arXiv:2504.12916

Code (0)

등록된 구현이 없습니다.

Tasks

In-Context Learning

Similar Papers 제목 키워드 기반

Large-Step Training Dynamics of a Two-Factor Linear Transformer Model

2026-05-20 · Krishnakumar Balasubramanian arxiv

Gradient-flow analyses show that simplified linear transformers can learn the in-context linear-regression algorithm, but they do not explain the finite-step behavior of gradient descent at large learning rates. Motivate…

Reachability and asymptotics of Gaussian Transformer dynamics

2026-05-29 · Albert Alcalde, Zhengping Ji, Enrique Zuazua arxiv

We formulate data propagation through the Transformer, the machine learning architecture powering large language models, as a nonlinear control system on the space of probability measures. For the mean-field Transformer …

In-Context Learning with Representations: Contextual Generalization of Trained Transformers

2024-08-19 · Tong Yang, Yu Huang, Yingbin Liang, Yuejie Chi

In-context learning (ICL) refers to a remarkable capability of pretrained large language models, which can learn a new task given a few examples during inference. However, theoretical understanding of ICL is largely unde…

In-Context Learning

Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformers

2024-06-05 · Brian K Chen, Tianyang Hu, Hui Jin, Hwee Kuan Lee 외

In-Context Learning (ICL) has been a powerful emergent property of large language models that has attracted increasing attention in recent years. In contrast to regular gradient-based learning, ICL is highly interpretabl…

In-Context Learning

Diagonal Batching Unlocks Parallelism in Recurrent Memory Transformers for Long Contexts

2025-06-05 · Danil Sivtsov, Ivan Rodkin, Gleb Kuzmin, Yuri Kuratov 외

Transformer models struggle with long-context inference due to their quadratic time and linear memory complexity. Recurrent Memory Transformers (RMTs) offer a solution by reducing the asymptotic cost to linear time and c…

GPUScheduling