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
The question for today
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.
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.
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.
Work it through
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.
The observed paired success difference is (8−2)/20=0.30, or thirty percentage points. The discordant count is d=10.
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.
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 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.
The living notebook
Explore the model
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.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
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.
Pause & reason
Check your understanding
Your turn
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.
Keep the idea
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.