Judge Calibration and Meta-Evaluation › Judge Ensembles

Michael BrenndoerferDecember 1, 20262 min read
Language AI HandbookAll chapters
Part 57 of 67Dynamic, Interactive, and Agentic Evaluation
Chapter 438Judge Calibration and Meta-Evaluation › Judge Ensembles
Reading section 14 of 20 · Judge Ensembles · 2 minSection 14 of 20 · 2 min

Section 14 of 20 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Now let's build a three-judge ensemble and evaluate it against the reference and against each judge's biases.

PythonIn [18]
CollapseExpand
def aggregate_votes(df, columns, weights=None):
    votes = df[columns].to_numpy(dtype=float)
    weight_vector = (
        np.ones(len(columns)) if weights is None else np.asarray(weights)
    )
    zero_votes = (votes == 0) @ weight_vector
    one_votes = (votes == 1) @ weight_vector
    close = np.isclose(zero_votes, one_votes, rtol=1e-12, atol=1e-12)
    chosen = np.where(close, np.nan, np.where(zero_votes > one_votes, 0.0, 1.0))
    return pd.Series(chosen, index=df.index)


judge_cols = ["judge_A", "judge_B", "judge_C"]
calibration = fixture.index % 2 == 0
test_mask = ~calibration

weights = {}
for col in judge_cols:
    kappa = cohen_kappa(
        fixture.loc[calibration, "ref_majority"], fixture.loc[calibration, col]
    )
    weights[col] = max(0.0, kappa) if np.isfinite(kappa) else 0.0

for suffix in ("", "_swapped"):
    columns = [col + suffix for col in judge_cols]
    fixture["ensemble_vote" + suffix] = aggregate_votes(fixture, columns)
    fixture["weighted_vote" + suffix] = aggregate_votes(
        fixture, columns, list(weights.values())
    )
ConsoleOut [19]
CollapseExpand
Agreement weights fitted on the calibration half:
  judge_A: 0.585
  judge_B: 0.549
  judge_C: 0.339
       judge_A | held-out kappa 0.596 | coverage 0.957
       judge_B | held-out kappa 0.520 | coverage 0.947
       judge_C | held-out kappa 0.378 | coverage 0.977
 ensemble_vote | held-out kappa 0.571 | coverage 0.980
 weighted_vote | held-out kappa 0.573 | coverage 1.000

Evaluate majority and weighted votes on the held-out half. Compare coverage and kappa together, since a method can change which items contribute.

PythonIn [20]
CollapseExpand
ensemble_pos = position_bias(fixture, "ensemble_vote")
ensemble_len_rho = length_pref_correlation(fixture, "ensemble_vote")
ensemble_source = source_affinity(fixture, "ensemble_vote", "model_b")
print(
    f"Majority: position {ensemble_pos:.3f}, length {ensemble_len_rho:.3f}, "
    f"model_b affinity {ensemble_source:.3f}"
)
ConsoleOut [21]
CollapseExpand
Judge A: pos=0.000, len_rho=0.031
Judge B: pos=0.137, len_rho=0.045
Judge C: pos=0.000, len_rho=0.620

The majority vote has its own position and length statistics. The results describe fixed synthetic draws and do not establish a general reduction.

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy