Active Example Selection for In-Context Learning
Abstract
With a handful of demonstration examples, large-scale language models demonstrate strong capability to perform various tasks by in-context learning from these examples, without any fine-tuning. We demonstrate that in-context learning performance can be highly unstable across samples of examples, indicating the idiosyncrasies of how language models acquire information. We formulate example selection for in-context learning as a sequential decision problem, and propose a reinforcement learning algorithm for identifying generalizable policies to select demonstration examples. For GPT-2, our learned policies demonstrate strong abilities of generalizing to unseen tasks in training, with a 5.8% improvement on average. Examples selected from our learned policies can even achieve a small improvement on GPT-3 Ada. However, the improvement diminishes on larger GPT-3 models, suggesting emerging capabilities of large language models.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
78 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- A Survey on In-context Learning cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- A Survey on In-context Learning cites An Explanation of In-context Learning as Implicit Bayesian Inference
- A Survey on In-context Learning cites Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- A Survey on In-context Learning cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- An Explanation of In-context Learning as Implicit Bayesian Inference cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- Large Language Models are Zero-Shot Reasoners cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- Large Language Models are Zero-Shot Reasoners cites Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- Prompting Large Language Model for Machine Translation: A Case Study cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learning cites Large Language Models are Zero-Shot Reasoners
- The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learning cites Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- LayoutLLM-T2I: Eliciting Layout Guidance from LLM for Text-to-Image Generation cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
- LayoutLLM-T2I: Eliciting Layout Guidance from LLM for Text-to-Image Generation cites Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- LayoutLLM-T2I: Eliciting Layout Guidance from LLM for Text-to-Image Generation cites Calibrate Before Use: Improving Few-shot Performance of Language Models
Cited by top-tier papers78
- A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng et al.EMNLP 2024 · 479 citations
- Prompting Large Language Model for Machine Translation: A Case StudyBiao Zhang, Barry Haddow, Alexandra BirchICML 2023 · 402 citations
- The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context LearningBill Yuchen Lin, Abhilasha Ravichander, Ximing Lu, Nouha Dziri et al.ICLR 2024 · 299 citations
- CodeS: Towards Building Open-source Language Models for Text-to-SQLHaoyang Li, Jing Zhang, Hanbing Liu, Ju Fan et al.SIGMOD 2024 · 124 citations
- LayoutLLM-T2I: Eliciting Layout Guidance from LLM for Text-to-Image GenerationLeigang Qu, Shengqiong Wu, Hao Fei, Liqiang Nie et al.ACM MM 2023 · 91 citations
Builds on10
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
- Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel et al.ACL 2022 · 1,494 citations
- An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe et al.EMNLP 2022 · 634 citations
Related papers
- What Do Language Models Learn in Context? The Structured Task HypothesisJiaoda Li, Yifan Hou, Mrinmaya Sachan, Ryan CotterellACL 2024 · 5 citations
- Revisiting Demonstration Selection Strategies in In-Context LearningKeqin Peng, Liang Ding, Yancheng Yuan, Xuebo Liu et al.ACL 2024
- Provoking Multi-modal Few-Shot LVLM via Exploration-Exploitation In-Context LearningCheng Chen, Yunpeng Zhai, Yifan Zhao, Jinyang Gao et al.CVPR 2025
- Se²: Sequential Example Selection for In-Context LearningHaoyu Liu, Jianfeng Liu, Shaohan Huang, Yuefeng Zhan et al.ACL Findings 2024 · 3 citations
- Instruction Induction: From Few Examples to Natural Language Task DescriptionsOr Honovich, Uri Shaham, Samuel R. Bowman, Omer LevyACL 2023 · 48 citations
