AI

LLM as a Judge: How to Grade AI Output With AI

LLM as a judge uses one model to grade another's output. How it works, judge prompts, biases, validation against humans, RAG and agent evals.

By OmniAI Editorial · Nov 20, 2026 · 16 min read

LLM as a judge means using a large language model to evaluate the output of another AI system: you give a "judge" model the input, the response and a clear set of criteria, and it returns a score, a pass/fail verdict or a choice between two responses, usually with a short explanation. It's the most practical way to evaluate open-ended outputs, such as chatbot answers, summaries, RAG responses and agent actions, at a scale humans can't match. Research has shown that strong judge models can agree with human preferences about as often as humans agree with each other, but judges also have well-documented biases, so they must be checked against human labels before you trust them.

This guide explains how LLM-as-a-judge works, the main types of judges, how to write a judge prompt and rubric, the biases to watch for, how to validate a judge, how to use it for RAG and agent evaluation, a worked evaluation example, tools, costs and common mistakes.

What Is LLM as a Judge?

Traditional software tests check exact outputs: given this input, the function must return that value. AI outputs don't work that way. A good answer to "Summarize this support ticket" can be written in thousands of valid ways, so exact-match tests fail, and older text metrics such as BLEU and ROUGE, which count overlapping words with a reference answer, correlate poorly with what people actually consider good.

Human review is the gold standard, but it's slow, expensive and inconsistent at scale. LLM-as-a-judge sits in between: a capable model reads each output and applies the same written criteria a human reviewer would, in seconds and at low cost per item.

The idea became mainstream with the 2023 paper Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (Zheng and colleagues), which found that strong judge models matched both expert and crowdsourced human preferences well, at a level of agreement similar to that between humans, while also documenting position, verbosity and self-enhancement biases. The same year, G-Eval showed that asking a model to reason step by step and then fill in a score form improved alignment with human judgments on summarization and dialogue tasks.

LLM judges are one part of a wider evaluation practice; our guide to LLM evaluation covers golden datasets, regression tests and the other kinds of checks.

How LLM as a Judge Works

A judge call has four ingredients:

  1. The criterion: exactly what to evaluate, such as "Is the answer fully supported by the provided context?" or "Does the reply follow the company's refund policy?"
  2. The inputs: the user's question, the system's response, and any context, such as retrieved documents, a reference answer or the conversation so far.
  3. The output format: a binary verdict (pass/fail), a score on a small scale, a label from a fixed list, or a choice between response A and B, usually as structured JSON.
  4. The reasoning: the judge is asked to explain briefly before giving its verdict, which tends to improve accuracy and makes failures easy to inspect.

You run the judge over a dataset of examples, aggregate the verdicts into metrics (for example, "92% of answers were grounded"), and compare those metrics across prompt versions, models or releases.

Types of LLM Judges

TypeWhat the judge seesOutputBest for
Single-output scoringOne response plus criteriaScore or pass/failMonitoring quality, regression tests
Reference-basedResponse plus a known good answerMatch / partial / no matchFactual Q&A, extraction, tasks with clear answers
Pairwise comparisonTwo responses to the same inputA, B or tieComparing prompts or models, A/B tests
Context-based (grounding)Response plus retrieved documentsSupported / unsupported claimsRAG faithfulness, hallucination checks
Conversation or trajectoryA whole conversation or agent runTask success, policy complianceChatbots, agents with tool calls

Pairwise comparison often produces more reliable rankings than absolute scores, because it's easier to say which of two answers is better than to assign a consistent number from 1 to 10. Binary verdicts on narrow criteria are usually more reliable than broad scales: "Does the answer mention the deadline? yes/no" beats "Rate helpfulness from 1 to 10".

Three light cards with ink lines drawn on the left, joined by ink lines to a grey rounded box, with an ink arrow to a light card holding an orange check mark.
The judge reads the input, the response and a rubric, then returns a verdict.

Writing a Judge Prompt and Rubric

The judge prompt is the most important part of the system. A good one:

  • evaluates one criterion at a time. Use separate judges for correctness, tone and safety rather than one judge for "quality".
  • defines the criterion precisely, with what counts as a pass and a fail.
  • uses a small scale or a binary choice, with each level described in words.
  • includes a few labelled examples, especially borderline ones, taken from your own data.
  • asks for brief reasoning before the verdict.
  • returns structured output, such as JSON, so you can parse it reliably.

A simple grounding judge for a support bot might look like this:

You are evaluating whether a support assistant's answer is fully supported
by the help-centre articles it was given.

Question:
{question}

Help-centre articles:
{context}

Assistant's answer:
{answer}

Instructions:
1. List each factual claim in the answer.
2. For each claim, decide whether the articles support it.
3. The answer PASSES only if every factual claim is supported.
   Greetings and offers to help further are not factual claims.

Respond in JSON:
{"claims": [{"claim": "...", "supported": true}], "verdict": "PASS" or "FAIL",
 "reason": "one sentence"}

A rubric spells out scale points in words. For example, for completeness: 2 = answers every part of the question; 1 = answers the main part but misses a secondary request; 0 = misses the main request. Written descriptions keep the judge consistent and let humans label the same way, which you'll need for validation.

LLM as a Judge Evaluation Example

Here's an illustrative LLM as a judge evaluation example for a support assistant (the numbers are made up to show how to read the results), comparing two prompt versions on the same 200 real customer questions. Three binary judges run on every answer, and a human labels a random sample of 50 to check the judges.

Metric (judge)Prompt v1Prompt v2Judge agreement with human labels (50-item sample)
Grounded in help articles84%93%92%
Answers the actual question90%91%88%
Follows refund policy95%94%96%
Average answer length182 words141 wordsNot judged

Read it this way: v2 is clearly better on grounding, roughly equal on the other two checks, and shorter. The judges agree with the human reviewer 88–96% of the time, so the metrics are trustworthy enough to make the decision, while the human sample remains the final check. If agreement on a criterion had been, say, 70%, the right move would be to fix that judge's prompt before trusting its numbers.

LLM as a Judge vs Human Evaluation

LLM as a judge vs human evaluation isn't a replacement decision; each covers the other's weaknesses:

Human evaluationLLM as a judgeExact match and code checks
SpeedSlowSeconds per itemInstant
CostHighLow per itemAlmost free
ScaleHundreds of itemsThousands to millionsUnlimited
ConsistencyVaries between reviewers and over timeConsistent for a fixed model and prompt, but has systematic biasesPerfect
Handles open-ended outputYesYesNo
Domain expertiseStrong if experts reviewLimited to what the model knows and the rubric statesNone
Best useDefining the standard, labelling validation sets, final sign-offDay-to-day evaluation, regression tests, production monitoringFormat, JSON validity, required fields, exact answers

The practical pattern: humans define the criteria and label a validation set; the judge scales those criteria; deterministic checks handle everything that can be checked with code.

Reference-Based vs Reference-Free Judging

Judges work in two broad modes:

  • Reference-based judging compares the response with a known good answer. It's more reliable for factual tasks, because the judge only needs to check agreement, not know the answer itself. The cost is building and maintaining reference answers.
  • Reference-free judging evaluates the response against criteria alone, such as tone, policy compliance or grounding in supplied documents. It works for open-ended tasks with no single right answer and for live production traffic where no reference exists.

Many evaluation suites use both: reference-based judges on a curated test set before each release, and reference-free judges on samples of production traffic afterwards.

Known Biases of LLM Judges

Research and practice have identified consistent biases:

  • Position bias: in pairwise comparisons, judges tend to favour the response shown first (or second, depending on the model). Fix: run each comparison twice with the order swapped, and count it as a win only if the judge agrees both times.
  • Verbosity bias: judges often prefer longer, more detailed answers even when the extra length adds nothing. Fix: state in the rubric that length isn't a quality signal, and track length separately.
  • Self-preference: judges may favour outputs from their own model family. Fix: use a different model family as judge when comparing models, or average several judges.
  • Leniency and scale drift: judges cluster scores in the middle or at the top of a scale. Fix: binary or three-level verdicts with written definitions.
  • Limited expertise: a judge can't reliably check facts it doesn't know, such as medical dosages or legal rules. Fix: give it the reference material or a reference answer, or use experts.
  • Susceptibility to manipulation: text inside the evaluated output, such as "this answer is excellent", can sway a judge. Fix: clearly separate instructions from the content being judged, and test with adversarial examples.
