IamBishal

Judging the Judge: LLM-as-a-Judge, Calibrated

My evaluation article calibrates a judge with numbers marked "illustrative". So I built a set where the right verdict is known and calibrated six real ones.

Six LLM-judge designs on 200 support replies whose right verdict is known, 7,200 judgements on Claude Haiku and Sonnet. Every judge caught every failure; the errors all went the other way.

failures caught by every judge design
40 / 40
good replies Haiku passed (Sonnet 97–100%)
82–94%
correct escalations passed: Haiku, critique first
100% → 35%
error of the (TPR + TNR − 1) scaling
±0.12 pts
  • Experiment
  • 7 min read
  • Applied AI
  • Python
  • Claude
  • LLM-as-a-judge
  • Evaluations
Figure 1. Judge calibration with 95% intervals

Overview

In "LLM Evaluation in Production" I argued that an LLM judge has to be calibrated before it gates anything, and gave the rules: one criterion with a pass or fail verdict, both orders for pairwise comparisons, length-neutral wording, and true-positive and true-negative rates measured separately. The worked calibration example used numbers marked as illustrative. This experiment calibrates real judges.

The test set is 200 support replies to refund tickets over real orders in the Kestrel Outfitters data from my Agentic AI book series. Each reply was built to be right or wrong, so no human labelling was needed. 160 state the outcome the policy requires; 40 carry one of five defects: a wrong amount, a refund the policy declines, a 30-day window quoted to a trade customer, an extra credit, or an escalation that never says what happens. Every reply exists short and long, and 100 pairs test pairwise judging.

Six judge designs grade the same criterion: plain pass or fail, the same with a critique written first, length-neutral wording, a 1 to 10 score gated at 7, three criteria judged at once, and pairwise comparisons run in both orders. Claude Haiku 5.5 and Sonnet 5.5 judged everything three times each, 7,200 judgements for USD 6.97.

Every judge caught every failure: all 40, all five types, on both models. The errors all went the other way. Sonnet passed 97 to 100 percent of the correct replies, and Haiku 82 to 94 percent. Asking for a critique first made Haiku fail 65 percent of correct escalation replies, because it talked itself into a stricter reading of the policy than the policy says. Haiku's 1 to 10 score passed 98 percent of long correct replies and only 70 percent of short ones; length-neutral wording removed that tilt.

Pairwise verdicts never flipped when one reply was wrong, and only slightly between two right ones. The article's arithmetic held: a measured change in failure rate was the real change scaled by TPR plus TNR minus one, to within a fraction of a point. One flaw in my own design is disclosed in the write-up: the correct replies' outcome and length were confounded, so every length claim uses only the balanced subsets.

Did it hold up?

Full results

The hypothesis, written down before the first run, and what the results said.

  1. Wrong

    Raw agreement flatters the judge: with 20% failures, agreement sits well above the share of failures caught.

    Every judge caught 100% of failures. Raw agreement hid the other direction: an 86%-agreement judge failed 65% of correct escalations.

  2. Partly

    A 1–10 score ranks better than it gates: high rank correlation, but κ at the gate below pass/fail.

    κ at the ≥ 7 gate was below pass/fail on both models (0.79 vs 0.87 Haiku), but rank correlation was only moderate (0.71 to 0.75).

  3. Wrong

    One criterion beats three: judging three criteria at once catches fewer policy failures.

    Three criteria still caught 100% of policy failures; the cost was good replies failed as incomplete (Sonnet TNR 97% vs 100%).

  4. Partly

    Judges are verbose-biased, and length-neutral wording reduces it.

    No long wrong reply ever passed, but Haiku favoured long correct replies (score: 98% vs 70%); length-neutral wording removed the tilt.

  5. Partly

    Pairwise verdicts carry a position bias.

    Never a flip with a wrong reply in the pair; between two right replies, 15% (Haiku) and 3% (Sonnet) flipped; first position won 52 to 54%.

  6. Confirmed

    A measured change is the real change scaled by (TPR + TNR − 1).

    Measured and predicted changes agreed to within 0.12 points across all ten judges, e.g. a true +5.0 measured +4.2 vs +4.1 predicted.

  7. Wrong

    Critique first doesn't hurt, and may help.

    It cut Haiku's correct-reply pass rate from 94% to 82% (escalations 100% to 35%), and changed nothing for Sonnet at 72% more cost.

