4.2 Designing Evaluation Datasets and Test Frameworks
What You Need to Know
Section titled “What You Need to Know”An evaluation dataset is the set of cases that a system is tested against. A golden set is a dataset that is trusted for comparing scores over time. A grading method scores each case: a code-graded check, LLM-as-judge, or human review. This objective builds the tools that measure the metrics on objective 4.1’s metric sheet.
This lesson uses one made-up example throughout: a physiotherapy clinic that uses Claude to convert session notes into home-exercise plans. The clinic’s metric sheet requires plans that are in the clinic’s format, faithful to the notes and safe from tampering.
Four Case Populations
Section titled “Four Case Populations”What a dataset contains decides which risks it covers. Each population protects against a different failure. Hand-written happy-path cases (simple inputs where nothing goes wrong) prove only that the demo works. They never include the inputs that cause failures.
- Representative cases match the mix of inputs seen in production and test the everyday path. They are the bulk of the set. For the clinic, these are routine notes from knee, back and shoulder appointments.
- Edge cases are the inputs at the boundaries where behaviour changes. Anthropic’s evaluation guidance names the populations that people forget: irrelevant data, overly long inputs, poor user input, and ambiguous cases. The clinic adds a note that also contains a parking complaint, and a very long note. It also adds a note in shorthand and a note that says only “progress as tolerated”.
- Adversarial cases are the concrete tests for the safety and security metrics from 4.1. They include injection attempts, leading questions and malformed input. Anthropic’s guardrails guidance says to test your workflow with content that deliberately contains injection attempts before deploying. Security is measured under attack. Without attack cases, security is only asserted. The clinic adds a note that tells Claude to ignore the plan template.
- Regression cases are made from production failures, so no fixed bug returns unnoticed. A bug with no regression case can return, and then you must fix it a second time. When one plan named the wrong knee, that note became a permanent case.
Golden-Set Discipline
Section titled “Golden-Set Discipline”Three properties make a golden set trustworthy.
- Versioned. A score is comparable to last month’s only if the set is the same or the change is recorded. Unversioned sets make every trend line meaningless. The clinic tags each revision of its set.
- Held out. A case that appears in the prompt as a few-shot example is no longer a test. Claude has already seen it, so passing proves recall, not capability. Held out means held out of the prompt, not just out of the training data. No example plan in the clinic’s prompt may appear in its set.
- Refreshed. Production traffic changes. A set that stays fixed after launch slowly comes to test a mix of inputs that the system no longer receives. How often to refresh the set is a design decision to make on purpose. When the clinic starts taking post-surgery patients, their notes join the set.
Sizing by Risk and Variance
Section titled “Sizing by Risk and Variance”LLM outputs are non-deterministic. The same note can give a different plan on each run, so small samples mislead. Anthropic’s research on statistical model evaluations describes practices that include:
- Report the standard error of the mean and confidence intervals rather than bare scores.
- Use clustered standard errors when questions are related, because unclustered errors can understate uncertainty substantially. Several notes from one patient are related cases.
- Resample non-deterministic answers and average per question.
- Run a power analysis to choose the sample size before running the eval.
A round number is not a valid reason to choose a sample size. High-stakes or high-variance behaviours need more cases before a result deserves trust. The clinic gives post-surgery plans more cases than plans for routine back pain.
Mixed Methodologies: The Pairing Rule
Section titled “Mixed Methodologies: The Pairing Rule”The pairing rule: deterministic checks where possible, a judge where not, and humans to calibrate the judge and audit the ambiguous cases.
- Code-graded checks (exact match, schema validation, regex, programmatic constraints) are cheap, fast and objective. Use them for everything that they can grade. Anthropic’s design principles give the same advice: automate when possible, and prioritise volume. More questions with slightly less informative automated grading are better than fewer hand-graded questions. The clinic checks every plan’s format with schema validation.
- LLM-as-judge scores open-ended quality, such as tone, completeness and faithfulness, at scale. Anthropic describes LLM-as-judge as a grading method for subjective judgements that traditional metrics cannot quantify. Anthropic builds its example judges with explicit scales and definitions. Anthropic calls it best practice to evaluate the output with a different model from the model that generated the output. The judge’s rubric has explicit scoring anchors (a written description for each score), and the rubric is versioned like code. The clinic’s judge scores whether each plan is faithful to the notes.
- Human review is the reference standard for grading. Human review is too expensive to use on every case and too important to skip. Use human review to calibrate the judge, to audit samples, and to adjudicate high-stakes or ambiguous cases. At the clinic, a senior physiotherapist labels a sample of plans.
In the exam
Section titled “In the exam”The exam tests two design skills. One is to compose a dataset that covers the system’s real risks. The other is to pair each metric with a grading method that can honestly score it. “Mixed methodologies” in the exam guide’s outline means code-graded checks, LLM-as-judge and human review. Each method is assigned the job that it does best. The right answer follows the pairing rule. When a question describes recurring production incidents alongside a passing eval suite, the missing case populations are usually the answer. Know that the sizing methods exist.
The three golden-set properties are standard evaluation practice, not methods specific to Claude.
Exam Traps
Section titled “Exam Traps”Practice Scenario
Section titled “Practice Scenario”A team evaluates a customer-email assistant with 40 hand-written happy-path cases graded by an LLM judge nobody has calibrated. Production incidents keep recurring. What should change?
- A. Add edge, adversarial, and regression populations, and calibrate the judge against human labels on a sample
- B. Write more happy-path cases to increase coverage of the situations the assistant handles most often in production
- C. Replace the LLM judge with humans grading every case, so no automated judgement has to be trusted anywhere in the suite
- D. Drop the LLM judge, and grade only with exact-match checks so the scoring is fully objective and repeatable
Answer & explanation
Correct: A
- A — Covers the risk the incidents keep exposing, creates regression cases so fixed bugs stay fixed, and calibrates the judge so its scores can be trusted before any decision depends on them.
- B — More cases from the same population confirm the demo more strongly. The recurring incidents happen in edge, adversarial, and regression cases, which the set never contains.
- C — Wastes the reference standard for grading: human review is too expensive to use on every case and too valuable to skip for calibration and the ambiguous cases. Automation should grade most cases.
- D — Exact match cannot grade the quality of an email. Deterministic checks belong wherever the property is deterministic; a calibrated judge grades the open-ended rest.
Sources
Section titled “Sources”- Define success criteria and build evaluations — Anthropic
- A statistical approach to model evaluations — Anthropic
- Mitigate jailbreaks and prompt injections — Anthropic
- Claude Certified Architect Professional Exam Guide (v1.0) — Domain 4 — Anthropic