Skip to main content

A Model as Grader

Why This Matters

Code can check a category. It cannot tell whether a summary is clear, or whether a bug report would let a developer reproduce the problem. For those qualities, a second model with a strict rubric is the practical grader, as long as you test the grader too.

What code grades, and what it cannot

QualityGrader
Category matches the labelCode
Every evidence quote appears in the inputCode
Confidence between 0 and 1Code (schema)
Summary is understandable in five secondsModel
Bug report lets a developer reproduce the problemModel
Suggested action fits the verdictModel

Always use code where code can decide. A model grader is for the rest.

A rubric, not “is this good?”

“Rate this bug report from 1 to 10” gives you noise. A rubric with concrete criteria gives you something you can check and argue about:

Score each criterion 0 (no) or 1 (yes):
1. The title names the feature and the wrong behaviour.
2. The steps can be followed without opening the test code.
3. Expected and actual results are both stated with exact values.
4. At least one piece of evidence is quoted exactly from the failure.
5. The report does not claim anything that is not in the evidence.

Build the grader

A separate call with its own system prompt and its own output schema:

const gradeSchema = z.object({
  scores: z.array(z.object({ criterion: z.number(), score: z.union([z.literal(0), z.literal(1)]), reason: z.string() })),
});

Give the grader the original failure and the report, so it can check claims against the evidence.

Grade the grader

Before you trust it, score ten reports yourself and compare with the grader. Where you disagree, either your rubric is ambiguous (fix the wording) or the grader is wrong (try examples or a stronger model). Only when you agree on most cases does the grader go into npm run eval.

Cost and bias

  • A grader runs on every case in every eval, so a smaller, cheaper model is often fine for clear binary criteria.
  • Do not ask a model to grade its own output in the same conversation: it tends to agree with itself. Use a fresh request with only the evidence, the output and the rubric.
  • Watch for a grader that prefers long answers. Criterion 5 (no unsupported claims) pushes back on that.

Exercise

Write the rubric for TestPilot’s summary field (three criteria), build the grader, and compare its scores with your own on ten cases.