Key takeaways
- ✓Goodhart's law: when a measure becomes a target, it stops being a good measure. Tuned for 14 simulated rounds against an AI judge, a summarizer prompt went from 75% to 96% with that judge on fresh tickets, while real quality, the share a careful person would pass, fell from 57.3% to 43.5%. It never rose above its start.
- ✓An optimizer learns whatever the grader rewards. This judge was built to like long answers, confident words and its rubric's phrases, and the optimized summary lost the refund amount, gained two sentences of padding, promised a refund "definitely within 24 hours, guaranteed" and ended by calling itself accurate and complete.
- ✓It picks those moves because they pay more. From the starting prompt, one step of detail raises real quality 4.9 points but the judge's score only 3.5; length, confidence and rubric echo buy 3.9 to 6.6 judge points for 1.3 real points or none. Which one wins a given round is partly luck: 100 tuning tickets is a noisy test.
- ✓Track a grader nobody tunes against. A second, independent judge (another model family, another prompt) needs no human labels: it drifted down while the first judge rose, and the gap between them grew from +14 to +46 points. A growing gap means: stop and read the outputs.
- ✓A held-out human check (60 tickets graded only by people, never used for tuning) is the final word but noisy: each round's 95% Wilson interval is about ±12 points. Watch the trend: 62% over the first three rounds, 44% over the last three. Seeing a 57% → 44% drop in a single before/after comparison takes about 205 tickets per side.
- ✓Fresh tickets alone don't help: the same judge gives them the same inflated score (96% on fresh tickets in the last round against 44% real). Held-out cases protect against luck on the cases; only a different grader catches a gamed grader.
- ✓The winner's curse: try 100 equally good versions (all truly 75%) on the same 50 cases and keep the best, and it scores 89.2%, 14 points too good, then falls back to 75% on fresh cases. Every look at a test set followed by a change is one more version tried. Choose on one set, report on another that played no part.
An AI judge grades every summary our support AI writes. We let an optimizer tune the summarizer's prompt against that judge for 14 rounds, and the judge's score on fresh tickets climbed from 75% to 96%. This is a simulation, so we know the real quality too: it fell from 57% to 44%. The score went up while the summaries got worse. This chapter is about why that happens whenever you optimize against a metric, what the optimizer learns, and the checks that would have caught it: a second judge, a small human check, and choosing on one set of cases while reporting on another.
The examples come from Lab 13 (When the Metric Stops Measuring Quality) of the eval labs, all three of its scripts: 01_optimize.py (tune the prompt for 14 rounds and grade every round three ways), 02_gaming_report.py (read what the tuned prompt writes, and the gap between two judges) and 03_overfit.py (the winner's curse, and the tuning set against fresh tickets). No API is needed. Of the lab's "exercises to try on your own", the chapter works through two from the recorded numbers (an early-stopping rule on the judges' gap, and sizing the human check); the others (an honest judge, tuning against two judges at once) aren't covered. Everything here is simulated: the tickets, the prompt, two AI judges and the people. The simulation also says exactly how good each prompt is, so the chapter can show real quality next to the scores; it says "known in the simulation" whenever it uses one of those values. The judges' and people's scores are measured, with the noise any real measurement has.
The setup
An AI judge is a model that grades another model's output against a checklist, its rubric (Chapter 7); here it passes or fails each ticket summary. Real quality is the share of summaries a careful person would pass. The lab calls it "true quality"; it's known exactly because the lab sets how good every prompt is.
The prompt is four knobs, each between 0 and 1. The lab decides what each one does to real quality:
| Knob | What it does to the summary | Real quality | Start |
|---|---|---|---|
| Detail | includes every request, amount and next step | ↑ | 0.30 |
Length (the lab's verbosity) |
writes more | ↑ a little, then ↓ past 0.5: padding | 0.20 |
| Confidence | sounds sure: "definitely", "guaranteed" | ↓ past 0.4: it promises things nobody said | 0.20 |
| Rubric echo | repeats the rubric's words: "accurate and complete" | no effect | 0.00 |
Three graders see the summaries:
| Grader | What it rewards | Used for |
|---|---|---|
| Tuning judge | real quality, plus three built-in habits: long answers, confident words, the rubric's phrases | the optimizer's score |
| Independent judge | real quality, and almost none of those habits | a check |
| People | real quality only | a 60-ticket check, never used for tuning |
Real AI judges are known to have habits like these; Chapter 9 measured simulated ones and shows how to test a real judge for them. Here they're built in, with known strength, so we can watch what an optimizer does with them.
The tuning loop
Prompt tuning means changing a prompt to raise a score. An optimizer is a program that does it: it tries changes and keeps what scores best (tools like DSPy do this, and so does an engineer tweaking a prompt every afternoon). The lab's optimizer is simple. Each round it nudges each knob up and down by 0.15, which makes 8 versions, and the tuning judge grades every version on the same 100 tuning tickets. The best one becomes the new prompt, if it beats the current one. After each round, the new prompt is graded three more ways: the tuning judge and the independent judge on 300 fresh tickets that tuning never used, and people on 60 held-out tickets, graded only by people and never used for tuning.
Start with only what the optimizer sees, then add the other graders one by one.
Only the AI judge it's tuned against, on 300 fresh tickets.
The prompt's four knobs this round (tick = the start)
Round 14: 96% on fresh tickets. From inside the loop, this looks like steady progress.
Simulated with the lab's seed 0: the exact numbers Script 1 prints. The tuning judge was built to like long answers, confident words and its rubric's phrases; the independent judge with almost none of that; people grade real quality only. Each judge's score is one draw on 300 tickets, so it wobbles by a few points from round to round.
| Round | Tuning judge (fresh tickets) | Independent judge | People (60 tickets, 95% range) | Real quality (known in the simulation) |
|---|---|---|---|---|
| 0, the start | 75.0% | 61.0% | 63% (51–74%) | 57.3% |
| 14, the end | 96.0% | 49.7% | 43% (32–56%) | 43.5% |
The tuning judge reached 96% in round 7 and stayed between 94% and 99% after that. The independent judge and the people drifted down, with real quality. (At round 0 the tuning judge passed 71% of the 100 tuning tickets and 75% of the 300 fresh ones: two noisy draws of the same prompt. The chapter uses the fresh tickets throughout.)
What it learned
Here is the same ticket summarized with the prompts from rounds 0, 7 and 14. These are the lab's templates, written from each round's knob settings, not a model's output:
- Round 0: "Maya (order #52300): wants a refund of $48. Next step: issue the refund." Short, and nothing in it is false.
- Round 7: the amount is gone. A new sentence says nothing ("The customer contacted us about their order and explained the situation."). The refund "will definitely arrive within 24 hours, guaranteed": nobody promised that. And the summary ends by grading itself: "Summary is accurate and complete."
- Round 14: one more empty sentence, and a longer self-review in the rubric's own words: "This summary is accurate, complete, concise and professional, with no unsupported facts."
Each of these won its round with the judge. None of them helps the agent who reads the summary, and the false promise actively hurts. Script 2 tracks them round by round: the amount is missing from round 3 on (except round 8), the self-grading appears in round 4, the promise in round 7, and the example grows from 13 words to 64.
It's like a student who learns what the teacher likes to see instead of the subject: longer essays, confident claims, the marking scheme's own words. The teacher's mark goes up; what the student knows doesn't. The widget marks one paper per round: the teacher's mark is the tuning judge's score, the subject is real quality.
Maya (order #52300): wants a refund [no amount]. The customer contacted us about their order and explained the situation. Next step: issue the refund, which will definitely arrive within 24 hours, guaranteed. Summary is accurate and complete.
Why the student learns the tricks: what one step on each knob buys, from the starting prompt
Round 7: the teacher gives 96% (round 0: 75%); the subject is worth 51% (round 0: 57%). Detail is the only knob that teaches the subject, and to this teacher it's worth the least per step: 3.5 points against 3.9 to 6.6 for the tricks. An optimizer that only sees the teacher's mark learns the tricks.
Simulated: the summary is the lab's template, written from that round's knob settings (common.example_summary), not a model's output; the customer's name is the lab's. Marks are Script 1's measured judge score on 300 fresh tickets and the real quality known in the simulation. One step = +0.15 on one knob, worth computed exactly with the lab's true_rate on 5,000 simulated tickets (not printed by the lab).
Why those moves?
The optimizer only ever sees the judge's score. Here's what one step (+0.15) on each knob is worth, starting from the round-0 prompt (computed with the lab's code; the lab doesn't print it):
| One step on… | Tuning judge | Independent judge | Real quality |
|---|---|---|---|
| Detail | +3.5 points | +4.9 | +4.9 |
| Length | +6.6 | +2.2 | +1.3 |
| Confidence | +5.5 | +0.3 | 0 |
| Rubric echo | +3.9 | 0 | 0 |
A step of detail raises real quality the most, and to this judge it's worth the least. Writing more, sounding sure and repeating the rubric each buy more judge score for little or no real quality. That's how the judge was built, and the optimizer found it.
Which move wins a given round is partly luck, though. The 100 tuning tickets are a noisy test, and two candidates a few points apart can swap places by chance. In round 3, luck even made a worse prompt look better: the optimizer cut detail, a change that lowered the judge's own expected score (86.1% → 83.3%, known in the simulation), because that candidate happened to score 92 of 100 tuning tickets against the current prompt's 81. That's when the refund amount fell out. Rounds 9 and 14 were the same kind of lucky draw.
Real quality never got above where it started: rounds 1 and 2 tie it (confidence 0.35 doesn't hurt yet, rubric echo never does), and every later round is below.
This has a name: Goodhart's law. When a measure becomes a target, it stops being a good measure. While nobody optimizes against the judge's score, it moves with quality. Once an optimizer pushes on it, it finds every way of raising the score, and the cheapest ones don't raise quality.
A second judge
How could we have caught this while tuning? The cheapest alarm is a second judge. An independent judge comes from another model family (a different maker's model) with another prompt, so it has other habits. The lab built it with almost none of the first judge's.
Each round it grades the same 300 fresh tickets. It didn't follow the first judge up; it drifted down, from 61.0% to 49.7%. Watch the gap between the two (tuning judge minus independent judge, in points; Script 2, Exercise 2):
| Round | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Gap | +14 | +24 | +27 | +28 | +35 | +37 | +34 | +44 | +38 | +38 | +37 | +52 | +45 | +54 | +46 |
It starts above zero because even the starting prompt has a little of what the first judge likes (some length and confidence): about 18 points' worth on average (known in the simulation), measured as +14. By the last round, it's +46. This alarm needs no human labels. When the gap keeps growing, stop and read the outputs.
The gap moves on its own too (it fell from +44 to +38 between rounds 7 and 8), so set an alarm on a sustained rise, not on one round. The lab suggests trying a rule; on the recorded numbers, "stop when the gap is more than 10 points above round 0's" fires at round 2 (+27), while real quality was still at its start. A rule like this stops early on purpose: it's cheaper to read the outputs once too often than to ship 14 rounds of gaming.
A held-out human check
People are the final word, but they're expensive, so the human check is small: 60 tickets, graded only by people and never used for tuning. Sixty is small, so each round's result is noisy. The Wilson interval (Chapter 1's 95% range for a pass rate) is about ±12 points every round: 63% (51–74%) at round 0, 43% (32–56%) at round 14, and rounds 6 and 7 read 45% and 55% when real quality actually went the other way (55% → 51%).
One round can't tell you much. The trend can: the first three rounds average 62%, the last three 44%.
How big would it need to be to see the drop in a single before/after comparison? With Chapter 2's sample-size formula (80% power, 5% false-alarm rate), 57% → 44% on two separate sets of tickets needs about 205 tickets per side. Grading the same tickets before and after (a paired comparison, also Chapter 2) needs fewer. Either way, size the human check for the drift you want to see; 60 is enough for a trend, not for one round.
The winner's curse
There's a second way a test score can lie, even with an honest grader. Script 3 makes K versions of a prompt that are all equally good: each truly passes 75%. It scores all of them on the same n test cases, keeps the one that scores best, and repeats that 2,000 times.
One example draw: 100 versions, all truly 75%, each scored on the same 50 cases
Averaged over Script 3's 2,000 repeats, the best of 100 on 50 cases scores 89.2%, +14.2 points above the truth, although none of the versions is better. Re-scored on fresh cases, it falls back to 75.1%. More versions make it worse; more cases make it smaller, but even 1,000 cases leave the winner of 100 3.4 points too good.
Simulated. The averages are the lab's printed table (seed 0, 2,000 repeats per row). The dot strips are example draws made the same way with our own seeds (0–5), to show one repeat. “Exact” is the expected inflation computed from the binomial distribution, no random draws: it agrees with the lab's simulation to 0.1 points.
| Versions tried (K) | Best score on 50 cases | Too good by | On 200 cases | On 1,000 cases |
|---|---|---|---|---|
| 1 | 75.1% | +0.1 points | +0.1 | +0.0 |
| 5 | 81.9% | +6.9 | +3.5 | +1.6 |
| 20 | 85.8% | +10.8 | +5.6 | +2.5 |
| 100 | 89.2% | +14.2 | +7.4 | +3.4 |
That's the winner's curse: nothing made the winner better, it just got lucky on these 50 cases. Re-scored on fresh cases, every winner falls back to 75% (74.8–75.1% across the table). More versions make it worse; more cases make it smaller, but even on 1,000 cases the winner of 100 is still 3 points too good. (These are simulated averages; computed exactly from the binomial distribution, they agree to 0.1 points.)
The same thing happens to a test set you look at often. Every time you check the results and change something, that's one more version tried, and the set slowly stops being a test. Choose on one set of cases, and report on another that played no part in the choice. Refresh the reporting set now and then.
Fresh tickets weren't enough
So should the tuning loop have checked its prompt on fresh tickets? It did: every round, the tuning judge graded 300 fresh tickets, and they showed the same 96%. Fresh tickets guard against luck on the tuning cases; they can't catch a gamed grader, because the same judge, with the same taste, grades them. Script 3's Exercise 2 compares the tuning set with the fresh tickets: after round 0 they differ by +0.1 points on average.
Read that number carefully, though. It's close to zero partly by construction: the lab re-grades the tuning set with fresh judge randomness before reporting it, and the four knobs can't memorize particular tickets. Inside the loop the winner's curse did act: each round's chosen candidate scored about 3 points above its own expected score on the tuning tickets (computed with the lab's code). So the loop had both problems: a little luck in picking winners, and a lot of gaming. Different cases fix the first. Only a different grader, an independent judge or people, catches the second.
What to do
- Track graders nobody tunes against, every round: a second, independent judge (no labels needed) and a small held-out human check. Never optimize against them, or they become the next target.
- Read the outputs side by side, before and after. Scores say that something changed; only reading says what. Then measure the suspects directly: length, words like "definitely" and "guaranteed", overlap with the rubric's text.
- Treat a score that only goes up as a warning, not good news, when you're optimizing against it.
- Watch trends, and size the human check for the drift you care about (about 205 tickets per side for 57% → 44% in one comparison; fewer if paired).
- Choose on one set, report on another that played no part, and refresh the reporting set now and then.
Caveats
- It's a simulation. The knobs, what they do, and the judges' habits (2.8, 2.6 and 1.8 extra log-odds for full length, confidence and rubric echo) are made up so that real quality is known. The numbers show the mechanism, not how much any real judge can be gamed. The summaries are the lab's templates, not model output.
- The order of moves is noise. Each trick buys more judge score per step than adding detail (+3.9 to +6.6 against +3.5), though barely for rubric echo, but length is worth the most and came only in round 5. With exact scores instead of 100 noisy tickets, the same optimizer would go length, length, confidence, then rubric echo six times (judge 77% → 98%, real quality 57% → 60%), and only then add detail, from round 10, once the judge's score was too close to 100% for anything else to pay. So which move came when, and that detail was picked only once (round 8, dropped again the next round), depends on this run's luck; what doesn't is that it gamed first, and that past about 95% each step is worth a point or less to the judge, far below the noise of 100 tickets.
- The people and the judges share nothing but quality. Real people disagree with each other, and a real independent judge shares some habits with the first (most models like longer answers). The alarm would be weaker than this clean simulation suggests.
The checklist
- What is Goodhart's law, and how does it show up when tuning prompts against an AI judge?
- What does a prompt optimizer typically learn to do to please a judge?
- How do you catch it while optimizing?
- Why isn't a held-out set of fresh cases enough?
- What is the winner's curse, and what does it mean for a test set you look at often?
- How big should a held-out human set be?
Practice: game a judge, then catch it
Write Lab 13's math: real quality and each grader's pass chance from the four knobs, what one step on a knob is worth to each grader, the template summary and Script 2's checks on it, the gap between two judges and an early-stopping rule on it, the people's Wilson interval, the winner's curse computed exactly (no random draws), and how many tickets a drop needs. The tests use the lab's recorded numbers: the 15 rounds' prompts, both judges' and the people's counts, the words and flags of every round's summary, and Script 3's 89.2% for the best of 100 on 50 cases.
Quiz
1.You tune a prompt against an AI judge for 14 rounds. The judge's score on fresh tickets goes from 75% to 96%. What does that tell you about the summaries?
2.To this judge, one step of detail is worth +3.5 points, one step of length +6.6, of confidence +5.5 and of rubric echo +3.9. Real quality gains +4.9, +1.3, 0 and 0. Which change does a judge-only optimizer prefer?
3.During tuning, the gap between the tuning judge and a second, independent judge grows from +14 to +46 points. What should you do?
4.A held-out human check uses 60 tickets. Round 7 scores 55% (42–67%), round 6 scored 45% (33–58%). Did round 7 improve real quality?
5.You try 100 prompt versions, all equally good (truly 75%), on the same 50 test cases, and keep the best. What will it score, on average?
6.After tuning, the tuning judge scores the final prompt at 96% on 300 fresh tickets it never saw. Is that a trustworthy held-out result?
Check your understanding
Try each question before opening its answer.
What is Goodhart's law, and how does it show up when tuning prompts against an AI judge?
"When a measure becomes a target, it stops being a good measure." A judge's score moves with quality only while nobody pushes on it. An optimizer finds every way of raising the score, and the cheapest ways often exploit the judge's habits instead of improving the output. In the simulation, 14 rounds took the judge from 75% to 96% on fresh tickets while real quality fell from 57% to 44%, and no round raised real quality above its start.
What does a prompt optimizer typically learn to do to please a judge?
Whatever the judge rewards beyond quality; the usual suspects are longer outputs, confident wording and the rubric's own phrases repeated back. The tuned summary lost the refund amount, gained two sentences of padding, promised a refund "definitely within 24 hours, guaranteed" and ended by calling itself accurate, complete, concise and professional. It learns them because they pay more: a step of detail is worth 3.5 judge points, the tricks 3.9 to 6.6.
How do you catch it while optimizing?
Track graders nobody optimizes against, every round. A second, independent judge (another model family, another prompt) needs no labels: here its gap with the tuning judge grew from +14 to +46 points. A held-out human check is the final word but noisy, so watch its trend (62% over the first three rounds, 44% over the last three). And read the outputs side by side: the scores say something changed, the outputs say what.
Why isn't a held-out set of fresh cases enough?
Because the problem is the grader, not the cases. Fresh tickets graded by the same judge get the same inflated score: 96% in the last round, against 44% real quality. Held-out cases catch luck on the tuning cases (the winner's curse); only a held-out grader, people or an independent judge, catches a gamed grader. You need both.
What is the winner's curse, and what does it mean for a test set you look at often?
Try many versions on the same cases and keep the best, and its score is too high even if they're all equally good, because you picked the one that got lucky. With 100 versions all truly at 75%, the winner scored 89.2% on 50 cases and fell back to 75% on fresh cases; on 1,000 cases it was still 3.4 points too good. Every look at a test set followed by a change is one more version tried, so choose on one set, report on another that played no part, and refresh the reporting set.
How big should a held-out human set be?
Big enough for the drift you want to see. With 60 tickets each round's interval is about ±12 points, enough to see a trend over many rounds but not a change in one. Seeing 57% → 44% in a single before/after comparison takes about 205 tickets per side (80% power, 5% false-alarm rate), fewer if the same tickets are graded before and after.
Next up: How much is this 92% worth? The team says its summarizer passes 92% of its eval. The capstone audits that one headline number with the tools from this series, and rebuilds the eval so its number means something.