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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Kong, Yilun, Mao, Hangyu, Zhao, Qi, Zhang, Bin, Ruan, Jingqing, Shen, Li, Chang, Yongzhe, Wang, Xueqian, Zhao, Rui, Tao, Dacheng
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910974314807296
author Kong, Yilun
Mao, Hangyu
Zhao, Qi
Zhang, Bin
Ruan, Jingqing
Shen, Li
Chang, Yongzhe
Wang, Xueqian
Zhao, Rui
Tao, Dacheng
author_facet Kong, Yilun
Mao, Hangyu
Zhao, Qi
Zhang, Bin
Ruan, Jingqing
Shen, Li
Chang, Yongzhe
Wang, Xueqian
Zhao, Rui
Tao, Dacheng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_10504
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle QPO: Query-dependent Prompt Optimization via Multi-Loop Offline Reinforcement Learning
Kong, Yilun
Mao, Hangyu
Zhao, Qi
Zhang, Bin
Ruan, Jingqing
Shen, Li
Chang, Yongzhe
Wang, Xueqian
Zhao, Rui
Tao, Dacheng
Artificial Intelligence
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.
title QPO: Query-dependent Prompt Optimization via Multi-Loop Offline Reinforcement Learning
topic Artificial Intelligence
url https://arxiv.org/abs/2408.10504