CCDV-F · Eval, Testing, and Debugging
Designing an evaluation, golden set, calibrated LLM-as-judge and regression
A team changes the prompt of its support assistant, tries three conversations by hand and they look fine. A week later, customers complain that answers are longer and less precise. Nobody measured anything: the “evaluation” was looking. An evaluation (eval) is what turns “it seems better” into a number you can compare before and after every change.
Start from the quality you want to measure
Before building anything, write in one sentence what “good” means for this component: “the summary does not invent facts”, “the classifier routes each ticket to the right team”, “the agent does not take actions outside its scope”. The metric comes out of that sentence. An evaluation that measures something else (say, response length) is precise and useless.
Golden set
A golden set is a fixed collection of cases with the expected answer or criterion, built and reviewed by people. To be worth anything:
- cover normal cases, edge cases and the failures you already had (every production bug becomes a case);
- keep it separate from the examples you put in the prompt, or you are measuring memory;
- version it and do not touch it to make a change “pass”: if the set changes, earlier numbers are no longer comparable.
Behavioral checks and an LLM judge
What can be checked with code is checked with code: that the JSON validates against the schema, that the right tool was called, that no fact appears that was not in the source. These behavioral checks are cheap, repeatable and do not argue.
For what cannot be checked with code (tone, summary faithfulness, usefulness), you use an LLM-as-judge: another model scores the outputs against a rubric. An uncalibrated judge is just one more opinion. To calibrate it:
- Have people label a sample with the same rubric.
- Run the judge on that sample and measure how much it agrees with the people (percent agreement, or a coefficient such as kappa).
- If agreement is low, adjust the rubric (concrete criteria, a short scale, for example pass or fail with a reason) and repeat.
- Check known biases: favoring longer answers, favoring the first option, favoring outputs from its own model.
Once calibrated, the judge is checked against people again from time to time, because the distribution of outputs shifts.
Regression tests
A regression test runs the same golden set before and after a change (prompt, model, tool) and compares. It runs on every change, ideally in CI, and a change that lowers a key metric does not ship. It matters most when migrating models: behavior changes between versions even with an identical prompt.
Defensible metrics
- In a classification with very uneven classes, accuracy misleads: a classifier that always says “not fraud” is 99% right and useless. Look at precision and recall for the class that matters.
- Slice results by segment (language, ticket type): a good average can hide a group that fails.
- With few samples, do not declare an improvement on a one-point difference.
The typical traps
- Evaluating “by eye” with three examples.
- A golden set built from the same examples that go in the prompt.
- Trusting the LLM judge without comparing to human labels.
- A different judge each time, or a vague rubric (“is the answer good?”).
- Measuring overall accuracy with uneven classes.
- Changing the model without running the regression.
On the exam
If the problem is “I don’t know whether the change improved things”, the answer is a golden set with regression, not more manual tests. If an LLM judge is used, look for the option that calibrates it against human labels. If the chosen metric does not match the goal (accuracy with uneven classes, length instead of faithfulness), drop it.
Quick question
A practice exam question on this domain. It counts towards your progress.
A software company routes incoming support tickets to one of six queues with a Claude prompt. The author of the prompt wrote eight few-shot examples, then built an evaluation set of twenty tickets: the same eight examples plus twelve more she invented herself. The prompt scores 100% on that set, and the team ships it.
Two weeks later the queue leads report that roughly one ticket in five lands in the wrong queue, mostly refund requests that mention a product defect. Nobody had put those cases in the evaluation set, and the team now wants an evaluation that will catch this kind of problem before the next prompt change goes out.
What should the team change about the evaluation?