Sub topic 3
Checking the Judge Against Human Labels
Assume you can read Python, understand prompts, and work with an evaluation set. An LLM judge is a proxy for human judgment, not ground truth. Validate it before using its scores to make decisions.
Compare the judge with human labels
Sample outputs from your real workload. Have trained reviewers label them with the same rubric. Compare the judge’s labels with the human labels using:
- Agreement rate: the fraction of matching labels.
- Cohen’s kappa: agreement after removing agreement expected by chance.
- Per-class results: precision and recall for important labels, such as
fail.
from collections import Counter
def cohens_kappa(human, judge):
n = len(human)
observed = sum(a == b for a, b in zip(human, judge)) / n
h, j = Counter(human), Counter(judge)
expected = sum(h[k] * j[k] for k in h) / (n * n)
return (observed - expected) / (1 - expected)
human = ["pass", "pass", "fail", "pass", "fail", "fail"]
judge = ["pass", "pass", "fail", "fail", "fail", "pass"]
print(round(cohens_kappa(human, judge), 3))A high pass rate can hide a judge that says pass for nearly everything. Kappa and per-class results expose that problem.
Apply mitigations
Choose a mitigation for the measured failure mode.
| Problem | Mitigation |
|---|---|
| Position bias | Swap answer order and count disagreement as a tie |
| Verbosity bias | Tell the judge to score the rubric only, not length or style |
| Self-preference | Use a different judge family and include varied model outputs |
| Run variance | Repeat judgments and aggregate results |
Report uncertainty and prevent gaming
Report a metric with a confidence interval, not just a single number. Bootstrap the examples by resampling with replacement, then report percentile bounds. Small evaluation sets produce wide intervals.
Optimizing directly for judge scores can cause Goodharting: outputs learn the rubric’s visible patterns without becoming better for users. Keep a human-labeled holdout set and track user or task outcomes separately.
Pin the judge
Record the judge model version, system prompt, rubric, decoding settings, and parser. Re-run a fixed calibration set after any change. Judge drift can change scores even when the evaluated system stays constant.
Use another method when appropriate
Prefer deterministic checks for schemas, exact answers, permissions, latency, and safety rules. Use human review for high-impact decisions, ambiguous quality, or cases where errors are costly. Use an LLM judge when the target is subjective but examples and a narrow rubric make consistent review possible.
Exercise
A judge agrees with humans on 92% of examples, but labels every example “pass.” What should you inspect?
Show answer
Inspect class balance, per-class precision and recall, and Cohen’s kappa. The raw agreement may be inflated by many human “pass” labels.