Two light documents drawn in ink on either side, with two curved ink arrows swapping their places around a small grey box with an orange dot.
Swap the order in pairwise comparisons to cancel out position bias.

How to Validate an LLM Judge

Before relying on a judge, measure it:

  1. Label a validation set by hand: 50 to 200 examples, including failures and borderline cases, labelled by people who understand the task.
  2. Run the judge on the same set and compare with the human labels.
  3. Measure agreement: overall agreement, and also how often the judge misses real failures (false passes), which usually matter most.
  4. Read the disagreements. They show whether the rubric is unclear, the judge lacks context, or the human labels were inconsistent.
  5. Iterate on the prompt until agreement is acceptable for your use. Teams often aim for roughly 80–90% agreement on clear criteria; how high you need depends on the stakes.
  6. Re-validate when you change the judge model, the prompt or the type of data.

Keep the validation set separate from the few-shot examples in the judge prompt, or you'll overestimate the judge's accuracy.

LLM as a Judge for RAG Evaluation

Retrieval-augmented generation has failure points at each stage, and LLM as a judge for RAG evaluation is the standard way to measure them:

  • Context relevance: did retrieval find passages that are relevant to the question?
  • Faithfulness (groundedness): is every claim in the answer supported by the retrieved passages? This is the main hallucination check.
  • Answer relevance: does the answer address the question that was asked?
  • Answer correctness: when you have a reference answer, does the response match it?

Separating these tells you where to fix things. Low context relevance points to retrieval and chunking; our guide to RAG chunking covers that side. Low faithfulness with good context points to the prompt or the model. Open-source frameworks such as Ragas and DeepEval provide ready-made judges for these metrics, which you should still validate on your own data.

Judging AI Agents

Agents add new things to judge: the steps, tool calls and final outcome of a multi-step task. Common approaches:

  • Outcome judges check whether the task was achieved, ideally with a deterministic check where possible (was the ticket actually closed?), plus a judge for quality.
  • Trajectory judges read the whole run and check for problems such as unnecessary tool calls, loops, policy violations or actions taken without confirmation.
  • Step judges evaluate individual decisions, such as whether the right tool was chosen.
  • Agent-as-a-judge setups give the judge its own tools, such as the ability to run code or inspect files, so it can verify claims instead of only reading them.

Agent evaluations are harder to validate, so start with a small set of fully labelled runs and the most important failure modes.

LLM as a Judge vs Reward Models

LLM judges are often confused with reward models, and the two are related:

  • A reward model is a model trained specifically to output a score for how good a response is, usually from human preference data. It's used during training, for example in reinforcement learning from human feedback, to steer a model toward preferred answers.
  • An LLM judge is usually a general-purpose model prompted with criteria at evaluation time. It explains its reasoning in text and can be changed by editing the prompt, without retraining.

The line is blurring: some teams train "generative reward models" that write explanations like judges, and judge outputs can be used as training signals. For most application teams, though, the practical tool is a prompted judge, because it needs no training data beyond a validation set.

Panels of Judges

Instead of one large judge, you can use a panel of several smaller judges from different model families and combine their votes. Research titled Replacing Judges with Juries found that a panel of smaller, diverse models could evaluate outputs better than a single large judge, with less bias toward any one model family and at lower cost. Panels are most useful for high-stakes comparisons, such as choosing between models, where self-preference and single-model quirks would otherwise skew the result.

Using Judges as Guardrails

