Judge Calibration and Meta-Evaluation › Per-Slice Agreement
Michael BrenndoerferDecember 1, 20262 min read
Language AI HandbookAll chapters Break agreement down by absolute length gap. The small bucket includes a gap of zero. Report the number of comparisons that contributed to each coefficient.
PythonIn [12]Expand
fixture["len_bucket"] = pd.cut(
fixture["len_diff"].abs(),
bins=[-1, 50, 200, 1e9],
labels=["small", "medium", "large"],
)
slice_rows = []
for j in ["A", "B", "C"]:
for b, sub in fixture.groupby("len_bucket", observed=True):
reference = sub["ref_majority"]
choice = sub[f"judge_{j}"]
paired = reference.notna() & choice.notna()
slice_rows.append(
{
"judge": j,
"len_bucket": b,
"kappa": cohen_kappa(reference, choice),
"decided": int(paired.sum()),
"offered": len(sub),
}
)
slice_df = pd.DataFrame(slice_rows)
slice_df.pivot(index="judge", columns="len_bucket", values="kappa")ConsoleOut [13]Expand
judge len_bucket decided offered kappa
A small 135 143 0.670
A medium 298 309 0.584
A large 143 148 0.526
B small 138 143 0.509
B medium 294 309 0.581
B large 138 148 0.459
C small 138 143 0.590
C medium 297 309 0.366
C large 147 148 0.127The bucket comparison describes agreement at small, medium, and large length gaps. Check the counts in each bucket. In this fixture, the length mechanism is known because it was explicitly assigned to C.
The plot shows the kappa column from the table. The decided column gives its denominator, and the offered column shows the total comparisons in the bucket. We already have slice_df with one row per judge and length bucket, so the figure only renders those precomputed values.
PythonIn [14]Expand
# Reshape the per-slice kappa table into a judge-by-bucket matrix for plotting.
slice_pivot = slice_df.pivot(
index="judge", columns="len_bucket", values="kappa"
)
slice_pivot = slice_pivot[["small", "medium", "large"]]VisualizationOut [15]Expand

Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!