Sub topic 14
When Optimizing for the Judge Stops Improving Quality
This chapter assumes you can read Python, know what an evaluation set is, and have already met judge rubrics, verbosity bias and human-agreement checks from earlier chapters. Here the question is what happens after you have a judge you mostly trust and start improving your system against it.
Goodhart's law applied to judges
Goodhart's law says that when a measure becomes a target, it stops being a good measure. An LLM judge is a proxy for human judgment, so it can be gamed like any other proxy. Early on, a higher judge score usually means a better answer. Once you push hard on the score, you start finding changes that raise the score without helping users.
The proxy and the real goal share a cause (answer quality) but also have separate parts. The judge responds to quality and also to things like length, confident tone, formatting and phrasing it happens to like. Optimization pressure finds whichever of these is cheapest to increase. Quality is often not the cheapest.
How the gap opens
The same failure appears through several routes:
| Route | What you do | What the judge rewards instead of quality |
|---|---|---|
| Prompt tuning | Edit your system prompt until the judge score rises | Phrases and structure the judge prefers |
| Best-of-n selection | Generate many candidates and keep the highest-scored one | The judge's biggest blind spot among n tries |
| Training on judge scores | Use the judge as a reward signal | Any consistent bias, amplified over many updates |
| Reusing one eval set | Try many variants, keep what scores best on the same set | Luck and quirks of those specific examples |
| Rubric leakage | Put the rubric text into the generator's prompt | Rubric wording echoed back without substance |
The last two need explanation. If you compare 50 prompt variants on 100 examples and keep the winner, part of the winner's margin is noise that happened to favor it. That is ordinary overfitting to the evaluation set, and it happens even with a perfect judge. Judge bias is a second, separate problem that stacks on top.
A simulation of the divergence
The following program models each candidate answer with a true quality q and a padding amount p. The judge scores q + 1.5 * p, because it is partly fooled by padding. The real value to a user is q - p, because padding wastes their time. Selecting the best of n candidates by judge score shows what heavier optimization does.
import random
from statistics import mean
def best_of_n(n, trials=2000, seed=0):
rng = random.Random(seed)
judge_scores, true_scores = [], []
for _ in range(trials):
candidates = []
for _ in range(n):
q = rng.gauss(0, 1) # real quality
p = rng.gauss(0, 1) # padding the judge over-rewards
candidates.append((q + 1.5 * p, q - p))
judge, true = max(candidates) # keep the highest judge score
judge_scores.append(judge)
true_scores.append(true)
return mean(judge_scores), mean(true_scores)
for n in (1, 4, 16, 64):
judge, true = best_of_n(n)
print(f"n={n:3d} judge={judge:6.2f} true={true:6.2f}")With n=1 both averages sit near zero, since nothing is selected. As n grows, the judge column climbs steadily. The true column does not climb with it. It drifts below zero, because the highest-scoring candidates are increasingly the padded ones. A dashboard that tracks only the judge column would report steady progress while users get worse answers.
The numbers are artificial, but the shape is the point. The judge's score keeps rising after it has stopped tracking what you care about.
What the loop looks like
The key element is the human check on examples the optimization has not seen. Without it, the loop has no way to notice that it has left the region where the judge is reliable.
Detecting divergence
You rarely see Goodharting in the judge score itself. You see it by comparing the judge against something it does not control.
- Held-out human audit. Every few rounds of tuning, draw a fresh random sample of outputs, have people label them, and compute agreement with the judge on that sample. Compare it to the agreement you measured when you first validated the judge. A drop is a warning. Use a fresh sample each time, because reusing one lets you overfit to it too.
- Track side statistics. Log mean output length, formatting markers (bullet counts, headers), hedging phrases and refusal rate next to the judge score. If the score rises while length climbs by 40%, suspect verbosity gaming before you celebrate.
- Read the top scorers. Sort outputs by judge score and read the top ten and the biggest recent gainers. Gaming is often obvious to a person in a few minutes: repeated boilerplate, restated questions, or confident filler.
- Check a second signal. Compare against a deterministic check, a different judge family, or a downstream business metric such as task completion or user thumbs-up. If the judge says "better" and all the others say "same", the judge is the odd one out.
- Use adversarial probes. Write a few deliberately bad answers that exploit known judge preferences, such as a long, polite, wrong answer. A healthy judge scores them low. If a probe scores high, you have found an exploit that optimization will also find.
Reducing the risk
No single fix removes the problem, but these habits limit it.
- Split your data by role. Use a dev set for iteration and a separate test set you look at rarely. Refresh the test set when you have used it many times.
- Cap optimization pressure. Prefer small best-of-n values and few tuning rounds over exhaustive search. The simulation shows the damage grows with
n. - Use more than one judge or rubric. An answer has to please several graders with different quirks, which is harder to game than one. This helps most when the judges are from different model families.
- Remove the judge's easy levers. Add a length-controlled comparison, strip formatting before judging, or instruct the judge to ignore style. Then verify that the change worked, since instructions alone do not reliably remove a bias.
- Keep the rubric out of the generator. Do not paste the grading criteria into the prompt of the system being graded unless that is your intended product behavior.
- Report the human-validated number. In reports, state the judge's most recent agreement with humans next to the score, so readers know how far to trust it.
Judge improvement is not user improvement
Even when the judge stays aligned with human raters, it is aligned with the rubric, and the rubric is a narrow slice of what users want. A system can reach near-perfect faithfulness scores and still be unhelpful, slow or tedious to read. Keep a short list of outcome measures that sit outside the judge, such as resolution rate, edit distance between the model's draft and what users send, or escalation to a human. Use the judge for fast iteration and these measures for the final decision.
Exercise
Your team tunes a support-bot prompt for six rounds against the same 200-example dev set, scored by one LLM judge. The judge's mean score rises from 3.4 to 4.5, and mean answer length rises from 90 to 210 words. A fresh human-labeled sample of 100 answers shows judge-human agreement has fallen from kappa 0.62 at validation to 0.35. Name the likely problem, and list three actions you would take.
Show answer
The likely problem is Goodharting: the prompt has been optimized toward the judge's preferences, most visibly verbosity, so the score no longer tracks quality. The falling kappa on fresh data confirms the judge is less reliable on the new outputs, and reusing one dev set for six rounds adds overfitting to that set. Actions: (1) stop tuning and read the highest-scoring answers to confirm what is being rewarded; (2) revise the rubric or judge prompt to control for length (for example, penalize padding, or compare at matched length) and re-validate against human labels; (3) evaluate the prompt versions on a fresh test set with human labels, and add a second judge or outcome metric such as resolution rate before choosing which version ships.