What you will be able to do
- Break an eval test case into its four parts: input, output, golden answer and score
- Build a test set that matches real traffic and deliberately includes edge cases
- Explain why the docs advise many automatically graded questions over a few hand-graded ones
- Say why each task needs several trials and why capability evals should start with a low pass rate
Key concept
Representative, edge-case-rich eval dataset — An evaluation dataset is a set of test cases chosen to match the inputs your application really receives. It deliberately adds the rare, awkward inputs that break naive prompts, so the scores tell you how the system will behave in real use.
1.From success criteria to a test case
An evaluation dataset exists to measure your success criteria, so the criteria decide what the dataset must contain. Anthropic's guidance notes that most applications are judged on several dimensions at once, such as accuracy, tone, privacy handling and latency. Each dimension needs test cases that can show it. A dataset built only for accuracy cannot tell you whether the model leaks private data.
Each entry in the dataset follows the same structure. The Anthropic cookbook lists four parts. First, an input prompt. This is often a set of variables that get dropped into a prompt template when the test runs. Second, the output the model produces for that input. Third, a golden answer to compare the output against. Fourth, a score produced by a grading method. The golden answer can take two forms. It can be a string the output must match exactly. Or it can be an example of an ideal answer that a grader compares the output against.
The docs' sentiment example shows the first form. Each test case pairs a tweet with a human-assigned label. That label is the golden answer, and a simple string comparison can score it. Look at the comments in the sample: the dataset author has marked which cases are edge cases.
tweets = [
{"text": "This movie was a total waste of time. 👎", "sentiment": "negative"},
{"text": "The new album is 🔥! Been on repeat all day.", "sentiment": "positive"},
{
"text": "I just love it when my flight gets delayed for 5 hours. #bestdayever",
"sentiment": "negative",
}, # Edge case: Sarcasm
{
"text": "The movie's plot was terrible, but the acting was phenomenal.",
"sentiment": "mixed",
}, # Edge case: Mixed sentiment
# ... 996 more tweets
]Not every golden answer is a single label. For an open-ended request, such as a workout plan with required numbers of reps, the cookbook writes the golden answer as a description of what a correct response must and must not include. A human or a model grader then checks the output against that description.
Checkpoint 1 of 4· Check yourself
Your eval asks for open-ended workout plans, so no single exact output is correct. What should the golden answer be?
The cookbook says a golden answer does not have to be an exact match. It can be an example of a perfect answer that gives the grader a reference point. That is how open-ended tasks get golden answers.
“it could be an example of a perfect answer meant to give a grader a point of comparison to base their scoring on”Source: platform.claude.com
2.Mirror real traffic, then add the edge cases
A dataset of tidy, typical inputs gives you a flattering score that does not hold up in production. The docs first ask for evals that match the real task distribution. They then name the edge cases worth adding: input data that is irrelevant or missing, input that is too long, poor or harmful user input in chat applications, and ambiguous cases where even humans would struggle to agree.
The example datasets in the docs apply this to each task. The table shows the edge cases the docs flag for each one.
| Eval (dataset size in the docs) | Edge cases flagged in the dataset |
|---|---|
| Sentiment classification (1,000 tweets) | Sarcasm; mixed sentiment |
| FAQ consistency (50 groups of paraphrases) | Typos; long, rambling question; irrelevant info |
| Summarisation (200 articles) | Multitopic article; misleading title |
| Tone (100 customer inquiries) | Angry customer; complex issue; compliment as complaint |
| Privacy (500 patient queries) | Explicit PHI; hypothetical PHI; implicit PHI |
Writing these cases has another benefit. Anthropic's agent-evals guidance points out that two engineers can read the same spec and handle edge cases differently. Writing the case down, with its expected result, settles which behaviour is correct. The same guidance says to take realistic tasks from the failures you actually see. Each production failure then becomes a new test case.
Checkpoint 2 of 4· Match them up
Match each edge case to the eval dataset in the docs that includes it
Tap a term, then the definition that fits it.
Each dataset adds edge cases for the specific way that task fails: sarcasm for sentiment, typos for consistency, implicit identifiers for privacy, and mismatched register for tone.
“Ambiguous test cases where even humans would find it hard to reach an assessment consensus”Source: platform.claude.com
3.Volume, automation and repeated trials
How large should the dataset be, and how carefully should each case be graded? The docs give two linked rules. First, automate grading when possible: write questions so a machine can grade them, for example as multiple-choice, string-match, code-graded or LLM-graded questions. Second, prefer volume over quality. Many questions graded automatically, each with slightly weaker signal, beat a few questions graded carefully by hand.
The cookbook explains why from cost. An eval has two expensive parts. Writing questions and golden answers is usually a one-off cost, and Claude can help by generating the questions. Grading is a cost you pay every time the eval runs, and you will run it often. So the dataset should be designed for grading that is fast and cheap.
The docs' example criterion also measures performance on a *held-out* test set of 10,000 diverse posts. Scoring on data kept apart from development is what makes the number credible.
Two more design choices come from Anthropic's agent-evals guidance. Model outputs vary between runs, so each task is run for several trials to get more consistent results. And a capability eval, which asks what the system can do well, should start with a low pass rate. A suite the system already passes gives you nothing to improve on.
Checkpoint 3 of 4· Exam question
A team is defining the success criteria for a new claims-summarization feature before building the evaluation dataset. The current draft criterion reads: "the summaries should be concise and helpful." Which revised criterion best follows the SMART framework for evaluation design?
Correct answer: A — Require summaries to average at least 4 out of 5 on a completeness rubric across a 500-claim sample
- A. Correct. This criterion is specific (completeness rubric), measurable (numeric threshold), achievable (a 4/5 average rather than perfection), and relevant (tied directly to summary quality), and it defines a concrete sample size for measurement.
- B. Incorrect. Requiring a perfect score from every adjuster is not achievable in practice; SMART criteria should be realistic targets grounded in frontier model capability, not unattainable perfection.
- C. Incorrect. "Sound less robotic" and "read more naturally" are not measurable without a defined metric or scale, so this fails the Measurable requirement of SMART criteria.
- D. Incorrect. This describes a manual sign-off process, not a measurable success criterion for the model's output quality, so it does not give the evaluation team a quantifiable target.
Checkpoint 4 of 4· Check yourself
A team proposes 40 expert-graded essay questions instead of 800 LLM-graded ones, arguing the expert grades are higher quality. What does the guidance recommend?
The docs explicitly prefer volume over quality, and automated grading is what makes a large set affordable to run again and again.
“Prioritize volume over quality: More questions with slightly lower signal automated grading is better than fewer questions with high-quality human hand-graded evals.”Source: platform.claude.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.A small set of carefully hand-graded questions is better than a large set graded automatically.Why is that wrong?
The docs say the opposite. Prefer volume, and design questions so they can be graded automatically.
Covered in Volume, automation and repeated trials
2.A good capability eval is one your system already mostly passes.Why is that wrong?
Capability evals should start with a low pass rate. They should target tasks the system struggles with, so there is room to improve.
Covered in Volume, automation and repeated trials
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Most use cases need multidimensional evaluation along several success criteria.”
↩︎ From success criteria to a test case“Example eval test cases: 1,000 tweets with human-labeled sentiments.”
↩︎ From success criteria to a test case“Design evals that mirror your real-world task distribution. Don't forget to factor in edge cases!”
↩︎ Mirror real traffic, then add the edge cases“Ambiguous test cases where even humans would find it hard to reach an assessment consensus”
↩︎ Mirror real traffic, then add the edge cases“Automate when possible: Structure questions to allow for automated grading (for example, multiple-choice, string match, code-graded, LLM-graded).”
↩︎ Volume, automation and repeated trials“On a held-out test set of 10,000 diverse Twitter posts”
↩︎ Volume, automation and repeated trials“Design evals that mirror your real-world task distribution. Don't forget to factor in edge cases!”
↩︎ Key concept“Prioritize volume over quality: More questions with slightly lower signal automated grading is better than fewer questions with high-quality human hand-graded evals.”
↩︎ Exam trap 1“Prioritize volume over quality: More questions with slightly lower signal automated grading is better than fewer questions with high-quality human hand-graded evals.”
↩︎ Checkpoint - 2.https://platform.claude.com/cookbook/misc-building-evalsSecondary source
“it could be an example of a perfect answer meant to give a grader a point of comparison to base their scoring on”
↩︎ From success criteria to a test case“Grading on the other hand is a cost you will incur every time you re-run your eval, in perpetuity”
↩︎ Volume, automation and repeated trials“consider using Claude to generate your questions!”
↩︎ Volume, automation and repeated trials - 3.
“Two engineers reading the same initial spec could come away with different interpretations on how the AI should handle edge cases.”
↩︎ Mirror real traffic, then add the edge cases“Source realistic tasks from the failures you see.”
↩︎ Mirror real traffic, then add the edge cases“Because model outputs vary between runs, we run multiple trials to produce more consistent results.”
↩︎ Volume, automation and repeated trials“They should start at a low pass rate, targeting tasks the agent struggles with and giving teams a hill to climb.”
↩︎ Exam trap 2