What Do Language Models Learn in Context? The Structured Task Hypothesis
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) exhibit an intriguing ability to learn a novel task from in-context examples presented in a demonstration, termed in-context learning (ICL). Understandably, a swath of research has been dedicated to uncovering the theories underpinning ICL. One popular hypothesis explains ICL by task selection. LLMs identify the task based on the demonstration and generalize it to the prompt. Another popular hypothesis is that ICL is a form of meta-learning, i.e., the models learn a learning algorithm at pre-training time and apply it to the demonstration. Finally, a third hypothesis argues that LLMs use the demonstration to select a composition of tasks learned during pre-training to perform ICL. In this paper, we empirically explore these three hypotheses that explain LLMs' ability to learn in context with a suite of experiments derived from common text classification tasks. We invalidate the first two hypotheses with counterexamples and provide evidence in support of the last hypothesis. Our results suggest an LLM could learn a novel task in context via composing tasks learned during pre-training.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 20 of its 33 references that are in the map. First posted on arXiv 6 Jun 2024.
Builds on
20 of 33 references.
References · 20
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2022In-context Learning and Induction Headscited by 964
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2023Larger language models do in-context learning differentlycited by 394
8 more
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 152
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
- 2023The Learnability of In-Context Learningcited by 127
- 2024In-Context Language Learning: Architectures and Algorithmscited by 89
- 2023A Theory of Emergent In-Context Learning as Implicit Structure Inductioncited by 86
- 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 76
- 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learningcited by 51
- 2023Do pretrained Transformers Learn In-Context by Gradient Descent?cited by 18
Built on by
Citing papers per year: 2024: 4; 2025: 6; 2026: 3.
13 papers.
Sort:
By area:
- 2024LLMs Are In-Context Bandit Reinforcement Learnerscited by 29
- 2026Training Language Models via Neural Cellular Automatacited by 15
- 2025Episodic memory in AI agents poses risks that should be studied and mitigatedcited by 11
- 2024StreamAdapter: Efficient Test Time Adaptation from Contextual Streamscited by 6
- 2025Investigating the Zone of Proximal Development of Language Models for In-Context Learningcited by 6
- 2024Can LLMs Learn by Teaching for Better Reasoning? A Preliminary Studycited by 5
- 2024Learning vs Retrieval: The Role of In-Context Examples in Regression with Large Language Modelscited by 5
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learningcited by 2
- 2025InPhyRe Discovers: Large Multimodal Models Struggle in Inductive Physical Reasoningcited by 2
- 2025Binary Autoencoder for Mechanistic Interpretability of Large Language Modelscited by 1
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatchcited by 1
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environmentscited by 0
1 more
- 2026Distributed Sparse Interventions in Language Modelscited by 0
- 2026Distributed Sparse Interventions in Language Models8 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Training Language Models via Neural Cellular Automata9 Mar 2026
- 2025Binary Autoencoder for Mechanistic Interpretability of Large Language Models25 Sep 2025
- 2025InPhyRe Discovers: Large Multimodal Models Struggle in Inductive Physical Reasoning12 Sep 2025
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environments2 Jul 2025
- 2025Investigating the Zone of Proximal Development of Language Models for In-Context Learning10 Feb 2025
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learning27 Jan 2025
- 2025Episodic memory in AI agents poses risks that should be studied and mitigated20 Jan 2025
- 2024StreamAdapter: Efficient Test Time Adaptation from Contextual Streams14 Nov 2024
- 2024LLMs Are In-Context Bandit Reinforcement Learners7 Oct 2024
- 2024Learning vs Retrieval: The Role of In-Context Examples in Regression with Large Language Models6 Sep 2024
1 more
- 2024LLMs Are In-Context Bandit Reinforcement Learnerscited by 29
- 2026Training Language Models via Neural Cellular Automatacited by 15
- 2025Episodic memory in AI agents poses risks that should be studied and mitigatedcited by 11
- 2024StreamAdapter: Efficient Test Time Adaptation from Contextual Streamscited by 6
- 2025Investigating the Zone of Proximal Development of Language Models for In-Context Learningcited by 6
- 2024Learning vs Retrieval: The Role of In-Context Examples in Regression with Large Language Modelscited by 5
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learningcited by 2
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatchcited by 1
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environmentscited by 0
- 2026Distributed Sparse Interventions in Language Modelscited by 0
- 2026Distributed Sparse Interventions in Language Models8 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Training Language Models via Neural Cellular Automata9 Mar 2026
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environments2 Jul 2025
- 2025Investigating the Zone of Proximal Development of Language Models for In-Context Learning10 Feb 2025
- 2025StaICC: Standardized Evaluation for Classification Task in In-context Learning27 Jan 2025
- 2025Episodic memory in AI agents poses risks that should be studied and mitigated20 Jan 2025
- 2024StreamAdapter: Efficient Test Time Adaptation from Contextual Streams14 Nov 2024
- 2024LLMs Are In-Context Bandit Reinforcement Learners7 Oct 2024
- 2024Learning vs Retrieval: The Role of In-Context Examples in Regression with Large Language Models6 Sep 2024