Tips

LLM-as-a-judge: using models to grade models, the right way

TL;DR

LLM judges agree with humans about as often as humans agree with each other, making them a viable way to scale evaluation. But you must handle position, verbosity, self-enhancement and reasoning biases, and validate the judge against human grades.

You tweak a prompt and want to know whether quality went up or down. For free-form output (summaries, customer replies, articles) there's no correct answer to match against, and having humans grade every sample is slow and expensive. The common solution is LLM-as-a-judge: using one model to grade another's output. The foundational study by Zheng et al. (2023, the LMSYS team behind MT-Bench and Chatbot Arena) showed it works, and also exposed the biases you need to know.

The study's main results

  • A strong judge (GPT-4 at the time) reached over 80% agreement with human evaluators, the same level at which two humans agree with each other.
  • That makes LLM judges a scalable, explainable way to evaluate, instead of paying humans to grade everything.

Three grading modes

ModeHow it worksGood for
Pairwise comparisonShow A and B, pick the better oneComparing two prompt/model versions
Single-answer gradingScore one output on a scale or rubricTracking quality over time
Reference-guided gradingProvide the correct solution for comparisonMaths, logic, questions with answers

Four biases to know

BiasSymptomMitigation
PositionFavours the answer shown first (or second)Grade twice with positions swapped; count a win only if consistent
VerbosityPrefers longer answers even when not betterRubric explicitly says length earns nothing; penalise padding
Self-enhancementMay favour its own model's outputsUse a judge from a different model family, or cross-check
Limited reasoningMisgrades problems it would itself get wrongProvide a reference answer; let the judge reason before scoring

A sample judge prompt

You are grading the customer support answer in <answer>.
Rubric (pass/fail per item):
1. Answers the question in <question>
2. Promises nothing the policy forbids (see <policy>)
3. Gives the customer a clear next step
Length earns no credit. Briefly analyse each item, then
return JSON: {"pass": true/false, "failed": [item numbers]}

Anthropic's experience with its Research system is similar: a single judge prompt with a clear rubric, outputting a 0.0–1.0 score plus pass/fail, gave the most consistent results.

Risks and caveats

  • Judges need validating too: take 30–50 human-graded samples and measure agreement before trusting the model's scores.
  • Optimising for the judge: tuning prompts just to please the judge can hurt the real experience.
  • Don't drop humans entirely: periodically have people review random samples to catch what the judge misses.

How to apply it

  • Dev: Write pass/fail rubrics per criterion instead of vague 1–10 scales; run the judge in CI when prompts change.
  • Tech Lead: Calibrate the judge against a human-graded set; track the agreement rate as a metric.
  • PM: Define "good" with specific business criteria; that is the judge's rubric.

Sources & references

  1. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena — Zheng et al. (arXiv)
  2. How we built our multi-agent research system — Anthropic Engineering