Concepts / A/B Testing for AI Models

A/B Testing for AI Models

Comparative evaluation selects two or more models to respond to the same request, and an evaluator picks the winner of each match, unlike A/B testing where one candidate is shown at a time.

  • Programming

Predict Before Reading the Definition

Suppose a team wants to find out which of several AI models gives answers that people prefer. Each time they collect feedback, a person is looking at a response to a prompt. The question to think about is how many candidate responses that person is shown at once. Your answer to that question determines which method you are using, and the two possible methods are easy to confuse even though they produce very different kinds of data.

What do you think happens?

In comparative evaluation, how many models respond to the same request, side by side, before an evaluator judges them?

  • One

  • Two or more

Reveal answer
Answer:

Two or more

Comparative evaluation selects two or more models to respond to the same request, and an evaluator picks the winner of each match. The key feature is that the candidates are judged together, not in isolation.

Two Methods That Look Alike

A common first impression of comparative evaluation is that it means showing a user one model's answer, then another model's answer, and recording which one the user liked more. That description sounds reasonable, but it describes a different method. Comparative evaluation has a specific structure, and mixing it up with a neighboring technique leads to wrong conclusions about what the results mean.

In A/B testing, one candidate is shown at a time. Each person who sees a request gets a single candidate response, and the feedback describes that one candidate. Comparative evaluation works differently. Because the evaluator sees several candidates together, each judgment is a direct contest between models. The evaluator is not scoring a response against an absolute standard; the evaluator is choosing between responses that were produced for the same request.

One requestOne requestModel A and Model BanswersOne candidate shownEvaluator picks awinnerFeedback on thatcandidatesent to both modelsjudged togetherone model answersjudged alone
How does the structure of a comparative match differ from an A/B test where only one candidate is shown per request?

This difference is why the two methods are not interchangeable. An A/B test tells you how people respond to one candidate. A comparative evaluation tells you which of several candidates won when they were placed head to head. The raw data also has different shapes: an A/B test produces feedback about individual candidates, while comparative evaluation produces a history of head-to-head results that can be ranked.

Recording a Match History

Comparative evaluation records each contest as a row: which two models competed, and which one won. Each row is one judgment by an evaluator, and no single row says anything about a model in isolation. The table below is a small history of three matches, written here as an illustrative example.

MatchModel 1Model 2Winner
1Model AModel BModel A
2Model AModel BModel B
3Model AModel BModel A

An illustrative match history: each row is one evaluator judgment.

This raw history does not yet answer the question a team usually cares about. Three matches are too few to say whether Model A is better than Model B in general. To answer that kind of question, the matches between the same pair of models have to be summarized, and the standard summary is the win rate.

Computing a Win Rate

The win rate of model A over model B is the probability that A is preferred over B. It is estimated by looking at every match between A and B and calculating the percentage of those matches that A won. The calculation is a simple count: wins divided by total matches, expressed as a percentage.

Rule

Worked example

Win rate from the three-match history

Using the match history above, what is the win rate of Model A over Model B, and what is the win rate of Model B over Model A?

  1. 1
    Count the total matches

    There are 3 matches between Model A and Model B in the history.

  2. 2
    Count the matches A won

    Model A won matches 1 and 3, so the count is 2.

  3. 3
    Apply the formula for A over B

    The win rate of A over B is $\frac{2}{3} \times 100\% \approx 66.7\%$.

  4. 4
    Count the matches B won and apply the formula for B over A

    Model B won match 2, so the count is 1. The win rate of B over A is $\frac{1}{3} \times 100\% \approx 33.3\%$.

Result

The win rate of Model A over Model B is about 66.7 percent, and the win rate of Model B over Model A is about 33.3 percent. The two values sum to 100 percent because every match has exactly one winner.

Source data often arrives already summarized as win rates for each pair of models, rather than as raw match rows. In that form, each value still means the same thing: the percentage of matches in that pair which the first model won. Source data of this kind can describe many pairs at once, with the matches behind each value often counted in the same way across pairs.

A vs B2 wins out of 3 matchesB vs A1 win out of 3 matches66.7%win rate of A over B33.3%win rate of B over Awins divided by totalwins divided by total
How do individual pairwise results map to the win count and win rate for each model pair?

Turning Win Rates into a Ranking

