Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Learning to Select In-Context Demonstration Preferred by Large Language Model

About

In-context learning (ICL) enables large language models (LLMs) to adapt to new tasks during inference using only a few demonstrations. However, ICL performance is highly dependent on the selection of these demonstrations. Recent work explores retrieval-based methods for selecting query-specific demonstrations, but these approaches often rely on surrogate objectives such as metric learning, failing to directly optimize ICL performance. Consequently, they struggle to identify truly beneficial demonstrations. Moreover, their discriminative retrieval paradigm is ineffective when the candidate pool lacks sufficient high-quality demonstrations. To address these challenges, we propose GenICL, a novel generative preference learning framework that leverages LLM feedback to directly optimize demonstration selection for ICL. Experiments on 19 datasets across 11 task categories demonstrate that GenICL achieves superior performance than existing methods in selecting the most effective demonstrations, leading to better ICL performance.

Zheng Zhang, Shaocheng Lan, Lei Song, Jiang Bian, Yexin Li, Kan Ren• 2025

Related benchmarks

TaskDatasetResultRank
Commonsense ReasoningHellaSwag
Accuracy74.6
1460
Mathematical ReasoningMATH
Accuracy88.4
643
Natural Language InferenceRTE
Accuracy72.9
367
Question AnsweringGPQA
Accuracy65.2
258
Reading ComprehensionBoolQ
Accuracy78.1
219
Natural Language InferenceSNLI
Accuracy84.6
174
Topic ClassificationAG-News
Accuracy92.6
173
Sentiment AnalysisSST-2
Accuracy95
156
Common Sense ReasoningCOPA
Accuracy86
138
Sentiment AnalysisSST-2 (test)
Accuracy94.6
136
Showing 10 of 26 rows

Other info

Code

Follow for update