[论文解读] Large Language Models Are Human-Level Prompt Engineers
本论文提出 Automatic Prompt Engineer (APE),一个由 LLM 驱动的方法,自动生成并选择自然语言指令以引导 LLM,在多任务上实现人与人类零-shot水平的表现,并提升少样本学习和真实性控制。
By conditioning on natural language instructions, large language models (LLMs) have displayed impressive capabilities as general-purpose computers. However, task performance depends significantly on the quality of the prompt used to steer the model, and most effective prompts have been handcrafted by humans. Inspired by classical program synthesis and the human approach to prompt engineering, we propose Automatic Prompt Engineer (APE) for automatic instruction generation and selection. In our method, we treat the instruction as the "program," optimized by searching over a pool of instruction candidates proposed by an LLM in order to maximize a chosen score function. To evaluate the quality of the selected instruction, we evaluate the zero-shot performance of another LLM following the selected instruction. Experiments on 24 NLP tasks show that our automatically generated instructions outperform the prior LLM baseline by a large margin and achieve better or comparable performance to the instructions generated by human annotators on 19/24 tasks. We conduct extensive qualitative and quantitative analyses to explore the performance of APE. We show that APE-engineered prompts can be applied to steer models toward truthfulness and/or informativeness, as well as to improve few-shot learning performance by simply prepending them to standard in-context learning prompts. Please check out our webpage at https://sites.google.com/view/automatic-prompt-engineer.
研究动机与目标
- 通过自动生成对 LLM 有效的指令来减少人类在提示设计上的工作量的动机。
- 将指令生成框架为自然语言程序综合,视为黑箱优化。
- 利用 LLM 同时提出候选提示并对其质量进行评分。
- 证明自动设计的提示在多样任务中可以与人类设计的提示相媲美甚至优于它们。
提出的方法
- 将指令生成定式为优化:找到 rho 使期望分数 f(rho, D_train, M) 最大。
- 使用 LLM 作为提案引擎,从示例中生成候选指令 U。
- 用所选分数 f 在训练数据上评估候选项并选择表现最佳者。
- 利用正向或逆向生成模式从示例中产生指令候选项。
- 可选地应用迭代蒙特卡洛搜索,以在高分候选附近细化提案集合。
- 使用执行准确度或对数概率作为评分函数,采用自适应多阶段评估以节省计算量。
实验结果
研究问题
- RQ1自动生成的指令是否能在零-shot 和少样本任务中与人工编写的提示相匹配或超越?
- RQ2在指令诱导和 BIG-Bench 任务中,LLM 生成的提示是否比贪婪的提示选择进一步提升?
- RQ3APE 能否发现有效的零-shot 连锁思维提示并将输出引导向真实性或信息性?
主要发现
- APE 在 24 项 Instruction Induction 任务和 21 项 BIG-Bench 任务中的 17 项上,达到或优于人类提示的零-shot 表现。
- 在 24 项任务的中位数均值(IQM)与 InstructGPT 比较,APE 超越了人工设计的提示(IQM 0.810 对 0.749)。
- 在上下文示例之前加入 APE 生成的指令,提升了大多数任务的少样本学习。
- APE 发现了有效的零-shot 连锁思维提示,并能将模型引导到真实或信息性。
- 在 TruthfulQA 上,APE-promoted 提示实现了强烈的真实性与信息性权衡,有时获得比人类提示更高的真实+信息准确性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。