Large Language Models Are Human-Level Prompt Engineers

By Yongchao Zhou, Andrei Ioan Muresanu, Ziwen Han, Keiran Paster, Silviu Pitis, Harris Chan, Jimmy Ba. 2022

1,479 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Information Systems, Prompting & Reasoning

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Mohit Bansal
  2. Jianfeng Gao
  3. Luke S. Zettlemoyer
  4. Yejin Choi
  5. Percy Liang
  6. Quoc V. Le
  7. Caiming Xiong
  8. Hannaneh Hajishirzi

In Information Systems

  1. Chun Xia
  2. Lingming Zhang
  3. Michael Pradel
  4. Xi Ye
  5. Denny Zhou
  6. Yejin Choi
  7. Matteo Paltenghi
  8. Jia Le Tian

In Prompting & Reasoning

  1. Xinyun Chen
  2. Greg Durrett
  3. Swaroop Mishra
  4. Jie Huang
  5. Xi Ye
  6. Weizhu Chen
  7. Karthik Narasimhan
  8. Shunyu Yao

Citations in the corpus