Skip to content
ALEX8642Public

About

Measurement system analysis (Gage R&R) for LLM judges

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

judge-msa

CI License: MIT

A gauge study for LLM judges. When an eval says system A beat system B by 8 points according to an LLM judge, how small a difference can that judge actually be trusted on? Manufacturing answers this for every measuring instrument before using it, with a measurement system analysis (MSA, or Gage R&R). judge-msa runs one on a table of judge verdicts and reports, in points, the smallest difference the judge can resolve.

It never calls a model. You bring the verdicts.

The short version

Applied to the judges of LLM-chatbot, a document-QA project whose v2 was reported 38 points ahead of v1 (full study, protocol committed before the runs). Three judges, 338 answers, 9,996 gradings, one human reference.

1. A judge at temperature 0 repeats itself, and still changes its mind when the prompt is rearranged. Sending the same request again changed almost nothing. Listing the same key facts in a different order changed the verdict on about 7% of answers, for every judge.

Share of answers whose verdict changed between trials: near zero for identical requests at temperature 0, up to 10.7% with sampling on, and 6.9% for every judge when the key facts are reordered at temperature 0.

2. Each judge could only resolve a difference above 19 to 21 points. Almost all of that comes from not knowing how differently the judge treats the two systems, which more judge runs cannot fix; judge noise was under half a point. v2's lead cleared the bar. A 10-point lead would not have, and nothing in the original eval would have said so.

For each of three judges, the smallest v2 minus v1 difference it can resolve, about 19 to 21 points, beside the 30 to 37 point difference it reported with its 95% interval.

3. The judge's "known bias" came from where the reference set was drawn. On questions picked because a judge had disputed them, the registered judge (phi4) scored 44 points below the human. On questions drawn at random, 2 points below.

Judge score minus human score for three judges, on 21 questions picked for being disputed and on 29 drawn at random. phi4: minus 44 points and minus 2 points.

Also found: the judge server's context window, a default nobody had set or recorded, changed verdicts on long inputs; one judge at temperature 0 gave a different verdict on another machine for 5 of 337 answers; and the human reference, regraded blind a week later, gave the same pass/fail verdict on 29 of 30 answers.

The charts are drawn from the study's result files by scripts/readme_charts.py.

"The judge ran at temperature 0" is not an answer to any of this: why not.

Five-minute start

uv tool install git+https://github.com/ALEX8642/judge-msa    # or: pip install git+https://...

# a simulated table to try it on: two systems, one judge that is lenient on system A
judge-msa simulate --out verdicts.csv --items 1000 --trials 3 --seed 2 \
    --systems A=0.7,B=0.7 --judge lenient:0.05:A=0.25/B=0.05:0

judge-msa analyze verdicts.csv --system system --reference reference \
    --positive pass --compare A B --out report

This writes report/report.html (self-contained), report.md and result.json. The two systems are equally good by construction. The judge reports A ahead by 4.8 points, and the report says it cannot resolve differences below 8.5 points, nearly all of that from its bias towards A.

Input

One row per verdict, as CSV, JSONL or Parquet. Column names are yours; map them with flags.

Column Flag Needed Meaning
item --item yes the question
judge --judge yes which judge (model, prompt or setup) gave the verdict
verdict --verdict yes a category, e.g. pass / fail; name the passing one with --positive
trial --trial for repeatability 0, 1, 2 … for repeated gradings of the same answer
system --system to compare systems which system wrote the answer
reference --reference for bias a trusted verdict (usually human) for some or all answers
weight --weight if the reference sample was not random sampling weight of each reference answer

Rows with an empty verdict (judge errors) are dropped and counted.

What is reported

  • Repeatability: does a judge give the same verdict again? Share of answers where all trials agree, flip rate, Fleiss' kappa.
  • Reproducibility: do judges agree with each other? Pairwise Cohen's kappa, Fleiss' kappa.
  • Against the reference: agreement, kappa, miss rate (passes a bad answer) and false-alarm rate (fails a good one).
  • Bias: judge score minus reference score, per system or any column (--by), and its difference between two systems, with 95% bootstrap intervals that resample questions.
  • Variance components: how much of the variation in verdicts comes from the answers, from judges, and from a judge disagreeing with itself.
  • Minimum resolvable difference (MRD): for --compare A B, per judge: noise + bias bound. Noise is the 95% half-width from trial-to-trial variation at your number of questions and trials. The bias bound is the larger end of the 95% interval for the difference in bias between A and B. An observed difference below the MRD could be produced by the judge alone.
  • What this data cannot tell you: every statistic the table could not support, and why. One trial per answer means no repeatability; no reference means no bias, and the report says that judges which agree may share a bias.

How to design the study

Advice the worked study paid for:

  • Repeat in a way that should not matter. At temperature 0, sending the same request again tests almost nothing. Reorder the rubric, reformat the answer, change the seed, move to another machine. Each is a trial.
  • Draw the reference sample at random, or record how it was drawn and pass --weight. A reference set made of disputed cases measures the judge at its worst and says little about the eval as a whole.
  • Use more than one judge, but do not read their agreement as correctness.
  • Write down the judge's full setup: model digest, runtime version, context window, output limit. Treat a changed default as a different gauge.
  • Spend on the reference. In the worked study, judge noise was under half a point and the bias bound was 20. Thirty more human-graded answers would have helped more than thirty thousand more judge calls.

Is the arithmetic right?

Every estimator is tested on simulated tables with planted judge behaviour: docs/validation.md. In short: the bias interval covers the planted value 95.5% of the time, and the MRD is conservative (exceeded in 0.3% of simulations against a nominal 5%), so it can call a real difference unresolved but should not call an artefact resolved.

Limits

  • Categorical verdicts only; bias, variance components and MRD need a binary pass/fail.
  • The MRD is a conservative bound, not a power calculation.
  • Bias is relative to your reference. If the reference is wrong, so is the bias. Enter the human grader as a judge with repeated trials to measure the reference's own repeatability.
  • The simulation model behind the validation is simple; real judges err in ways that depend on the question.

Development

uv sync
uv run pytest            # fast tests
uv run pytest -m slow    # statistical validation, about a minute
uv run ruff check . && uv run ruff format --check .

MIT licence. Built with AI coding agents; design, protocol and review by Alexander Feht.

About

Measurement system analysis (Gage R&R) for LLM judges

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages