使用EASE进行提示优化?具备顺序感知能力的高效示例自动选择方法
Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars
AI总结:
针对大语言模型上下文学习中示例选择存在的测试开销高、忽略排序与指令影响的问题,提出EASE方法,利用预训练模型隐藏嵌入和神经老虎机算法优化有序示例集,可联合优化指令,性能优于现有方法。
摘要:
大语言模型(LLM)已在实际应用中展现出令人瞩目的能力。其上下文学习(ICL)能力使得我们无需对模型进行微调,只需在提示中加入输入-标签示例,就能让LLM适配下游任务。然而,提示中这些示例的质量会极大影响模型性能,这凸显了有效自动化示例选择方法的必要性。近期研究探索了基于检索的方法,为单个测试查询定制选择示例,但这类方法存在额外的测试阶段计算开销,且数据泄露风险更高,因而并不理想。此外,现有方法未能充分考虑示例排序对性能的影响。另一方面,作为提供给LLM的提示中另一核心组成部分的指令,其影响在现有示例选择方法中往往被忽视。为应对这些挑战,我们提出了一种名为EASE的新方法,该方法利用预训练语言模型的隐藏嵌入来表示有序示例集,并采用神经老虎机算法优化示例集,同时兼顾示例排序的影响。我们的EASE能够高效找到一组有序示例,在给定任务的所有测试查询上都能取得良好表现,从而消除了测试阶段的计算开销。重要的是,EASE可以很容易地扩展,以联合优化示例和指令。通过大量实证评估(包括新提出的任务),我们证明了EASE优于现有方法,并揭示了关于示例选择对ICL影响的实用洞见,这些洞见本身可能具有独立研究价值。我们的代码可在https://github.com/ZhaoxuanWu/EASE-Prompt-Optimization获取。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。