A grader that never gets tired, reads ten thousand answers overnight, and costs a few dollars sounds too good to be true, and partly it is. LLM as judge means using one language model to score or rank the outputs of another model (or of itself) against criteria you define. It works well enough to be the default way teams grade open-ended text, and badly enough that an uncalibrated judge will quietly steer you into shipping worse prompts.
The short version: a judge is a measurement instrument, not an oracle. Like any instrument you need to know its error bars, and you find them by comparing it against humans on a small labeled sample. The rest of this guide is the practical path from “ask GPT to rate this 1-10” to a judge you can trust enough to put in a pipeline, including the biases that bite, the prompt shape that reduces them, and the checks that tell you when to stop believing it.
Where a judge earns its keep (and where it should not be used)
Exact-match and regex checks cover maybe a third of what you care about. They cannot tell you whether a summary dropped the one caveat that mattered, whether a support reply was condescending, or whether an answer stayed inside the retrieved evidence. Those are the jobs judges are good at: fuzzy, language-shaped criteria where a competent human could decide quickly but writing code to decide is impractical.
Judges are a poor fit when a deterministic check exists. If the output must be valid JSON, parse it. If it must contain an order number, assert on the string. If a SQL query must return the right rows, run it. Spend judge tokens only on what code cannot decide, and your eval suite gets cheaper, faster, and less noisy at once.
They are also a poor fit as the sole safety net for high-stakes domains. Medical, legal, and financial answers still need sampled human review; the judge’s job there is to rank which outputs a human should read first.
Three judge shapes: pointwise, pairwise, and reference-based
Pointwise judging scores one output at a time against a rubric (“does the answer cite a source for each claim: yes/no”). It is cheap, parallel, and easy to track over time, but absolute scores drift between judge models and prompt versions, so compare only scores produced by the same judge setup.
Pairwise judging shows two candidate answers and asks which is better. Humans and models are both more consistent at relative comparison than at absolute scoring, which makes pairwise the better tool for “is prompt B better than prompt A?” It costs more as candidates grow and it is highly exposed to position bias, covered below.
Reference-based judging gives the judge a trusted answer (or a list of facts that must appear) and asks whether the candidate agrees. This is the sturdiest of the three because the judge is checking rather than inventing standards. It needs reference material, which is exactly what a golden dataset provides.
A practical default: reference-based pointwise for regression suites, pairwise for choosing between two prompt or model candidates, and plain pointwise for open-ended production sampling where no reference exists.
Writing a rubric a model can actually follow
Vague rubrics produce vague scores. “Rate helpfulness from 1 to 10” invites the judge to invent its own scale, and it will invent a different one tomorrow. Better rubrics share four traits:
- One criterion per judge call. Ask about groundedness or tone or completeness, not all three. Blended scores are impossible to debug.
- Binary or three-level scales. Pass/fail, or “fully / partially / not at all”, with a written definition of each level. Ten-point scales mostly measure the judge’s mood.
- Anchored examples. Include one clearly passing and one clearly failing example inside the prompt, ideally drawn from real failures.
- Reasoning before the verdict. Let the judge write a short justification first, then output the label in a fixed format. This tends to improve agreement with humans and gives you something to read when a score looks wrong.
Here is the shape of a groundedness judge that follows those rules:
You are grading whether an ANSWER is supported by the CONTEXT.
Definitions:
- SUPPORTED: every factual claim in the answer appears in the context.
- PARTIAL: at least one claim is unsupported, but the main point is supported.
- UNSUPPORTED: the main point is not in the context, or contradicts it.
Think step by step in at most 4 sentences, then output exactly:
VERDICT: SUPPORTED | PARTIAL | UNSUPPORTED
CONTEXT: {{context}}
ANSWER: {{answer}}
Notice what is missing: no request for a number, no mention of style, no instruction to be “strict” or “generous.” Adjectives like those shift the distribution of verdicts without telling you why.
The biases that quietly corrupt scores
Research on model-graded evaluation, including the MT-Bench and Chatbot Arena work, has documented several repeatable judge biases. Three matter most in day-to-day builds.
Position bias. In pairwise grading the judge often prefers whichever answer appears first (or last). The fix is cheap: run every comparison twice with the order swapped, and count a win only when both orderings agree. Disagreements become ties, and the tie rate itself is a useful measure of how noisy your judge is.
Verbosity bias. Longer answers tend to score higher even when the extra length is filler. If your new prompt makes answers 40% longer and the judge loves it, be suspicious. Track answer length next to the score, and consider an explicit rubric line such as “do not reward length; penalize repeated or irrelevant content.”
Self-preference. A judge can favor outputs written by its own model family. If GPT-class models generate your answers and a GPT-class model grades them, you may be inflating results. Prefer a judge from a different family than the generator, or use two judges and flag disagreements.
Other effects worth testing for are formatting bias (markdown headers and bullets scoring better than plain prose) and sycophancy toward confident tone. You do not need a research program: build five or six adversarial pairs, such as the same answer in bullets versus prose, and see whether the verdict moves.
Calibrate against humans before you trust the number
The step most teams skip is the one that makes a judge usable. Take 50 to 100 real outputs, have a person who knows the product label them with your rubric, and run the judge on the same items. Then compute agreement.
- Raw agreement is the easy number, but it flatters judges when one label dominates.
- Cohen’s kappa corrects for chance agreement and is a better headline metric for binary or three-level labels.
- A confusion table shows the failure direction. A judge that lets bad answers through (false passes) is far more dangerous in a release gate than one that over-flags.
If agreement is low, resist the urge to swap models first. Read the disagreements. Usually the rubric is ambiguous, the humans disagreed with each other, or the judge sees less context than the human did. Fix the rubric, relabel, and rerun. Keep the labeled set; it becomes the unit test for your judge, rerun whenever you change the judge prompt or model.
Failure modes and what they look like in practice
- Score inflation after a judge upgrade. A newer judge model is stricter or looser, and every number shifts overnight. Pin the judge model version, and when you change it, rerun the previous baseline with the new judge before comparing anything.
- Judge sees the answer but not the evidence. Groundedness judges fed only the answer will guess. Pass the retrieved context and use the same context your production pipeline served. The RAGAS evaluation guide covers how faithfulness-style metrics depend on this, and the RAGAS documentation lists the exact metric definitions.
- Leaking the label. If your test row includes “expected: refuse” and the judge prompt echoes it, the judge learns to agree with metadata instead of reading the answer.
- Rubric overfitting. Tune prompts against a judge long enough and you optimize for the judge’s taste. Hold out a human-labeled slice that the judge never saw during prompt iteration.
- Nondeterminism. Set temperature to zero where the provider allows, but still expect small variation. For borderline gates, average two or three runs rather than trusting one.
Operating a judge inside a real pipeline
Treat the judge as a versioned component with its own change log. Store the judge prompt, model identifier, and rubric version alongside every score so a number from March can be interpreted in June. Log judge reasoning text so reviewers can audit a surprising failure without rerunning it.
Budget deliberately. A judge call per test row per metric multiplies fast: 300 rows and four criteria is 1,200 calls per run. Cache judge verdicts keyed on the hash of the input, output, and judge version; unchanged outputs then cost nothing on reruns. Run the cheap deterministic assertions first and skip judge calls for rows that already failed.
Then connect scores to decisions. A judge becomes valuable when it feeds a threshold that blocks or approves a change, which is the subject of eval regression gates. If you are wiring this into a wider ownership model, the LLMOps production guide shows where judge scores sit next to traces, cost, and rollout controls, and the harness view in what is an agent harness explains why the judge belongs inside the loop that supervises agent behavior rather than bolted on afterward. For a concrete implementation, DeepEval and promptfoo both ship judge-style assertions you can adopt instead of writing the plumbing yourself.
A one-week rollout plan
1. Day 1: pick the single failure that costs you most (hallucinated claims, wrong tone, missed refusals) and write a one-criterion rubric. 2. Day 2: hand-label 60 outputs. Note where you hesitated; those are rubric gaps. 3. Day 3: implement the judge prompt, run it, compute agreement and kappa, and read every disagreement. 4. Day 4: add order-swapping for any pairwise use and an adversarial bias set. 5. Day 5: wire it into your eval runner with caching and version stamps, and record a baseline score.
By the end of the week you have a judge with a known error rate, which is worth more than a sophisticated judge with an unknown one. The upstream docs for the tooling you pick, such as the promptfoo llm-rubric reference and DeepEval’s G-Eval metric page, show concrete implementations of the same ideas.
Questions about using LLM as judge
What is LLM as judge in simple terms?
It is the practice of using a language model to grade another model’s output against a rubric you wrote, returning a label, score, or preference. It scales review beyond what humans can read, but its verdicts need calibration against human labels.
Is LLM as judge reliable enough for release decisions?
It can be, once you measure it. Label 50 to 100 outputs by hand, compare judge verdicts using a chance-corrected metric like Cohen’s kappa, and fix the rubric until agreement is acceptable for your risk level. Without that step the score is a guess with decimals.
Should the judge be a different model from the one that generated the answer?
Preferably yes. Models can favor text from their own family, so using a judge from a different provider or family reduces self-preference inflation. If cost forces the same model, add a human-labeled holdout to catch the bias.
Pointwise or pairwise judging, which should I use?
Use pairwise when comparing two candidates, since relative judgments are more consistent, and swap the order to cancel position bias. Use reference-based pointwise grading for regression suites where you want a stable number over time.
How do I stop the judge from rewarding long answers?
Grade one criterion per call, write an explicit line telling the judge not to reward length, and log answer length beside the score. If scores climb whenever outputs get longer, treat that as a bias signal rather than a quality gain.
How many examples do I need to validate a judge?
Fifty to a hundred labeled items is a workable starting point for a single binary criterion. Add more where the judge and humans disagree, and make sure your sample covers rare failures instead of only easy cases.
AI Generated Apps AI Code Learning Technology
