Skip to content

Practice · Chapter 9 of 11

Testing and improving

A prompt is finished when it works on your cases, not when it looks good. Testing is how you find out.

By Updated

Finn in a lab coat comparing two test tubes

Decide what good means

Before you tune a prompt, write down what a good result does. Anthropic advises success criteria that are specific, measurable, achievable and relevant Anthropic.

Weak

A good summary.

Better

At most five bullets. Every decision from the notes appears. Nothing appears that isn't in the notes. Someone who wasn't there understands it.

A handful of test cases

Collect a few inputs that look like real use, including awkward ones. Anthropic suggests tests that mirror your actual task and, where you can, grading them automatically Anthropic. For a meeting-summary prompt, four cases could be:

CaseInputWhat to watch
TypicalA normal set of meeting notes.Is every decision there?
ShortThree lines, half of them abbreviations.Does it invent detail to fill space?
MessyTwo meetings pasted together.Does it mix them up or say so?
TrickyNotes where a decision is reversed later.Does it report the final one?

Change one thing at a time

If you change three things at once, you won't know which one helped. OpenAI advises tests and evaluation checks before changing prompts that are already in use OpenAI.

  1. Run

    All your cases, with the current prompt.

  2. Compare

    Mark what misses the criteria.

  3. Change

    One thing, aimed at one failure.

  4. Repeat

    Run every case again, not only the failed one.

A loop, not a line: stop when every case meets your criteria.

Keep your versions

Keep each version with a short note on why you changed it, compare old and new on the same cases, and keep the winner. When you switch models, run the cases again: Anthropic advises testing a technique against your own evaluations before applying it to a different model Anthropic.

PromptPrinter keeps the versions of a saved prompt and shows what changed between them.

Sources

Official guides by the model providers. They change as models change, so check them for your model.