Skip to main content
QUICK REVIEW

[Paper Review] Large Language Models Are Human-Level Prompt Engineers

Yongchao Zhou, Andrei Ioan Muresanu|arXiv (Cornell University)|Nov 3, 2022
Topic Modeling297 citations
TL;DR

The paper introduces Automatic Prompt Engineer (APE), an LLM-driven method that automatically generates and selects natural-language instructions to steer LLMs, achieving human-level zero-shot performance on many tasks and enhancing few-shot learning and truthfulness control.

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 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.

Motivation & Objective

  • Motivate reducing human effort in prompt design by auto-generating effective instructions for LLMs.
  • Frame instruction generation as natural language program synthesis treated as black-box optimization.
  • Leverage LLMs for both proposing candidate prompts and scoring their quality.
  • Demonstrate that automatically engineered prompts can rival or exceed human-crafted prompts across diverse tasks.

Proposed method

  • Formulate instruction generation as optimization: find rho that maximizes expected score f(rho, D_train, M).
  • Use an LLM as proposal engine to generate candidate instructions U from demonstrations.
  • Evaluate candidates with a chosen score f over train data and select top performers.
  • Employ forward or reverse generation modes to produce instruction candidates from demonstrations.
  • Optionally apply iterative Monte Carlo search to refine the proposal set around high-scoring candidates.
  • Use execution accuracy or log-probability as score functions, with an adaptive multi-stage evaluation to save computation.

Experimental results

Research questions

  • RQ1Can automatically generated instructions match or exceed human-crafted prompts on zero-shot and few-shot tasks?
  • RQ2Do LLM-generated prompts improve beyond greedy prompt selection in instruction induction and BIG-Bench tasks?
  • RQ3Can APE discover effective zero-shot chain-of-thought prompts and steer outputs toward truthfulness or informativeness?

Key findings

  • APE achieves equal or better zero-shot performance than human prompts on 24 Instruction Induction tasks and 17 of 21 BIG-Bench tasks.
  • Interquartile mean across 24 tasks with InstructGPT indicates APE surpasses human-engineered prompts (IQM 0.810 vs 0.749).
  • Adding APE-generated instructions before in-context demonstrations improves few-shot learning on most tasks.
  • APE discovers effective zero-shot chain-of-thought prompts and can steer models toward truthfulness or informativeness.
  • On TruthfulQA, APE-promoted prompts achieve strong truthfulness and informativeness trade-offs, sometimes yielding higher true+informative accuracy than a human prompt.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.