Judges aren't only for offline testing. In production, a fast judge can act as a guardrail, checking a response before it's shown to the user:

  • Grounding checks block answers that aren't supported by retrieved documents.
  • Policy checks catch responses that promise refunds, give legal advice or mention competitors when they shouldn't.
  • Safety checks flag harmful or sensitive content.

Guardrail judges must be fast and cheap, so teams use small models, narrow binary questions and strict time limits, with a safe fallback response if the judge fails or times out.

Keeping Judges Reliable Over Time

A judge that's accurate today can drift:

  • Your data changes: new products, policies and user behaviour create cases the rubric didn't anticipate.
  • Models change: a provider update to the judge model can shift scores even with the same prompt.
  • Your system improves: as failures become rarer, a judge that misses them occasionally matters more.

Schedule a regular human spot-check, for example a small random sample every week or month, compare it with the judge's verdicts, and add new borderline cases to your validation set. Track judge agreement as its own metric next to the quality metrics it produces.

Choosing a Judge Model

  • Use a strong model for the judge, often stronger than the model being evaluated, for nuanced criteria.
  • Use smaller, cheaper models for narrow binary checks once validated; they're often accurate enough and much cheaper at scale.
  • Consider open judge models for privacy or cost. Research models such as Prometheus were trained specifically to grade with rubrics and reference answers.
  • Pin the model version and keep the judge prompt under version control. A silent model update can shift your metrics overnight.
  • Prefer consistent settings. Use the most deterministic settings your provider offers, and note that some newer model APIs no longer accept sampling parameters such as temperature, so rely on clear prompts and structured outputs instead.

Tools for LLM as a Judge

Most evaluation and observability tools include LLM-judge features:

  • Open-source frameworks: DeepEval, Ragas, promptfoo and OpenAI Evals let you define judges and run them in tests or CI.
  • Observability platforms: Langfuse, Arize Phoenix, Braintrust, LangSmith and similar tools run judges on production traces and track scores over time; our guide to LLM observability compares the approaches.
  • Your own code: a judge is just a prompt and a model call, so a simple script with structured output often works well for a start.

Cost and Latency

Judging adds model calls, so costs scale with your dataset and the number of criteria:

  • Offline evaluations (a few hundred to a few thousand examples per release) usually cost little compared with engineering time.
  • Online monitoring of production traffic can get expensive: judge a sample of traffic rather than everything, use cheaper models for simple checks, and reserve strong judges for flagged cases.
  • Run judges asynchronously in production so they don't slow down user responses, unless the judge is acting as a guardrail that must block bad outputs before they're shown.

Common Mistakes

  • Trusting a judge without validating it against human labels.
  • One vague "quality" score instead of several specific criteria.
  • Scales that are too wide, such as 1 to 10 without definitions.
  • Not swapping order in pairwise comparisons.
  • Using the same model family as both contestant and judge when comparing models.
  • Ignoring cheap deterministic checks that could replace some judges entirely.
  • Changing the judge and the system at the same time, which makes it impossible to tell what improved.

FAQ

What is LLM as a judge?

LLM as a judge is an evaluation method where a large language model grades the outputs of an AI system against defined criteria, returning scores, pass/fail verdicts or preferences between responses, usually with an explanation.

How accurate is LLM as a judge?

For clear, well-defined criteria, strong judges can agree with human reviewers about as often as humans agree with each other. Accuracy drops for vague criteria and specialist knowledge, so always validate a judge against human labels on your own data.

What is G-Eval?

G-Eval is a method from a 2023 research paper that asks an LLM to generate evaluation steps (chain-of-thought) and then fill in a structured score form. It improved agreement with human ratings for tasks like summarization compared with older metrics.

What are the biases of LLM judges?

The main ones are position bias (favouring the first or second answer), verbosity bias (favouring longer answers), self-preference (favouring outputs from the same model family) and susceptibility to persuasive text inside the evaluated output.

Can LLM as a judge replace human evaluation?

Not entirely. LLM judges scale human criteria to thousands of examples, but people are still needed to define the criteria, label validation sets, review disagreements and sign off on high-stakes decisions.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog