# Can an AI judge stand in for expert raters?

Teams grade the answers of their AI features with another model, an "AI judge". This study checks two small judges
against expert human votes on a public dataset: how often each picks the answer the experts picked, how much its
verdicts move when it is asked again or shown the answers in the other order, and how many runs or judges a verdict
needs. The page is `index.html`; `results.html`, `follow-up.html` and `method.html` hold the detail.

## Data

MT-Bench human judgments (Zheng et al., 2023, "Judging LLM-as-a-judge with MT-Bench and Chatbot Arena",
arXiv:2306.05685), `human` split, CC BY 4.0, from https://huggingface.co/datasets/lmsys/mt_bench_human_judgments, and
the MT-Bench question file from the FastChat repository (Apache-2.0) for each question's category.
`tools/get_data.py` downloads both, checks their sha256 against `data/sources.json` and writes the three small tables
in `data/`: every turn-1 expert vote, each answer's length and hash, and each question's category. The answer texts
are not copied here. One model id is written in a short form, `alp-13b`, in these tables and in the reply files. Every
other id is as the dataset has it, and the short id sorts in the same place, so the samples are the same either way.

## Reproduce

Python 3.12. `tools/get_data.py` needs pyarrow to read the source file; everything else needs only the standard
library.

```
python3 -I -B tools/get_data.py /path/to/new/dir
python3 -I -B tools/samples.py
python3 -I -B tools/score.py
python3 -I -B tools/changes_r1.py
python3 -I -B tools/judge_gate.py sample1
python3 -I -B tests/test_judge.py
python3 -I -B site/render.py
```

`tools/score.py` rebuilds `results/summary.json` from the stored judge replies in `results/replies/`, and
`tools/changes_r1.py` rebuilds `results/changes-r1.json`, the changes declared after the results, from the same
replies. Every result on the pages comes from these two files with no model call, and the tests check that both
rebuilds match them exactly. The prompt file still has the fingerprint written into `protocol-r1.json` before the
first call, and a test checks it. The judge calls themselves are not part of the download: each reply file
holds the model, the sha256 of the exact prompt, the reply text and how it was read, and `tools/prompts.py` holds
the two prompts, so the calls can be repeated with any model.

## Files

- `protocol-r1.json`, `predictions-r1.json`: the frozen parameters and the predictions, as declared before any
  judge call. The written design that went with them is not in this download; its sha256 is
  f7e9a57505d785f18b4a7ec6d52b2426f0833248bda65d53ca1551b720c8c002.
- `tools/prompts.py`: the rubric prompt and the pairwise prompt.
- `tools/samples.py`: the sampling rule for the two samples.
- `tools/judgelib.py`, `tools/score.py`: the scoring rules and every measure; `results/summary.json` is their output,
  including the predictions scored as declared.
- `tools/judge_gate.py`: the regression gate a team can run on a judge setup before trusting it.
- `tools/changes_r1.py`, `results/changes-r1.json`: five changes declared after the results, before any code for
  them, with their predictions and the rule for the call: unreadable replies left out of the noise shares, the gap to
  a second expert on identical votes with two 95% ranges, questions needed at 80% power, the gate with a same-pairs
  floor, and the experts' agreement on the pairs the four-pick rule accepts and sends on. The declared results stay
  as scored. Their written declaration is not in this download; its sha256 is
  77a8ed7eb696c8fc0e1804f8d5569e6c5e2a6bac2079ddd7e08bcb32bdeaa105.
- A sixth change, declared the same way before its code, sizes a team's own check from this study's range; it is
  computed in `site/render.py` from `results/changes-r1.json`. Its declaration's sha256 is
  2ed28bc44efc345b528fcb83fcdd97c72ded42b0dede65d9af91a1beb3bd88ee.
- `assumptions.json`: the cost assumptions behind the page's "What it is worth" section.
- `site/render.py`, `site/page.css`: the pages. Every number on them comes from `results/summary.json`,
  `results/changes-r1.json` or `assumptions.json`, and the claims the text makes are asserted in `render.py`.
- `vendor/viz-design-system/`: the chart kit (version 2.3.0) with its licences.

## Licence of the data

The expert votes and model answers belong to their authors and are used under CC BY 4.0, credited to Zheng et al.
(2023). Derived tables in `data/` carry the same licence.

Some files are packed in llm-judge-calibration-data-1.zip; unzip it here to restore the full export, which the manifest lists file by file.
