AI 202Lesson 2 of 4
GuideIntermediateEvaluation
LLM-as-a-judge: how to use model graders without fooling yourself
An LLM judge is a measuring instrument, and like any instrument it must be calibrated before you trust its readings. Judges favour the first or second answer, longer answers and their own outputs, and high raw agreement can hide large score differences. Swap positions, control length, use a different model family, write a tight rubric and compare the judge with human labels using chance-corrected agreement.
AI 202 syllabus · lesson 2 of 4
On this page
- Why use an LLM as a judge at all?
- Which biases do LLM judges have?
- How do you write a rubric a judge can follow?
- How do you calibrate a judge against human labels?
- How do you make judging more robust?
- How do judges fit into a fine-tuning decision?
- Checklist before you trust a judge
- Check your understanding
- Sources and further reading
LLM-as-a-judge means asking a language model to grade the output of another model, either by scoring one answer against a rubric or by choosing the better of two answers. It is the only practical way to grade open-ended qualities such as helpfulness, tone or faithfulness at scale, but a judge is itself a model with errors and biases. It is useful only after you have measured how often it agrees with the people whose judgment it replaces.
Why use an LLM as a judge at all?
Many outputs cannot be checked by code. A support reply can be factually correct and still rude, a summary can be grammatical and still omit the one clause that matters, and a medical answer can be fluent and still unsafe. Human review catches these, but it is slow and expensive, so teams cannot run it on every prompt or model change.
The MT-Bench and Chatbot Arena study made the case for model judges. On its question sets, strong LLM judges matched both expert and crowdsourced human preferences more than 80% of the time, which was about the level at which humans agreed with each other. The same paper also named the problems this lesson is about: position bias, verbosity bias, self-enhancement bias and limited reasoning on questions the judge cannot answer itself.
The right mental model is that a judge is a classifier. It predicts the label a careful human would give. Like any classifier it has a false-pass rate, a false-fail rate and biases, and you should measure them on your task before relying on it, exactly as you would for a model you were about to ship.
Before you build one, check whether you need one. If the answer can be checked by exact match, a JSON schema, a regular expression, a unit test or a numeric tolerance, use code. The evaluation framework lesson covers those deterministic graders; judges are for what is left.
Which biases do LLM judges have?
Position bias
When a judge compares two answers, the order in which they appear changes the verdict. In the study “Large Language Models are not Fair Evaluators”, simply swapping the order let Vicuna-13B appear to beat ChatGPT on 66 of 80 questions when ChatGPT was the judge. The fix the authors proposed, and the one most teams use, is to run every comparison in both orders and count a win only when the judge prefers the same answer both times; inconsistent verdicts become ties or go to a person.
Length and verbosity bias
Judges tend to prefer longer answers even when the extra length adds nothing. AlpacaEval, an automatic benchmark judged by an LLM, was known to favour verbose models. Its authors fitted a regression that predicts what the judge’s preference would be if both answers had the same length; this length-controlled version raised its Spearman correlation with Chatbot Arena human rankings from 0.94 to 0.98 and made the metric harder to game by padding answers.
In your own evaluations, record answer length next to every verdict. If the winning system is also systematically longer, look at a sample by hand before believing the result, and consider telling the judge explicitly that length is not a criterion.
Self-preference
A judge can rate its own outputs more highly than humans do. Panickssery and colleagues found that models such as GPT-4 and Llama 2 can tell their own generations apart from other text with non-trivial accuracy, and that the strength of self-preference rose linearly with this self-recognition ability. If the system you are evaluating and the judge come from the same model family, the comparison is tilted.
Leniency and limited competence
“Judging the Judges” tested thirteen judge models in a deliberately clean setting where humans agreed strongly. Only the best and largest judges reached reasonable alignment with humans, and even they stayed well below human-to-human agreement, with a tendency toward leniency. JudgeBench went further, building pairs where the correct answer is objectively verifiable in knowledge, reasoning, maths and code; many strong judges, GPT-4o among them, did only slightly better than random guessing. A judge that cannot solve a problem cannot reliably tell which answer solved it.
| Bias or weakness | What you see | Mitigation |
|---|---|---|
| Position | Verdict flips when answers swap places | Judge both orders; count consistent wins only |
| Length | Longer answer wins regardless of quality | Log length; instruct the judge; length-controlled analysis |
| Self-preference | Judge favours its own model family | Use a different family, or a panel of families |
| Leniency | Pass rates higher than human pass rates | Binary criteria with explicit fail conditions; calibrate |
| Limited competence | Near-random verdicts on hard questions | Give a reference answer; use code checks where possible |
How do you write a rubric a judge can follow?
Most unreliable judges are unreliable because the instructions are vague. “Rate the helpfulness from 1 to 10” invites the judge to invent its own definition, and the scale has more levels than anyone can apply consistently.
A better rubric has a small number of criteria, each phrased as an observable yes-or-no question, each with a short example of a pass and a fail. Grade each criterion separately and combine them in code, so that you can see which criterion is failing.
You are grading a reply from a customer support assistant.
Answer each question with PASS or FAIL, then give a one-sentence reason.
1. ANSWERS_QUESTION: Does the reply address the customer's actual question?
FAIL if it answers a different question or only restates policy.
2. FACTS_FROM_CONTEXT: Is every factual claim supported by the provided policy text?
FAIL if any claim (dates, amounts, eligibility) is missing from or contradicts it.
3. NEXT_STEP: Does the reply tell the customer exactly what to do next?
4. TONE: Is the reply polite and free of blame?
Reference answer written by a support lead (may be phrased differently):
{reference}
Policy text:
{context}
Customer message:
{question}
Reply to grade:
{answer}
Three choices in this rubric come from the research. Asking for a reason alongside each verdict follows G-Eval and the “multiple evidence” calibration of the fairness study, which both found that judges produce better-aligned scores when they reason before deciding. Supplying a reference answer and an explicit score rubric is what let Prometheus, an open 13-billion-parameter judge, reach a Pearson correlation of 0.897 with human evaluators on customised rubrics, on par with GPT-4’s 0.882 in the same test. And binary criteria make agreement with humans measurable with simple, well-understood statistics.
Pairwise or pointwise?
Pairwise judging asks which of two answers is better. It suits a decision between two systems, such as a tuned model versus the current prompt, and relative judgments are usually more stable than absolute ones. Pointwise judging grades one answer against the rubric. It gives you a pass rate you can track over time and slice by category. Many teams use pointwise criteria for regression tests and pairwise comparisons, in both orders, for release decisions.
How do you calibrate a judge against human labels?
Calibration means measuring how closely the judge’s labels match the labels of the person whose judgment the business trusts. The procedure is simple and should be repeated whenever the rubric, the judge model or the task changes.
- Sample 100 to 200 outputs that cover your important slices, including failures.
- Have a domain expert label each one against the rubric without seeing any judge verdicts. If possible, have a second person label a subset, so you know how much humans agree with each other.
- Run the judge on the same items, in both orders if it is pairwise.
- Compute raw agreement, Cohen’s kappa and the confusion matrix for each criterion.
- Read every disagreement. Decide whether the judge or the rubric is wrong, revise, and repeat on fresh items.
Why chance-corrected agreement matters
Raw agreement is misleading when labels are unbalanced. If 90% of outputs pass, a judge that always says pass agrees with the human 90% of the time and catches nothing. Cohen’s kappa subtracts the agreement you would expect by chance given each rater’s label rates; a kappa near zero means the judge is no better than chance even if raw agreement looks high.
The “Judging the Judges” authors reached the same conclusion from another direction: judges with high percent agreement can still assign very different scores from humans, so look at more than one number.
from sklearn.metrics import cohen_kappa_score, confusion_matrix
# 1 = pass, 0 = fail, aligned item by item
human = [1, 1, 0, 1, 0, 1, 1, 0, 1, 1]
judge = [1, 1, 0, 1, 1, 1, 1, 0, 1, 1]
agreement = sum(h == j for h, j in zip(human, judge)) / len(human)
kappa = cohen_kappa_score(human, judge)
print(f"agreement={agreement:.2f} kappa={kappa:.2f}")
print(confusion_matrix(human, judge, labels=[0, 1]))
# Look at the off-diagonal cells: here the judge passed one answer the human failed.
The confusion matrix tells you which way the judge errs. A judge that passes answers humans fail is dangerous for a release gate; a judge that fails answers humans pass mainly wastes review time. Report both rates, and compare the judge’s kappa with the human-to-human kappa on the same items. A judge cannot be expected to agree with one expert more than a second expert does.
Expect your criteria to drift
The EvalGen study, presented in the talk above, observed what its authors call criteria drift: people need criteria to grade outputs, but grading outputs is what helps them define the criteria. Some criteria only became clear after the participants had seen specific outputs. In practice this means the first rubric is a draft. Plan for at least two calibration rounds, and keep the human-labelled items as a permanent test set for the judge itself.
How do you make judging more robust?
Use a different model family, or a panel
Self-preference argues against judging a model with itself. The “Replacing Judges with Juries” study proposed a panel of several smaller judges from different model families, combined by vote. Across three judge settings and six datasets, the panel outperformed a single large judge, showed less intra-model bias and cost over seven times less. A panel also makes disagreement visible: items where the judges split are good candidates for human review.
Give the judge what it needs
Supply the reference answer, the retrieved context and the policy text the system was given. A judge asked whether an answer is faithful to a document must see the document. The lesson on evaluating RAG and agents shows where faithfulness and citation judges sit in a retrieval pipeline. On questions where the judge itself would struggle, as JudgeBench showed for hard reasoning and maths, prefer a reference answer and a deterministic comparison over an open-ended opinion.
Fix the judge’s configuration
Pin the judge model version, the prompt and the decoding settings, and store them with every score. A provider updating the judge model is a change to your measuring instrument; scores from before and after are not directly comparable until you have re-run calibration.
Keep humans in the loop after release
Even a calibrated judge drifts as inputs change. Route a small random sample of judged outputs to human review each week, plus every item where the panel disagrees or the two orders give different verdicts, and add the human labels to the judge’s test set.
How do judges fit into a fine-tuning decision?
When you compare a tuned model with the current system, the judge’s errors become part of the result. If the judge has a position bias and the tuned model’s answers always appear first, the “improvement” may be the bias. Judge both orders, keep the judge out of the model family being tested, and report the comparison with the paired statistics from the lesson on measuring improvement. If the decision is close, have humans label the items that drive the difference.
On Attempts today, an evaluation runs your deployed tuned model on held-out test examples from its run and scores each answer with the run’s metrics, which are deterministic checks such as exact match. Open-ended qualities that need a judge are graded in your own harness, using the calibration steps in this lesson.
Checklist before you trust a judge
- Could code check this instead? If so, use code.
- The rubric has a few binary criteria, each with pass and fail examples.
- The judge sees the reference answer and any context the system saw.
- Pairwise comparisons run in both orders; inconsistent verdicts are ties or go to a person.
- Answer length is logged next to every verdict.
- The judge comes from a different model family, or a panel of families is used.
- Agreement, Cohen’s kappa and the confusion matrix are reported against blind human labels, next to human-to-human agreement.
- The judge model, prompt and settings are pinned and stored with the scores.
- Calibration is repeated when the rubric, the judge or the task changes, and a human spot-checks a sample every week.
Check your understanding
Answer each question in your own words, then open it to compare with the lesson’s answer.
Q1What are the main biases of LLM-as-a-judge?
Three are well documented. Position bias: the verdict changes when the two answers swap places. Verbosity or length bias: longer answers are preferred even when they are not better. Self-preference: a model rates text it generated, or text from its own family, more highly than humans do. Judges can also be lenient, and they struggle to grade questions they cannot answer themselves.
Q2Should an LLM judge compare two answers or score one answer?
Use pairwise comparison when you are choosing between two systems, because relative judgments are usually more stable than absolute scores; run each pair in both orders. Use pointwise grading against a rubric when you need a pass rate for one system or want to track it over time. Either way, prefer a binary pass or fail per criterion over a 1 to 10 scale.
Q3How do I check whether my LLM judge agrees with humans?
Have a domain expert label 100 to 200 outputs without seeing the judge's verdicts, run the judge on the same items, and report raw agreement, Cohen's kappa and the confusion matrix. Compare with agreement between two humans on a subset. If the judge disagrees mainly in one direction, for example passing answers humans fail, fix the rubric before scaling up.
Q4Why is percent agreement not enough to validate a judge?
When most outputs pass, a judge that always says pass agrees with humans most of the time while being useless. Cohen's kappa corrects for the agreement expected by chance from each rater's label rates. Research on judge alignment also found that judges with high percent agreement can still assign very different scores from humans.
Q5Can I use the same model as both the system and the judge?
Avoid it. Studies show models can recognise their own generations and rate them more highly than humans do, and the bias strengthens with self-recognition. Use a judge from a different model family, or a panel of several smaller judges from different families, and validate it against human labels either way.
Q6When should I not use an LLM judge at all?
Whenever code can check the answer: exact or normalised match, JSON schema validation, regular expressions, unit tests, numeric tolerance or set overlap. Deterministic checks are cheaper, faster and have no bias. Reserve judges for qualities such as tone, helpfulness, completeness or faithfulness that code cannot test.
Sources and further reading
- Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena — arXiv (NeurIPS 2023 Datasets and Benchmarks), 2023
- Large Language Models are not Fair Evaluators — arXiv, 2023
- Length-Controlled AlpacaEval: A Simple Way to Debias Automatic Evaluators — arXiv (COLM 2024), 2024
- LLM Evaluators Recognize and Favor Their Own Generations — arXiv (NeurIPS 2024), 2024
- Judging the Judges: Evaluating Alignment and Vulnerabilities in LLMs-as-Judges — arXiv, 2024
- JudgeBench: A Benchmark for Evaluating LLM-based Judges — arXiv (ICLR 2025), 2024
- Replacing Judges with Juries: Evaluating LLM Generations with a Panel of Diverse Models — arXiv, 2024
- Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferences — arXiv (UIST 2024), 2024
- Prometheus: Inducing Fine-grained Evaluation Capability in Language Models — arXiv (ICLR 2024), 2023
- G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment — arXiv (EMNLP 2023), 2023
- A Survey on LLM-as-a-Judge — arXiv, 2024
- cohen_kappa_score — scikit-learn documentation, 2026
Progress is saved in this browser only. No account needed.