Lesson 3.1 decided what to measure. This lesson is about what you measure it on. The evaluation dataset is usually the most durable asset in a Claude system: prompts, models and retrieval stacks will all change, but a well-built dataset outlives them and turns every change into a testable claim. Anthropic’s own guidance is blunt about its priority: when choosing between models, “having a good evaluation set is the most important step”. It is also easy to get wrong in ways that make scores look excellent while telling you nothing.
Start smaller than you think. Anthropic’s agent-evals write-up suggests that a modest set of simple tasks drawn from real failures is a great start, and warns against delaying until you have hundreds. The docs also say to prefer volume over polish: more cases graded automatically beat fewer cases graded painstakingly by hand. Grow the set continuously from production (Lesson 3.6) rather than in one heroic sprint.
What goes in the set: four kinds of case
- Representative cases. Sampled from, or faithfully mimicking, the real task distribution. Anthropic’s guidance is to mirror your real-world distribution rather than what the developer finds interesting. Sample from production logs where you can (with the privacy handling covered in Lessons 1.4 and 4.4), and stratify by the slices that matter: intent, language, customer tier, document type.
- Edge cases. The docs list several: irrelevant or nonexistent input, overly long input, poor, harmful or irrelevant user input in chat use cases, and ambiguous cases where even humans struggle to agree. Include a few you do not expect the system to pass. A set the system always passes has stopped measuring anything.
- Adversarial cases. Jailbreak attempts, direct injection from the user, and indirect injection where instructions hide in a retrieved page, email, file or tool result. Anthropic recommends red-teaming your own workflow with such content before deployment. Track these as their own slice so a security regression does not average away inside a good overall score.
- Negative and balanced cases. Test both when a behaviour should occur and when it should not. If you only test that the agent escalates dangerous requests, you will optimise it to escalate everything.
Tag every case with metadata (source, slice, difficulty, date added, expected behaviour, and the label owner). Metadata is what lets you report per-slice results, retire stale cases and explain a regression.
Holdout discipline, overfitting and contamination
Any dataset you iterate against becomes a training signal for you. Tune a prompt fifteen times against the same 60 cases and the score will climb because you fixed those 60 cases, not because the system generalises. The defences are the same ones used elsewhere in machine learning, applied to prompts:
- Split by purpose. A development set you look at freely, and a held-out set you run rarely and never debug against. Anthropic’s example success criterion is stated on a held-out test set for exactly this reason. When the held-out set is used up, refresh it from new production traffic.
- Keep few-shot examples out of the eval. If a worked example in your prompt also appears in the test set, you are grading memorisation.
- Prevent answer leakage. A retrieval index that contains the eval questions with their answers, or an agent environment that carries state between trials, will inflate scores. Anthropic reports seeing an agent gain an unfair advantage by reading history left by previous trials, so each trial should start from a clean environment.
- Do not treat model-generated data as ground truth. LLM-generated test inputs are a useful way to widen coverage, but if the same model family writes the inputs and the expected answers, shared blind spots pass silently. Have humans verify labels for anything that gates a release.
- Version everything. Hash the dataset, record the hash with every run, and never change the dataset in the same change as the system under test; otherwise a score movement cannot be attributed.
- Watch for saturation. Near-100% pass rates remove the improvement signal. Move mastered tasks into a regression suite that should stay near 100%, and write new, harder capability tasks that start at a low pass rate.
Key concept: fair tasks, fair graders
A good task is one where two domain experts would independently reach the same pass or fail verdict, and everything the grader checks is clear from the task description. Keep a reference solution that passes every grader, which proves the task is solvable. When a score is low, read the transcripts: failures should look fair. Ambiguous specs and rigid graders masquerade as model weakness.
A mixed-methodology framework
No single evaluation layer catches everything. Anthropic describes the layers as slices of Swiss cheese: automated evals for fast iteration, production monitoring for real behaviour at scale, A/B tests for significance on live traffic, user feedback for unexpected issues, manual transcript review to build intuition, and structured human studies to calibrate subjective judgements. The pieces this lesson owns are the ones you run before release.
| Layer | Runs | Catches | Misses |
|---|---|---|---|
| Code-graded checks | Every change, in CI | Format breaks, wrong labels or fields, wrong final state, latency and cost regressions | Valid variation, tone, faithfulness in free text |
| LLM judge with fixed rubric | Every change; also on sampled production traffic | Open-ended quality, instruction following, groundedness at scale | Judge blind spots; drift if the rubric changes |
| Human review | Samples, calibration rounds, release gates for high risk | What no automated grader was written to see; judge miscalibration | Volume; slow and expensive |
Design rules: prefer the cheapest layer that can grade a case; use model graders where a code check would be brittle, with a different judge model, a per-dimension rubric and an unknown option; and treat a human-labelled calibration sample as part of the framework, not an optional extra. Because model output is non-deterministic, run multiple trials for important cases and look at distributions, using pass@k or pass^k depending on whether one success or consistent success is the requirement. Lesson 4.3 covers where humans sit inside the running product, which is a different question from where they sit in the test framework.
Common exam distractor
Watch for answers that report a very high score after repeated prompt tuning on one fixed set, that rely on synthetic test data written by the same model being evaluated, or that use one grading method for everything (all human, or all LLM judge). The exam prefers a held-out split, verified labels, adversarial and negative slices, and layered methods with a human-calibrated judge.