Black-Box Prompt Optimization: Aligning Large Language Models without Model Training

Jiale Cheng, Xiao Liu, Kehan Zheng, Pei Ke, Hongning Wang +3 more
11/7/2023
cs.CL

Official code: thu-coai/BPO (336 stars, Apache-2.0, last commit 2024-06-24).

Abstract

Large language models (LLMs) have shown impressive success in various applications. However, these models are often not well aligned with human intents, which calls for additional treatments on them; that is, the alignment problem. To make LLMs better follow user instructions, existing alignment methods primarily focus on further training them. However, the extra training of LLMs is usually expensive in terms of GPU computing; even worse, some LLMs are not accessible for user-demanded training, such as GPTs. In this work, we take a different perspective -- Black-Box Prompt Optimization (BPO) -- to perform alignments. The idea is to optimize user prompts to suit LLMs' input understanding, so as to best realize users' intents without updating LLMs' parameters. BPO leverages human preferences to optimize prompts, thus making it superior to LLM (e.g., ChatGPT) as a prompt engineer. Moreover, BPO is model-agnostic, and the empirical results demonstrate that the BPO-aligned ChatGPT yields a 22% increase in the win rate against its original version and 10% for GPT-4. Notably, the BPO-aligned LLMs can outperform the same models aligned by PPO and DPO, and it also brings additional performance gains when combining BPO with PPO or DPO. Code and datasets are released at https://github.com/thu-coai/BPO.

View on arXivView PDF

Code Implementations(1)

thu-coai/BPOOfficial100%
Apache-2.0
33617PythonNov 6, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{cheng2023blackbox,
  title  = {Black-Box Prompt Optimization: Aligning Large Language Models without Model Training},
  author = {Jiale Cheng and Xiao Liu and Kehan Zheng and Pei Ke and Hongning Wang and Yuxiao Dong and Jie Tang and Minlie Huang},
  year   = {2023},
  eprint = {2311.04155},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.04155v3}
}

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/2311.04155.svg)](https://codeofpaper.com/paper/2311.04155)

Discussion