AI Research Foundations / Rigor & Communication
Telling a real effect from noise.
Reviewed by Yuvaraj
Two results that a paper reports as facts are often nothing of the kind: a number that no one else can regenerate, and a number from a single lucky run. Reproducibility is about whether a result can be regenerated, by you tomorrow, or by a stranger next year. Statistical significance is about whether a result is real, distinguishable from the noise of random variation. This lesson treats both, keeping the mathematics light but correct, because an experiment that fails either test is not yet evidence.
A result is reproducible when someone with your artifacts can obtain the same numbers. That is harder than it sounds, because a modern experiment depends on far more than the code you wrote. Four categories of state must be pinned, or the outcome drifts silently.
| What to pin | Why it changes results | How to record it |
|---|---|---|
| Random seed | Initialization, shuffling, dropout, and sampling are all stochastic | Set and log seeds for every RNG (framework, library, and language) |
| Data version | Datasets get re-scraped, re-split, or silently updated | Hash the exact files; record the split indices, not just the split ratio |
| Code commit | A one-line change days later alters behavior | Record the exact commit SHA; never report numbers from uncommitted code |
| Environment | Library and driver versions change numerics and defaults | Pin dependency versions and hardware/driver; capture a lockfile or container image |
The seed deserves emphasis because it is the one most often forgotten and the one that quietly does the most damage. Deep-learning results vary run to run purely from random initialization and data ordering. If you do not fix and report the seed, you cannot even reproduce your own number, let alone let others do so. But there is a deeper point coming: fixing a single seed makes a result reproducible, yet a result from one seed is not thereby . Reproducibility and significance are different virtues, and cheap reproducibility can even hide the variance problem.
Ask about this lesson, or about anything in AI. Answers cite the lessons they draw on.
Finished this lesson?
Mark it complete to earn XP, keep your streak, and schedule a review.
Determinism is a spectrum, not a switch
Even with every seed pinned, some operations (certain GPU kernels, non-deterministic reductions) do not produce bit-identical results across runs or hardware. Aim for reproducibility at the level of your reported precision, the mean and spread should regenerate, rather than demanding bit-exactness that the hardware may not offer. Document which knobs you set (deterministic algorithm flags, thread counts) so others know how close they should expect to get.
Here is the trap at the heart of empirical ML. Suppose your method scores 84.6 and the baseline scores 83.1. Is your method better? You cannot say, because you do not yet know how much either number would move if you simply changed the seed. If re-running the baseline with different seeds produces anything from 82.0 to 85.5, then the 84.6 is comfortably inside the baseline's own range of luck, and your "improvement" is noise.
The remedy is to run each condition multiple times with different seeds and summarize the distribution, not a single draw. Report the mean and the standard deviation across runs, never a lone number. The sample mean over runs is
and the (sample) standard deviation, which measures how much individual runs scatter around that mean, is
Reporting "84.6" becomes "84.6 plus-or-minus 0.9 over 5 seeds." That single addition transforms an anecdote into data, because it exposes whether the gap between two methods is large or small relative to the noise.
Compare gaps to spreads, not to zero
The question is never "is my number bigger?", it is "is the gap between the means large compared to how much the runs scatter?" A 1.5-point improvement with a per-condition standard deviation of 0.3 is likely real; the same 1.5-point improvement with a standard deviation of 2.0 is almost certainly noise. Always read a difference next to the variability around it.
A standard deviation describes how much individual runs scatter. But we usually care about how precisely we know the mean, and that precision improves as we average more runs. The standard error of the mean captures this:
The is the crucial and often-misunderstood part: to halve your uncertainty about the mean you must quadruple the number of runs. From the standard error we form a confidence interval, approximately
where is a multiplier from the t-distribution that depends on and the confidence level (near 2 for a 95 percent interval with a handful of runs).
A confidence interval is easy to misread. A 95 percent confidence interval does not say "there is a 95 percent probability the true mean is in this interval." It says: if you repeated the whole experiment many times, about 95 percent of the intervals constructed this way would contain the true mean. Operationally, treat it as a statement about the precision of your estimate: a wide interval means you have not run enough seeds to know the mean well, and two methods whose intervals overlap heavily are not distinguishable on this evidence.
A significance test formalizes "is this gap bigger than noise?" You posit a null hypothesis, typically "the two methods have the same true mean", and compute a p-value: the probability of observing a gap at least as large as the one you saw, if the null were true. A small p-value (conventionally below 0.05) means the observed gap would be surprising under the assumption of no real difference, so you have evidence against that assumption.
Two cautions matter more than the mechanics. First, a p-value is not the probability that your hypothesis is true, and it is not a measure of how big the effect is, with enough runs, a trivially small difference becomes "statistically significant." Second, p-values are easily abused: testing many configurations and reporting only the one that crossed 0.05 (p-hacking) manufactures false positives.
This is why you must also report effect size, how large the difference is, in units you care about, independent of sample size. A common standardized measure is Cohen's d, the gap between the means in units of the pooled standard deviation :
The pairing is the point: the p-value (or confidence interval) tells you whether an effect is distinguishable from noise, while the effect size tells you whether it is large enough to matter. A result can be statistically significant yet practically negligible, or practically large yet not yet significant because you ran too few seeds. Report both, and interpret them together.
Common mistakes