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

面向大语言模型自动化提示工程的序贯最优学习方法

A Sequential Optimal Learning Approach to Automated Prompt Engineering in Large Language Models

Northwestern University(西北大学);Stevens Institute of Technology(史蒂文斯理工学院)

Shuyang Wang, Somayeh Moazeni, Diego Klabjan

AI总结:

本文提出基于特征表示、贝叶斯回归与 Knowledge-Gradient 序贯学习的自动化提示工程框架,可在有限评估预算下高效搜索提示,并在指令归纳任务上显著优于基准策略。

摘要:

设计有效的提示对于引导大语言模型(LLM)生成期望响应至关重要。自动化提示工程旨在通过简化自然语言提示的设计、改进与优化,减少对人工工作的依赖。本文提出一种用于自动化提示工程的最优学习框架,旨在序贯识别有效的提示特征,同时高效分配有限的评估预算。我们引入一种基于特征的提示表示方法,显著扩展了搜索空间。该框架采用贝叶斯回归利用相似提示之间的相关性,从而加速学习过程。为在庞大的提示特征空间中高效探索以获得高质量提示,我们采用前瞻性的 Knowledge-Gradient(KG,知识梯度)策略进行序贯最优学习。KG 策略通过求解混合整数二阶锥优化问题得到高效计算,因此具备可扩展性,并能够处理仅通过约束刻画的提示。实验在指令归纳任务上评估表明,我们的方法显著优于一系列基准策略。结果凸显了在评估预算有限时,使用 KG 策略进行提示学习的优势。本框架为在提示评估成本高昂的更广泛应用中部署自动化提示工程提供了解决方案。

英文摘要:

Designing effective prompts is essential to guiding large language models (LLMs) toward desired responses. Automated prompt engineering aims to reduce reliance on manual effort by streamlining the design, refinement, and optimization of natural language prompts. This paper proposes an optimal learning framework for automated prompt engineering, designed to sequentially identify effective prompt features while efficiently allocating a limited evaluation budget. We introduce a feature-based method to express prompts, which significantly broadens the search space. Bayesian regression is employed to utilize correlations among similar prompts, accelerating the learning process. To efficiently explore the large space of prompt features for a high quality prompt, we adopt the forward-looking Knowledge-Gradient (KG) policy for sequential optimal learning. The KG policy is computed efficiently by solving mixed-integer second-order cone optimization problems, making it scalable and capable of accommodating prompts characterized only through constraints. We demonstrate that our method significantly outperforms a set of benchmark strategies assessed on instruction induction tasks. The results highlight the advantages of using the KG policy for prompt learning given a limited evaluation budget. Our framework provides a solution to deploying automated prompt engineering in a wider range applications where prompt evaluation is costly.

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

↑