arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.08607cs.LG
收藏

面向上下文学习的样本高效示范选择

Sample Efficient Demonstration Selection for In-Context Learning

Indian Institute of Technology, Kharagpur, India(印度理工学院Kharagpur分校);Delft University of Technology (TU Delft)(代尔夫特理工大学)

Kiran Purohit, V Venktesh, Sourangshu Bhattacharya, Avishek Anand

AI总结:

本文将上下文学习中的少样本示例选择建模为 top-m 最佳臂识别问题,提出随机线性 bandits 下的 CASE 选择性探索策略,以最高 7 倍加速和 87% 的 LLM 调用减少实现同等性能。

摘要:

使用 LLM 的上下文学习范式在推动广泛自然语言处理任务方面发挥了重要作用。少样本示例(exemplars/demonstration samples)的选择对于在上下文长度预算约束下构建有效提示至关重要。本文将示例选择任务表述为 top-m 最佳臂识别问题。该设置中的一个关键挑战是,为识别 m 个最佳臂而需要评估的臂数量呈指数级增长。我们提出 CASE(Challenger Arm Sampling for Exemplar selection,用于示例选择的挑战者臂采样),这是一种新颖的样本高效选择性探索策略,维护一个由“挑战者”臂组成的候选短名单,这些臂是当前 top-m 臂的候选。在每次迭代中,只抽取该短名单或当前 top-m 集合中的一个臂,从而降低样本复杂度,并因此减少 LLM 评估次数。此外,我们使用参数化线性评分函数对示例子集(臂)的分数进行建模,形成随机线性 bandits 设置。与最先进的示例选择方法相比,CASE 在不牺牲性能的情况下实现了显著的效率提升:运行时加速最高达 7 倍,同时 LLM 调用次数减少 7 倍(降低 87%)。我们在 https://github.com/kiranpurohit/CASE 发布代码和数据。

英文摘要:

The in-context learning paradigm with LLMs has been instrumental in advancing a wide range of natural language processing tasks. The selection of few-shot examples (exemplars / demonstration samples) is essential for constructing effective prompts under context-length budget constraints. In this paper, we formulate the exemplar selection task as a top-m best arms identification problem. A key challenge in this setup is the exponentially large number of arms that need to be evaluated to identify the m-best arms. We propose CASE (Challenger Arm Sampling for Exemplar selection), a novel sample-efficient selective exploration strategy that maintains a shortlist of "challenger" arms, which are current candidates for the top-m arms. In each iteration, only one of the arms from this shortlist or the current topm set is pulled, thereby reducing sample complexity and, consequently, the number of LLM evaluations. Furthermore, we model the scores of exemplar subsets (arms) using a parameterized linear scoring function, leading to stochastic linear bandits setting. CASE achieves remarkable efficiency gains of up to 7x speedup in runtime while requiring 7x fewer LLM calls (87% reduction) without sacrificing performance compared to state-of-the-art exemplar selection methods. We release our code and data at https://github.com/kiranpurohit/CASE

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