mlsanityData to 14 Oct 2026

Provable In-Context Learning of Nonlinear Regression with Transformers

arXiv 2507.20443 ↗First posted 28 Jul 2025cs.LGcited by 4

Not on the map. Why?

Abstract (arXiv)

The transformer architecture, which processes sequences of input tokens to produce outputs for query tokens, has revolutionized numerous areas of machine learning. A defining feature of transformers is their ability to perform previously unseen tasks using task specific prompts without updating parameters, a phenomenon known as in-context learning (ICL). Recent research has actively explored the training dynamics behind ICL, with much of the focus on relatively simple tasks such as linear regression and binary classification. To advance the theoretical understanding of ICL, this paper investigates more complex nonlinear regression tasks, aiming to uncover how transformers acquire in-context learning capabilities in these settings. We analyze the stage-wise dynamics of attention during training: attention scores between a query token and its target features grow rapidly in the early phase, then gradually converge to one, while attention to irrelevant features decays more slowly and exhibits oscillatory behavior. Our analysis introduces new proof techniques that explicitly characterize how the nature of general non-degenerate L-Lipschitz task functions affects attention weights. Specifically, we identify that the Lipschitz constant L of nonlinear function classes as a key factor governing the convergence dynamics of transformers in ICL. Leveraging these insights, for two distinct regimes depending on whether L is below or above a threshold, we derive different time bounds to guarantee near-zero prediction error. Notably, despite the convergence time depending on the underlying task functions, we prove that query tokens consistently attend to prompt tokens with highly relevant features at convergence, demonstrating the ICL capability of transformers for unseen functions.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 41 of its 46 references that are in the map. First posted on arXiv 28 Jul 2025.

Builds on

41 of 46 references.

References · 41

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  4. 2022Transformers learn in-context by gradient descentcited by 732
  5. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  6. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  7. 2020A Survey on Visual Transformercited by 654
  8. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  9. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  10. 2018Towards a Definition of Disentangled Representationscited by 296
  11. 2024Long-context LLMs Struggle with Long In-context Learningcited by 286
  12. 2024Many-Shot In-Context Learningcited by 206
29 more
  1. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  2. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  3. 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 161
  4. 2023Birth of a Transformer: A Memory Viewpointcited by 161
  5. 2021AMMUS : A Survey of Transformer-based Pretrained Models in Natural Language Processingcited by 131
  6. 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 118
  7. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 118
  8. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
  9. 2023In-Context Convergence of Transformerscited by 115
  10. 2022Disentangled Representation Learningcited by 112
  11. 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 86
  12. 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
  13. 2023Battle of the Backbones: A Large-Scale Comparison of Pretrained Models across Computer Vision Taskscited by 72
  14. 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
  15. 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 57
  16. 2024Asymptotic theory of in-context learning by linear attentioncited by 55
  17. 2023A Review of Deep Learning Techniques for Speech Processingcited by 52
  18. 2024ICLR: In-Context Learning of Representationscited by 50
  19. 2024Dual Operating Modes of In-Context Learningcited by 43
  20. 2024An Information-Theoretic Analysis of In-Context Learningcited by 40
  21. 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 40
  22. 2023Transformers in Speech Processing: A Surveycited by 39
  23. 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
  24. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  25. 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 31
  26. 2024Transformers on Markov Data: Constant Depth Sufficescited by 27
  27. 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
  28. 2023Towards Understanding How Transformers Learn In-context Through a Representation Learning Lenscited by 15
  29. 2024Local to Global: Learning Dynamics and Effect of Initialization for Transformerscited by 11

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 3.

4 papers.