mlsanityData to 7 Oct 2026

Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learning

arXiv 2406.11890 ↗First posted 14 Jun 2024cs.LG cs.AI cs.CLcited by 9

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

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  4. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
  5. 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
  6. 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
  7. 2019Similarity of Neural Network Representations Revisitedcited by 1,695
  8. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
  9. 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
  10. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  11. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  12. 2022In-context Learning and Induction Headscited by 930
28 more
  1. 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
  2. 2021Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Modelscited by 462
  3. 2021MEMO: Test Time Robustness via Adaptation and Augmentationcited by 376
  4. 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 242
  5. 2022SGPT: GPT Sentence Embeddings for Semantic Searchcited by 204
  6. 2016Movie Descriptioncited by 180
  7. 2020MTOP: A Comprehensive Multilingual Task-Oriented Semantic Parsing Benchmarkcited by 156
  8. 2023Compositional Exemplars for In-context Learningcited by 143
  9. 2023Unified Demonstration Retriever for In-Context Learningcited by 141
  10. 2020Break It Down: A Question Understanding Benchmarkcited by 131
  11. 2020Task-Oriented Dialogue as Dataflow Synthesiscited by 122
  12. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  13. 2023Finding Support Examples for In-Context Learningcited by 104
  14. 2018NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating Systemcited by 97
  15. 2021Self-Supervised Aggregation of Diverse Experts for Test-Agnostic Long-Tailed Recognitioncited by 95
  16. 2023Batch Calibration: Rethinking Calibration for In-Context Learning and Prompt Engineeringcited by 91
  17. 2024Mind Your Format: Towards Consistent Evaluation of In-Context Learning Improvementscited by 82
  18. 2023Overthinking the Truth: Understanding how Language Models Process False Demonstrationscited by 78
  19. 2023How Robust is GPT-3.5 to Predecessors? A Comprehensive Study on Language Understanding Taskscited by 58
  20. 2023AdaNPC: Exploring Non-Parametric Classifier for Test-Time Adaptationcited by 48
  21. 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
  22. 2022Towards Online Domain Adaptive Object Detectioncited by 36
  23. 2023In-Context Learning for Text Classification with Many Labelscited by 35
  24. 2019Universal Text Representation from BERT: An Empirical Studycited by 28
  25. 2023Understanding In-Context Learning from Repetitionscited by 27
  26. 2023IDEAL: Influence-Driven Selective Annotations Empower In-Context Learners in Large Language Modelscited by 26
  27. 2023SEER : A Knapsack approach to Exemplar Selection for In-Context HybridQAcited by 9
  28. 2023LLMs Learn Task Heuristics from Demonstrations: A Heuristic-Driven Prompting Strategy for Document-Level Event Argument Extractioncited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 5; 2025: 3; 2026: 1.

9 papers.