Abstract
Bayesian Optimization (BO) has been widely used to efficiently optimize expensive black-box functions with limited evaluations. In this paper, we investigate the use of BO for prompt engineering to enhance text classification with Large Language Models (LLMs). We employ an LLM-powered Gaussian Process (GP) as the surrogate model to estimate the performance of different prompt candidates. These candidates are generated by an LLM through the expansion of a set of seed prompts and are subsequently evaluated using an Upper Confidence Bound (UCB) acquisition function in conjunction with the GP posterior. The optimization process iteratively refines the prompts based on a subset of the data, aiming to improve classification accuracy while reducing the number of API calls by leveraging the prediction uncertainty of the LLM-based GP. The proposed BO-LLM algorithm is evaluated on two datasets, and its advantages are discussed in detail in this paper.
Abstract (translated)
贝叶斯优化(BO)已被广泛用于高效地优化昂贵的黑盒函数,同时限制评估次数。本文研究了使用贝叶斯优化进行提示工程以增强大型语言模型(LLMs)在文本分类中的效果。我们采用由LLM驱动的高斯过程(GP)作为代理模型来估计不同提示候选方案的表现。这些候选方案通过扩展一组种子提示并通过LLM生成,随后利用与GP后验概率结合的上置信界(UCB)获取函数进行评估。优化过程基于数据子集迭代地改进提示,旨在提高分类准确性的同时减少API调用次数,并通过LLM基GP预测不确定性实现这一目标。本文提出的BO-LLM算法在两个数据集上进行了评估,其优点也在文中详细讨论。
URL
https://arxiv.org/abs/2510.04384