Advanced

Pairwise comparison

Absolute scores rank badly when the bar is wrong: two models can both pass eighty percent and still differ visibly. Pairwise comparison asks a simpler question, which output is better, and answers it once per case.

What you will see

Two. Same winner both orders is a win; different winners is a tie.

About 1 min of reading

Try It

Run one case in both orders

1

Write both outputs

printf 'A: A token is a text unit the model reads.\nB: Tokens are pieces of text.\n' > /tmp/pair.txt; cat /tmp/pair.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Two labelled outputs for one case.
2

Record the first judgement

printf 'A_first: A\n' >> /tmp/verdicts.txt; cat /tmp/verdicts.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One line naming the winner when A was shown first.
3

Record the second judgement

printf 'B_first: A\n' >> /tmp/verdicts.txt; grep -c ': A' /tmp/verdicts.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Two. Same winner both orders is a win; different winners is a tie.

Data Flow

Two outputs to one decision
1 Both models answer the same case
↓
2 The judge ranks A over B
↓
3 The judge ranks B over A
↓
4 Agreement is a win, disagreement is a tie
Why this works
Why ties are reported, not dropped

A tie is evidence that the difference is invisible. Hiding ties makes a small real difference look like a large one.

The price of pairwise

Pairwise costs two judge calls per case, doubled for both orders. It is the most expensive grade and the most sensitive one.

Examples

Why pairwise finds what rates miss

A rate says both are good. A pairwise result says one is better, and that is the decision actually being made.

Running both orders

Judge models prefer the first answer they see. Running A first then B first and requiring agreement removes that bias.

Counting a win

A win is a case where the order did not matter. Cases that flip with order are counted as ties, not wins.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Eval set drift
Previous Lesson
Eval set drift
Next Lesson
Regression evals
Regression evals →