What Is LLM-as-a-Judge? How to Use an AI Model to Grade AI Output, and When to Trust It
LLM-as-a-judge explained for product managers: how it works, the three types, the biases researchers have measured, and how to check a judge against human labels before you rely on it.
Short answer: LLM-as-a-judge means using a large language model (LLM) to grade the output of an AI feature against criteria you write down, such as "answers the question using only our refund policy". It lets a team check thousands of answers in minutes, but the judge is itself an AI that can be wrong, so you measure it against human labels before you trust its scores.
What is LLM-as-a-judge?
LLM-as-a-judge is an evaluation method in which one language model scores or compares the output of another AI system. You give the judge a prompt that describes what good looks like, the input the user sent and the answer your product gave. The judge returns a verdict, such as pass or fail, a score or "answer A is better", usually with a short explanation.
A simple example: your customer-support assistant answers a refund question. The judge prompt says: "Pass only if the reply answers the customer's question and every statement matches the refund policy below. Explain your reasoning, then answer PASS or FAIL." Run that over 2,000 real conversations and you get a pass rate in minutes, plus a list of failures to read.
The best-known study of the method is the 2023 paper Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena by Lianmin Zheng and colleagues (NeurIPS 2023 Datasets and Benchmarks Track), which tested how well strong models such as GPT-4 agree with human preferences.1 LLM-as-a-judge is one of the three main ways to grade AI evals, alongside code checks and human review.
Why do teams use LLM-as-a-judge?
Because the alternatives don't scale to the questions that matter. Code can check that a reply is valid JSON or under 200 words, but it can't tell whether the reply was helpful, polite or faithful to a document. People can, but they are slow and expensive. OpenAI's evaluation guide puts it plainly: using models to judge output "is cheaper to run and more scalable than human evaluation."8
The research also shows that a good judge can get close to human agreement. In Zheng and colleagues' study, GPT-4 as a judge agreed with human preferences more than 80% of the time, "the same level of agreement between humans."1
What the research found
What are the three types of LLM judge?
Zheng and colleagues describe three variations, and most real setups use one of them:
| Type | How it works | Good for |
|---|---|---|
| Pairwise comparison | The judge sees one question and two answers, and picks the better one or calls a tie | Choosing between two prompts or two models |
| Single answer grading | The judge grades one answer on its own, as pass/fail or a score | Checking quality on every release and in production |
| Reference-guided grading | The judge compares the answer with a correct reference answer you provide | Questions with a known right answer, such as maths or policy facts |
OpenAI's evaluation guide gives the same advice: "Use pairwise comparison or pass/fail for more reliability."8
What biases do LLM judges have, and how do you reduce them?
LLM judges make systematic mistakes. These are the ones researchers have measured, with the fixes that research and practitioners recommend:
| Bias | What happens | How to fix |
|---|---|---|
| Position bias | The judge favours an answer because of where it appears. With ChatGPT as the judge, changing only the order let Vicuna-13B beat ChatGPT on 66 of 80 questions2 | Run each comparison twice with the order swapped, and count a win only if the same answer wins both times1 |
| Verbosity bias | The judge favours longer, wordier answers, even when they are not clearer or more accurate1 | Control for response length, and say in the rubric that length is not a sign of quality8 |
| Self-preference | The judge favours answers it wrote itself. Models such as GPT-4 and Llama 2 can partly recognise their own writing, and the better they recognise it, the stronger the bias3 | Use a judge from a different model family than the one that wrote the answer, or a panel of judges |
| Weak maths and reasoning | The judge can accept wrong answers to maths and reasoning questions1 | Give the judge a reference answer. In Zheng's tests this cut the failure rate on maths questions from 70% to 15%1 |
Two more habits help across the board. Ask the judge to reason before it gives the verdict; OpenAI's guide says reasoning before scoring "improves eval performance".8 And add a few worked examples to the prompt: in Zheng's study, few-shot examples raised GPT-4's consistency when the answer order was swapped from 65.0% to 77.5%.1
How do you build an LLM judge you can trust?
This method follows the practice Hamel Husain describes in his guide Using LLM-as-a-Judge For Evaluation,7 plus the research above. A product manager can lead it, and planning it needs no code.
- Find the principal domain expert. Husain notes that in most organisations "there is usually one (maybe two) key individuals whose judgment is crucial", such as a senior support lead for a support assistant. Their judgment is the standard the judge has to match.
- Collect real examples. Take a varied sample of real inputs and outputs, including the awkward ones. Our free AI PRD Template has a test-set section you can use.
- Have the expert mark each one pass or fail, with a written reason. Husain calls this "critique shadowing". His advice: "Don't stray from binary pass/fail judgments when starting out", because people "don't know what to do with a 3 or 4."
- Write the judge prompt from those critiques. One clear criterion per judge, a detailed rubric, a few of the expert's labelled examples, reasoning first and a PASS or FAIL verdict last.
- Measure the judge against the expert. Run it on labelled examples it hasn't seen. Don't rely on overall agreement alone. "Raw agreement can be misleading when classes are imbalanced," Husain writes, so report the true positive rate (real passes it passes) and the true negative rate (real failures it catches) separately. For example, a judge that always says "pass" agrees 95% of the time on a set where 5% of answers fail, and catches none of the failures.
- Improve, then scale. Fix the prompt where it disagrees with the expert, and measure again. OpenAI's guide says to scale up once the judge is "faster, cheaper, and consistently agrees with human annotations."8
- Re-check regularly. Measure again when the model, the prompt or your criteria change. Criteria do change: researchers call this "criteria drift", because "users need criteria to grade outputs, but grading outputs helps users define criteria".5
Can you use several judges instead of one?
Yes. Instead of one large model, you can ask a panel of smaller models from different model families and combine their votes. In Replacing Judges with Juries,4 the researchers tested this across three judge settings and six datasets. The panel, which they call a PoLL (Panel of LLM evaluators), "outperforms a single large judge", shows "less intra-model bias" because its members come from different model families, and was "over seven times less expensive."
A panel is worth considering when one judge's cost or bias becomes a problem. For most teams starting out, one well-measured judge is enough.
When should you not use an LLM judge?
- When code can check it. Format, length, required fields, banned words and exact matches are cheaper and fully reliable as code checks.
- Before anyone has labelled examples. Without human labels you can't tell whether the judge is right, so its scores look precise but prove nothing.
- As the only check on high-stakes output. For medical, legal or financial answers, keep people reviewing a sample even after the judge is trusted. A study of 13 judge models found that "judges with high percent agreement can still assign vastly different scores".6
Where can I learn to build LLM judges?
Product Faculty's AI Evals certification is three weeks, with three live 2.5-hour classes taught by Reah Miyara, Senior Director at Google Models. You design annotation and adjudication workflows, build representative cases, edge cases and a golden set, design and calibrate LLM-as-a-judge prompts, and set up dashboards and release gates. Your capstone is an end-to-end evaluation system for a real AI feature.
For evals inside the full product workflow, AI Product Management has you build automated eval suites that use LLMs as graders. For the wider picture, start with What Are AI Evals?
FAQ
What is LLM-as-a-judge?
LLM-as-a-judge is an evaluation method in which a large language model grades or compares the output of an AI system against written criteria. It returns a verdict such as pass/fail, a score or a preferred answer, usually with a reason.
Is LLM-as-a-judge accurate?
It can be. In Zheng et al. (2023), GPT-4 as a judge agreed with human preferences more than 80% of the time, about as often as humans agree with each other. But judges have known biases, so measure yours against human labels before you trust it.
What are the main biases of LLM judges?
Position bias (favouring an answer because of where it appears), verbosity bias (favouring longer answers), self-preference (favouring their own writing) and weak grading of maths and reasoning questions.
Should an LLM judge use a 1–5 scale or pass/fail?
Start with pass/fail plus a written reason. Binary verdicts are easier to check against human labels and to act on, and OpenAI recommends pairwise comparison or pass/fail for reliability.
How do I know if my LLM judge is good enough?
Compare it with a domain expert's pass/fail labels on examples it hasn't seen. Report the true positive rate and the true negative rate separately, because overall agreement can hide a judge that misses rare failures.
Can the same model write and judge answers?
It can, but research shows models tend to favour their own output. Where possible, use a judge from a different model family, or a panel of judges from several families.
Where can I learn LLM-as-a-judge?
Product Faculty's AI Evals certification teaches you to design and calibrate LLM-as-a-judge prompts in three live classes with Reah Miyara, Senior Director at Google Models.
Sources
- Zheng, L. et al. (2023). Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. NeurIPS 2023 Datasets and Benchmarks Track.
- Wang, P. et al. (2023). Large Language Models are not Fair Evaluators.
- Panickssery, A., Bowman, S. R. and Feng, S. (2024). LLM Evaluators Recognize and Favor Their Own Generations.
- Verga, P. et al. (2024). Replacing Judges with Juries: Evaluating LLM Generations with a Panel of Diverse Models.
- Shankar, S. et al. (2024). Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferences.
- Thakur, A. S. et al. (2024). Judging the Judges: Evaluating Alignment and Vulnerabilities in LLMs-as-Judges.
- Husain, H. (2024). Using LLM-as-a-Judge For Evaluation: A Complete Guide.
- OpenAI. Evaluation best practices.
Learn to measure AI quality
Build and calibrate LLM judges for a real AI feature in AI Evals, part of the AI Builder Fellowship.