How Do In-Context Examples Affect Compositional Generalization?
On the map: LLM reasoning → Reasoning benchmarks and evaluation
Abstract (arXiv)
Compositional generalization--understanding unseen combinations of seen primitives--is an essential reasoning capability in human intelligence. The AI community mainly studies this capability by fine-tuning neural networks on lots of training samples, while it is still unclear whether and how in-context learning--the prevailing few-shot paradigm based on large language models--exhibits compositional generalization. In this paper, we present CoFe, a test suite to investigate in-context compositional generalization. We find that the compositional generalization performance can be easily affected by the selection of in-context examples, thus raising the research question what the key factors are to make good in-context examples for compositional generalization. We study three potential factors: similarity, diversity and complexity. Our systematic experiments indicate that in-context examples should be structurally similar to the test case, diverse from each other, and individually simple. Furthermore, two strong limitations are observed: in-context compositional generalization on fictional words is much weaker than that on commonly used ones; it is still critical that the in-context examples should cover required linguistic structures, even though the backbone model has been pre-trained on large corpus. We hope our analysis would facilitate the understanding and utilization of in-context learning paradigm.
Key facts. Cited by 51 papers in the map (data through 7 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 39 of its 55 references that are in the map. First posted on arXiv 8 May 2023.
Builds on
39 of 55 references.
Closest ancestors · 1
Same direction, newest first
Other references · 38
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,199
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
26 more
- 2022Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Modelcited by 557
- 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
- 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 260
- 2022Active Example Selection for In-Context Learningcited by 195
- 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 162
- 2019Good-Enough Compositional Data Augmentationcited by 158
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
- 2020Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both?cited by 147
- 2022Diverse Demonstrations Improve In-context Compositional Generalizationcited by 136
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2020Compositional Generalization in Semantic Parsing: Pre-training vs. Specialized Architecturescited by 95
- 2022Compositional Semantic Parsing with Large Language Modelscited by 95
- 2020Compositional Generalization via Neural-Symbolic Stack Machinescited by 80
- 2020Span-based Semantic Parsing for Compositional Generalizationcited by 77
- 2020Learning to Recombine and Resample Data for Compositional Generalizationcited by 65
- 2021Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representationscited by 55
- 2020Compositional Generalization by Learning Analytical Expressionscited by 53
- 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsingcited by 50
- 2021Learning Algebraic Recombination for Compositional Generalizationcited by 31
- 2022Unobserved Local Structures Make Compositional Generalization Hardcited by 29
- 2021Finding needles in a haystack: Sampling Structurally-diverse Training Sets from Synthetic Data for Compositional Generalizationcited by 27
- 2022Uncontrolled Lexical Exposure Leads to Overestimation of Compositional Generalization in Pretrained Modelscited by 26
- 2022On the Compositional Generalization Gap of In-Context Learningcited by 24
- 2020Revisiting Iterative Back-Translation from the Perspective of Compositional Generalizationcited by 19
- 2021Learning to Generalize Compositionally by Transferring Across Semantic Parsing Taskscited by 6
- 2023Does Deep Learning Learn to Abstract? A Systematic Probing Frameworkcited by 6
Built on by
Citing papers per year: 2023: 11; 2024: 18; 2025: 18; 2026: 4.
51 papers.
Sort:
By area:
- 2024Agent AI: Surveying the Horizons of Multimodal Interactioncited by 167
- 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examplescited by 84
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2024Do Large Language Models Have Compositional Ability? An Investigation into Limitations and Scalabilitycited by 39
- 2023Can Multimodal Large Language Models Truly Perform Multimodal In-Context Learning?cited by 31
- 2023Instruct Me More! Random Prompting for Visual In-Context Learningcited by 30
- 2023Understanding In-Context Learning from Repetitionscited by 27
- 2024Evaluating Morphological Compositional Generalization in Large Language Modelscited by 16
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Modelscited by 12
- 2024Attention as a Hypernetworkcited by 12
38 more
- 2024MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofscited by 12
- 2024How Does the Textual Information Affect the Retrieval of Multimodal In-Context Learning?cited by 11
- 2024STAND-Guard: A Small Task-Adaptive Content Moderation Modelcited by 11
- 2025Task Generalization With AutoRegressive Compositional Structure: Can Learning From D Tasks Generalize to DT Tasks?cited by 11
- 2023Leveraging Code to Improve In-context Learning for Semantic Parsingcited by 10
- 2024Compositional API Recommendation for Library-Oriented Code Generationcited by 10
- 2024Move-in-2D: 2D-Conditioned Human Motion Generationcited by 8
- 2023MAGNIFICo: Evaluating the In-Context Learning Ability of Large Language Models to Generalize to Novel Interpretationscited by 7
- 2024When can transformers compositionally generalize in-context?cited by 7
- 2024Revisiting In-Context Learning with Long Context Language Modelscited by 7
- 2023Imagine the Unseen World: A Benchmark for Systematic Generalization in Visual World Modelscited by 6
- 2025FitCF: A Framework for Automatic Feature Importance-guided Counterfactual Example Generationcited by 6
- 2025The Role of Diversity in In-Context Learning for Large Language Modelscited by 6
- 2024Towards Understanding the Relationship between In-context Learning and Compositional Generalizationcited by 5
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directionscited by 5
- 2026Dissecting Multimodal In-Context Learning: Modality Asymmetries and Circuit Dynamics in modern Transformerscited by 5
- 2025Unraveling Indirect In-Context Learning Using Influence Functionscited by 3
- 2025Towards Compute-Optimal Many-Shot In-Context Learningcited by 3
- 2025What Drives Compositional Generalization in Visual Generative Models? The Importance of Continuous Training Objectivescited by 3
- 2023Harnessing Dataset Cartography for Improved Compositional Generalization in Transformerscited by 2
- 2023Towards Equipping Transformer with the Ability of Systematic Compositionalitycited by 2
- 2024Evaluating Structural Generalization in Neural Machine Translationcited by 2
- 2025Unveiling Effective In-Context Configurations for Image Captioning: An External & Internal Analysiscited by 2
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agentscited by 2
- 2024DiNeR: a Large Realistic Dataset for Evaluating Compositional Generalizationcited by 1
- 2025Learning to Substitute Components for Compositional Generalizationcited by 1
- 2025Diverse In-Context Example Selection After Decomposing Programs and Aligned Utterances Improves Semantic Parsingcited by 1
- 2025Reinforcing Compositional Retrieval: Retrieving Step-by-Step for Composing Informative Contextscited by 1
- 2025E-InMeMo: Enhanced Prompting for Visual In-Context Learningcited by 1
- 2025CrossICL: Cross-Task In-Context Learning via Unsupervised Demonstration Transfercited by 1
- 2025PANICL: Mitigating Over-Reliance on Single Prompt in Visual In-Context Learningcited by 1
- 2025Two Heads Are Better Than One: Audio-Visual Speech Error Correction with Dual Hypothesescited by 1
- 2026Learning to Select Visual In-Context Demonstrationscited by 1
- 2024Distilling Event Sequence Knowledge From Large Language Modelscited by 0
- 2024Evaluating Linguistic Capabilities of Multimodal LLMs in the Lens of Few-Shot Learningcited by 0
- 2025Investigating the (De)Composition Capabilities of Large Language Models in Natural-to-Formal Language Conversioncited by 0
- 2025Can Language Models Compose Skills In-Context?cited by 0
- 2025Rethinking Label Consistency of In-Context Learning: An Implicit Transductive Label Propagation Perspectivecited by 0
50 most cited of 51 All 51 (JSON)
- 2026MAG: MAnifold Guided Semi-Supervised Multi-modal In-Context Learning13 Aug 2026
- 2026Learning to Select Visual In-Context Demonstrations24 Mar 2026
- 2026Bifrost: Steering Strategic Trajectories to Bridge Contextual Gaps for Self-Improving Agents5 Feb 2026
- 2026Dissecting Multimodal In-Context Learning: Modality Asymmetries and Circuit Dynamics in modern Transformers28 Jan 2026
- 2025Rethinking Label Consistency of In-Context Learning: An Implicit Transductive Label Propagation Perspective13 Dec 2025
- 2025Can Language Models Compose Skills In-Context?27 Oct 2025
- 2025Two Heads Are Better Than One: Audio-Visual Speech Error Correction with Dual Hypotheses15 Oct 2025
- 2025What Drives Compositional Generalization in Visual Generative Models? The Importance of Continuous Training Objectives3 Oct 2025
- 2025PANICL: Mitigating Over-Reliance on Single Prompt in Visual In-Context Learning26 Sep 2025
- 2025Towards Compute-Optimal Many-Shot In-Context Learning22 Jul 2025
- 2025Unveiling Effective In-Context Configurations for Image Captioning: An External & Internal Analysis8 Jul 2025
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directions8 Jun 2025
38 more
- 2025CrossICL: Cross-Task In-Context Learning via Unsupervised Demonstration Transfer30 May 2025
- 2025The Role of Diversity in In-Context Learning for Large Language Models26 May 2025
- 2025E-InMeMo: Enhanced Prompting for Visual In-Context Learning25 Apr 2025
- 2025Reinforcing Compositional Retrieval: Retrieving Step-by-Step for Composing Informative Contexts15 Apr 2025
- 2025Diverse In-Context Example Selection After Decomposing Programs and Aligned Utterances Improves Semantic Parsing4 Apr 2025
- 2025Learning to Substitute Components for Compositional Generalization28 Feb 2025
- 2025Task Generalization With AutoRegressive Compositional Structure: Can Learning From D Tasks Generalize to DT Tasks?13 Feb 2025
- 2025Investigating the (De)Composition Capabilities of Large Language Models in Natural-to-Formal Language Conversion24 Jan 2025
- 2025Unraveling Indirect In-Context Learning Using Influence Functions1 Jan 2025
- 2025FitCF: A Framework for Automatic Feature Importance-guided Counterfactual Example Generation1 Jan 2025
- 2024Revisiting In-Context Learning with Long Context Language Models22 Dec 2024
- 2024Move-in-2D: 2D-Conditioned Human Motion Generation17 Dec 2024
- 2024STAND-Guard: A Small Task-Adaptive Content Moderation Model7 Nov 2024
- 2024MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofs17 Oct 2024
- 2024Evaluating Morphological Compositional Generalization in Large Language Models16 Oct 2024
- 2024Do Large Language Models Have Compositional Ability? An Investigation into Limitations and Scalability22 Jul 2024
- 2024Evaluating Linguistic Capabilities of Multimodal LLMs in the Lens of Few-Shot Learning17 Jul 2024
- 2024When can transformers compositionally generalize in-context?17 Jul 2024
- 2024Evaluating Structural Generalization in Neural Machine Translation19 Jun 2024
- 2024Attention as a Hypernetwork9 Jun 2024
- 2024DiNeR: a Large Realistic Dataset for Evaluating Compositional Generalization7 Jun 2024
- 2024Why Larger Language Models Do In-context Learning Differently?30 May 2024
- 2024How Does the Textual Information Affect the Retrieval of Multimodal In-Context Learning?19 Apr 2024
- 2024Towards Understanding the Relationship between In-context Learning and Compositional Generalization18 Mar 2024
- 2024Compositional API Recommendation for Library-Oriented Code Generation29 Feb 2024
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models23 Feb 2024
- 2024Distilling Event Sequence Knowledge From Large Language Models14 Jan 2024
- 2024Agent AI: Surveying the Horizons of Multimodal Interaction7 Jan 2024
- 2023Towards Equipping Transformer with the Ability of Systematic Compositionality12 Dec 2023
- 2023Can Multimodal Large Language Models Truly Perform Multimodal In-Context Learning?29 Nov 2023
- 2023Leveraging Code to Improve In-context Learning for Semantic Parsing16 Nov 2023
- 2023Imagine the Unseen World: A Benchmark for Systematic Generalization in Visual World Models15 Nov 2023
- 2023Instruct Me More! Random Prompting for Visual In-Context Learning7 Nov 2023
- 2023Harnessing Dataset Cartography for Improved Compositional Generalization in Transformers18 Oct 2023
- 2023MAGNIFICo: Evaluating the In-Context Learning Ability of Large Language Models to Generalize to Novel Interpretations18 Oct 2023
- 2023In-Context Learning with Iterative Demonstration Selection15 Oct 2023
- 2023Understanding In-Context Learning from Repetitions30 Sep 2023
- 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examples24 May 2023
50 newest of 51 All 51 (JSON)
- 2023Can Multimodal Large Language Models Truly Perform Multimodal In-Context Learning?cited by 31
- 2024How Does the Textual Information Affect the Retrieval of Multimodal In-Context Learning?cited by 11
- 2026Dissecting Multimodal In-Context Learning: Modality Asymmetries and Circuit Dynamics in modern Transformerscited by 5
- 2026Learning to Select Visual In-Context Demonstrationscited by 1
- 2024Evaluating Linguistic Capabilities of Multimodal LLMs in the Lens of Few-Shot Learningcited by 0
- 2026MAG: MAnifold Guided Semi-Supervised Multi-modal In-Context Learningcited by 0
- 2026MAG: MAnifold Guided Semi-Supervised Multi-modal In-Context Learning13 Aug 2026
- 2026Learning to Select Visual In-Context Demonstrations24 Mar 2026
- 2026Dissecting Multimodal In-Context Learning: Modality Asymmetries and Circuit Dynamics in modern Transformers28 Jan 2026
- 2024Evaluating Linguistic Capabilities of Multimodal LLMs in the Lens of Few-Shot Learning17 Jul 2024
- 2024How Does the Textual Information Affect the Retrieval of Multimodal In-Context Learning?19 Apr 2024
- 2023Can Multimodal Large Language Models Truly Perform Multimodal In-Context Learning?29 Nov 2023
- 2024Agent AI: Surveying the Horizons of Multimodal Interactioncited by 167
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2024Do Large Language Models Have Compositional Ability? An Investigation into Limitations and Scalabilitycited by 39
- 2023Instruct Me More! Random Prompting for Visual In-Context Learningcited by 30
- 2023Understanding In-Context Learning from Repetitionscited by 27
- 2024Evaluating Morphological Compositional Generalization in Large Language Modelscited by 16
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Modelscited by 12
- 2024Attention as a Hypernetworkcited by 12
- 2024MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofscited by 12
- 2024STAND-Guard: A Small Task-Adaptive Content Moderation Modelcited by 11
- 2025Task Generalization With AutoRegressive Compositional Structure: Can Learning From D Tasks Generalize to DT Tasks?cited by 11
12 most cited of 40 All 40 (JSON)
- 2025Can Language Models Compose Skills In-Context?27 Oct 2025
- 2025Two Heads Are Better Than One: Audio-Visual Speech Error Correction with Dual Hypotheses15 Oct 2025
- 2025What Drives Compositional Generalization in Visual Generative Models? The Importance of Continuous Training Objectives3 Oct 2025
- 2025PANICL: Mitigating Over-Reliance on Single Prompt in Visual In-Context Learning26 Sep 2025
- 2025Towards Compute-Optimal Many-Shot In-Context Learning22 Jul 2025
- 2025Unveiling Effective In-Context Configurations for Image Captioning: An External & Internal Analysis8 Jul 2025
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directions8 Jun 2025
- 2025CrossICL: Cross-Task In-Context Learning via Unsupervised Demonstration Transfer30 May 2025
- 2025The Role of Diversity in In-Context Learning for Large Language Models26 May 2025
- 2025E-InMeMo: Enhanced Prompting for Visual In-Context Learning25 Apr 2025
- 2025Reinforcing Compositional Retrieval: Retrieving Step-by-Step for Composing Informative Contexts15 Apr 2025
- 2025Diverse In-Context Example Selection After Decomposing Programs and Aligned Utterances Improves Semantic Parsing4 Apr 2025
12 newest of 40 All 40 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2023Skills-in-Context Prompting: Unlocking Compositionality in Large Language Models
- 2023Can LLM find the green circle? Investigation and Human-guided tool manipulation for compositional generalization
- 2025Impact of Pretraining Word Co-occurrence on Compositional Generalization in Multimodal Models
- 2023Im-Promptu: In-Context Composition from Image Prompts
- 2023In-context Learning Generalizes, But Not Always Robustly: The Case of Syntax
- 2025Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoning
- 2025On the generalization of language models from in-context learning and finetuning: a controlled study
- 2023Teaching Smaller Language Models To Generalise To Unseen Compositional Questions