advanced24 min studyLesson 845 in Engineering

Compare models on matched cases and preserve the pairing

Estimate within-case improvements, distinguish effect size from a hypothesis test, and compute a fixed-sample exact discordance test under a stated null model.

On this page

What you’ll understand

  • Compute a paired mean difference using a declared direction.
  • Use discordant outcomes in a binary paired comparison.
  • Separate fixed-sample inference from selection, clustering, and optional stopping.

Two assistants differ by three percentage points, but the scores were computed on different prompt collections. Difficulty and model effects are entangled. Evaluating both systems on matched cases can isolate within-case differences and often improve precision when their outcomes move together. Preserve that pairing in analysis and resampling. A paired estimate still needs a defined population, comparable system budgets, and an uncertainty method; a small p-value is not the size or practical importance of the improvement.

Define the paired effect and comparison conditions

For each eligible case, obtain scores from model A and model B under the declared resource, retrieval, and scoring contracts. Define a positive difference as improvement in the direction relevant to the metric. The mean of paired differences estimates the chosen population contrast when the collection and measurement assumptions support it. Its sampling variance involves the covariance between model scores, which an analysis treating the two score lists as unrelated ignores. Pairing cannot fix a change in prompts, tool permissions, or annotation rules applied only to one model.

Use a shared case identifier to join outputs and record missing or failed evaluations before computing the contrast. Restricting to cases where both systems succeeded can create a different conditional estimand, so choose and report the missing-outcome policy. If several outputs come from the same user or source, retain that cluster in the paired bootstrap or another appropriate procedure. The same selected cases and clusters must appear for both systems within each resample. For corpus-level metrics, recompute the metric rather than assume it equals the mean of per-example scores.

Δ^=1n∑i=1nDi,Di=sB,i−sA,i,n>0\widehat{\Delta}=\frac1n\sum_{i=1}^{n}D_i,\qquad D_i=s_{B,i}-s_{A,i},\quad n>0
Δ_hat has score units, or a dimensionless difference in success probabilities for binary scores. This is a paired statistic on the stated eligible cases. Its uncertainty depends on the sampling and dependence structure, not only on the two marginal success counts.↔ Scroll wide equations horizontally.

A simple exact binary test uses the discordant pairs

For binary success scores, cases where both models pass or both fail have zero difference. Let W count B-only successes and L count A-only successes. Under an independent-pair null with equal probabilities of these two discordant outcomes, conditioning on W+L gives a binomial count of W with success probability one half. An exact fixed-sample tail calculation can test that null. It is a test of a specified contrast under assumptions, not a posterior probability that B is better and not a guarantee that the improvement exceeds a practical threshold.

State the alternative and p-value convention before inspecting the outcome. A one-sided improvement test and a two-sided difference test answer different questions. Ties, abstentions, and parsing failures need a declared policy; silently dropping them after seeing which model benefits can bias the analysis. For continuous or ordinal outcomes, choose a method suited to the score and design instead of forcing every comparison into a binary win count. Koehn's paired-bootstrap discussion illustrates the importance of resampling matched outputs when comparing evaluation systems on the same test cases.

W∣(W+L=d,H0)∼Binomial⁡(d,1/2)W\mid(W+L=d,H_0)\sim\operatorname{Binomial}(d,1/2)
This conditional null model assumes independent identically distributed matched cases and equal discordant probabilities. d is a nonnegative integer; when d=0 there is no discordant evidence and the tail test is uninformative. Related cases need dependence-aware analysis.↔ Scroll wide equations horizontally.

Separate confirmation from model selection and repeated looks

If a team tries many prompts and reports the model pair with the smallest test p-value, the single fixed-comparison calculation no longer describes the full selection procedure. Preserve a final confirmation role or use an inference design that accounts for the planned comparisons and adaptations. Repeatedly recomputing an ordinary fixed-sample test and stopping at significance also changes its error behavior. Time-uniform methods have their own assumptions and boundaries; they are not obtained by relabeling a fixed-sample interval as safe for continuous monitoring.

The probability lab represents only the exact conditional null in a small example. Reset, set both p=0.5 and n=10, predict the upper tail from eight through ten wins, then inspect the bars and add them. The tail is 56/1024=0.0546875. A symmetric doubled-tail two-sided value for this observation is 0.109375. The instrument has no pairing, model outputs, clustering, or automatic p-value computation. It displays the binomial masses to be summed under the stipulated null, while the actual evaluation must justify why that null applies.

A visible improvement need not pass the declared test

A fictional fixed test has twenty independent matched binary cases. B alone succeeds on eight cases, A alone succeeds on two, and the models agree on the remaining ten. Test equal discordant probabilities using the specified symmetric two-sided binomial tail.

  1. The observed paired success difference is (8−2)/20=0.30, or thirty percentage points. The discordant count is d=10.

  2. Under the stated null, the upper tail is P(W≥8)=[45+10+1]/1024=0.0546875. Symmetry gives a doubled two-sided value 0.109375.

  3. At a predeclared two-sided 5% threshold this test does not reject the null. Report the large observed effect together with limited support and appropriate uncertainty rather than declaring equality or treating the p-value as the chance the null is true.

The result

The observed contrast is thirty percentage points, while this exact fixed-sample two-sided test yields 0.109375. Effect size, uncertainty, practical relevance, and the test decision are separate statements.

Explore the model

Interactive lab

Interactive lab · probability

Sum the conditional null masses explicitly

Reset, set both p=0.5 and n=10, predict, then inspect. Add bars k=8, 9, 10 to obtain 56/1024=0.0546875. The stated symmetric two-sided calculation doubles this tail. The lab displays exact binomial masses but does not run paired models, handle ties, or select a statistical test.

Sum the conditional null masses explicitlyThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA test result follows from a declared null and design. Pairing, dependence, selection, and stopping assumptions must be justified outside the probability display.

Check your understanding

Why should a bootstrap comparison resample both models on the same selected cases?

Try it yourself

In forty matched cases, B alone succeeds on twelve and A alone on four. The rest agree. Compute the paired success difference and state the conditional null count model.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use all forty cases for the effect denominator and only the sixteen discordant cases for the conditional binomial test.

Compare with the solution

The paired difference is (12−4)/40=0.20, or twenty percentage points. Under the stated independent equal-discordance null, W conditional on d=16 is Binomial (16, 0.5). The observed effect denominator and conditional-test denominator serve different purposes; neither alone supplies an interval or release decision.

Take it with you

  • Preserve matched cases and compatible system conditions.
  • Effect size, practical threshold, and hypothesis-test evidence are distinct.
  • Fixed-sample paired tests do not automatically cover clustering, selection, repeated looks, or deployment shift.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.