Skip to content
mentoor

Topic 2 of 5 · 5 min read

Pairwise comparison between two outputs

Goal: Set up a pairwise judgment that controls for order and decide when it is better than pointwise scoring.

Pairwise judging shows the judge two outputs for the same input and asks which one is better; run it in both orders and allow a tie. Pointwise judging grades one output on its own. Both are useful, and each fits different questions.

Check yourself · 1 of 3

Why run a pairwise judgment twice with the two answers swapped?

Choose one answer

Why it matters

Some qualities are hard to define as pass or fail but easy to compare. Which summary is clearer? Which of two prompts gives the more helpful reply? People find "A or B?" easier than "is this a 7?", and so do models. Pairwise is the natural tool when you compare two versions of a prompt, two models or two retrieval settings. The MT-Bench paper used it to compare chat assistants and reported that a strong judge agreed with humans over 80% of the time, about as often as humans agree with each other.

Pointwise still wins when you need an absolute answer: "does this reply leak personal data?" has a correct answer without a competitor.

How to set it up

  1. Same input for both outputs. The judge sees the question once and then two answers.
  2. State the criterion. "Which reply better follows the refund policy?" beats "which is better?".
  3. Randomise or swap the order. Models often prefer the first or the second position. Run each pair twice with the answers swapped. If the judge picks a different winner after the swap, record a tie, not a win.
  4. Allow a tie. Forcing a pick on two equal answers creates noise that looks like signal.
  5. Count wins, ties and losses over the whole set. Report the win rate with the number of items, and look at a sample of the disagreements by hand.

Before and after

Weak: one call with the new answer always shown first, "Which is better?".

Fixed:

Question: {question}. Reply 1: {x}. Reply 2: {y}. Which reply follows the refund policy more closely? Write a two-sentence critique, then answer 1, 2 or TIE.

Run it again with {x} and {y} swapped. Count a win only when both runs agree.

What goes wrong

  • No order swap. If the new version is always shown second and the judge favours the second slot, every release looks like an improvement.
  • A vague criterion. "Better" lets the judge reward length or style instead of the thing you care about.
  • Only win rate. A 55% win rate over 20 items is within noise. Report the count and read examples.
  • Using pairwise for a safety gate. Two bad answers can still produce a winner.

Examples

Order swap changes the result

A team compared prompt v1 and prompt v2 on 40 questions. With v2 always shown second, it won 31. After swapping the order and counting only agreeing runs, v2 won 17, v1 won 9 and 14 were ties. The first number was mostly position bias.

Choosing pointwise instead

Before each release the team needs to know whether any reply mentions another customer's order number. That is a yes/no check on one output with a known right answer, so they use a pointwise judge. For "is the new tone friendlier" they use pairwise.

Key points

  • Pairwise judging compares two outputs for the same input, which suits comparing prompts, models or settings.
  • Run every pair in both orders and count a win only when both runs agree; otherwise record a tie.
  • Name the criterion in the question; plain 'which is better' invites the judge to reward length or style.
  • Pointwise scoring is the better tool for absolute checks such as 'does this leak personal data'.
  • Report win, tie and loss counts with the number of items, and read a sample of the disagreements.

Common mistakes

  • Showing the candidate version in the same position on every call.
  • Forcing a winner when the two outputs are equal.
  • Asking "which is better" with no criterion.
  • Reporting a win percentage without the number of items behind it.

Check yourself · 2 of 3

You want to know whether a new prompt gives friendlier replies than the old one. Which judging setup fits best?

Choose one answer

Check yourself · 3 of 3

Two replies are almost identical in quality. What should a pairwise setup do?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic