LLM-as-Judge Graders
Use a model with a clear rubric to grade open-ended outputs, and calibrate it against human judgments so its scores mean something.
Intermediate · about 4 hours · difficulty 3/5
Learn first: Building Golden Datasets, Structured Outputs and JSON Schema
When there is no single correct answer, a model grader can score outputs at scale. Done well it agrees with humans most of the time; done badly it produces confident nonsense.
Designing a judge
- Specific rubric: "Does the answer mention the refund window? Does it cite a source? Is it under 120 words?" beats "rate helpfulness 1 to 10".
- Binary or small scales: pass/fail or a 3 point scale is more consistent than 1 to 10.
- Reasoning before verdict: ask the judge to explain briefly and then output a structured score.
- Reference answers when available make grading far more reliable.
- Pairwise comparison ("which of A or B is better?") is useful when comparing two prompt versions.
Known biases
Judges tend to favour longer answers, the first option in a pair, and outputs from their own model family. Mitigate by swapping order, using length limits in the rubric and checking with a different model.
Calibration
Label 50 to 100 outputs yourself, run the judge on them, and measure agreement. Iterate on the rubric until agreement is high, and re-check whenever you change the judge model. Track precision and recall on the "fail" class, since missed failures are what hurt.
Good enough to move on
You have a judge prompt with a written rubric, structured output and a measured agreement rate with your own labels, and you can explain where it disagrees and why.
Key concepts
- Rubric design
- Binary vs scaled scores
- Reference-guided grading
- Pairwise comparison
- Judge biases and mitigations
- Calibrating against human labels
Mini project
Write a faithfulness judge for your RAG app that checks whether every claim is supported by retrieved context, label 60 answers yourself, and report the judge's agreement, false passes and false fails.
Check yourself
Your judge passes 98% of outputs. What experiment tells you whether the judge is too lenient?
Free resources
- Anthropic docs: grading with models (Anthropic)
- Judging LLM-as-a-Judge (MT-Bench paper) (arXiv)