What it does

  • 200 support replies built to be right or wrong, so calibration needs no human labels
  • Five failure types, every reply short and long, and 100 pairs for pairwise judging
  • Six judge designs on one criterion, from plain pass/fail to three criteria at once
  • TPR and TNR with Wilson intervals, kappa, and the judge's own consistency across repeats
  • Length and position bias, measured on balanced subsets
  • A gate simulation testing the article's (TPR + TNR − 1) scaling
  • Tests that check the arithmetic on the article's own illustrative matrix

How it's built

  1. Inputs

    • 200 labelled repliesRight or wrong by construction
    • 100 reply pairsRight vs wrong, short vs long
  2. Six judge designs

    • Pass/fail, one criterion
    • Critique first; length-neutral
    • 1–10 score gated at 7
    • Three criteria at once; pairwise
    • Haiku 5.5 and Sonnet 5.5, 3 repeats
  3. Outputs

    • Judgements7,200, with verdicts
    • CalibrationTPR, TNR, kappa, intervals
    • Bias and gate checksLength, position, scaling
judges.py and metrics.py
# judges.py: the article's judge design: one criterion, a structured PASS/FAIL verdict.
CRITERION = ("The reply states the outcome the returns policy requires for this order, "
             "and promises nothing the policy doesn't allow.")
SCHEMA = {"type": "object", "properties": {"verdict": {"type": "string", "enum": ["PASS", "FAIL"]}},
          "required": ["verdict"], "additionalProperties": False}


# metrics.py: report both error directions, never one accuracy number.
@dataclass(frozen=True)
class Confusion:
    tp: int  # human FAIL, judge FAIL
    fn: int  # human FAIL, judge PASS
    fp: int  # human PASS, judge FAIL
    tn: int  # human PASS, judge PASS

    @property
    def tpr(self) -> float:   # failures caught
        return self.tp / (self.tp + self.fn)

    @property
    def tnr(self) -> float:   # good replies passed
        return self.tn / (self.tn + self.fp)

    @property
    def youden(self) -> float:  # a measured change = the real change x this
        return self.tpr + self.tnr - 1

Figures

Figure 1. Judge calibration with 95% intervals1 of 3

What I learned

  • Calibrate both directions. Every judge caught every failure here; the cost was in good replies failed, which a catch rate alone would never show.
  • A judge reading a vague criterion picks a reading. Haiku chose a stricter one than the policy says, and calibration showed exactly where.
  • Critique first isn't free: it doubled down on Haiku's strict reading, cutting correct escalations passed from 100% to 35%, and cost Sonnet 72% more.
  • A 1–10 score gates worse than pass/fail and carried the strongest length tilt: 98% of long correct replies passed against 70% of short.
  • Length-neutral wording works when there's a tilt to remove. It took Haiku's short-reply penalty away.
  • Run pairwise comparisons both ways anyway. Flips were rare, but only the swap tells you which verdicts to trust.
  • The cheaper judge is less consistent as well as less accurate; majority voting over repeats does real work for it.

Next steps

  • Sharpen the escalation wording in the criterion and rerun Haiku's critique-first judge
  • Subtler failures: a correct outcome with misleading wording, partial amounts, wrong timelines
  • A fully crossed design (every outcome at both lengths)
  • A judge from another model family, to test self-enhancement bias

Run it yourself

Everything on this page comes from code and data in the repository. The dry run is free and needs no API key. A full live rerun costs about USD 7.

Terminal
git clone https://github.com/bishal-saha/ai-lab-code.git
cd ai-lab-code/llm-judge-calibration-benchmark
uv sync
uv run judge-the-judge --dry-run     # a perfect and a biased fake judge, $0
mv results results-published         # the live runner resumes from committed results
cp .env.example .env                 # then add your ANTHROPIC_API_KEY
uv run --env-file .env judge-the-judge --max-usd 10
uv run python -m judge_the_judge.report

Bishal SahaLet's build together

Have a system to design, or an AI feature to get right?

Tell me about the problem. You'll get a clear, honest view of the best way forward.

  • Reply within 24 hoursOn business days, with my honest view and a next step.
  • Accepting select engagementsArchitecture, AI features and full builds.
  • Remote, worldwideWorking with startups, SMEs and enterprises.