Module 2 · 4 lessons
Evaluation and observability
How to tell whether answers are getting better or worse: test sets, live signals and the limits of a model grading a model.
Before you start
From this track: Modules 0 to 1. Each module uses only ideas from the ones before it.
Builds on: Observability, SLOs and error budgets
Already know these? Start with the first lesson below.
1. Building a test set
The picture
A few by hand can fool you
A fixed set of real questions, each with a check, shows what a change really does, which a few tries by hand can miss.
Scene 1 of 4 · Three tries by hand
You change the prompt and try three questions by hand: all three look better.
| Question | Before | After |
|---|---|---|
| Can I return shoes after 40 days? (highlighted) | fail | pass |
| Is the blue jacket in stock? (highlighted) | fail | pass |
| Why was I charged twice? (highlighted) | fail | pass |
- Pass rate before
- not shown yet
- Pass rate after
- not shown yet
- Three tries by hand. You change the prompt and try three questions by hand: all three look better.
- A fixed set. This small test set keeps 10 real questions, and each one has its own clear check.
- Run all of them. Run on every change, the set shows 60% passing before and 80% after.
- The one that broke. But "What is your phone number?" now fails, and none of your three hand tries found it.
- Now you try. Pick the questions you would try by hand, and compare with the full set. For example, tapping "How do I reset my password" and "Do you match lower prices" gives this: By hand: 0 better, 0 worse, 2 the same. The full set: 60% to 80%, with 1 broken. Your sample missed the broken question, so only the full set shows the whole picture.
Scene 1 of 4: Three tries by hand. You change the prompt and try three questions by hand: all three look better.
Key points
- Three questions tried by hand can all look better.
- A fixed test set gives each question a clear check.
- Run the whole set on every change, like code tests.
- Add every question that goes wrong in real use.
You cannot tell whether a (Everything sent to a language model in one request: instructions, context and the question.) change helps by trying two or three questions by hand. You need a fixed set of real questions, with a clear check for each.
A check can be exact, such as "the answer mentions the 30-day limit", or a short note on what a good answer must do.
Run the whole set on every change, the way code runs its tests, and keep adding questions that went wrong in real use.
In system design: Treat the test set as part of the code: keep it with the code, and run it before every prompt or model change.
Where it goes wrong
- A small test set is noisy. With 10 questions, one answer changing moves the score by 10 points, so a small gain may mean nothing.
- Answers vary from run to run, so one run of the set can mislead. Run it more than once before comparing two versions.
In an interview
- Say where the test questions come from, how each is checked, and when the set runs, such as before every release.
Check yourself
Two harder questions
The first uses the idea on a new case. The second asks you to judge a design.
Apply it
Judge a design
Sources and further reading (2)
First-hand sources to check this lesson against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Official docsDefine success criteria and build evaluationsAnthropic docs (one provider)Writing test cases with clear checks, and grading by code, by a person or by a model.
- Official docsOpenAI EvalsOpenAI on GitHubAn open-source tool for running a fixed set of test cases against a model.
2. Fixes that break other things
The picture
v1 passes 6 of 10 (60%); v2 passes 8 of 10 (80%). v2 fixed 3 and broke 1.
| Question | Check | v1 | v2 |
|---|---|---|---|
| 1. Can I return shoes after 40 days?fixed by v2 | Says no, since the limit is 30 days | fail | pass |
| 2. Do you ship to Canada? | Says yes, with the 5 to 7 day wait | pass | pass |
| 3. How do I reset my password? | Gives the reset-link steps | pass | pass |
| 4. Is the blue jacket in stock?fixed by v2 | Says it cannot check live stock | fail | pass |
| 5. What is your phone number?broken by v2 | Gives the support phone number | pass | fail |
| 6. Can I pay with a gift card? | Says yes | pass | pass |
| 7. Why was I charged twice?fixed by v2 | Offers the refund steps, without blame | fail | pass |
| 8. Can I change my order after it ships? | Says no, and offers a return | pass | pass |
| 9. Do you match lower prices? | Says there is no price matching | fail | fail |
| 10. Where is order 123? | Asks the user to sign in first | pass | pass |
Read one question's answers, and how each was scored
5. “What is your phone number?”
Scoring rule. The answer passes when it contains "555 0100".
“You can call support on 0800 555 0100.”
“You can reach us any time through our friendly help page, where our team is always happy to help.”
A model grader against a person, on v2's answers
They agree on 8 of 10, but the grader caught 1 of the 2 answers the person failed. They disagree on:
- “Do you ship to Canada?” The answer: “Yes. 5 to 7 days.” The grader says fail; the person says pass, since the check is: says yes, with the 5 to 7 day wait.
- “What is your phone number?” The answer: “You can reach us any time through our friendly help page, where our team is always happy to help.” The grader says pass; the person says fail, since the check is: gives the support phone number.
What this simplifies. The questions, answers and checks are made up to show the idea. Each answer is scored by a rule that looks for exact words. Such a rule is cheap and easy to read, but a right answer in other words would fail it. A real test set has hundreds of questions, and the grader here stands for a second model asked to judge each answer.
A change that fixes some answers often breaks others. Looking only at the overall score can hide this.
So compare each question between the old version and the new one, and look at what got fixed and what got broken.
In system design: Read every question a change breaks before shipping it, even when the overall score goes up.
Where it goes wrong
- A score that rises overall can hide one broken answer that matters most, such as a legal or safety question. Mark those as must-pass.
- A provider can update a model with no change in your code. Use a fixed model version, and test before you move to a new one.
In an interview
- Describe comparing old and new answers question by question, and say which failures block a release.
Check yourself
Two harder questions
The first uses the idea on a new case. The second asks you to judge a design.
Apply it
Judge a design
Sources and further reading (2)
First-hand sources to check this lesson against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Research paperBeyond Accuracy: Behavioral Testing of NLP Models with CheckList (2020)Ribeiro et al., ACLTests grouped by behaviour, so a change that breaks one kind of case shows up even when the total looks fine.
- Official docsDefine success criteria and build evaluationsAnthropic docs (one provider)Running the same cases after every change and comparing the results.
3. When a model grades a model
The picture
Check the checker
A second model can grade answers fast, but it must first be compared with a person, because it can be fooled.
Scene 1 of 4 · A person marks them
A person checks 10 answers against their checks: 8 pass and 2 fail.
| Question | Person | Grader |
|---|---|---|
| Can I return shoes after 40 days? | pass | ? |
| Do you ship to Canada? | pass | ? |
| How do I reset my password? | pass | ? |
| Is the blue jacket in stock? | pass | ? |
| What is your phone number? | fail | ? |
| Can I pay with a gift card? | pass | ? |
| Why was I charged twice? | pass | ? |
| Can I change my order after it ships? | pass | ? |
| Do you match lower prices? | fail | ? |
| Where is order 123? | pass | ? |
- Marks that agree
- not shown yet
- Bad answers the grader caught
- not shown yet
- A person marks them. A person checks 10 answers against their checks: 8 pass and 2 fail.
- A model marks them. A second model marks the same answers in seconds, far faster than a person can.
- Where they differ. They agree on 8 of 10, but the grader catches only 1 of the 2 bad answers.
- Fooled by a warm tone. It passed a friendly answer that never gave the phone number: tone won over the actual check.
- Now you try. Pick an answer, and compare the person's mark with the grader's. For example: Person: pass. Grader: fail. The answer was "Yes. 5 to 7 days." The answer was right but short, and the grader marked it down: it tends to favour longer answers.
Scene 1 of 4: A person marks them. A person checks 10 answers against their checks: 8 pass and 2 fail.
Key points
- A model grader checks many answers fast and cheaply.
- It can favour answers that sound sure, warm or long.
- Compare its marks with a person's on a sample.
- Rely on it only where its marks match people's.
Checking hundreds of answers by hand is slow, so teams often ask a second model to grade each answer against its check.
A (A second model asked to judge whether an answer passes its check. It is fast and cheap, but can be fooled.) is fast and cheap, but it can be fooled. It tends to favour answers that sound confident, longer answers, and answers in its own style.
So compare its verdicts with a person's on a sample, and trust it only for checks where it agrees with people.
In system design: Use a model grader to check more answers, but first measure how often it agrees with people.
Where it goes wrong
- Shown two answers, a grader often favours the first one. Swap the order, grade again, and count only verdicts that agree.
- A grader can favour answers written in its own style. Check it against a person's marks before you rely on it.
In an interview
- Say how you would check a model grader: compare it with people on a sample before trusting its scores.
Check yourself
Two harder questions
The first uses the idea on a new case. The second asks you to judge a design.
Apply it
Judge a design
Sources and further reading (2)
First-hand sources to check this lesson against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Research paperJudging LLM-as-a-Judge with MT-Bench and Chatbot Arena (2023)Zheng et al., NeurIPSMeasures how often a model grader agrees with people, and its biases toward position, length and its own answers.
- Research paperG-Eval: NLG Evaluation using GPT-4 with Better Human Alignment (2023)Liu et al., EMNLPA grading method that gives the grader steps to follow, and how well it matched people.
4. Watching quality in real use
The picture
Watch real chats, not only tests
Signals from real traffic, such as how often a person must take over, show a quality drop that a test set missed.
Scene 1 of 4 · A normal week
For five days, about 5% of chats are handed to a person to finish.
- Two days before
- not shown yet
- Two days from
- not shown yet
- A normal week. For five days, about 5% of chats are handed to a person to finish.
- A new release. On day 6, release v2.4 ships, with a new prompt and a new model.
- The jump. From that day, about 12% of chats need a person, up from 5%: check that release first.
- Logs to find out why. Each logged request keeps its prompt, chunks, answer and model, with private fields hidden.
- Now you try. Pick a release, and compare handoffs in the two days before it and the two days from it. For example: Before: 11.5%. After: 12.5%. No real change around this release, so it is probably not the cause.
Scene 1 of 4: A normal week. For five days, about 5% of chats are handed to a person to finish.
Key points
- A test set cannot cover everything real users ask.
- Watch thumbs down, repeated questions and handoffs to a person.
- A sudden jump points at whatever changed that day.
- Logs need limits: they hold prompts with personal data.
A test set cannot cover everything users ask, so also watch signals from real traffic.
Useful signals include thumbs up or down, how often users ask the same thing again, and how often a person has to take over.
Log each request with its prompt, the (A short passage cut from a longer document, so it can be turned into an embedding and found on its own.) it used, the answer and the model. Prompts often hold personal data, so limit who can read the logs, hide private fields and delete old logs.
In system design: Watch quality signals next to (How long one request takes, from sending it to getting the answer.) and cost, and alert on sudden changes, as you would for errors.
Where it goes wrong
- Few users press thumbs up or down, and unhappy ones press more often. Read the votes as a signal, not a score.
- Logs full of prompts become a store of personal data. Limit who can read them, hide private fields and delete old ones.
In an interview
- Name the quality signals you would chart beside latency and cost, and the change that would raise an alert.
Check yourself
Two harder questions
The first uses the idea on a new case. The second asks you to judge a design.
Apply it
Judge a design
Sources and further reading (2)
First-hand sources to check this lesson against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Official docsSemantic conventions for generative AI systemsOpenTelemetry (marked as still in development)A shared way to record each model call: model, token counts, and timing.
- Official docsRules of Machine LearningGoogle for DevelopersGoogle’s advice on watching a model in use, including logging what it saw when it answered.