APE treats natural-language instructions as programs that a model executes. This makes prompt engineering resemble program synthesis: generate candidate instructions from examples, execute them on the task model, score behavior, and keep the instructions that best control the model.
In practice an LLM proposes candidate instructions from a few input-output demonstrations, each candidate is scored on a training set (for example by execution accuracy or log probability), and the best candidates are refined iteratively through Monte Carlo variants. Related work optimizes prompt embeddings by gradient descent (AutoPrompt, Prompt-Tuning) or learns a distribution over chain-of-thought examples with policy gradients. The common move is to stop hand-tweaking prompts and measure them.
Related
- Prompt optimization turns prompt writing into measurable search
- Seedless prompt induction lowers entry cost but still needs task examples
- Few-shot prompt performance swings wildly with example choice and order
- Self-consistency sampling improves reliability through majority vote
- Keep a tool call only when it improves prediction of future tokens
- Prompt Optimization