Prompt Optimization with Human Feedback

Xiaoqiang Lin, Zhongxiang Dai, Arun Verma, See-Kiong Ng, Patrick Jaillet +1 more
5/27/2024
cs.LGcs.AI

Official code: xqlin98/APOHF (18 stars, MIT, last commit 2024-08-07).

Abstract

Large language models (LLMs) have demonstrated remarkable performances in various tasks. However, the performance of LLMs heavily depends on the input prompt, which has given rise to a number of recent works on prompt optimization. However, previous works often require the availability of a numeric score to assess the quality of every prompt. Unfortunately, when a human user interacts with a black-box LLM, attaining such a score is often infeasible and unreliable. Instead, it is usually significantly easier and more reliable to obtain preference feedback from a human user, i.e., showing the user the responses generated from a pair of prompts and asking the user which one is preferred. Therefore, in this paper, we study the problem of prompt optimization with human feedback (POHF), in which we aim to optimize the prompt for a black-box LLM using only human preference feedback. Drawing inspiration from dueling bandits, we design a theoretically principled strategy to select a pair of prompts to query for preference feedback in every iteration, and hence introduce our algorithm named automated POHF (APOHF). We apply our APOHF algorithm to various tasks, including optimizing user instructions, prompt optimization for text-to-image generative models, and response optimization with human feedback (i.e., further refining the response using a variant of our APOHF). The results demonstrate that our APOHF can efficiently find a good prompt using a small number of preference feedback instances. Our code can be found at \url{https://github.com/xqlin98/APOHF}.

View on arXivView PDF

Code Implementations(1)

xqlin98/APOHFOfficial100%
MIT

Prompt Optimization with Human Feedback

185Shell, PythonMay 25, 20242 years agoMIT

Similar Papers

Cite this paper

@article{lin2024prompt,
  title  = {Prompt Optimization with Human Feedback},
  author = {Xiaoqiang Lin and Zhongxiang Dai and Arun Verma and See-Kiong Ng and Patrick Jaillet and Bryan Kian Hsiang Low},
  year   = {2024},
  eprint = {2405.17346},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.17346v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.17346.svg)](https://codeofpaper.com/paper/2405.17346)

Discussion