Lesson 4.2
Graders: Code, Model and Human
The three families of graders, where each is trustworthy, how to design and calibrate a model grader, and how to combine them so that cost, speed and judgement are balanced.
A grader turns an output into a verdict. Pick the wrong grader and your eval will confidently measure something irrelevant. The professional architect knows three families, uses the cheapest one that is valid for the question, and calibrates any grader that involves judgement against human labels before trusting it.
The three families
| Grader | Examples | Strengths | Weaknesses | Relative cost |
|---|---|---|---|---|
| Code | Exact match, schema validation, unit tests, regex, numeric tolerance, state checks | Deterministic, fast, free to rerun, no bias | Only measures what can be specified; brittle to acceptable variation | Lowest |
| Model | Rubric scoring, reference comparison, pairwise preference, grounding checks | Handles nuance, scales to open-ended output | Biases, variance, must itself be evaluated | Medium |
| Human | Expert review, user ratings, adjudication | Ground truth for judgement; catches the unknown | Slow, expensive, inconsistent without training | Highest |
The rule is to grade with code wherever the property is codifiable, with a model wherever judgement is required at scale, and with humans to establish ground truth, calibrate the model grader and adjudicate disagreements.
Code graders
Underused because teams assume model outputs are too fuzzy. In practice much of what matters is codifiable: a JSON schema validates, a required field is present, a number is within tolerance, a cited passage exists in the source, a generated SQL statement parses and touches only allowed tables, an agent's final state passes the application's own test suite. For agents, state-based grading (inspect the repository, the database, the file system after the run) is far more reliable than reading the transcript.
Model graders
A model grader is a Claude call with a grading prompt. Design it like any production prompt:
- Binary rubric items. "Does the answer state the refund deadline? yes/no" is gradeable; "Is the answer good? 1 to 10" is not. Sum binary items into a score.
- Evidence first. Require the grader to quote the passage that supports each verdict before giving it.
- Structured verdict. Use structured outputs so the result is machine-readable.
- Reference-based where possible. Comparing against a gold answer is more reliable than absolute judgement.
- Pairwise for preferences. When comparing two system versions, ask which output is better and randomise the order to control position bias.
Known biases to control: position bias in pairwise comparisons, preference for longer or more confident answers, self-preference when the grader is the same model as the system under test, and leniency drift when rubrics are vague. Mitigations: randomise order, instruct the grader to ignore length, use a different or stronger model to grade, and keep rubrics specific.
Calibrating the grader
A model grader is itself a system that needs an eval. Take a sample of cases that humans have labelled, run the grader, and measure agreement. Report agreement per rubric item; a grader may be reliable on factual items and weak on tone. Re-calibrate whenever the grading prompt, the grading model or the task changes. Without this step the grader's output is an opinion with a decimal point.
Human graders
Humans are the source of truth, and they are noisy. Improve reliability with written guidelines, training examples, a calibration round where graders discuss disagreements, and measurement of inter-rater agreement. Reserve human effort for: building the initial labelled set, calibrating model graders, adjudicating cases where graders disagree, and periodic audits of production samples. User feedback (thumbs, ratings, escalations) is a human signal too, cheap and biased; treat it as a lead for investigation rather than a verdict.
Combining graders
A typical production stack:
1. Code checks: schema valid, required fields present, no banned content -> hard fail if violated
2. Model grader: rubric items with evidence -> score per item
3. Human review: random sample plus all code/model disagreements plus low scores
4. Agreement tracking: model vs human, reported monthly; re-calibrate on drift
The stack keeps cost low (most cases never reach a human), keeps quality high (humans see the hard cases) and keeps the model grader honest (continuous calibration).
Grading agents
For agentic systems grade both the outcome and the path. Outcome grading uses state checks and tests. Path grading uses a model grader over the trajectory with rubric items such as "called the search tool before answering", "did not attempt a write without confirmation", "stopped after completing the task". Managed Agents offer outcome definitions with rubrics that a separate grader applies; the same design principles apply to graders you build yourself.
Exam focus
- Use code graders wherever the property is codifiable; they are deterministic and free to rerun.
- Model graders need binary rubric items, evidence quotes, structured verdicts and bias controls (order randomisation, length neutrality, a different grading model).
- Calibrate every model grader against human labels and track agreement per rubric item over time.
- Humans establish ground truth, adjudicate disagreements and audit; measure inter-rater agreement.
- Combine graders in a stack: code hard-fails, model scores, humans review samples and disagreements.
- Grade agents on outcome (state checks, tests) and on path (trajectory rubrics).
Check yourself
5 questions
1.An eval for a data-extraction feature needs to check that each response is valid JSON matching a schema, that dates are in ISO format, and that extracted totals equal the sum of line items. Which grader type is MOST appropriate for these criteria?
2.A team uses a model-based grader to score the helpfulness and tone of support replies. They want the grader to be as reliable as possible. Which set of practices BEST achieves this?
3.A medical-information assistant's eval includes criteria such as clinical appropriateness and whether the response would be acceptable to a practising physician. The team has limited access to clinicians. How should human grading be used MOST effectively?
4.After introducing a model-based grader, a team's eval score jumped from 71% to 94% without any change to the system under test. Spot checks by a product manager suggest many responses marked as passing are mediocre. What is the MOST likely explanation and remedy?
5.An eval for a report-writing agent has four criteria: the output must be valid Markdown with required sections, figures must match the source data, the tone must be suitable for executives, and the recommendations must be sound. Which grader assignment is MOST sensible?
