LLM-as-a-judge is an evaluation pattern where one model grades another model’s output against an explicit rubric. It’s useful for scalable, semantics-aware regression testing when human labels are expensive or slow. The judge reads the question, the candidate answer, and optionally a reference context, then returns a structured verdict.

Two judging modes cover most use cases. Absolute scoring (rubric scorecards) assigns a numeric score per dimension, like correctness 0-2 or groundedness 0-5. Relative preference (pairwise comparisons) shows the judge two candidate answers side-by-side and asks which is better. Absolute scoring works when you need hard pass/fail thresholds. Pairwise works when quality is subjective or you’re iterating quickly and care about “better than baseline” more than a specific number.

The core workflow: define a rubric, write a judge prompt that enforces it, run the judge at scale, and periodically spot-check its verdicts against human labels to catch drift.

Rubric Scorecards

Rubric scorecards measure multiple dimensions of an LLM output using a small, consistent scale with clear scoring anchors. Each dimension gets its own score so you can see exactly where a response fails.

Good rubrics:

  • Are explicit and testable (define what a 0, 1, and 2 each mean in concrete terms).
  • Separate concerns (don’t mix correctness and tone in one score).
  • Are calibrated through periodic human spot checks and judge agreement tracking.
  • Include required evidence when needed (citations, quotes, tool outputs).

Common dimensions:

  • Correctness (factual and task correctness)
  • Groundedness (claims supported by provided sources)
  • Safety/policy compliance
  • Actionability (clear next steps)
  • Format compliance (schema, required fields)

Scorecard example (0-2 scale) for a support assistant:

Correctness:
0: wrong policy / wrong action
1: partially correct
2: correct
 
Groundedness:
0: unsupported claims
1: mixed or unclear
2: all key claims supported by sources
 
Safety:
0: unsafe or policy violation
1: questionable
2: safe

Pairwise Comparisons

Pairwise comparisons evaluate two candidate outputs side-by-side and pick the better one. Humans and judge models are generally better at relative preference than absolute scores, which makes pairwise more reliable when quality is subjective or multi-dimensional.

Pairwise results aggregate naturally into rankings: win-rate percentages or Elo-style ratings across a test set. This makes it easy to compare prompt versions or model checkpoints without needing a fixed numeric threshold.

To make pairwise reliable:

  • Use a clear rubric for what “better” means (correctness first, then groundedness, then style).
  • Randomize which answer appears as A vs B to control for position bias.
  • Include “tie” as a valid output when both answers are acceptable.

Pairwise judge prompt (rubric-first):

You are evaluating two answers to the same question.
Choose the better answer.
Priority order: correctness > groundedness > safety > clarity.
 
Output JSON only: {"winner": "A", "rationale": "..."}  (winner must be "A", "B", or "tie")

Judge Prompt Design

The judge prompt is the most important lever. A vague prompt produces noisy, unreliable scores. A well-structured prompt locks in the rubric, specifies the output format, and gives the judge the reference context it needs to evaluate groundedness.

Groundedness-focused judge prompt template:

System: You are a strict evaluator. Score from 0 to 5.
Rules:
- Only use the provided REFERENCE to judge factual correctness.
- If the ANSWER claims facts not supported by REFERENCE, penalize heavily.
- Output JSON only. Required keys: score (0-5 integer), rationale (string), unsupported_claims (array of strings).
 
User:
QUESTION:
<question>
 
REFERENCE:
<snippets or retrieved passages>
 
ANSWER:
<candidate answer>

Calibration tips:

  • Treat the judge as a test harness: define rubric, scale, and required evidence before writing the prompt.
  • Spot-check judge outputs with humans, track agreement, and update the rubric or prompt when drift appears.
  • Reduce noise by running multiple judgments (different seeds or models) and aggregating with median or majority vote.
  • Defend against gaming by keeping rubrics specific and including reference context for groundedness checks.

Pitfalls

Verbosity bias — judge models prefer longer, more detailed answers even when a shorter answer is correct and sufficient. Zheng et al. (2023) demonstrated this with a “repetitive list” attack: padding an answer with rephrased duplicates of its own content fooled GPT-3.5 and Claude-v1 judges into scoring it higher, and even GPT-4 was not fully immune. Mitigation: add a conciseness dimension to the rubric, include calibration examples where short answers score full marks, and cap acceptable length in the judge prompt.

Position bias in pairwise — judges systematically favor an answer based on the position it appears in, not its content. Zheng et al. (2023) found all tested judge models exhibited position bias, with only GPT-4 staying reasonably consistent when answer order was swapped. Mitigation: always randomize A/B order and verify that win-rates are symmetric. If bias persists, run each pair twice with positions swapped and accept only verdicts that agree across both orderings.

Prompt sensitivity — small wording changes in the judge prompt (for example “evaluate correctness” versus “grade factual accuracy”) can shift scores across the entire eval set, breaking comparability between runs. Mitigation: lock the judge prompt in version control, run regression checks when you change it, and treat prompt changes like code changes with tests and review.

Hidden coupling (self-preference) — judges score outputs from their own model family higher than equivalent outputs from other models. Zheng et al. (2023) report GPT-4 favoring its own answers by roughly a 10% higher win rate and Claude-v1 favoring its own by roughly 25%. Mitigation: use a different model family for judging, or validate judge scores against human labels on a diverse multi-model sample.

Calibration drift — judge behavior shifts when the underlying model receives updates: a provider-side model change can make the judge stricter or looser on dimensions like formatting, so an unchanged golden set suddenly produces different scores. Mitigation: maintain a fixed gold dataset with known human labels and re-run calibration after every model update. Alert if agreement with human labels drops below 80% on binary pass/fail.

Questions

References