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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Zheng, Lan, Shaocheng, Song, Lei, Bian, Jiang, Li, Yexin, Ren, Kan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916759659872256
author Zhang, Zheng
Lan, Shaocheng
Song, Lei
Bian, Jiang
Li, Yexin
Ren, Kan
author_facet Zhang, Zheng
Lan, Shaocheng
Song, Lei
Bian, Jiang
Li, Yexin
Ren, Kan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2505_19966
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Learning to Select In-Context Demonstration Preferred by Large Language Model
Zhang, Zheng
Lan, Shaocheng
Song, Lei
Bian, Jiang
Li, Yexin
Ren, Kan
Machine Learning
Artificial Intelligence
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.
title Learning to Select In-Context Demonstration Preferred by Large Language Model
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2505.19966