Judging AI Output: Your First Evals
How to tell whether a prompt change actually helped, why vibes-based testing misleads, and how to build a useful evaluation set in an afternoon.
What you'll be able to do
- Build a small evaluation set that catches regressions before users do
- Choose an appropriate grader for a given kind of task
- Explain why a few good examples beat a large unlabelled sample
Assumes: Lesson 2 β Prompt Engineering Techniques
The problem with judging by eye
Here is how prompt tuning usually goes. You change something, run it a few times, the answers look better, you ship it. A fortnight later something is subtly worse and nobody can say when it broke.
Two things make eyeballing unreliable, and neither is about carelessness:
Output is sampled. Run the same prompt five times and you get five different answers. Three good ones after a change might be the change, or might be the three you would have got anyway.
You are looking at what you changed. You tightened the tone instruction, so you read the tone. You do not notice that it stopped including the reference number, because you were not looking there.
Evaluation β βevalsβ β is the fix. It is the highest-leverage practice in applied AI and the one most often skipped, because it feels like overhead until the first time it saves you.
An eval is three things
- A set of inputs representative of real use.
- A definition of correct for each one.
- A grader that scores output against that definition.
Then you run it whenever anything changes: prompt, model, retrieval, temperature. You get a number. Numbers you can compare; impressions you cannot.
Build the set first
Twenty cases beats a thousand, if the twenty are the right ones. Assemble them like this:
Ten ordinary cases. The everyday requests. These catch catastrophic breakage.
Ten hard cases. This is where the value is:
- Genuine ambiguity where you have a policy β mixed sentiment, partial matches.
- Things it should refuse β out of scope, missing information, unanswerable.
- Adversarial input β someone trying to talk it out of its instructions.
- Anything it has already got wrong. Every bug becomes a permanent test case. This one habit compounds more than any other.
A spreadsheet is a perfectly good format. Input in one column, expected output in the next, notes in a third. Do not build infrastructure first.
Choosing a grader
Match the grader to the shape of the output. Using the wrong one is worse than not measuring.
| Output shape | Grader | Notes |
|---|---|---|
| Label, number, extracted field | Exact match | Cheap, unambiguous, use wherever possible |
| Structured data | Schema check + field match | Validate shape, then compare fields |
| Must contain specific facts | Keyword or assertion check | Brittle on phrasing, but fast |
| Open-ended prose | Model-as-judge, or a human | See the caveats below |
| Retrieval quality | Was the right passage returned? | Score retrieval separately from generation |
That last row deserves emphasis. In a RAG system, grade the two halves separately. If you only score the final answer, you cannot tell whether a failure came from fetching the wrong passage or from writing a bad answer over the right one β and those have completely different fixes.
Model-as-judge, honestly
For open-ended output, using a strong model to grade is often the only practical option. It works, with real caveats that are documented rather than folklore:
- Length bias. Longer answers score higher, other things being equal.
- Self-preference. Judges favour output resembling their own style.
- Position bias. In A-versus-B comparisons, the order of presentation shifts the verdict.
- Confidence bias. Assertive wrongness outscores hedged correctness.
Three things make it usable anyway:
- Give the judge a rubric, not a vibe. βScore 1β5 on whether every claim is supported by the provided contextβ is gradeable. βRate the qualityβ is not.
- Ask for a judgement, not a number in isolation. Have it state the reason, then the score.
- Calibrate against humans. Grade thirty examples yourself, compare with the judge, and check they broadly agree before trusting it on three hundred.
The workflow
1. Write 20 cases with expected outputs
2. Run the current prompt β record the baseline score
3. Change ONE thing
4. Re-run the full set
5. Compare. Better β keep. Worse or flat β revert.
6. Every production bug becomes case 21, 22, 23...
Step 3 is the one people skip. Change three things at once and a flat score tells you nothing β two may have helped and one hurt.
Step 5 needs judgement about noise. If your set is small and the model is sampling, a one-case difference is probably variance. Look for movement of several cases, or run each case a few times and average.
What to measure beyond correctness
Correctness is not the only thing that regresses:
- Refusal rate β is it now declining things it should answer, or answering things it should decline?
- Format compliance β is the JSON still parseable, every time?
- Length β has it quietly become twice as verbose, and therefore twice as expensive?
- Latency and cost per case β improvements that triple the bill are a trade, not a win.
The honest limits
An eval set tells you about the cases in it. It cannot tell you about the ones you did not think of. It goes stale as usage shifts. And a high score on twenty cases is not proof of a working system.
None of that is an argument against it. It is an argument for treating the set as a living thing that grows every time reality surprises you.
Try this: Open a spreadsheet and write ten inputs for a task you already use AI for, with the answer you would want beside each. Run your current prompt against all ten and count the passes. That number is your baseline β and you now have something no amount of eyeballing gives you: a way to tell whether tomorrowβs change helped.
Go deeper
Quick Quiz
Test what you just learned. Pick the best answer for each question.
Q1 You tweak a prompt and the next three answers look better. What have you learnt?
Q2 What is the minimum useful evaluation set?
Q3 When is an exact-match grader the right choice?
Q4 What is the main risk of using a model to grade another model?