Topic 3 of 6 · 6 min read
Measuring quality before launch
Goal: Design a pre-launch quality measurement with test set size, grading method and run count, and spot a sample too small to support its claim.
Measure quality before launch with a fixed set of real cases, a written grading guide and several runs per case; a handful of tries you liked is a demo, not a measurement.
Check yourself · 1 of 3
Why run each test case several times instead of once?
Why it matters
AI output varies. The same input can pass on one run and fail on the next. People also remember the good answers. Without a fixed set and a rule for grading, "it works" means "it worked when I tried it".
The parts
- A golden test set. A fixed list of real inputs, each with the expected outcome or a note on what a pass looks like. Take them from real tickets, emails or queries, and include the hard and odd ones, not only typical ones. Keep it unchanged between versions so scores compare. Keep some cases out of any prompt or training so you are not testing on what the system has seen.
- A grading method. Humans with a written guide are the reference: each case gets a pass or fail and a reason, and two graders should agree most of the time. When there are too many cases, an LLM judge can grade the rest. The Zheng et al. paper on judges shows they can match human preference well but have biases, such as favouring longer answers. So check the judge against human grades on a sample before trusting it.
- Several runs per input. Run each case more than once, for example five times, and report how often it passes. A case that passes 2 times out of 5 is not a pass.
- Enough cases. With 20 cases, one case moves the score by 5 points, so a change from 80% to 85% is a single case. Say how many cases a claim rests on, and be careful with differences smaller than what one or two cases cause.
A small plan
Cases: 200 real tickets, 40 of them hard
Grading: two human graders per case, guide v2; judge model checked on 50
Runs: 5 per case
Report: pass rate per run, cases that pass 5/5, 3-4/5, under 3/5
Before and after
Before: "I tried it on 10 prompts and it got 9 right, so it is 90% accurate."
After: "On 200 real tickets, graded by two people, 168 passed on all five runs (84%), 21 passed on some runs, and 11 failed every run. The 10-prompt check was too small: one case equals 10 points."
What goes wrong
- Picking test cases after seeing what the model does well.
- Running each case once and calling a lucky run a pass.
- Using an LLM judge that nobody checked against human grades.
- Editing the prompt until the test set passes, then reporting that score as expected real-world quality.
- Reporting a gain from a sample so small that one case explains it.
Examples
A pre-launch plan
| Item | Choice |
|---|---|
| Cases | 200 real tickets, 40 hard |
| Graders | Two people, guide v2 |
| Judge | LLM judge, checked on 50 human-graded cases |
| Runs | 5 per case |
| Report | Pass rate, plus how many cases fail on some runs |
Spotting a thin claim
"Version B scored 85% and version A scored 80%, so B is better." With 20 cases, that is one case. Ask for more cases or more runs before choosing.
Key points
- Use a fixed golden set of real inputs, including hard ones, and keep it unchanged between versions.
- Grade with a written guide; check any LLM judge against human grades on a sample first.
- Run each case several times, because outputs vary and one pass can be luck.
- State how many cases a claim rests on; with few cases, one case moves the score a lot.
- Tuning the prompt on the test set makes the score optimistic, so hold some cases back.
Common mistakes
- Choosing test cases after seeing which ones the model passes.
- Running each input once and treating a pass as stable.
- Trusting an LLM judge without comparing it to people.
- Claiming a gain that one or two cases explain.
Check yourself · 2 of 3
A team scored 18 of 20 test cases and says the feature is 90% accurate. What is the best reading?
Check yourself · 3 of 3
A team wants an LLM to grade 5,000 outputs. What should they do first?
Practice items, not counted towards your mastery.
Start here
- Applied LLMs: What we learned from a year of building with LLMs (opens in a new tab)ArticleFree
Practitioners on evals, regression sets and keeping humans in the loop when shipping LLM features.
- Your AI product needs evals (Hamel Husain) (opens in a new tab)ArticleFree
How to build test cases from real failures and measure them before and after each change.
- People + AI Guidebook (Google PAIR) (opens in a new tab)ArticleFree
Product guidance on errors, trust and setting expectations for AI features.
More for this topic
- Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (Zheng et al.) (opens in a new tab)PaperFree
Reports how closely LLM judges agree with people and which biases to check for.
- Develop test cases (Claude docs) (opens in a new tab)DocsFree
Practical guidance on building test cases and choosing code, human or LLM grading.