# Code vs Model vs Human Graders

> The three ways to grade an AI's answer, when each one fits, and how they work together, explained simply for your AI interview.

**In short:** A code grader checks an AI answer with fixed rules, a model grader uses a second model to judge it against a rubric, and a human grader is a trained reviewer. Teams use code wherever a rule can decide, a model where judgement is needed, and people to check that both are right.

AI and LLM interview question Q270, Evaluation and observability. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/code-vs-model-vs-human-graders

## Say it in 30 seconds

There are three kinds of grader. Code graders run fixed rules, like checking a date format or a policy number. Model graders use a second AI to judge an answer against a written rubric. Human graders are trained people who give the gold-standard verdict, and model graders are calibrated against them. I use code wherever a rule can decide, a model where judgement is needed, and people to check the model grader against real labels.

## Say it in 2 minutes

A grader is the step that turns an AI answer into a verdict, usually pass or fail, or a score. The first kind is code. It is a short program with fixed rules: the answer must be valid JSON, the policy number must exist, the amount must be under the approved limit. It is fast, cheap, objective and reproducible, so it can run on every change. Its weakness is nuance. A rule can check that a reason is well formed, and it cannot check that the reason is fair.

The second kind is a model grader. A separate model reads the answer and a written rubric, then scores it. It handles open-ended work like tone, completeness, or whether a reason fits the policy wording. The cost is that it is less predictable, and a vague rubric gives inconsistent verdicts. So before I trust it, I check it against human labels and measure how often they agree.

The third kind is human. Trained reviewers give the gold-standard verdict, and they produce the labels that model graders are calibrated against. They are slow and expensive, so I use them on a sample of replies. Once the system is stable, people review only now and then.

In practice I combine all three. For a claims assistant, code checks the format and the policy number, a model grader checks whether the reason fits the policy, and adjusters review a weekly sample. The rule I follow is to use the cheapest grader that can answer the question reliably.

## What are code, model and human graders, in plain words?

A grader is the step that marks an AI's answer. It gives a pass or fail, or a score. Anthropic's engineering team says: "Agent evaluations typically combine three types of graders: code-based, model-based, and human."

Picture how a bank audits a loan file. A system checks that every box is filled in. A senior auditor scores the reasoning against the bank's written guide. A review board sets the standard and reads a sample of files. An insurer's claims triage agent, which drafts a decision and a reason for each motor claim, needs all three kinds of check too.

- **Grader:** The step that marks an AI answer as pass, fail or a score.
- **Rubric:** A written list of what a good answer must do.
- **Ground truth:** The correct verdict that people have already agreed on.
- **Calibrate:** Measure how often a grader agrees with human labels before you trust it.
- **Eval:** A test: an input, the AI's output, and the grading that scores it.

## How do the three graders compare?

- **Code: Fixed rules.** Fast, cheap, objective and reproducible, so it can run on every change. It checks formats, policy numbers and limits. Weak point: a correct answer worded differently can fail, and a rule can't judge nuance.
- **Model: A judge with a rubric.** A second model reads the answer against a written rubric. It handles tone, completeness and whether a reason fits the policy. Weak point: it can vary between runs and needs checking against people.
- **Human: Trained reviewers.** The gold standard, meaning the most trusted verdict. People give the verdict that model graders are calibrated against. Weak point: slow and expensive, so use a sample of replies.

*Diagram, Pick the grader that fits the question: Start from the question. A rule that can decide goes to code, a judgement call goes to a model grader, and new or risky cases go to a person. Every route ends in one verdict.*
1. A rule can decide the question, so it goes to code.
2. The question needs judgement, so it goes to a model grader.
3. The case is new or risky, so a person grades it.
4. The code check gives an exact pass or fail.
5. The judge gives a verdict against the written rubric.
6. The reviewer gives the gold-standard verdict that model graders are calibrated against.

Two terms first. Deterministic means a grader gives the same verdict for the same input every time. OpenAI calls a plain text rule a string check grader. It uses basic string operations to return a 0 or 1, so it is the code grader in its simplest form.

> "We recommend choosing deterministic graders where possible, LLM graders where necessary or for additional flexibility, and using human graders judiciously for additional validation." (Anthropic)
>
> "String check graders are good for scoring straightforward pass or fail answers" (OpenAI)

The rule is: rules first, a judge where judgement is needed, and people to check both.

## How do you check that a model grader is right?

A model grader is only as good as its rubric and its agreement with people. OpenAI's guide describes it as prompting a separate model to grade the outputs of the model you're evaluating. Before you trust it, build a set of answers that people have already graded, and measure the match.

OpenAI also advises providing many high quality examples of answers, from the model and from trusted human experts. Their guide says you can then evaluate how effectively the model grader distinguishes answers of different quality levels. In their ticket example, each item has a human-provided correct label, and a string check compares the model's output with that label.

*Diagram, How the graders work together on a release: Human labels are the answer key. The judge is tuned until it agrees with people, then it grades every reply. Code rules run alongside, and both feed one release gate, a check a new version must pass before it goes live.*
1. People's verdicts become the answer key.
2. The judge is tuned until it agrees with those verdicts.
3. Each reply gets a judge verdict before release.
4. Rule failures go to the same release gate.

Here is a small worked example. An insurer's triage agent returns a decision, a policy number and a reason. A code grader checks that the decision is allowed and the policy exists. It cannot judge the reason, so the team compares the verdicts with a human label for each claim.

