Diverse Demonstrations Improve In-context Compositional Generalization
Not on the map. Why?
Abstract (arXiv)
In-context learning has shown great success in i.i.d semantic parsing splits, where the training and test sets are drawn from the same distribution. In this setup, models are typically prompted with demonstrations that are similar to the input utterance. However, in the setup of compositional generalization, where models are tested on outputs with structures that are absent from the training set, selecting similar demonstrations is insufficient, as often no example will be similar enough to the input. In this work, we propose a method to select diverse demonstrations that aims to collectively cover all of the structures required in the output program, in order to encourage the model to generalize to new structures from these demonstrations. We empirically show that combining diverse demonstrations with in-context learning substantially improves performance across three compositional generalization semantic parsing datasets in the pure in-context learning setup and when combined with finetuning.
Key facts. Cited by 139 papers in the map (data through 14 Oct 2026). Builds on 40 of its 62 references that are in the map. First posted on arXiv 13 Dec 2022.
Builds on
40 of 62 references.
References · 40
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
- 2021MetaICL: Learning to Learn In Contextcited by 454
- 2022Complexity-Based Prompting for Multi-Step Reasoningcited by 388
- 2018AllenNLP: A Deep Semantic Natural Language Processing Platformcited by 347
- 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 284
28 more
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2021Meta-learning via Language Model In-context Tuningcited by 164
- 2020Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both?cited by 147
- 2018Improving Text-to-SQL Evaluation Methodologycited by 135
- 2020Task-Oriented Dialogue as Dataflow Synthesiscited by 122
- 2019Compositional generalization through meta sequence-to-sequence learningcited by 99
- 2022State-of-the-art generalisation research in NLP: A taxonomy and reviewcited by 98
- 2020Compositional Generalization in Semantic Parsing: Pre-training vs. Specialized Architecturescited by 95
- 2022Compositional Semantic Parsing with Large Language Modelscited by 95
- 2022Complementary Explanations for Effective In-Context Learningcited by 71
- 2021Meta-Learning to Compositionally Generalizecited by 62
- 2022Training Data is More Valuable than You Think: A Simple and Effective Method by Retrieving from Training Datacited by 61
- 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsingcited by 50
- 2021Improving Compositional Generalization with Latent Structure and Data Augmentationcited by 46
- 2021Joint Passage Ranking for Diverse Multi-Answer Retrievalcited by 43
- 2021Controllable Semantic Parsing via Retrieval Augmentationcited by 35
- 2022Unobserved Local Structures Make Compositional Generalization Hardcited by 29
- 2022A Well-Composed Text is Half Done! Composition Sampling for Diverse Conditional Generationcited by 28
- 2021Finding needles in a haystack: Sampling Structurally-diverse Training Sets from Synthetic Data for Compositional Generalizationcited by 27
- 2019Don't paraphrase, detect! Rapid and Effective Data Collection for Semantic Parsingcited by 24
- 2022On the Compositional Generalization Gap of In-Context Learningcited by 24
- 2021Determinantal Beam Searchcited by 18
- 2021RETRONLU: Retrieval Augmented Task-Oriented Semantic Parsingcited by 15
- 2022Generate-and-Retrieve: use your predictions to improve retrieval for semantic parsingcited by 15
- 2022Submodlib: A Submodular Optimization Librarycited by 8
- 2022Structurally Diverse Sampling for Sample-Efficient Training and Comprehensive Evaluationcited by 8
- 2022Simplifying Semantic Annotations of SMCalFlowcited by 7
- 2022Diverse Multi-Answer Retrieval with Determinantal Point Processescited by 2
Built on by
Citing papers per year: 2022: 1; 2023: 38; 2024: 44; 2025: 36; 2026: 20.
139 papers.
Sort:
By area:
- 2023A Survey of Large Language Modelscited by 2,576
- 2022A Survey on In-context Learningcited by 721
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2023What can Large Language Models do in chemistry? A comprehensive benchmark on eight taskscited by 185
- 2023Compositional Exemplars for In-context Learningcited by 144
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 128
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2023When Large Language Models Meet Personalization: Perspectives of Challenges and Opportunitiescited by 90
- 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examplescited by 84
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2024In-context Learning with Retrieved Demonstrations for Language Models: A Surveycited by 70
- 2023Coverage-based Example Selection for In-Context Learningcited by 59
38 more
- 2023How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settingscited by 58
- 2023Grammar Prompting for Domain-Specific Language Generation with Large Language Modelscited by 58
- 2023OpenICL: An Open-Source Framework for In-context Learningcited by 51
- 2023How Do In-Context Examples Affect Compositional Generalization?cited by 51
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2023Large Language Model-Aware In-Context Learning for Code Generationcited by 43
- 2023Small Models are Valuable Plug-ins for Large Language Modelscited by 42
- 2023Self-ICL: Zero-Shot In-Context Learning with Self-Generated Demonstrationscited by 42
- 2024Lifelong Knowledge Editing for LLMs with Retrieval-Augmented Continuous Prompt Learningcited by 40
- 2024Do Large Language Models Have Compositional Ability? An Investigation into Limitations and Scalabilitycited by 40
- 2023MoT: Memory-of-Thought Enables ChatGPT to Self-Improvecited by 38
- 2024Efficient Prompt Optimization Through the Lens of Best Arm Identificationcited by 37
- 2024Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplarscited by 37
- 2023How to Configure Good In-Context Sequence for Visual Question Answeringcited by 33
- 2024LLMs Are In-Context Bandit Reinforcement Learnerscited by 29
- 2024In-Context Learning Enables Robot Action Prediction in LLMscited by 27
- 2024Retrieval Augmented Fact Verification by Synthesizing Contrastive Argumentscited by 25
- 2023RetICL: Sequential Retrieval of In-Context Examples with Reinforcement Learningcited by 24
- 2023Improving Generalization in Language Model-Based Text-to-SQL Semantic Parsing: Two Simple Semantic Boundary-Based Techniquescited by 24
- 2023Selective Demonstrations for Cross-domain Text-to-SQLcited by 21
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generationcited by 21
- 2023LMCap: Few-shot Multilingual Image Captioning by Retrieval Augmented Language Model Promptingcited by 17
- 2024DemoRank: Selecting Effective Demonstrations for Large Language Models in Ranking Taskcited by 17
- 2024Enhancing In-context Learning via Linear Probe Calibrationcited by 16
- 2024On the Noise Robustness of In-Context Learning for Text Generationcited by 16
- 2023Cost-Effective In-Context Learning for Entity Resolution: A Design Space Explorationcited by 15
- 2023Overview of the PromptCBLUE Shared Task in CHIP2023cited by 14
- 2024Learning to Retrieve Iteratively for In-Context Learningcited by 13
- 2023Bring Your Own KG: Self-Supervised Program Synthesis for Zero-Shot KGQAcited by 11
- 2024Demonstration Augmentation for Zero-shot In-context Learningcited by 11
- 2025Is Relevance Propagated from Retriever to Generator in RAG?cited by 11
- 2023Diverse Retrieval-Augmented In-Context Learning for Dialogue State Trackingcited by 10
- 2023Leveraging Code to Improve In-context Learning for Semantic Parsingcited by 10
- 2024Improving Demonstration Diversity by Human-Free Fusing for Text-to-SQLcited by 10
- 2024Unleashing the Power of Large Language Models in Zero-shot Relation Extraction via Self-Promptingcited by 10
- 2025Optimizing Decomposition for Optimal Claim Verificationcited by 10
- 2023Distilling Rule-based Knowledge into Large Language Modelscited by 9
- 2024NICE: To Optimize In-Context Examples or Not?cited by 9
50 most cited of 139 All 139 (JSON)
- 2026ActICL: Post-Training for Agentic Multimodal In-Context Learning14 Oct 2026
- 2026Cross-Protocol Personality Assessment with LLMs: Aligning Behavioral Evidence with Human Ratings12 Oct 2026
- 2026Verb-ICL: Rethinking In-Context Learning for Structured Prediction3 Oct 2026
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learning27 Sep 2026
- 2026ClusterFewshot: Improving Few-shot Optimization for LLMs workflow22 Sep 2026
- 2026Unifying Conformal Language Tasks with In-Context Ensembles2 Sep 2026
- 2026MAG: MAnifold Guided Semi-Supervised Multi-modal In-Context Learning13 Aug 2026
- 2026EdgeLM: Edge Demonstrations for Language Models' Table Understanding5 Aug 2026
- 2026PromptPath: Prompt-Adaptive Computational Pathways for In-Context Learning3 Aug 2026
- 2026Self-Improving In-Context Learning22 May 2026
- 2026From Residuals to Reasons: LLM-Guided Mechanism Inference from Tabular Data21 May 2026
- 2026Skill Neologisms: Towards Skill-based Continual Learning6 May 2026
38 more
- 2026Reinforcement Learning for Compositional Generalization with Outcome-Level Optimization6 May 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026UCS: Estimating Unseen Coverage for Improved In-Context Learning13 Apr 2026
- 2026Legal2LogicICL: Improving Generalization in Transforming Legal Cases to Logical Formulas via Diverse Few-Shot Learning13 Apr 2026
- 2026No Single Best Model for Diversity: Learning a Router for Sample Diversity2 Apr 2026
- 2026Contrast Matters: Understanding Robustness of In-Context Fine-Tuning to Target-Context Relatedness2 Apr 2026
- 2026Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning12 Feb 2026
- 2026AsynDBT: Asynchronous Distributed Bilevel Tuning for efficient In-Context Learning with Large Language Models6 Feb 2026
- 2025Bridging Streaming Continual Learning via In-Context Large Tabular Models12 Dec 2025
- 2025Can Language Models Compose Skills In-Context?27 Oct 2025
- 2025Fine-Grained Emotion Recognition via In-Context Learning8 Oct 2025
- 2025ALLabel: Three-stage Active Learning for LLM-based Entity Recognition using Demonstration Retrieval9 Sep 2025
- 2025A Taxonomy of Transcendence25 Aug 2025
- 2025Enhancing Cross-task Transfer of Large Language Models via Activation Steering17 Jul 2025
- 2025Unveiling Effective In-Context Configurations for Image Captioning: An External & Internal Analysis8 Jul 2025
- 2025Learning-to-Context Slope: Evaluating In-Context Learning Effectiveness Beyond Performance Illusions29 Jun 2025
- 2025Relic: Enhancing Reward Model Generalization for Low-Resource Indic Languages with Few-Shot Examples19 Jun 2025
- 2025Leveraging In-Context Learning for Language Model Agents16 Jun 2025
- 2025Provoking Multi-modal Few-Shot LVLM via Exploration-Exploitation In-Context Learning11 Jun 2025
- 2025What Makes a Good Natural Language Prompt?7 Jun 2025
- 2025MarginSel : Max-Margin Demonstration Selection for LLMs7 Jun 2025
- 2025Large Language Models are Demonstration Pre-Selectors for Themselves6 Jun 2025
- 2025Exploring Explanations Improves the Robustness of In-Context Learning3 Jun 2025
- 2025Improving Dialogue State Tracking through Combinatorial Search for In-Context Examples31 May 2025
- 2025Learning Composable Chains-of-Thought28 May 2025
- 2025We Need to Measure Data Diversity in NLP -- Better and Broader26 May 2025
- 2025What Really Matters in Many-Shot Attacks? An Empirical Study of Long-Context Vulnerabilities in LLMs26 May 2025
- 2025The Role of Diversity in In-Context Learning for Large Language Models26 May 2025
- 2025An Empirical Study on Configuring In-Context Learning Demonstrations for Unleashing MLLMs' Sentimental Perception Capability22 May 2025
- 2025Enhancing Multimodal In-Context Learning for Image Classification through Coreset Optimization19 Apr 2025
- 2025Reinforcing Compositional Retrieval: Retrieving Step-by-Step for Composing Informative Contexts15 Apr 2025
- 2025Enhancing Contrastive Demonstration Selection with Semantic Diversity for Robust In-Context Machine Translation12 Apr 2025
- 2025Diverse In-Context Example Selection After Decomposing Programs and Aligned Utterances Improves Semantic Parsing4 Apr 2025
- 2025Post-Incorporating Code Structural Knowledge into Pretrained Models via ICL for Code Translation28 Mar 2025
- 2025Optimizing Decomposition for Optimal Claim Verification19 Mar 2025
- 2025Learning to Search Effective Example Sequences for In-Context Learning11 Mar 2025
- 2025textttSEM-CTRL: Semantically Controlled Decoding3 Mar 2025
- 2025Learning to Substitute Components for Compositional Generalization28 Feb 2025
50 newest of 139 All 139 (JSON)
- 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examplescited by 84
- 2023How Do In-Context Examples Affect Compositional Generalization?cited by 51
- 2023MoT: Memory-of-Thought Enables ChatGPT to Self-Improvecited by 38
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generationcited by 21
- 2024Reasoning on Efficient Knowledge Paths:Knowledge Graph Guides Large Language Model for Domain Question Answeringcited by 9
- 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learningcited by 8
- 2025Learning Composable Chains-of-Thoughtcited by 3
- 2025Adaptive Prompting: Ad-hoc Prompt Composition for Social Bias Detectioncited by 2
- 2026From Residuals to Reasons: LLM-Guided Mechanism Inference from Tabular Datacited by 1
- 2026Verb-ICL: Rethinking In-Context Learning for Structured Predictioncited by 0
- 2026Verb-ICL: Rethinking In-Context Learning for Structured Prediction3 Oct 2026
- 2026From Residuals to Reasons: LLM-Guided Mechanism Inference from Tabular Data21 May 2026
- 2025Learning Composable Chains-of-Thought28 May 2025
- 2025Adaptive Prompting: Ad-hoc Prompt Composition for Social Bias Detection10 Feb 2025
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generation1 Feb 2025
- 2024Reasoning on Efficient Knowledge Paths:Knowledge Graph Guides Large Language Model for Domain Question Answering16 Apr 2024
- 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning11 Apr 2024
- 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examples24 May 2023
- 2023MoT: Memory-of-Thought Enables ChatGPT to Self-Improve9 May 2023
- 2023How Do In-Context Examples Affect Compositional Generalization?8 May 2023
- 2023How to Configure Good In-Context Sequence for Visual Question Answeringcited by 33
- 2023Lever LM: Configuring In-Context Sequence to Lever Large Vision Language Modelscited by 7
- 2025Enhancing Multimodal In-Context Learning for Image Classification through Coreset Optimizationcited by 7
- 2024SADL: An Effective In-Context Learning Method for Compositional Visual QAcited by 5
- 2025An Empirical Study on Configuring In-Context Learning Demonstrations for Unleashing MLLMs' Sentimental Perception Capabilitycited by 4
- 2026MAG: MAnifold Guided Semi-Supervised Multi-modal In-Context Learningcited by 0
- 2026ActICL: Post-Training for Agentic Multimodal In-Context Learningcited by 0
- 2026ActICL: Post-Training for Agentic Multimodal In-Context Learning14 Oct 2026
- 2026MAG: MAnifold Guided Semi-Supervised Multi-modal In-Context Learning13 Aug 2026
- 2025An Empirical Study on Configuring In-Context Learning Demonstrations for Unleashing MLLMs' Sentimental Perception Capability22 May 2025
- 2025Enhancing Multimodal In-Context Learning for Image Classification through Coreset Optimization19 Apr 2025
- 2024SADL: An Effective In-Context Learning Method for Compositional Visual QA2 Jul 2024
- 2023Lever LM: Configuring In-Context Sequence to Lever Large Vision Language Models15 Dec 2023
- 2023How to Configure Good In-Context Sequence for Visual Question Answering4 Dec 2023
- 2024Lifelong Knowledge Editing for LLMs with Retrieval-Augmented Continuous Prompt Learningcited by 40
- 2024Retrieval Augmented Fact Verification by Synthesizing Contrastive Argumentscited by 25
- 2023LMCap: Few-shot Multilingual Image Captioning by Retrieval Augmented Language Model Promptingcited by 17
- 2025Is Relevance Propagated from Retriever to Generator in RAG?cited by 11
- 2023Diverse Retrieval-Augmented In-Context Learning for Dialogue State Trackingcited by 10
- 2024RAGSys: Item-Cold-Start Recommender as RAG Systemcited by 4
- 2025Is Relevance Propagated from Retriever to Generator in RAG?20 Feb 2025
- 2024Retrieval Augmented Fact Verification by Synthesizing Contrastive Arguments14 Jun 2024
- 2024RAGSys: Item-Cold-Start Recommender as RAG System27 May 2024
- 2024Lifelong Knowledge Editing for LLMs with Retrieval-Augmented Continuous Prompt Learning6 May 2024
- 2023Diverse Retrieval-Augmented In-Context Learning for Dialogue State Tracking4 Jul 2023
- 2023LMCap: Few-shot Multilingual Image Captioning by Retrieval Augmented Language Model Prompting31 May 2023
- 2023A Survey of Large Language Modelscited by 2,576
- 2022A Survey on In-context Learningcited by 721
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2023What can Large Language Models do in chemistry? A comprehensive benchmark on eight taskscited by 185
- 2023Compositional Exemplars for In-context Learningcited by 144
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 128
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2023When Large Language Models Meet Personalization: Perspectives of Challenges and Opportunitiescited by 90
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2024In-context Learning with Retrieved Demonstrations for Language Models: A Surveycited by 70
- 2023Coverage-based Example Selection for In-Context Learningcited by 59
- 2023How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settingscited by 58
12 most cited of 104 All 104 (JSON)
- 2026Cross-Protocol Personality Assessment with LLMs: Aligning Behavioral Evidence with Human Ratings12 Oct 2026
- 2026ClusterFewshot: Improving Few-shot Optimization for LLMs workflow22 Sep 2026
- 2026Unifying Conformal Language Tasks with In-Context Ensembles2 Sep 2026
- 2026EdgeLM: Edge Demonstrations for Language Models' Table Understanding5 Aug 2026
- 2026PromptPath: Prompt-Adaptive Computational Pathways for In-Context Learning3 Aug 2026
- 2026Self-Improving In-Context Learning22 May 2026
- 2026Skill Neologisms: Towards Skill-based Continual Learning6 May 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026UCS: Estimating Unseen Coverage for Improved In-Context Learning13 Apr 2026
- 2026Legal2LogicICL: Improving Generalization in Transforming Legal Cases to Logical Formulas via Diverse Few-Shot Learning13 Apr 2026
- 2026No Single Best Model for Diversity: Learning a Router for Sample Diversity2 Apr 2026
- 2026Contrast Matters: Understanding Robustness of In-Context Fine-Tuning to Target-Context Relatedness2 Apr 2026
12 newest of 104 All 104 (JSON)