With two models, ranking is straightforward: the model that wins more often ranks higher. With five models, it is no longer obvious how to order them from a table of ten pairwise win rates, because some models win against some opponents and lose to others. This is the job of a rating algorithm. Typically it first assigns each model a score based on the comparative signals, then ranks the models by those scores.

Initial scoresMatch outcomerecordedScores adjustedNext match outcomeScores adjusted againFinal ordering ofmodelsstartuse outcomerepeat for each matchuse outcomesort by score
What happens to each model's rating after every match, and how do repeated updates produce a final ordering of several models? The exact update rule differs between algorithms, so this diagram shows the general pattern rather than a specific formula.

Several rating algorithms have been adapted from other fields, including Elo, Bradley-Terry, and TrueSkill. They come from sports and video games, where ranking players from head-to-head results has been done for a long time. The choice of algorithm matters because different ranking algorithms can produce different rankings from the same comparison data. A ranking can be judged by how well it predicts future match outcomes.

When Preference Is a Poor Signal

Comparative evaluation measures which response an evaluator preferred. That is a useful measurement when preference is what you care about, but it does not automatically measure the quality you care about for every question. A preference judgment records what the evaluator chose between the two candidates shown. It does not, by itself, confirm that the chosen answer is factually correct.

Consider a factual question where one response is fluent and confident but wrong, and the other is correct but plainly worded. An evaluator who prefers the fluent answer produces a win for the wrong model. The win rate is then accurate as a record of preference, yet it misleads anyone who reads it as a measure of correctness. Preference-based comparison is therefore a weak signal for questions where the right answer can be checked and where style can pull the evaluator away from accuracy.

Mistakes Beginners Make

  • Common mistake

    Treating a comparative match as two separate ratings

    What it looks like

    Showing Model A's answer to one reviewer and Model B's answer to another, then comparing their scores as if they were on one scale.

    Why it fails

    In comparative evaluation the evaluator sees the candidates together and chooses between them, so each judgment is a direct contest.

    Do this instead

    Record each match as a head-to-head row with a winner, then summarize those rows.

  • Common mistake

    Reading a win rate from too few matches

    What it looks like

    Concluding that Model A is better than Model B from a single match that A won.

    Why it fails

    Three or even a handful of matches are too few to estimate a stable probability of preference.

    Do this instead

    Count all matches between the same pair before interpreting the win rate.

  • Common mistake

    Assuming the order of the ranking is fixed

    What it looks like

    Trusting a ranking produced by one algorithm without checking whether a different algorithm produces the same order.

    Why it fails

    Different ranking algorithms can produce different rankings from the same comparison data.

    Do this instead

    Compare rankings from more than one method, and judge the ranking by how well it predicts future match outcomes.

  • Common mistake

    Using preference judgments to confirm factual accuracy

    What it looks like

    Declaring the more popular answer the correct one for a question with a checkable answer.

    Why it fails

    A preference records what the evaluator chose, which can differ from what is correct.

    Do this instead

    Use a different check for correctness on questions where the right answer can be verified.

Practice Computing Win Rates

EASY

A match record shows that Model X beat Model Y in 40 of the 50 matches between them. Compute the win rate of X over Y, then compute the win rate of Y over X. Explain in one sentence why the two values must add up to 100 percent.

Hints
  • Divide the number of matches X won by the total number of matches between X and Y.
  • Multiply the result by 100 to express it as a percentage.
  • Model Y won the matches that X did not win, so its count is the remainder out of 50.

Summary of the Method

Comparative evaluation places two or more models in head-to-head matches on the same request, and an evaluator picks the winner of each match. That structure is different from A/B testing, where one candidate is shown at a time. The recorded matches can be summarized as win rates, and a rating algorithm can turn those comparisons into a ranking of several models. Each step has a limit: win rates need enough matches, rankings depend on the algorithm, and preference is not the same as correctness.

At a glance

  • Comparative evaluation shows two or more models the same request and records which one the evaluator prefers, which is different from A/B testing where one candidate is shown at a time.
  • The win rate of model A over model B is the number of matches A won divided by the total matches between them, expressed as a percentage.
  • A rating algorithm assigns each model a score from comparison outcomes, and the models are ranked by those scores; different algorithms can produce different rankings.
  • Preference-based comparison is a weak signal when the question has a checkable answer, because a preferred response is not guaranteed to be correct.

Related concepts

More concepts starting with A