Automatic Prompt Engineering
The owner had rewritten the triage instruction eleven times, each version "feeling" better than the last. The test set said otherwise: accuracy wobbled between 88 and 92 percent with no clear winner. There is another way to search for a good prompt: let a model write the candidates, and let the test set choose.
The rule
Let a model propose prompts; let labelled data pick the winner.
Automatic prompt engineering (APE) turns prompt writing into a search:
- Generate — show a model some input/output pairs from your task and ask it to write many candidate instructions that would produce those outputs.
- Score — run every candidate on a labelled evaluation set and measure accuracy, or whatever metric matters.
- Select and refine — keep the best few, ask the model for variations of them, and score again.
- Confirm — check the final winner on a separate held-out set it was never tuned on.
Here are pairs of customer emails and the correct category:
<examples> ...20 labelled emails... </examples>
Write 10 different instructions that would lead an assistant to produce
exactly these categories. Vary the wording, the definitions and the
level of detail.The value is not that the machine writes more cleverly than you. It is that the choice is made by measurement instead of taste, and far more candidates can be tried than a person would bother to write. Sometimes the winner uses a phrasing no human would have guessed.