LLM-as-Judge

An LLM grades another LLM.

A model evaluates outputs against criteria, rubrics, or comparative examples — scoring one output at a time (pointwise) or picking the better of two (pairwise, more robust to score drift). Structuring the judgment as chain-of-thought reasoning before a form-filled score (the G-Eval paradigm) improves alignment with human ratings.

In practiceA customer-service platform runs a frontier-model judge nightly over a sampled 5% of agent responses, flagging answers that fail a tone-and-accuracy rubric before they surface in the weekly quality report.

Without itWithout an automated judge, semantic regressions — answers that are factually wrong yet structurally valid — accumulate undetected, since schema validators and log monitors have no rubric for correctness or tone. See the anti-pattern →

Level
04 · Production
Subdomain
Observability & Evaluation
Also known as
Model Judge, AI Evaluator, LLM Evaluator, Evaluation & Monitoring
Trade-off
Scalable evaluation is gained against uncertainty and calibration needs.
Native in
LangSmith, OpenAI Evals, Microsoft Agent Framework, Google ADK, AutoGen / AG2
The mechanism

How it works.

A second model reads an answer together with a rubric and returns a judgement. It reasons first and scores afterwards, and its scores are compared with human ratings before anyone relies on them.

1 · Prepare

  1. Write the rubricCriteria, with a description per score
  2. CalibrateCompare the judge with human ratings on a sample

2 · Judge

  1. Give the judge the caseQuestion, answer, rubric, reference material
  2. Reason firstStep by step, per criterion
  3. ScoreOne value per criterion
  4. AggregateAcross the sample, into a report
Rubric
The criteria and what each score means. A judge without one invents its own scale on every call.
Pointwise and pairwise
Pointwise scores one answer. Pairwise picks the better of two and is less sensitive to a judge whose scale drifts.
Calibration
Measuring how often the judge agrees with people. Without it a score is only a number.
Walk it through

A real run, step by step.

TaskA support platform has a judge model score a nightly sample of answers for accuracy and tone, on a scale from 1 to 5. The policy text is part of the judge's input:
Illustrative scores.
AnswerAccuracyToneFlag
Explains the return policy correctly and kindly55None
Correct, but curt, and blames the customer52Flagged for tone
Polite, but names a return period of 60 days where the policy says 3015Flagged for accuracy
Correct and polite55None
What this shows: the third answer is the valuable catch. It reads well and is wrong, and the judge could see that only because the policy text was in its input. A judge has blind spots of its own. It tends to rate text from its own model family more kindly, so the judge should be a different model from the one being judged, and its agreement with human ratings should be measured again from time to time.
In code

The pattern in code.

Plain Pythonpython
import random

RUBRIC = """Accuracy (1-5): does the answer match the policy text?
Tone (1-5): is the answer polite and free of blame?"""

def judge(question, answer, policy):
    reply = judge_model(
        f"{RUBRIC}\n\nPolicy:\n{policy}\n\nQuestion:\n{question}\n\nAnswer:\n{answer}\n\n"
        # reason first,
        "First reason about each criterion in two sentences. "
        'Then return JSON: {"accuracy": n, "tone": n}.'  # score afterwards
    )
    return parse_scores(reply)

def nightly_report(conversations, sample_rate=0.05, threshold=3):
    sample = [c for c in conversations if random.random() < sample_rate]
    scored = [(c, judge(c.question, c.answer, c.policy)) for c in sample]
    # the flagged answers
    return [c for c, scores in scored if min(scores.values()) < threshold]
Fit

Use it, or not.

When to reach for it

  • Human evaluation must be scaled.
  • Quality criteria can be linguistically formulated.
  • Regressions in agent responses need to be detected.

When it backfires

  • Objective tests are available.
  • The evaluating model shares the same bias as the generator.
  • High legal binding force is required.
Pitfalls

Three ways this pattern will hurt you.

Judge bias — the evaluator shares the generator's training data

The judge model was trained on the same corpus as the generator. It rewards answers that sound correct rather than are correct.

Countermeasure

Use a different model family for evaluation, or ground scores in verifiable checks (test cases, regex, database queries).

Correlated failures — judge agrees with the same hallucination

Both generator and judge hallucinate the same false fact. The judge gives a high score to a wrong answer.

Countermeasure

Add a human calibration set. When judge and human disagree, retrain the rubric or switch to a non-LLM verifier.

Position, verbosity, and self-preference bias skew the scores

In pairwise judging the model favors whichever answer comes first and rewards longer, more confident-sounding text; worse, it scores its own generations higher than humans do (self-preference correlated with self-recognition).

Countermeasure

Average both orderings to cancel position bias, normalize for length, and judge with a different model family than the generator. Calibrate against a human-rated set.

Framework support

Where LLM-as-Judge is native.

LangSmithServiceLLM-as-judge evaluators over datasetsNative
OpenAI EvalsLibrarygraders + eval harnessNative
Microsoft Agent Frameworkbuilt-in evaluationNative
Google ADKGoogle ADK EvaluationNative
AutoGen / AG2agent-evaluation utilitiesNative

Search

Search patterns, frameworks, and pages.