arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.10504cs.AI
收藏

QPO:基于多环离线强化学习的查询相关提示优化

QPO: Query-dependent Prompt Optimization via Multi-Loop Offline Reinforcement Learning

Tsinghua University(清华大学);SenseTime Research(商汤科技研究院);University of Chinese Academy of Sciences(中国科学院大学);Sun Yat-Sen University(中山大学);Nanyang Technological University(南洋理工大学)

Yilun Kong, Hangyu Mao, Qi Zhao, Bin Zhang, Jingqing Ruan, Li Shen, Yongzhe Chang, Xueqian Wang, Rui Zhao, Dacheng Tao

AI总结:

本文提出查询相关提示优化方法QPO,利用多环离线强化学习迭代微调小型预训练模型,根据输入查询生成定制化最优提示,在避免在线交互开销的同时显著提升大型目标LLM的提示效果与成本效益。

摘要:

提示工程在提升大型语言模型(LLMs)在各类任务上的性能方面取得了显著成功。然而,大多数现有的提示优化方法仅关注任务级别的性能,忽视了查询偏好提示的重要性,从而导致次优性能。此外,这些方法严重依赖与LLMs的频繁交互以获取指导优化过程的反馈,产生了大量冗余的交互成本。在本文中,我们提出了查询相关提示优化(QPO),该方法利用多环离线强化学习迭代地微调一个小型预训练语言模型,以生成针对输入查询量身定制的最佳提示,从而显著提升对大型目标LLM的提示效果。我们从离线提示演示数据中提取见解,这些数据作为在开源任务上对各种提示进行基准测试的副产品已经大量存在,从而避免了在线交互的开销。此外,我们在每个循环中持续用生成的提示扩充离线数据集,因为来自微调模型的提示理应优于原始数据集中的源提示。这些迭代循环通过自举法引导模型生成最佳提示。在各种LLM规模和多样的NLP与数学任务上的实验表明,我们的方法在零样本和少样本场景下均具有有效性和成本效益。

英文摘要:

Prompt engineering has demonstrated remarkable success in enhancing the performance of large language models (LLMs) across diverse tasks. However, most existing prompt optimization methods only focus on the task-level performance, overlooking the importance of query-preferred prompts, which leads to suboptimal performances. Additionally, these methods rely heavily on frequent interactions with LLMs to obtain feedback for guiding the optimization process, incurring substantial redundant interaction costs. In this paper, we introduce Query-dependent Prompt Optimization (QPO), which leverages multi-loop offline reinforcement learning to iteratively fine-tune a small pretrained language model to generate optimal prompts tailored to the input queries, thus significantly improving the prompting effect on the large target LLM. We derive insights from offline prompting demonstration data, which already exists in large quantities as a by-product of benchmarking diverse prompts on open-sourced tasks, thereby circumventing the expenses of online interactions. Furthermore, we continuously augment the offline dataset with the generated prompts in each loop, as the prompts from the fine-tuned model are supposed to outperform the source prompts in the original dataset. These iterative loops bootstrap the model towards generating optimal prompts. Experiments on various LLM scales and diverse NLP and math tasks demonstrate the efficacy and cost-efficiency of our method in both zero-shot and few-shot scenarios.

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

↑