Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context
Xiang Cheng, Yuxin Chen, Suvrit Sra
Abstract
Many neural network architectures are known to be Turing Complete, and can thus, in principle implement arbitrary algorithms. However, Transformers are unique in that they can implement gradient-based learning algorithms under simple parameter configurations. This paper provides theoretical and empirical evidence that (non-linear) Transformers naturally learn to implement gradient descent in function space, which in turn enable them to learn non-linear functions in context. Our results apply to a broad class of combinations of non-linear architectures and non-linear in-context learning tasks. Additionally, we show that the optimal choice of non-linear activation depends in a natural way on the class of functions that need to be learned.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
36 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- A Theoretical Understanding of Self-Correction through In-context Alignment cites Transformers Learn In-Context by Gradient Descent
- A Theoretical Understanding of Self-Correction through In-context Alignment cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Linear Transformers are Versatile In-Context Learners cites Language Models are Few-Shot Learners
- Linear Transformers are Versatile In-Context Learners cites Transformers Learn In-Context by Gradient Descent
- Linear Transformers are Versatile In-Context Learners cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Linear Transformers are Versatile In-Context Learners cites Linear Transformers Are Secretly Fast Weight Programmers
- How Do Nonlinear Transformers Learn and Generalize in In-Context Learning? cites Language Models are Few-Shot Learners
- How Do Nonlinear Transformers Learn and Generalize in In-Context Learning? cites Transformers Learn In-Context by Gradient Descent
- How Do Nonlinear Transformers Learn and Generalize in In-Context Learning? cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Can large language models explore in-context? cites Language Models are Few-Shot Learners
- Can large language models explore in-context? cites Transformers Learn In-Context by Gradient Descent
- Can large language models explore in-context? cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Why Larger Language Models Do In-context Learning Differently? cites Language Models are Few-Shot Learners
- Why Larger Language Models Do In-context Learning Differently? cites Transformers Learn In-Context by Gradient Descent
- Why Larger Language Models Do In-context Learning Differently? cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Why Larger Language Models Do In-context Learning Differently? cites Linear Transformers Are Secretly Fast Weight Programmers
- Transformers Learn In-Context by Gradient Descent cites Language Models are Few-Shot Learners
- Transformers Learn In-Context by Gradient Descent cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Transformers Learn In-Context by Gradient Descent cites Linear Transformers Are Secretly Fast Weight Programmers
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Language Models are Few-Shot Learners
Cited by top-tier papers36
- Can large language models explore in-context?Akshay Krishnamurthy, Keegan Harris, Dylan J. Foster, Cyril Zhang et al.NeurIPS 2024 · 95 citations
- A Theoretical Understanding of Self-Correction through In-context AlignmentYifei Wang, Yuyang Wu, Zeming Wei, Stefanie Jegelka et al.NeurIPS 2024 · 69 citations
- Why Larger Language Models Do In-context Learning Differently?Zhenmei Shi, Junyi Wei, Zhuoyan Xu, Yingyu LiangICML 2024 · 54 citations
- Linear Transformers are Versatile In-Context LearnersMax Vladymyrov, Johannes von Oswald, Mark Sandler, Rong GeNeurIPS 2024 · 37 citations
- How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?Hongkang Li, Meng Wang, Songtao Lu, Xiaodong Cui et al.ICML 2024 · 37 citations
Builds on18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
- Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations
- XCiT: Cross-Covariance Image TransformersAlaaeldin Ali, Hugo Touvron, Mathilde Caron, Piotr Bojanowski et al.NeurIPS 2021 · 692 citations
- Linear Transformers Are Secretly Fast Weight ProgrammersImanol Schlag, Kazuki Irie, Jürgen SchmidhuberICML 2021 · 394 citations
Related papers
- In-context Learning on Function Classes Unveiled for TransformersZhijie Wang, Bo Jiang, Shuai LiICML 2024 · 8 citations
- Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete FunctionsSatwik Bhattamishra, Arkil Patel, Phil Blunsom, Varun KanadeICLR 2024 · 77 citations
- One-Layer Transformer Provably Learns One-Nearest Neighbor In ContextZihao Li, Yuan Cao, Cheng Gao, Yihan He et al.NeurIPS 2024 · 25 citations
- Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear RegressionDeqing Fu, Tianqi Chen, Robin Jia, Vatsal SharanNeurIPS 2024 · 54 citations
- What learning algorithm is in-context learning? Investigations with linear modelsEkin Akyürek, Dale Schuurmans, Jacob Andreas, Tengyu Ma et al.ICLR 2023 · 85 citations
