An LLM judge is a measuring instrument. When it scores your outputs 0.82 on average, that number only means something if the judge agrees with careful human reviewers on the cases you care about. Most teams skip this step. They write a rubric, run the judge over a test set, and start making release decisions from the trend line. If the judge is systematically wrong about a particular kind of answer, the trend line will be smooth, confident, and misleading.

This article walks through a calibration procedure you can run before trusting a judge: build a gold set, measure agreement with a statistic that survives class imbalance, test for position bias with paired swaps, and read the errors per class instead of only the headline number.

Build a gold set the judge can actually fail on

Start with a few hundred outputs that humans have labeled. Random sampling from production traffic is the wrong default, because most real traffic is easy. If 90% of answers are clearly fine, a judge that approves everything will look excellent. Sample deliberately:

  • Stratify by the label you need to decide on (pass, partial, fail), so the rare classes get enough examples to measure.
  • Include boundary cases: answers that are correct but incomplete, factually right with a wrong citation, or fluent but off-topic. These are where judges disagree with humans.
  • Hold out a split you never look at while editing the rubric. Otherwise you will tune the judge prompt against the exact cases it is graded on, and the gold set stops being a test.

Have two people label a subset of about 20% independently. Their agreement is your ceiling. If two careful humans agree only 70% of the time on a criterion, a judge at 75% agreement is not a failure of the judge. It is a sign the rubric is underspecified, and the fix belongs in the rubric, not in the model choice.

Measure agreement with a statistic that handles imbalance

Raw agreement is the first thing people compute and the least useful. Suppose 90% of your gold labels are "pass." A judge that says "pass" to everything scores 90% agreement and catches zero failures. Cohen's kappa corrects for the agreement you would expect by chance, given each rater's label distribution:

from collections import Counter

def cohens_kappa(human: list[str], judge: list[str]) -> float:
    """Chance-corrected agreement between two raters on the same items."""
    if len(human) != len(judge) or not human:
        raise ValueError("labels must be non-empty and aligned")
    n = len(human)
    observed = sum(h == j for h, j in zip(human, judge)) / n

    h_counts, j_counts = Counter(human), Counter(judge)
    labels = set(h_counts) | set(j_counts)
    expected = sum((h_counts[l] / n) * (j_counts[l] / n) for l in labels)

    if expected == 1.0:  # both raters used one identical label throughout
        return 1.0
    return (observed - expected) / (1 - expected)

human = ["pass"] * 90 + ["fail"] * 5 + ["partial"] * 5
always_pass = ["pass"] * 100
print(round(cohens_kappa(human, always_pass), 3))  # 0.0

The always-pass judge scores 0.0, which is what it deserves. Kappa is only one tool, and its limits matter:

  • It is defined for two raters. With several human raters, use Krippendorff's alpha.
  • For ordinal labels (1 to 5 quality scores), an unweighted kappa treats a 1-vs-5 disagreement the same as a 4-vs-5 one. Use a weighted kappa so near misses cost less.
  • Kappa depends on prevalence. Very rare classes can produce low kappa even when the judge is mostly right, so always read it next to the per-class numbers described below.

Set a threshold before you run the judge, not after. A reasonable process is to agree on a minimum kappa per criterion with the product owner, and treat anything below it as "this judge is not yet an instrument for this decision."

Test for position bias with paired swaps

Pairwise judges, which pick the better of two responses, are sensitive to presentation order. The MT-Bench and Chatbot Arena paper by Zheng et al. (2023) studied position bias and verbosity bias in LLM judges and reported that GPT-4 agreed with human preferences at a level it described as comparable to human-to-human agreement. The same paper is the reason to test your own judge rather than assume the published result transfers to your rubric and model.

The check is cheap to write: present each pair in both orders and see whether the verdict follows the content or the position.

