Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learning
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have demonstrated impressive in-context learning (ICL) capabilities from few-shot demonstration exemplars. While recent learning-based demonstration selection methods have proven beneficial to ICL by choosing more useful exemplars, their underlying mechanisms are opaque, hindering efforts to address limitations such as high training costs and poor generalization across tasks. These methods generally assume the selection process captures similarities between the exemplar and the target instance, however, it remains unknown what kinds of similarities are captured and vital to performing ICL. To dive into this question, we analyze the working mechanisms of the learning-based demonstration selection methods and empirically identify two important factors related to similarity measurement: 1) The ability to integrate different levels of task-agnostic text similarities between the input of exemplars and test cases enhances generalization power across different tasks. 2) Incorporating task-specific labels when measuring the similarities significantly improves the performance on each specific task. We validate these two findings through extensive quantitative and qualitative analyses across ten datasets and various LLMs. Based on our findings, we introduce two effective yet simplified exemplar selection methods catering to task-agnostic and task-specific demands, eliminating the costly LLM inference overhead.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 40 of its 58 references that are in the map. First posted on arXiv 14 Jun 2024.
Builds on
40 of 58 references.
References · 40
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
- 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
- 2019Similarity of Neural Network Representations Revisitedcited by 1,695
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
- 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
- 2022In-context Learning and Induction Headscited by 930
28 more
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
- 2021Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Modelscited by 462
- 2021MEMO: Test Time Robustness via Adaptation and Augmentationcited by 376
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 242
- 2022SGPT: GPT Sentence Embeddings for Semantic Searchcited by 204
- 2016Movie Descriptioncited by 180
- 2020MTOP: A Comprehensive Multilingual Task-Oriented Semantic Parsing Benchmarkcited by 156
- 2023Compositional Exemplars for In-context Learningcited by 143
- 2023Unified Demonstration Retriever for In-Context Learningcited by 141
- 2020Break It Down: A Question Understanding Benchmarkcited by 131
- 2020Task-Oriented Dialogue as Dataflow Synthesiscited by 122
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2018NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating Systemcited by 97
- 2021Self-Supervised Aggregation of Diverse Experts for Test-Agnostic Long-Tailed Recognitioncited by 95
- 2023Batch Calibration: Rethinking Calibration for In-Context Learning and Prompt Engineeringcited by 91
- 2024Mind Your Format: Towards Consistent Evaluation of In-Context Learning Improvementscited by 82
- 2023Overthinking the Truth: Understanding how Language Models Process False Demonstrationscited by 78
- 2023How Robust is GPT-3.5 to Predecessors? A Comprehensive Study on Language Understanding Taskscited by 58
- 2023AdaNPC: Exploring Non-Parametric Classifier for Test-Time Adaptationcited by 48
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2022Towards Online Domain Adaptive Object Detectioncited by 36
- 2023In-Context Learning for Text Classification with Many Labelscited by 35
- 2019Universal Text Representation from BERT: An Empirical Studycited by 28
- 2023Understanding In-Context Learning from Repetitionscited by 27
- 2023IDEAL: Influence-Driven Selective Annotations Empower In-Context Learners in Large Language Modelscited by 26
- 2023SEER : A Knapsack approach to Exemplar Selection for In-Context HybridQAcited by 9
- 2023LLMs Learn Task Heuristics from Demonstrations: A Heuristic-Driven Prompting Strategy for Document-Level Event Argument Extractioncited by 8
Built on by
Citing papers per year: 2024: 5; 2025: 3; 2026: 1.
9 papers.
- 2024Focused Large Language Models are Stable Many-Shot Learnerscited by 8
- 2024Unveiling In-Context Learning: A Coordinate System to Understand Its Working Mechanismcited by 6
- 2024Retrieved In-Context Principles from Previous Mistakescited by 5
- 2024DemoShapley: Valuation of Demonstrations for In-Context Learningcited by 3
- 2024Comparative Analysis of Demonstration Selection Algorithms for LLM In-Context Learningcited by 3
- 2025STARE at the Structure: Steering ICL Exemplar Selection with Structural Alignmentcited by 1
- 2025Domain-Specific Data Generation Framework for RAG Adaptationcited by 1
- 2025Disentangling Instruction Influence in Diffusion Transformers for Parallel Multi-Instruction-Guided Image Editingcited by 0
- 2026Gradient-free Task-Conditioned Retrieval for On-Device In-Context Learningcited by 0
- 2026Gradient-free Task-Conditioned Retrieval for On-Device In-Context Learning30 Jul 2026
- 2025Domain-Specific Data Generation Framework for RAG Adaptation13 Oct 2025
- 2025STARE at the Structure: Steering ICL Exemplar Selection with Structural Alignment28 Aug 2025
- 2025Disentangling Instruction Influence in Diffusion Transformers for Parallel Multi-Instruction-Guided Image Editing7 Apr 2025
- 2024Comparative Analysis of Demonstration Selection Algorithms for LLM In-Context Learning30 Oct 2024
- 2024DemoShapley: Valuation of Demonstrations for In-Context Learning10 Oct 2024
- 2024Focused Large Language Models are Stable Many-Shot Learners26 Aug 2024
- 2024Unveiling In-Context Learning: A Coordinate System to Understand Its Working Mechanism24 Jul 2024
- 2024Retrieved In-Context Principles from Previous Mistakes8 Jul 2024