CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 4 · Lesson 21/38

    Eval datasets and graders: designing a mixed-method test framework

    Design evaluation datasets and test frameworks using mixed methodologies

    18 min read
    2.67% of exam
    3 sources
    Published 19 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Rewrite a vague success criterion so that it is specific, measurable, achievable and relevant enough to test
    • Build an evaluation dataset that mirrors real traffic and then deliberately adds edge cases
    • Explain why many automated cases run over repeated trials beat a few hand-graded ones
    • Choose between code, LLM and human graders for a given criterion, and combine them in one framework

    Key concept

    Eval test case — The unit every evaluation is built from. It holds an input fed to the model, the model's output, a golden answer to compare against, and a score from a grader. You design the dataset by choosing the inputs and golden answers, and you design the framework by choosing how each output is scored.

    1.Success criteria come before test cases

    An evaluation dataset is only useful if it measures something definite. Before anyone writes a test case, the team needs success criteria that say what good output looks like, because every case and every grader exists to check one of them. Choosing which dimensions matter, such as accuracy, latency, cost or safety, belongs to defining evaluation metrics. This lesson starts one step later: the shape a criterion needs before a dataset can test it.

    A criterion is testable when it has four properties:

    • Specific: it names the behaviour. "Accurate sentiment classification" is specific; "good performance" is not.
    • Measurable: it uses a number, or a qualitative scale applied consistently alongside numbers. Even safety can be counted, for example fewer than 0.1% of outputs out of 10,000 trials flagged for toxicity.
    • Achievable: the target comes from industry benchmarks, prior experiments or expert knowledge, and stays within what current frontier models can do.
    • Relevant: it fits the application's purpose. Citation accuracy can be critical for a medical app and matter much less for a casual chatbot.

    A rewrite shows the difference. "The model should classify sentiments well" fails all four. The good version asks for an F1 score of at least 0.85 on a held-out test set of 10,000 diverse Twitter posts, a 5% improvement over the current baseline. That criterion already describes a dataset: how big it is, where it comes from, and that it is held out. A criterion written this way tells you what to build next.

    Run the same check on a draft like "summaries should be concise and helpful." Rewritten as "average at least 4 out of 5 on a completeness rubric across a 500-claim sample," it becomes a number you can check on every run, and it holds up: a rubric scale is a legitimate qualitative measure, and an average leaves room for imperfect individual outputs. Three other rewrites look like progress but still fail. "Sound less robotic" is a preference with no measurement attached. "A perfect 5 from every reviewer" is measurable but not achievable, because it demands flawless agreement that no baseline supports. "Every summary signed off by a senior reviewer" is a review process, not a criterion, and it puts a human into the grading of every run.

    Checkpoint 1 of 9· Check yourself

    A support-bot team's draft success criterion reads "replies should be friendly and helpful." Which rewrite is a testable criterion that an evaluation dataset can check on every run?

    Checkpoint 2 of 9· 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?

    Sources1

    2.Test cases that mirror real traffic, then edge cases

    Your criteria tell you what to test, and production tells you what mix of inputs to test it on. A dataset of only easy, well-formed inputs will score well and predict little. Automated evals can create false confidence when they don't match real usage patterns. So the first job is to reproduce the inputs the system actually receives: the same document types, lengths, phrasing and noise, in roughly the same proportions.

    Next, add edge cases on purpose. They are rare in any sample, and failures tend to hide there. The standard categories are:

    • irrelevant or nonexistent input data
    • overly long input data or user input
    • poor, harmful or irrelevant user input, in chat use cases
    • ambiguous cases where even humans would find it hard to agree on an assessment
    A sentiment dataset: ordinary tweets with human labels, plus edge cases for sarcasm and mixed sentiment, marked in commentspython
    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
    ]

    Each task has its own edge cases. A summarization set adds multitopic articles and misleading headlines. An FAQ consistency set adds typos, long rambling questions and irrelevant personal details. A medical-privacy set adds health information that is explicit, hypothetical ("if my friend Alice, born on…") and implicit ("the same medication as his father"). Every case also needs a golden answer. That is either a mandatory exact match, or an example of a perfect answer that gives the grader something to compare against.

    Take a clause-extraction feature tested only on clean, standard commercial leases. Adding more clean leases gives more statistical confidence about a category that was never the risk. Translating the set into other languages measures a capability that production may not use. Having experts re-label the existing leases improves label quality but adds no coverage. What improves prediction is adding the malformed, scanned and non-standard contracts that production actually sees, stratified so that each type sits alongside the standard leases.

    After launch, real failures are the best source of new cases. Every bug that becomes a test case guards against that bug coming back, so the dataset tracks production more closely over time.

    Checkpoint 3 of 9· Fill the gap

    This sentiment dataset deliberately includes a sarcastic tweet as an edge case. Which golden label belongs in the blank so that the case tests what it is meant to test?

    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": " ? ",
        },  # Edge case: Sarcasm
        {
            "text": "The movie's plot was terrible, but the acting was phenomenal.",
            "sentiment": "mixed",
        },  # Edge case: Mixed sentiment
        # ... 996 more tweets
    ]

    Checkpoint 4 of 9· Check yourself

    An invoice-extraction eval scores 97% on 800 clean, digitally generated PDFs. Production also receives scanned faxes, multi-page invoices and some files with missing fields, and users say the feature fails often. Which change would most improve how well the eval predicts production results?

    Checkpoint 5 of 9· Exam question

    An evaluation team is assembling test cases for a clause-extraction feature used on uploaded contracts. The current dataset contains only well-formatted, standard commercial leases. Following evaluation design best practices, which addition would most improve the test set's ability to predict real-world failures?

    Sources12

    3.Volume, automation and repeated trials

    Many automated cases beat a few hand-graded ones, and the reason is cost over time. Writing questions and golden answers is usually a one-time cost. Grading is paid again every time the eval runs, and a useful eval runs constantly: on each prompt change, each model upgrade, each release. Hand grading makes every run slow and expensive. Automated grading lets you run hundreds of cases on every change. If no dataset exists, Claude can help generate the questions.

    Automation is decided when you write the question, not when you grade it. Structure cases so the output can be checked mechanically: multiple choice, string match, code-graded or LLM-graded. An eval that asks how many legs an animal has, and tells Claude to output only a number, can be graded by exact match, including the tricky case of a fox that regrows a lost leg plus an extra one. The same question asked open-ended would need a person to read every answer.

    A single run is also not enough. Each attempt at a task is a trial, and model outputs vary between runs, so one pass over the suite is one sample of a non-deterministic system. Running multiple trials per task gives more consistent results, which means a change of a few points is less likely to be noise. Some criteria need repetition anyway. A toxicity target stated over 10,000 trials, or a requirement that the same question asked twice gets a semantically similar answer, cannot be checked with one output per input.

    Checkpoint 6 of 9· Check yourself

    After a prompt tweak, a code-graded suite of 400 cases goes from 81% to 84% on a single pass over each version. Before crediting the tweak, what should the team do?

    Sources132

    4.Code-graded, LLM-graded and human-graded evals

    Use the cheapest grader that can reliably judge the criterion. Code-based grading is the best method whenever the eval can be designed to allow it, because it is fast and highly reliable. Model-based grading covers what code cannot judge. Human grading can judge almost anything, but it is slow and expensive, so avoid designing evals that depend on it where you can.

    The three grader types compared
    GraderTypical methodsStrengthsWeaknessesBest fit
    Code-basedString match (exact, regex, fuzzy), binary tests, static analysis, outcome verificationFast, cheap, objective, reproducible, easy to debugBrittle to valid variations; lacking in nuanceCategorical or short, well-defined answers
    Model-based (LLM)Rubric-based scoring, natural language assertions, pairwise comparison, multi-judge consensusFlexible, scalable, captures nuance, handles freeform outputNon-deterministic; more expensive than code; requires calibration with human gradersTone, open-ended answers, subtle policy checks
    HumanSME review, spot-check sampling, inter-annotator agreementGold standard quality; matches expert user judgmentExpensive, slow, often needs human experts at scaleCalibrating LLM graders; subjective outputs

    Code graders come in more than one form, and each answers a different question. Exact match checks whether the output equals the correct answer after whitespace and case are normalized, which suits categorical labels. Cosine similarity between sentence embeddings checks whether paraphrased versions of a question get semantically similar answers, so it measures consistency, not correctness. ROUGE-L measures the longest common subsequence between a generated summary and a reference summary.

    An exact-match grader: normalize, then compare against the golden answerpython
    def evaluate_exact_match(model_output, correct_answer):
        return model_output.strip().lower() == correct_answer.lower()

    LLM graders take two common forms. A Likert scale grader asks a model to rate an output from 1 to 5 against a target, such as how empathetic a customer-service reply is. It suits nuanced qualities like empathy, professionalism or patience that traditional metrics struggle to measure. A binary grader asks a yes/no question, such as "does this response contain personal health information?". It can catch implicit or subtle cases that rule-based checks miss. In both forms the grader prompt should demand a constrained output ("Output only the number", "Output only 'yes' or 'no'") so the verdict can be parsed in code. It is generally best practice to grade with a different model from the one that produced the output.

    Checkpoint 7 of 9· Match them up

    Match each grader to the evaluation job it is best suited for in a mixed-method framework.

    Tap a term, then the definition that fits it.

    Checkpoint 8 of 9· Exam question

    A team is designing a test framework for a Claude-based tool that answers factual questions about internal HR policies using short, well-defined answers (e.g., "What is the maximum number of paid sick days?"). To keep pace with frequent policy updates, which grading approach best supports automation while remaining accurate?

    Sources13

    5.Combining graders in one framework

    Most applications need to be evaluated on several success criteria at once, and that is why mixed methods exist. The sentiment model from the earlier criterion is judged on F1, the share of non-toxic outputs, how severe its errors are, and response time, all on the same held-out set. No single grader checks all four, so one task usually carries several graders, each checking one part of the output.

    There are three ways to combine those graders into one verdict. Weighted scoring requires the combined scores to reach a threshold. Binary scoring requires every grader to pass. A hybrid mixes the two, for example making a privacy check a hard gate while weighting tone and completeness together. Graders can also look at different evidence. A flight-booking agent may say "Your flight has been booked" in its transcript, but the outcome is whether a reservation actually exists in the database. A code check on the outcome catches what a rubric reading the transcript would accept.

    In a mixed framework, humans do a specific job: calibration. LLM graders are non-deterministic and need checking against human graders before their scores can be trusted, so systematic human review is best spent on calibrating LLM graders and on subjective outputs where human consensus is the reference standard. Descript's video-editing agent followed this path. It moved from manual grading to LLM graders using criteria defined by the product team, with periodic human calibration. The result is a stack where code checks what is checkable, LLMs judge what needs nuance, and a small, regular human sample keeps the LLM judges honest.

    Checkpoint 9 of 9· Match them up

    A support-bot task has a privacy grader, a tone grader and a completeness grader. Pair each way of turning their scores into one verdict with how that verdict behaves.

    Tap a term, then the definition that fits it.

    Sources12

    Sources

    (3)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Building a successful LLM-based application starts with clearly defining your success criteria and then designing evaluations to measure performance against them.”
      ↩︎ Success criteria come before test cases
      “Your success metrics should not be unrealistic to current frontier model capabilities.”
      ↩︎ Success criteria come before test cases
      “Numbers provide clarity and scalability, but qualitative measures can be valuable if consistently applied along with quantitative measures.”
      ↩︎ Success criteria come before test cases
      “Design evals that mirror your real-world task distribution. Don't forget to factor in edge cases!”
      ↩︎ Test cases that mirror real traffic, then edge cases
      “Ambiguous test cases where even humans would find it hard to reach an assessment consensus”
      ↩︎ Test cases that mirror real traffic, then edge cases
      “Structure questions to allow for automated grading (for example, multiple-choice, string match, code-graded, LLM-graded).”
      ↩︎ Volume, automation and repeated trials
      “It's a simple, unambiguous metric that's perfect for tasks with clear-cut, categorical answers like sentiment analysis (positive, negative, neutral).”
      ↩︎ Code-graded, LLM-graded and human-graded evals
      “It's ideal for evaluating nuanced aspects like empathy, professionalism, or patience that are difficult to quantify with traditional metrics.”
      ↩︎ Code-graded, LLM-graded and human-graded evals
      “Generally best practice to use a different model to evaluate than the model used to generate the evaluated output”
      ↩︎ Code-graded, LLM-graded and human-graded evals
      “Most use cases need multidimensional evaluation along several success criteria.”
      ↩︎ Combining graders in one framework
      “More questions with slightly lower signal automated grading is better than fewer questions with high-quality human hand-graded evals.”
      ↩︎ Exam trap 1
      “It's ideal for evaluating consistency because similar questions should yield semantically similar answers, even if the wording varies.”
      ↩︎ Exam trap 2
      “Design evals that mirror your real-world task distribution. Don't forget to factor in edge cases!”
      ↩︎ Exam trap 4
      “Measurable: Use quantitative metrics or well-defined qualitative scales.”
      ↩︎ Checkpoint
      “More questions with slightly lower signal automated grading is better than fewer questions with high-quality human hand-graded evals.”
      ↩︎ Prediction
    2. 2.
      “Can create false confidence if it doesn't match real usage patterns”
      ↩︎ Test cases that mirror real traffic, then edge cases
      “development accelerates as failures become test cases, test cases prevent regressions, and metrics replace guesswork.”
      ↩︎ Test cases that mirror real traffic, then edge cases
      “Because model outputs vary between runs, we run multiple trials to produce more consistent results.”
      ↩︎ Volume, automation and repeated trials
      “For each task, scoring can be weighted (combined grader scores must hit a threshold), binary (all graders must pass), or a hybrid.”
      ↩︎ Combining graders in one framework
      “The outcome is the final state in the environment at the end of the trial.”
      ↩︎ Combining graders in one framework
      “They evolved from manual grading to LLM graders with criteria defined by the product team and periodic human calibration”
      ↩︎ Combining graders in one framework
      “Requires calibration with human graders for accuracy”
      ↩︎ Combining graders in one framework
      “Reserve systematic human studies for calibrating LLM graders or evaluating subjective outputs where human consensus serves as the reference standard.”
      ↩︎ Exam trap 3
      “Each attempt at a task is a trial. Because model outputs vary between runs, we run multiple trials to produce more consistent results.”
      ↩︎ Checkpoint
      “Reserve systematic human studies for calibrating LLM graders or evaluating subjective outputs where human consensus serves as the reference standard.”
      ↩︎ Checkpoint
    3. 3.
      “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
      “This is by far the best grading method if you can design an eval that allows for it”
      ↩︎ Code-graded, LLM-graded and human-graded evals
      “You should mostly try to avoid designing evals that require human grading if you can help it.”
      ↩︎ Code-graded, LLM-graded and human-graded evals
      “A "golden answer" to which we compare the model output.”
      ↩︎ Key concept

    Spotted a mistake, or was something unclear? Tell us.