Black-Box Prompt Optimization: Aligning Large Language Models without Model Training
Jiale Cheng1,2 , Xiao Liu3, , Kehan Zheng1 , Pei Ke1 , Hongning Wang1 , Yuxiao Dong3 , Jie Tang3 , Minlie Huang1 1The Conversational Artificial Intelligence (CoAI) Group, Tsinghua University 2Zhipu AI 3The Knowledge Engineering Group (KEG), Tsinghua University JC and XL made equal contributions. Corresponding author.
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 ga
中文速览
让大语言模型(LLM)更好地听懂用户的意思,通常需要对模型本身做昂贵的再训练,而对于GPT-4这类只开放API的闭源模型更是无从下手。黑箱提示优化(Black-Box Prompt Optimization,BPO)换了一个思路:不动模型参数,而是训练一个小型的"提示改写器",把用户写得模糊或不够清晰的输入自动改写成模型更容易理解、更符合人类偏好的形式。具体做法是收集约1.4万条带有人类偏好标注的数据,利用ChatGPT分析好回答和差回答的差异并据此改写原始提示,再用这些"改写前后"的配对数据微调一个7B大小的序列到序列模型。实验表明,BPO让ChatGPT的胜率提升了22%、GPT-4提升了10%,甚至超过了直接用PPO或DPO对模型做偏好训练的效果,并且与这些方法叠加使用时还能带来额外增益。这项工作的意义在于:它提供了一种无需访问模型内部权重、计算开销低、可跨模型通用的对齐新路径,对封闭API模型同样有效。
原文 arXiv:2311.04155;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2311.04155v3