Lune

ICML2023Top-tier venue

Compositional Exemplars for In-context Learning

Jiacheng Ye, Zhiyong Wu, Jiangtao Feng, Tao Yu, Lingpeng Kong

Abstract

Large pretrained language models (LMs) have shown impressive In-Context Learning (ICL) ability, where the model learns to do an unseen task via a prompt consisting of input-output examples as the demonstration, without any parameter updates. The performance of ICL is highly dominated by the quality of the selected in-context examples. However, previous selection methods are mostly based on simple heuristics, leading to sub-optimal performance. In this work, we formulate in-context example selection as a subset selection problem. We propose CEIL (Compositional Exemplars for In-context Learning), which is instantiated by Determinantal Point Processes (DPPs) to model the interaction between the given input and in-context examples, and optimized through a carefully-designed contrastive learning objective to obtain preference from LMs. We validate CEIL on 12 classification and generation datasets from 7 distinct NLP tasks, including sentiment analysis, paraphrase detection, natural language inference, commonsense reasoning, open-domain question answering, code generation, and semantic parsing. Extensive experiments demonstrate not only the state-of-the-art performance but also the transferability and compositionality of CEIL, shedding new light on effective and efficient in-context learning. Our code is released at https://github.com/HKUNLP/icl-ceil.

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.

74 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Self-Consistency Improves Chain of Thought Reasoning in Language Models cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Self-Consistency Improves Chain of Thought Reasoning in Language Models cites Language Models are Few-Shot Learners
  • Self-Consistency Improves Chain of Thought Reasoning in Language Models cites The Curious Case of Neural Text Degeneration
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity cites Language Models are Few-Shot Learners
  • 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 Language Models are Few-Shot Learners
  • Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
  • Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars cites Language Models are Few-Shot Learners
  • Diffusion of Thought: Chain-of-Thought Reasoning in Diffusion Language Models cites Self-Consistency Improves Chain of Thought Reasoning in Language Models
  • Diffusion of Thought: Chain-of-Thought Reasoning in Diffusion Language Models cites Language Models are Few-Shot Learners
  • Diffusion of Thought: Chain-of-Thought Reasoning in Diffusion Language Models cites The Curious Case of Neural Text Degeneration
  • Grammar Prompting for Domain-Specific Language Generation with Large Language Models cites Self-Consistency Improves Chain of Thought Reasoning in Language Models
  • Grammar Prompting for Domain-Specific Language Generation with Large Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers74

  1. A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng et al.EMNLP 2024 · 479 citations
  2. Grammar Prompting for Domain-Specific Language Generation with Large Language ModelsBailin Wang, Zi Wang, Xuezhi Wang, Yuan Cao et al.NeurIPS 2023 · 138 citations
  3. Training-Free Long-Context Scaling of Large Language ModelsChenxin An, Fei Huang, Jun Zhang, Shansan Gong et al.ICML 2024 · 68 citations
  4. Diffusion of Thought: Chain-of-Thought Reasoning in Diffusion Language ModelsJiacheng Ye, Shansan Gong, Liheng Chen, Lin Zheng et al.NeurIPS 2024 · 47 citations
  5. Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of ExemplarsZhaoxuan Wu, Xiaoqiang Lin, Zhongxiang Dai, Wenyang Hu et al.NeurIPS 2024 · 44 citations

Builds on16

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  3. 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
  4. Self-Consistency Improves Chain of Thought Reasoning in Language ModelsXuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le et al.ICLR 2023 · 681 citations
  5. Extractive Summarization as Text MatchingMing Zhong, Pengfei Liu, Yiran Chen, Danqing Wang et al.ACL 2020 · 410 citations

Related papers

  1. Task Descriptors Help Transformers Learn Linear Models In-ContextRuomin Huang, Rong GeICLR 2025
  2. What Do Language Models Learn in Context? The Structured Task HypothesisJiaoda Li, Yifan Hou, Mrinmaya Sachan, Ryan CotterellACL 2024 · 5 citations
  3. Not All Demonstration Examples are Equally Beneficial: Reweighting Demonstration Examples for In-Context LearningZhe Yang, Damai Dai, Peiyi Wang, Zhifang SuiEMNLP Findings 2023 · 3 citations
  4. Large Language Models Might Not Care What You Are Saying: Prompt Format Beats DescriptionsChenming Tang, Zhixiang Wang, Hao Sun, Yunfang WuEMNLP Findings 2025 · 2 citations
  5. Data Curation Alone Can Stabilize In-context LearningTing-Yun Chang, Robin JiaACL 2023 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines