Skip to content
mlmentorship

Hypothesis testing and confidence intervals

Quantify paired model gains under sampling assumptions, then compare uncertainty with a predeclared useful-effect threshold.

Published · 9 min read ·Core ·Foundation

Visual quick review

Classify a model-gain confidence interval by whether it rules out no effect and whether it establishes a gain large enough to change the decision.

Evidence versus decision

Three model-gain confidence intervals compared with zero and a minimum useful gain

Three model-gain confidence intervals compared with zero and a minimum useful gain An original plot of three synthetic 95 percent confidence intervals in percentage points. The first interval runs from minus 0.3 to 1.9 and crosses zero, so the direction is uncertain. The second runs from 0.1 to 1.5; it excludes zero but crosses the predeclared minimum useful gain of 1.0, so there is evidence of a positive effect but practical value remains unresolved. The third runs from 1.2 to 2.0 and lies entirely above the minimum useful gain, supporting a decision-relevant gain under the assumptions. no effect minimum useful gain 0 +1.0 point 1 −0.3 +1.9 2 +0.1 +1.5 3 +1.2 +2.0 VERDICT 1 · Direction uncertain: interval crosses zero. 2 · Positive effect; useful size still uncertain. 3 · Entire interval clears the useful-gain threshold. −0.5 0 +0.5 +1.0 +1.5 +2.0 model B gain over model A (percentage points)
compare each interval with zero and the predeclared useful gain. Row 1 establishes neither direction nor usefulness. Row 2 excludes zero but still crosses one point; row 3 lies wholly above one point. The paired calculation below produces row 1's rounded endpoints; the other rows are separate synthetic examples. Definitions retain the ASA, NIST, and Neyman reference provenance.
Check: Why does interval 2 support a positive effect without establishing that the gain exceeds one percentage point?
Full explanation 9 min read
Reading depth

Summary

A hypothesis test compares observed data with a null model under explicit sampling and test assumptions. A confidence interval quantifies uncertainty using a procedure whose coverage is defined across repeated samples. Statistical evidence of improvement is different from evidence of a practically useful gain.

The basic setup

Compare two fixed models on independent paired examples from a declared target population. Before inspection, choose the accuracy difference, test direction, significance level, and minimum useful gain of one percentage point. All counts and intervals here are teaching fixtures, not measured model results.

For scores , the observed change is

A common null hypothesis is:

Choose a two-sided alternative , or a predeclared directional alternative. A standardized statistic compares the estimate with its standard error:

Its null distribution and standard error require justification; the formula alone is not a valid test.

What a p-value means

A p-value is a null-conditional probability of a statistic at least as extreme as observed. It is not the null’s posterior probability, replication probability, effect size, or evidence of causation by itself.

Confidence intervals

A normal-approximation interval uses

For approximate 95% coverage, use under the matching assumptions. Across repetitions, about 95% of intervals constructed this way cover the fixed effect when the approximation is accurate. This is not a 95% posterior probability statement about the realized interval.

Evidence versus decision

Use paired uncertainty before claiming direction or a worthwhile model gain

Use paired uncertainty before claiming direction or a worthwhile model gainKeep one difference per paired example. The first interval spans zero and the useful-gain threshold, so direction remains uncertain. More new independent pairs narrow it above zero, but it still crosses the threshold. Positive evidence is not proof of a worthwhile gain. Duplicating observations supplies no new independent information. Coverage is a repeated-sampling property, not a posterior probability. Predeclare the test and claim family; twenty claims need multiplicity control.Paired information narrowsuncertainty, not the decision ruleTwo fixed models; independent pairedexamples from a declared population.Predeclare test direction, level anduseful gain: one percentage point.1000 pairs: 20 B-only wins, 12 A-onlywins968 zero differences; estimate 0.8pointPaired variance 0.031968; standarderror 0.5654 point012Approximate 95-percent interval:-0.308 to 1.908 points4000 pairs: 80 B-only wins, 48 A-onlywins3872 zero differences; estimate 0.8pointPaired variance 0.031944; standarderror 0.2826 point012Approximate 95-percent interval:0.246 to 1.354 pointsSame ruler: grey zero; dashed redone-point useful threshold. Firstinterval spans zero and thethreshold. Second is positive butstill crosses the useful threshold.Four thousand new independent pairssupply more information. Repeatingthe original records four times doesnot. Keep discordant pairs; separatemodel marginals lose covariance.First interval also fails toestablish equivalence within ahalf-point margin. Samplingassumptions and normal-approximationcoverage need justification.Coverage belongs to therepeated-sampling procedure, not a95-percent posterior claim about thisinterval. A p-value isnull-conditional, not the chance thenull is true.Twenty prespecified formal claims atfamily-wise level 0.05: Bonferronithreshold 0.0025 each. A p-value 0.01does not reject under that procedure.
Read it this way: Keep one difference per paired example. The first interval spans zero and the useful-gain threshold, so direction remains uncertain. More new independent pairs narrow it above zero, but it still crosses the threshold. Positive evidence is not proof of a worthwhile gain. Duplicating observations supplies no new independent information. Coverage is a repeated-sampling property, not a posterior probability. Predeclare the test and claim family; twenty claims need multiplicity control. Does the positive second interval establish a gain exceeding one point?
Reference drawing

Evidence versus decision

Use paired uncertainty before claiming direction or a worthwhile model gain

Use paired uncertainty before claiming direction or a worthwhile model gainKeep one difference per paired example. The first interval spans zero and the useful-gain threshold, so direction remains uncertain. More new independent pairs narrow it above zero, but it still crosses the threshold. Positive evidence is not proof of a worthwhile gain. Duplicating observations supplies no new independent information. Coverage is a repeated-sampling property, not a posterior probability. Predeclare the test and claim family; twenty claims need multiplicity control.Paired information narrowsuncertainty, not the decision ruleTwo fixed models; independent pairedexamples from a declared population.Predeclare test direction, level anduseful gain: one percentage point.1000 pairs: 20 B-only wins, 12 A-onlywins968 zero differences; estimate 0.8pointPaired variance 0.031968; standarderror 0.5654 point012Approximate 95-percent interval:-0.308 to 1.908 points4000 pairs: 80 B-only wins, 48 A-onlywins3872 zero differences; estimate 0.8pointPaired variance 0.031944; standarderror 0.2826 point012Approximate 95-percent interval:0.246 to 1.354 pointsSame ruler: grey zero; dashed redone-point useful threshold. Firstinterval spans zero and thethreshold. Second is positive butstill crosses the useful threshold.Four thousand new independent pairssupply more information. Repeatingthe original records four times doesnot. Keep discordant pairs; separatemodel marginals lose covariance.First interval also fails toestablish equivalence within ahalf-point margin. Samplingassumptions and normal-approximationcoverage need justification.Coverage belongs to therepeated-sampling procedure, not a95-percent posterior claim about thisinterval. A p-value isnull-conditional, not the chance thenull is true.Twenty prespecified formal claims atfamily-wise level 0.05: Bonferronithreshold 0.0025 each. A p-value 0.01does not reject under that procedure.
Derivation
Three model-gain confidence intervals compared with zero and a minimum useful gain An original plot of three synthetic 95 percent confidence intervals in percentage points. The first interval runs from minus 0.3 to 1.9 and crosses zero, so the direction is uncertain. The second runs from 0.1 to 1.5; it excludes zero but crosses the predeclared minimum useful gain of 1.0, so there is evidence of a positive effect but practical value remains unresolved. The third runs from 1.2 to 2.0 and lies entirely above the minimum useful gain, supporting a decision-relevant gain under the assumptions. no effect minimum useful gain 0 +1.0 point 1 −0.3 +1.9 2 +0.1 +1.5 3 +1.2 +2.0 VERDICT 1 · Direction uncertain: interval crosses zero. 2 · Positive effect; useful size still uncertain. 3 · Entire interval clears the useful-gain threshold. −0.5 0 +0.5 +1.0 +1.5 +2.0 model B gain over model A (percentage points)
compare each interval with zero and the predeclared useful gain. Row 1 establishes neither direction nor usefulness. Row 2 excludes zero but still crosses one point; row 3 lies wholly above one point. The paired calculation below produces row 1's rounded endpoints; the other rows are separate synthetic examples. Definitions retain the ASA, NIST, and Neyman reference provenance.
Check: Why does interval 2 support a positive effect without establishing that the gain exceeds one percentage point?
Read it this way: Keep one difference per paired example. The first interval spans zero and the useful-gain threshold, so direction remains uncertain. More new independent pairs narrow it above zero, but it still crosses the threshold. Positive evidence is not proof of a worthwhile gain. Duplicating observations supplies no new independent information. Coverage is a repeated-sampling property, not a posterior probability. Predeclare the test and claim family; twenty claims need multiplicity control. Does the positive second interval establish a gain exceeding one point?

Use paired comparisons

Keep one difference per paired example:

Among 1,000 pairs, B alone is correct on 20 and A alone on 12; 968 differences are zero. Therefore , and . The paired sample variance and standard error are

The interval is , or approximately percentage points. The statistic is about . Discarding the 32 discordant pairs loses the covariance needed for this variance. The interval neither establishes direction nor equivalence within a -point margin.

Increase independent information

New task: evaluate 4,000 new independent pairs with the same hypothetical discordance proportions.

Picture and change: use 80 positive differences, 48 negative differences, and 3,872 zeros. Recompute variance and standard error rather than copying the old interval.

Check: , , and SE is approximately . The interval becomes approximately points: positive, but still crossing the useful threshold. Duplicating the original observations four times would not provide this independent information.

Use when: fresh evaluation units can improve precision without changing the estimand.

Make twenty formal claims

New task: control family-wise error at for twenty prespecified tests.

Picture and change: Bonferroni compares each p-value with .

Check: the threshold is ; p-value does not reject under this procedure. Record the entire claim family rather than selecting its size after seeing results.

Use when: formal claims span multiple metrics, variants, or slices.

Why AI labs care

Evaluation examples, training seeds, generated outputs, and human ratings are different randomness sources. The paired fixture addresses evaluation-example uncertainty conditional on fixed models, not every training recipe’s variation. Report failed and missing runs; do not select the best seed and hide the rest.

Type I and Type II errors

  • Type I error: report a gain when no true gain exists.
  • Type II error: miss a real gain.
  • Power: the chance of detecting an effect of a chosen size when it exists.

Non-rejection does not establish equality. An equivalence claim needs a predeclared margin and an appropriate procedure. Choose a minimum decision-relevant effect and plan power under plausible variance and clustering before an expensive study.

Multiple comparisons

Model or prompt selection on the evaluation set changes what the reported interval covers. Keep exploratory slices distinct from planned claims and confirm selected findings on fresh data. Repeated peeking needs a sequentially valid design, not repeated use of a fixed-sample threshold.

Common assumptions

Pair generation outputs by prompt and randomize human presentation order. If users or documents contribute repeated observations, retain clusters when estimating uncertainty. Normal approximations need adequate sampling behavior; paired bootstrap and paired-binary tests require their own assumptions. Representative sampling, causal assignment, and training-run uncertainty are separate concerns.

In an interview

An interval is points and the useful threshold is one point. What follows?

Answer

It supports a positive effect under the matching test and assumptions, but not a gain exceeding one point. It is not a posterior probability statement or a complete launch decision.

Common mistakes

CI exclusion corresponds to rejection only for a matching direction, level, and test construction. A statistically precise tiny gain can still lose against cost, latency, or safety constraints.

Related: expectation, variance, covariance, and correlation, bootstrap and resampling, A/B testing for ML systems, and design an ablation study.