Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Asking one model to grade another
Grading thousands of essays by hand is slow, so we ask a strong model to do it. It works surprisingly well, but this grader has habits: it tends to favour the first essay it reads, the longer essay, and essays written in its own style. Good practice is to check the grader against people, show answers in both orders, and tell it not to reward length. The demo shows how swapping the order removes the first-position preference.
Engineering teams use LLM judges to grade generated maintenance summaries or mission briefs at scale, with humans checking a sample.
- 1. An LLM judge often prefers…
- 2. A judge should be checked against…
- 3. To cancel position bias, judge…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Pointwise: score one answer 1–10 against a rubric; simple but poorly calibrated across prompts.
- Pairwise: pick the better of two; more reliable; aggregate with win rates or Bradley-Terry / Elo.
- Reference-guided: give the judge a correct answer for maths or facts.
- Rubrics and checklists: itemised criteria (correct, complete, cites sources) turn vague grading into checks.
- Known biases: position, verbosity (length), self-preference, style over substance, sensitivity to formatting; judges can also be prompt-injected by the answers.
- Mitigations: swap orders, length-controlled win rates (AlpacaEval 2), several samples or a panel of different judges (PoLL), rubrics, hiding model names.
- Validation: agreement with humans (accuracy, Cohen’s κ, rank correlation) on a labelled sample before trusting the judge.
- 1. Pairwise judgements are aggregated with…
- 2. AlpacaEval 2 corrects for…
- 3. A panel of different judges reduces…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Building a reliable judge
Exercise 1.
- Swap-consistent verdicts.
- Cohen’s κ between raters.
- Bradley-Terry strengths from pairwise wins.
Practice.
- Write a rubric with explicit criteria and a required short justification before the verdict.
- Judge both orders; count inconsistent pairs as ties and report the inconsistency rate.
- Instruct the judge not to reward length; or regress win rates on length differences.
- Use a judge from a different family than the models judged, or a panel.
- Label 100–200 examples by hand; measure judge-human agreement and κ; re-check when the judge or prompts change.
- Tools: OpenAI Evals, Inspect, promptfoo, DeepEval, Ragas.
JUDGE = """You compare two answers to the question. Criteria: correctness, completeness, clarity.
Do not prefer an answer for being longer. Explain briefly, then output exactly 'A', 'B' or 'tie'."""
def judge(q, a, b):
v1 = call_llm(JUDGE, f"Question: {q}\nAnswer A: {a}\nAnswer B: {b}").strip()[-3:]
v2 = call_llm(JUDGE, f"Question: {q}\nAnswer A: {b}\nAnswer B: {a}").strip()[-3:]
v2 = {"A": "B", "B": "A"}.get(v2.strip(), "tie")
return v1.strip() if v1.strip() == v2 else "tie"- 1. Before the verdict, the judge should give…
- 2. How many human labels to validate a judge?
- 3. Inconsistent swapped verdicts are counted as…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
A model of judging. Let the judge’s log-odds of preferring the first answer be k(Δq + β Δlen + s Δself + ε) + b_pos, with true quality difference Δq, log length difference Δlen, self-family indicator Δself, noise ε and position offset b_pos. Each bias term shifts the verdict independently of quality.
What swapping fixes. Judging both orders flips the sign of Δq, Δlen and Δself but not b_pos; requiring agreement removes the position effect, but not length or self-preference, which move with the answer.
Noise. The judge’s verdict is a random draw; majority over m samples reduces the error from randomness, like an ensemble. Systematic biases do not average out across samples from the same judge, only across judges with different biases.
- 1. Swapping orders removes…
- 2. Self-preference averages out across…
- 3. Several samples from one judge reduce…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How far does a biased LLM judge agree with the truth, and which mitigations remove which biases?
History.
- L. Zheng et al., “Judging LLM-as-a-judge with MT-Bench and Chatbot Arena” (2023).
- Y. Dubois et al., “Length-controlled AlpacaEval” (2024).
- P. Verga et al., “Replacing judges with juries” (PoLL, 2024).
Exercise 2. A simulated judge.
- Pairs: 2000; quality difference Δq ~ N(0, 0.5²); log length differences ~ N(0, 0.5²), unrelated to quality.
- Judge: log-odds 6(Δq + 0.6 Δlen + 0.4 Δself + 0.3 ε) + 1.5 for the first position; verdict sampled.
- Human: prefers the better answer unless N(0, 0.25²) noise flips it.
- Bias tests: equal-quality rivals: twice as long; or from the judge’s own family. Length control sets β = 0.1; the panel has judges biased towards family A, towards B and neutral.
| agreement with the better answer | seed 0 |
|---|---|
| human | 0.859 |
| judge, one order | 0.717 |
| judge, both orders (ties count half) | 0.727 |
| both orders, with a reference answer | 0.748 |
| both orders, length controlled | 0.743 |
| majority of 3 samples, both orders | 0.782 |
| equal-quality win rate (fair = 0.5) | seed 0 |
|---|---|
| first-shown answer | 0.724 |
| twice-as-long answer | 0.677 |
| … with length control | 0.517 |
| judge’s own family | 0.673 |
| … with a panel of three families | 0.48 |
- Swapping removed position bias but barely raised agreement (0.717 → 0.727): ties replaced wrong verdicts.
- Sampling three times helped most, because the judge’s verdicts were random draws.
- Length control and panels removed their target biases almost entirely.
- The judge stayed below the human in every variant.
- Seeds 1 and 2: three samples 0.779 and 0.787; verbose 0.68 and 0.678 → 0.528 and 0.522; self 0.673 and 0.675.
- Caveat: a simple logistic judge with fixed bias sizes; real biases vary by judge, task and prompt.
LLM judges in AI, robotics and aerospace
- Report generation: judges grade generated inspection or incident summaries against rubrics, with engineer spot checks.
- Robot task success: VLM judges score video of robot attempts; validated against human labels.
- Safety reviews: judges triage outputs for policy violations; high-stakes cases go to humans.
References
- L. Zheng et al. (2023). “Judging LLM-as-a-judge with MT-Bench and Chatbot Arena.” NeurIPS.
- Y. Dubois, B. Galambosi, P. Liang and T. Hashimoto (2024). “Length-controlled AlpacaEval.” arXiv.
- P. Verga et al. (2024). “Replacing judges with juries: evaluating LLM generations with a panel of diverse models.” arXiv.
- A. Panickssery, S. Bowman and S. Feng (2024). “LLM evaluators recognize and favor their own generations.” NeurIPS.