APE: Human-Level Prompt Engineers (2023)
FreeLLM auto-generates and selects instructions — beats human prompts
About APE: Human-Level Prompt Engineers (2023)
Automatic Prompt Engineer (APE) is a method for automatically generating and optimizing instructions for large language models (LLMs). Inspired by classical program synthesis and human prompt engineering, APE treats the instruction as a 'program' and searches over a pool of candidate instructions proposed by an LLM to maximize a chosen score function. The selected instruction is then evaluated by measuring the zero-shot performance of another LLM. In experiments across 24 NLP tasks, APE-generated instructions outperformed prior LLM baselines by a large margin and achieved better or comparable performance to human-written instructions on 19 out of 24 tasks. The method can also steer models toward truthfulness and/or informativeness and improve few-shot learning performance by prepending generated prompts to standard in-context learning prompts.
Key Features
Pros & Cons
- Generates prompts that outperform prior automated baselines
- Achieves comparable or better results than human-written prompts on most tasks
- Fully automatic, no manual prompt tuning required
- Can be used to steer model behavior (truthfulness, informativeness)
- Improves few-shot learning with minimal additional cost
- Requires access to a large language model for candidate generation and evaluation
- Computational cost may be high due to iterative search and LLM calls
- Performance depends on the quality and diversity of initial candidate proposals
- Not designed for multimodal or non-text tasks