passdrill
AI & LLM Engineering · Prompt Engineering · Card 042/049 hard

A team wants an LLM to write and keep improving its own instruction for a reasoning task, given only a way to score any candidate instruction against a small held-out set (for example, accuracy on GSM8K). Zhou et al.'s Automatic Prompt Engineer (APE) generates a batch of candidate instructions in one pass from example input-output pairs and selects whichever scores best. Yang et al. (2023), "Large Language Models as Optimizers," propose OPRO for the same kind of problem. How does OPRO's procedure differ from APE's one-pass generate-and-select approach?

  1. OPRO trains a separate small neural network purely on the numeric scores to predict the best wording, without the LLM ever seeing the scores itself
  2. OPRO removes scoring from the loop entirely and instead has the LLM vote on which of several candidate instructions sounds most natural to a human reader
  3. OPRO runs an iterative optimization loop: at each step it feeds the model a "meta-prompt" containing the trajectory of previously tried instructions together with their scores, and asks the model to propose a new instruction intended to score higher than the ones already tried, so each new attempt is conditioned on the full history of earlier attempts rather than everything being generated in one pass
  4. OPRO requires updating the LLM's own weights via gradient descent on the scoring function, making it inapplicable to closed-weight models accessed only through an API
Next card → Shuffle