Do pretrained Transformers Learn In-Context by Gradient Descent?
Not on the map. Why?
Abstract (arXiv)
The emergence of In-Context Learning (ICL) in LLMs remains a remarkable phenomenon that is partially understood. To explain ICL, recent studies have created theoretical connections to Gradient Descent (GD). We ask, do such connections hold up in actual pre-trained language models? We highlight the limiting assumptions in prior works that make their setup considerably different from the practical setup in which language models are trained. For example, their experimental verification uses ICL objective (training models explicitly for ICL), which differs from the emergent ICL in the wild. Furthermore, the theoretical hand-constructed weights used in these studies have properties that don't match those of real LLMs. We also look for evidence in real models. We observe that ICL and GD have different sensitivity to the order in which they observe demonstrations. Finally, we probe and compare the ICL vs. GD hypothesis in a natural setting. We conduct comprehensive empirical analyses on language models pre-trained on natural data (LLaMa-7B). Our comparisons of three performance metrics highlight the inconsistent behavior of ICL and GD as a function of various factors such as datasets, models, and the number of demonstrations. We observe that ICL and GD modify the output distribution of language models differently. These results indicate that the equivalence between ICL and GD remains an open hypothesis and calls for further studies.
Key facts. Cited by 18 papers in the map (data through 7 Oct 2026). Builds on 37 of its 46 references that are in the map. First posted on arXiv 12 Oct 2023.
Builds on
37 of 46 references.
References · 37
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,674
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
25 more
- 2022In-context Learning and Induction Headscited by 930
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2023Large Language Models as Optimizerscited by 830
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 471
- 2021True Few-Shot Learning with Language Modelscited by 343
- 2018Generating Wikipedia by Summarizing Long Sequencescited by 333
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2021Reframing Instructional Prompts to GPTk's Languagecited by 176
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 149
- 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
- 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
- 2023The Learnability of In-Context Learningcited by 126
- 2023A Theory of Emergent In-Context Learning as Implicit Structure Inductioncited by 86
- 2022On the Effect of Pretraining Corpora on In-context Learning by a Large-scale Language Modelcited by 78
- 2023Tighter Bounds on the Expressivity of Transformer Encoderscited by 65
- 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
- 2023Understanding In-Context Learning via Supportive Pretraining Datacited by 41
- 2023Flatness-Aware Prompt Selection Improves Accuracy and Sample Efficiencycited by 5
Built on by
Citing papers per year: 2023: 2; 2024: 5; 2025: 7; 2026: 4.
18 papers.
Sort:
By area:
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modelingcited by 25
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Deeper Insights Without Updates: The Power of In-Context Learning Over Fine-Tuningcited by 20
- 2024What Do Language Models Learn in Context? The Structured Task Hypothesiscited by 13
- 2023Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention Weightscited by 11
- 2025Rethinking Invariance in In-context Learningcited by 8
- 2026Steered LLM Activations are Non-Surjectivecited by 7
- 2025Scaling sparse feature circuit finding for in-context learningcited by 5
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 4
- 2025Relational reasoning and inductive bias in transformers and large language modelscited by 1
6 more
- 2025IA2: Alignment with ICL Activations Improves Supervised Fine-Tuningcited by 1
- 2025Genomic Next-Token Predictors are In-Context Learnerscited by 1
- 2024Intermittent Semi-Working Mask: A New Masking Paradigm for LLMscited by 0
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classificationcited by 0
- 2026Mitigating Many-shot Jailbreak Attacks with One Single Demonstrationcited by 0
- 2026Convergent Emergence of In-Context Learning Across Modalitiescited by 0
- 2026Convergent Emergence of In-Context Learning Across Modalities12 Sep 2026
- 2026Mitigating Many-shot Jailbreak Attacks with One Single Demonstration8 May 2026
- 2026Steered LLM Activations are Non-Surjective10 Apr 2026
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classification3 Jan 2026
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025IA2: Alignment with ICL Activations Improves Supervised Fine-Tuning26 Sep 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025Relational reasoning and inductive bias in transformers and large language models4 Jun 2025
- 2025Rethinking Invariance in In-context Learning8 May 2025
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Ciphers28 Apr 2025
- 2025Scaling sparse feature circuit finding for in-context learning18 Apr 2025
- 2024Deeper Insights Without Updates: The Power of In-Context Learning Over Fine-Tuning7 Oct 2024
6 more
- 2024Intermittent Semi-Working Mask: A New Masking Paradigm for LLMs1 Aug 2024
- 2024What Do Language Models Learn in Context? The Structured Task Hypothesis6 Jun 2024
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness18 Feb 2024
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modeling1 Feb 2024
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysis1 Nov 2023
- 2023Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention Weights19 Oct 2023
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modelingcited by 25
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Deeper Insights Without Updates: The Power of In-Context Learning Over Fine-Tuningcited by 20
- 2024What Do Language Models Learn in Context? The Structured Task Hypothesiscited by 13
- 2023Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention Weightscited by 11
- 2026Steered LLM Activations are Non-Surjectivecited by 7
- 2025Scaling sparse feature circuit finding for in-context learningcited by 5
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 4
- 2025IA2: Alignment with ICL Activations Improves Supervised Fine-Tuningcited by 1
- 2025Genomic Next-Token Predictors are In-Context Learnerscited by 1
12 most cited of 13 All 13 (JSON)
- 2026Convergent Emergence of In-Context Learning Across Modalities12 Sep 2026
- 2026Steered LLM Activations are Non-Surjective10 Apr 2026
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025IA2: Alignment with ICL Activations Improves Supervised Fine-Tuning26 Sep 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Ciphers28 Apr 2025
- 2025Scaling sparse feature circuit finding for in-context learning18 Apr 2025
- 2024Deeper Insights Without Updates: The Power of In-Context Learning Over Fine-Tuning7 Oct 2024
- 2024What Do Language Models Learn in Context? The Structured Task Hypothesis6 Jun 2024
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness18 Feb 2024
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modeling1 Feb 2024
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysis1 Nov 2023
12 newest of 13 All 13 (JSON)