Lesson 5.1 · 7 min read · about 50 min to master at a very slow pace
Why Evals Come First
An eval is a test set plus a way to score outputs. Why "it looks good on five examples" fails in client work, how to build a first eval set of 50–200 cases, and how evals turn prompt changes into measurable decisions.
The vibe check problem
LLM output is varied and fluent, so it looks right far more often than it is right. A developer tries five questions, tweaks the prompt, tries five more, and ships. A week later the client reports that the bot now gets refund questions wrong, because the tweak that fixed one case broke three others nobody re-tested.
An eval is the fix: a fixed set of test cases, run automatically after every change, with a score you can compare.
What goes in an eval set
- Inputs: real questions or tasks, ideally from the client (support tickets, search logs, emails).
- Expected outputs or criteria: the right answer, the right source document, or a rubric ("must mention the 30-day limit; must not promise a refund").
- Tags: topic, difficulty, type (factual, multi-step, should-refuse), so you can see where it fails.
Cover the common cases, the edge cases you know about, and questions the system should refuse.
How big?
Start with 50–100 cases; that is enough to catch large regressions and takes a day to build with the client. Grow it to a few hundred as failures appear in production: every bug report becomes a new case. Small sets are noisy: with 50 cases, one case is 2 percentage points, so a change from 84% to 86% may be chance.
Worked example
Accuracy on cases: , so the true accuracy is roughly (two standard errors). On 400 cases it is . Do not celebrate a 2-point gain on 100 cases.
Evals drive the whole project
- Agree the eval set and a target score with the client before building. It becomes the acceptance test.
- Every change (prompt, chunk size, model, reranker) is run against it. Keep what improves the score.
- Before each release, run it as a regression test. A drop blocks the release.
Why clients care
"Our assistant answers 91% of your 300 test questions correctly with the right source, and refuses 95% of the out-of-scope ones" is a statement a client can sign off. "It works well" is not.
Stuck? Common doubts
Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.
First passWhere do I get expected answers if the client is busy?
Draft them yourself from the documents, or have an LLM draft question–answer pairs from chunks, then ask a domain expert at the client to review rather than write them. Reviewing 100 drafts takes an hour; writing them takes a week. Never skip the expert review: unchecked synthetic answers bake in errors.
Going deeperShould the eval set ever change?
Add cases continually, but keep a frozen core so scores stay comparable over time. When you add cases, re-run the current version so the new baseline is clear. Remove a case only if it was wrong, and record why.
Cheatsheet
What an eval is
Noise in a small eval
Eval set recipe
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.