Towards Understanding the Relationship between In-context Learning and Compositional Generalization
Not on the map. Why?
Abstract (arXiv)
According to the principle of compositional generalization, the meaning of a complex expression can be understood as a function of the meaning of its parts and of how they are combined. This principle is crucial for human language processing and also, arguably, for NLP models in the face of out-of-distribution data. However, many neural network models, including Transformers, have been shown to struggle with compositional generalization. In this paper, we hypothesize that forcing models to in-context learn can provide an inductive bias to promote compositional generalization. To test this hypothesis, we train a causal Transformer in a setting that renders ordinary learning very difficult: we present it with different orderings of the training instance and shuffle instance labels. This corresponds to training the model on all possible few-shot learning problems attainable from the dataset. The model can solve the task, however, by utilizing earlier examples to generalize to later ones (i.e. in-context learning). In evaluations on the datasets, SCAN, COGS, and GeoQuery, models trained in this manner indeed show improved compositional generalization. This indicates the usefulness of in-context learning problems as an inductive bias for generalization.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 51 of its 65 references that are in the map. First posted on arXiv 18 Mar 2024.
Builds on
51 of 65 references.
References · 51
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2016Layer Normalizationcited by 5,579
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,861
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2019On the Variance of the Adaptive Learning Rate and Beyondcited by 763
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2018Universal Transformerscited by 613
38 more
- 2016RL2: Fast Reinforcement Learning via Slow Reinforcement Learningcited by 490
- 2021MetaICL: Learning to Learn In Contextcited by 450
- 2022Complexity-Based Prompting for Multi-Step Reasoningcited by 387
- 2016Learning to reinforcement learncited by 369
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
- 2019Compositionality decomposed: how do neural networks generalise?cited by 264
- 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 260
- 2021Meta-learning via Language Model In-context Tuningcited by 163
- 2016Language to Logical Form with Neural Attentioncited by 158
- 2019Good-Enough Compositional Data Augmentationcited by 158
- 2020Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both?cited by 147
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2018Meta-Learning for Low-Resource Neural Machine Translationcited by 105
- 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 102
- 2019Compositional generalization through meta sequence-to-sequence learningcited by 98
- 2020Compositional Generalization in Semantic Parsing: Pre-training vs. Specialized Architecturescited by 95
- 2020Learning Compositional Rules via Neural Program Synthesiscited by 74
- 2021Making Transformers Solve Compositional Taskscited by 72
- 2019Meta-learning of Sequential Strategiescited by 68
- 2020Zero-Shot Cross-Lingual Transfer with Meta Learningcited by 66
- 2020Learning to Recombine and Resample Data for Compositional Generalizationcited by 65
- 2021Meta-Learning to Compositionally Generalizecited by 62
- 2019Linguistic generalization and compositionality in modern artificial neural networkscited by 58
- 2019Compositional generalization in a deep seq2seq model by separating syntax and semanticscited by 56
- 2021Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representationscited by 55
- 2020Compositional Generalization by Learning Analytical Expressionscited by 53
- 2023How Do In-Context Examples Affect Compositional Generalization?cited by 51
- 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsingcited by 50
- 2019Compositional Generalization for Primitive Substitutionscited by 48
- 2020The EOS Decision and Length Extrapolationcited by 46
- 2019Domain Adaptive Dialog Generation via Meta Learningcited by 41
- 2021Systematic Generalization with Edge Transformerscited by 38
- 2020Hierarchical Poset Decoding for Compositional Generalization in Languagecited by 26
- 2022On the Compositional Generalization Gap of In-Context Learningcited by 24
- 2022Revisiting the Compositional Generalization Abilities of Neural Sequence Modelscited by 20
- 2020Revisiting Iterative Back-Translation from the Perspective of Compositional Generalizationcited by 19
- 2021Inducing Transformer's Compositional Generalization Ability via Auxiliary Sequence Prediction Taskscited by 19
50 most cited of 51 All 51 (JSON)
Built on by
Citing papers per year: 2024: 2; 2025: 3.
5 papers.
- 2024Position: Understanding LLMs Requires More Than Statistical Generalizationcited by 20
- 2025From Isolation to Entanglement: When Do Interpretability Methods Identify and Disentangle Known Concepts?cited by 5
- 2024Rule Extrapolation in Language Models: A Study of Compositional Generalization on OOD Promptscited by 2
- 2025Out-of-distribution Tests Reveal Compositionality in Chess Transformerscited by 2
- 2025Layer Specialization Underlying Compositional Reasoning in Transformerscited by 0
- 2025From Isolation to Entanglement: When Do Interpretability Methods Identify and Disentangle Known Concepts?17 Dec 2025
- 2025Out-of-distribution Tests Reveal Compositionality in Chess Transformers23 Oct 2025
- 2025Layer Specialization Underlying Compositional Reasoning in Transformers20 Oct 2025
- 2024Rule Extrapolation in Language Models: A Study of Compositional Generalization on OOD Prompts9 Sep 2024
- 2024Position: Understanding LLMs Requires More Than Statistical Generalization3 May 2024