Large Language Models are Human-Level Prompt Engineers
Yongchao Zhou Affiliation: University of Toronto Affiliation: Vector Institute Affiliation: Equal Andrei Ioan Muresanu Affiliation: Vector Institute Affiliation: University of Waterloo Affiliation: Equal Ziwen Han Affiliation: University of Toronto Affiliation: Vector Institute Affiliation: Equal Keiran Paster Affiliation: University of Toronto Affiliation: Vector Institute Silviu Pitis Affiliation: University of Toronto Affiliation: Vector Institute Harris Chan Affiliation: University of Toronto Affiliation: Vector Institute Jimmy Ba Affiliation: University of Toronto Affiliation: Vector Institute
Abstract
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 Engineer11 1 We define “prompt engineering” as optimizing the language in a prompt in order to elicit the best possible performance. Notably, this does not include prompts that chain multiple LLM queries together or give the LLM access to external tools. (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. Extensive experiments show that our automatically generated instructions outperform the prior LLM baseline by a large margin and achiev
原文 arXiv:2211.01910;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2211.01910v2