[论文解读] Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars
本文提出 EASE,一种用于大语言模型(LLMs)少样本学习(ICL)中高效、有序感知的样本选择新方法。EASE 使用预训练语言模型对有序样本集进行嵌入,并采用神经上下文 bandit 算法,以一种在推理时无需额外计算的方式,联合优化样本选择与排序,从而在不暴露测试数据的前提下实现跨测试查询的泛化,显著优于现有方法,同时降低隐私风险,并支持与指令的联合优化。
Large language models (LLMs) have shown impressive capabilities in real-world applications. The capability of in-context learning (ICL) allows us to adapt an LLM to downstream tasks by including input-label exemplars in the prompt without model fine-tuning. However, the quality of these exemplars in the prompt greatly impacts performance, highlighting the need for an effective automated exemplar selection method. Recent studies have explored retrieval-based approaches to select exemplars tailored to individual test queries, which can be undesirable due to extra test-time computation and an increased risk of data exposure. Moreover, existing methods fail to adequately account for the impact of exemplar ordering on the performance. On the other hand, the impact of the instruction, another essential component in the prompt given to the LLM, is often overlooked in existing exemplar selection methods. To address these challenges, we propose a novel method named EASE, which leverages the hidden embedding from a pre-trained language model to represent ordered sets of exemplars and uses a neural bandit algorithm to optimize the sets of exemplars while accounting for exemplar ordering. Our EASE can efficiently find an ordered set of exemplars that performs well for all test queries from a given task, thereby eliminating test-time computation. Importantly, EASE can be readily extended to jointly optimize both the exemplars and the instruction. Through extensive empirical evaluations (including novel tasks), we demonstrate the superiority of EASE over existing methods, and reveal practical insights about the impact of exemplar selection on ICL, which may be of independent interest. Our code is available at https://github.com/ZhaoxuanWu/EASE-Prompt-Optimization.
研究动机与目标
- 解决基于检索的样本选择方法在测试时计算开销高且因查询特定样本暴露而增加隐私风险的问题。
- 克服现有 ICL 方法中对样本排序考虑不足的问题,该问题显著影响性能但常被忽略。
- 通过联合优化提示词中的样本选择与指令,弥合两者之间的差距。
- 开发一种方法,选择一个单一、固定的样本集合,使其在所有测试查询上均具有良好泛化能力,从而消除对每查询检索的需求。
提出的方法
- EASE 使用预训练语言模型的隐藏表示对有序样本集进行编码,同时捕捉内容信息与排序效应。
- 它采用神经上下文 bandit 算法,基于 LLM 性能反馈,迭代优化样本的选择与排序。
- 该方法将样本选择建模为序列决策问题,其中每个动作对应于选择并排序样本子集。
- EASE 设计为推理高效,在最优样本集学习完成后,测试时无需检索或额外计算。
- 它通过将指令视为同一优化框架内的可学习组件,支持样本与指令的联合优化。
- 该方法具备可扩展性和泛化能力,使得同一固定样本集可适用于给定任务的所有测试查询。
实验结果
研究问题
- RQ1样本排序如何影响少样本学习性能?是否可以系统性地进行优化?
- RQ2一个固定且经过优化的样本集合是否能在不依赖每查询检索的前提下,良好泛化至所有测试查询?
- RQ3在提示词中联合优化样本与指令对 ICL 性能有何影响?
- RQ4与基于检索和启发式的选择方法相比,EASE 在准确率、效率和隐私方面表现如何?
- RQ5在少样本学习中,样本质量、排序与指令之间的相互作用可提供哪些洞见?
主要发现
- EASE 在多个少样本学习基准测试中达到最先进性能,包括 AG News Remap 和 SST5 Reverse,准确率最高比现有方法提升 13.7%。
- 在 AG News Remap 任务中引入 10% 噪声时,EASE 达到 43.7% 的准确率,显著优于次优方法(32.3%),展现出对噪声数据的鲁棒性。
- 采用联合指令优化的 EASE 在 18 项任务中的 7 项上提升性能,包括在 second_word_letter 任务上实现 58% 的显著提升,表明联合优化带来强大增益。
- 该方法通过使用单一固定样本集处理所有查询,消除了查询特定样本暴露,从而降低隐私风险。
- 实证结果表明,样本排序对性能有显著影响,EASE 的有序感知优化始终优于随机或贪心排序,准确率更高。
- 消融实验表明,EASE 具备卓越的泛化能力,在多种任务和噪声水平下均保持高性能,证实其有效性与鲁棒性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。