Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wu, Zhaoxuan, Lin, Xiaoqiang, Dai, Zhongxiang, Hu, Wenyang, Shu, Yao, Ng, See-Kiong, Jaillet, Patrick, Low, Bryan Kian Hsiang
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916458741628928
author Wu, Zhaoxuan
Lin, Xiaoqiang
Dai, Zhongxiang
Hu, Wenyang
Shu, Yao
Ng, See-Kiong
Jaillet, Patrick
Low, Bryan Kian Hsiang
author_facet Wu, Zhaoxuan
Lin, Xiaoqiang
Dai, Zhongxiang
Hu, Wenyang
Shu, Yao
Ng, See-Kiong
Jaillet, Patrick
Low, Bryan Kian Hsiang
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_16122
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars
Wu, Zhaoxuan
Lin, Xiaoqiang
Dai, Zhongxiang
Hu, Wenyang
Shu, Yao
Ng, See-Kiong
Jaillet, Patrick
Low, Bryan Kian Hsiang
Artificial Intelligence
Computation and Language
Machine Learning
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.
title Prompt Optimization with EASE? Efficient Ordering-aware Automated Selection of Exemplars
topic Artificial Intelligence
Computation and Language
Machine Learning
url https://arxiv.org/abs/2405.16122