mlsanityData to 14 Oct 2026

Transformers Meet In-Context Learning: A Universal Approximation Theory

arXiv 2506.05200 ↗First posted 5 Jun 2025cs.LG math.ST stat.MLcited by 6

Not on the map. Why?

Abstract (arXiv)

Large language models are capable of in-context learning, the ability to perform new tasks at test time using a handful of input-output examples, without parameter updates. We develop a universal approximation theory to elucidate how transformers enable in-context learning. For a general class of functions (each representing a distinct task), we demonstrate how to construct a transformer that, without any further weight updates, can predict based on a few noisy in-context examples with vanishingly small risk. Unlike prior work that frames transformers as approximators of optimization algorithms (e.g., gradient descent) for statistical learning tasks, we integrate Barron's universal function approximation theory with the algorithm approximator viewpoint. Our approach yields approximation guarantees that are not constrained by the effectiveness of the optimization algorithms being mimicked, extending far beyond convex problems like linear regression. The key is to show that (i) any target function can be nearly linearly represented, with small ℓ1-norm, over a set of universal features, and (ii) a transformer can be constructed to find the linear representation -- akin to solving Lasso -- at test time.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 53 of its 71 references that are in the map. First posted on arXiv 5 Jun 2025.

Builds on

53 of 71 references.

References · 53

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
  4. 2021Transformers in Vision: A Surveycited by 1,013
  5. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  6. 2022Transformers learn in-context by gradient descentcited by 732
  7. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  8. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  9. 2021A Survey of Transformerscited by 401
  10. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  11. 2014Breaking the Curse of Dimensionality with Convex Neural Networkscited by 331
  12. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
38 more
  1. 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 294
  2. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
  3. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  4. 2022Transformers Learn Shortcuts to Automatacited by 268
  5. 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 260
  6. 2022Transformers in Medical Imaging: A Surveycited by 245
  7. 2023Looped Transformers as Programmable Computerscited by 237
  8. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  9. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
  10. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  11. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  12. 2023Representational Strengths and Limitations of Transformerscited by 133
  13. 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
  14. 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 118
  15. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
  16. 2023In-Context Convergence of Transformerscited by 115
  17. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  18. 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
  19. 2023A Theory of Emergent In-Context Learning as Implicit Structure Inductioncited by 86
  20. 2023In-Context Learning through the Bayesian Prismcited by 83
  21. 2024Transformers, parallel computation, and logarithmic depthcited by 79
  22. 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 75
  23. 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 74
  24. 2024RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrievalcited by 64
  25. 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
  26. 2024On Limitations of the Transformer Architecturecited by 63
  27. 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
  28. 2021On the Expressive Power of Self-Attention Matricescited by 47
  29. 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 46
  30. 2024Theoretical limitations of multi-layer Transformercited by 45
  31. 2024Transformers are Universal In-context Learnerscited by 43
  32. 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
  33. 2019Neural tangent kernels, transportation mappings, and universal approximationcited by 30
  34. 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
  35. 2024Linear Transformers are Versatile In-Context Learnerscited by 28
  36. 2017On the ability of neural nets to express distributionscited by 26
  37. 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 25
  38. 2024Provably learning a multi-head attention layercited by 21

50 most cited of 53 All 53 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 4.

6 papers.