```python
# A claims team checks its triage agent's replies, then tests the code check against human verdicts.
ALLOWED = {"approve", "deny", "refer"}
POLICIES = {"POL-2041", "POL-7713"}  # policy numbers the company really issued

def code_grader(reply):
    # Fast exact rules: the decision must be allowed and the policy must exist.
    if reply["decision"] not in ALLOWED or reply["policy"] not in POLICIES:
        return "fail"
    return "pass"

replies = [
    {"claim": "CL-101", "decision": "deny", "policy": "POL-2041"},
    {"claim": "CL-102", "decision": "approve", "policy": "POL-9999"},
    {"claim": "CL-103", "decision": "maybe", "policy": "POL-7713"},
    {"claim": "CL-104", "decision": "refer", "policy": "POL-7713"},
]
human = {"CL-101": "pass", "CL-102": "pass", "CL-103": "fail", "CL-104": "pass"}
for reply in replies:
    verdict = code_grader(reply)
    match = "agrees with human" if human[reply["claim"]] == verdict else "differs from human"
    print(reply["claim"], verdict, match)
```

Output:

```text
CL-101 pass agrees with human
CL-102 fail differs from human
CL-103 fail agrees with human
CL-104 pass agrees with human
```

The reviewer passed CL-102, yet its policy number is not real. The code grader catches the broken reference that the reviewer missed. A check on the decision alone would miss it, and only a person or a judge can say whether the reason is fair.

## Where does each grader go wrong?

- **Code graders are brittle:** A correct answer worded in a new way can fail. Normalise the text first, or check the fact rather than the exact words.
- **Model graders vary between runs:** A vague rubric gives inconsistent verdicts, and the same reply can pass one run and fail the next. Tighten the rubric, then re-test it against the labels.
- **Human graders disagree:** Reviewers tire, and two reviewers can judge the same reply differently. Settle the disagreements, and keep one shared guide for everyone.

### How would you grade a refund bot that quotes fees?

A bank's support bot must never quote a fee that is not in the fee table. I would layer the three graders so the cheapest check does the most work.

1. **Code checks the fee first:** Each quoted fee is matched against the fee table. That is a yes or no, so a code grader runs it on every reply.
2. **A model judges the tone:** A model grader with a rubric checks that the reply is clear, polite and tells the customer what to do next.
3. **People sample the rest:** Each week, reviewers label a sample of replies. Their labels re-check the model grader, so its scores stay honest.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] The three graders: code, model and human, and what each one checks.
- [ ] Code first when a rule can decide, because it is fast, cheap and repeatable.
- [ ] A model grader needs a clear rubric and calibration against human labels.
- [ ] Humans give the gold-standard verdict, but they are slow, so sample them.
- [ ] Where each one fails: brittle rules, judges that vary between runs, tired reviewers.
- [ ] Combining them into one release check that people review now and then.

**Common traps**

- Trap: "Use an LLM judge for everything." Better: A judge costs more, can vary between runs and needs calibration. Use a rule wherever a rule can decide.
- Trap: "Humans are the most accurate, so review every reply." Better: Humans are the reference, but they are slow and costly. Sample them, and use them to check the cheaper graders.
- Trap: "A format check proves the answer is right." Better: It proves the answer is well formed, like a valid decision word. Whether the policy is real and the reason is right needs a rule lookup, a judge or a person.

## Can you pick the right grader?

**Spot the weak grader:** A support team's model grader agrees with human reviewers on 6 of 10 replies. What should they do first?

A. Trust it, since 60 percent is good enough to ship.
B. Stop checking with people, because the model is the judge now.
C. Tighten the rubric, then measure agreement again on the same labelled replies.
D. Swap in a longer system prompt for the grader and skip the labels.

**Answer:** C. A model grader is only as good as its rubric and its agreement with people. Tighten the rubric, then measure the match again on the same labelled set.

**Quick check:** An insurer's triage agent words a correct decision in a new way, and the exact-match code check keeps failing it. What should the team change?

A. Add more policy rules to the code check.
B. Send every reply to a human reviewer.
C. Normalise the text, or check the fact rather than the exact words.
D. Drop the code check and trust the model grader.

**Answer:** C. Code graders are brittle: a correct answer worded in a new way can fail an exact check. Normalising the text, or checking the fact itself, fixes that and keeps the cheap rule.

## Can you answer these from memory?

**Flash cards**

- **What are the three grader types?** Code (fixed rules), model (a judge with a rubric), human (trained reviewers).
- **Which grader is fastest and cheapest?** Code. It is fast, cheap and gives the same result on every run.
- **Why calibrate a model grader?** To measure how often it agrees with human labels before you trust it.
- **Why keep humans in the loop?** They give the gold-standard labels and check the cheaper graders.
- **What makes a model grader unreliable?** A vague rubric, and its own randomness. The same reply can get different verdicts.
- **Where does a code grader fail?** A correct answer worded in a new way. It cannot judge nuance.

## Likely follow-up questions

- Q264 When do you need human evaluation? https://designervenkat.online/interview/ai/when-do-you-need-human-evaluation
- Q265 How do you sample production traffic for evals? (full answer coming)
- Q268 How many eval examples are enough? https://designervenkat.online/interview/ai/how-many-eval-examples-are-enough
- Q269 What is a rubric-based grader? https://designervenkat.online/interview/ai/what-is-a-rubric-based-grader
- Q271 What are error analysis and transcript reading? https://designervenkat.online/interview/ai/what-are-error-analysis-and-transcript-reading
- Q278 How do you evaluate an LLM classifier (confusion matrix)? https://designervenkat.online/interview/ai/how-do-you-evaluate-an-llm-classifier-confusion-matrix

## Learn it in depth

- [Deterministic Evals](https://designervenkat.online/learn/ai-engineering/deterministic-evals)
- [A model as the judge](https://designervenkat.online/learn/ai-engineering/model-based-evals)
- [People as the judges](https://designervenkat.online/learn/ai-engineering/human-evals)