def resolve_pair(verdict_ab: str, verdict_ba: str) -> str:
    """
    verdict_ab: judge output when candidate A is shown first.
                One of "first", "second", "tie".
    verdict_ba: judge output when candidate B is shown first.
    Returns "A", "B", "tie", or "inconsistent".
    """
    a_wins_ab = {"first": "A", "second": "B", "tie": "tie"}[verdict_ab]
    a_wins_ba = {"first": "B", "second": "A", "tie": "tie"}[verdict_ba]
    if a_wins_ab == a_wins_ba:
        return a_wins_ab
    return "inconsistent"  # the verdict flipped with the position

Count how often the result is "inconsistent." A high rate is a direct measurement of position sensitivity. Treat "inconsistent" as a tie in your metrics rather than picking one order's answer, which would quietly reintroduce the bias.

Swap tests have a blind spot. A judge that prefers longer answers will prefer the longer answer in both orders, so the swap check reports consistency while the verdict is still wrong. Test verbosity separately: build pairs where the shorter response is the correct one, and measure how often the judge prefers the longer, wrong one. Swapping doubles the judge calls for pairwise evaluation, which is usually worth it before a decision you will act on. For single-answer scoring the swap test does not apply, but the verbosity check does.

Read the confusion matrix per class

The headline agreement hides where the judge fails. Suppose you have 200 gold labels (these numbers are illustrative, not from a real evaluation):

| Human \ Judge | pass | partial | fail | |---|---|---|---| | pass (120) | 114 | 5 | 1 | | partial (50) | 22 | 20 | 8 | | fail (30) | 2 | 4 | 24 |

Overall agreement is 158/200, or 79%, which sounds acceptable. But the judge labels 22 of 50 partial answers as "pass." Partial answers are the ones your product most needs to get right, because they are the cases where a user receives something useful but incomplete. The judge is effectively blind to them, and any dashboard that counts "pass" as success will overstate quality precisely in that band.

Compute precision and recall per class, and look at the cells that matter for your decisions. Then decide what to do about each weak class:

  • Make the rubric more specific for that class, with two or three labeled boundary examples in the judge prompt.
  • Route that class to a deterministic check or a human queue, if one exists.
  • Report that class's metric separately and with its uncertainty, instead of folding it into an average.

With 50 partial examples, a 40% recall estimate has a wide interval, so bootstrap each class's interval before calling the judge "bad" or "good enough" at it.

Recalibrate whenever the judge changes

A judge has three moving parts: the model, the judge prompt, and the rubric. Changing any one invalidates the calibration. In practice:

  • Pin the judge model version and store it with every score. A score without the judge version is not comparable to one from last month.
  • Store a hash of the judge prompt alongside the score, so you can tell whether a shift in scores came from the product or from a prompt edit.
  • Re-run the calibration on the held-out split after any change, and compare against the previous run, not against the threshold alone.
  • Add production failures to the gold set over time, but keep the held-out split fixed so you can see whether the judge improved on it.

Failure modes to watch for: a judge that scores well on the gold set after several rounds of prompt edits may have been fitted to those specific examples; a kappa that drops after a model upgrade may reflect a changed verbosity or refusal style rather than a change in quality; and a calibration run on only the easy traffic will certify a judge that fails on the hard traffic.

Checklist

  • Gold set of a few hundred human-labeled items, stratified by decision label, with boundary cases.
  • A held-out split that is never used for rubric edits.
  • Human-human agreement measured on a subset, as the ceiling.
  • Chance-corrected agreement (Cohen's kappa for two raters, weighted for ordinal labels) against a threshold agreed before the run.
  • Position-swap test for pairwise judges, with "inconsistent" counted as a tie.
  • Separate verbosity check with pairs where the shorter answer is correct.
  • Per-class precision and recall, with bootstrap intervals, reviewed before any aggregate score is trusted.
  • Judge model version and judge prompt hash stored with every score, and calibration re-run on every change.

If the judge fails this procedure, the answer is not to trust its average more carefully. It is to narrow the decision the judge is allowed to make, or to stop using it for that decision.

Further reading

  • Zheng et al., "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena," arXiv:2306.05685: https://arxiv.org/abs/2306.05685
  • The same paper as published at NeurIPS 2023 (Datasets and Benchmarks): https://proceedings.neurips.cc/paper_files/paper/2023/hash/91f18a1287b398d378ef22505bf41832-Abstract.html