Peeking problem

Also known as: peeking

On this page 8

The peeking problem is the inflation of the false positive rate that occurs when analysts repeatedly check the results of a running test and stop it as soon as the p-value crosses the significance threshold. In experimentation, and especially in online A/B testing on product data, a test designed for a fixed sample size assumes one single analysis at the end; every additional unplanned look gives random noise another chance to appear significant.

Peeking is not a flaw in the data or the software. It is a mismatch between the analysis procedure and the statistical method: classical fixed-horizon tests are valid only when the decision is made once, at a horizon chosen in advance.

Why repeated looks inflate the error rate

Repeated looks inflate the error rate because the test statistic performs a random walk while data accumulate. Under the null hypothesis, a z-statistic computed after each new batch of users wanders up and down, and the probability that it touches the critical value at least once over many looks is much larger than the probability that it sits beyond that value at one predetermined moment.

With a nominal alpha of 0.05, a single final analysis yields a 5% chance of a false positive. If the same test is evaluated after every day of a month-long run and stopped at the first significant result, the actual false positive rate can exceed 25%. In the limit of continuous monitoring, the law of the iterated logarithm guarantees that a fixed threshold will eventually be crossed, so the error rate approaches 100% given enough looks.

The table below shows approximate false positive rates for a two-sided test at a nominal 5% level when the analyst checks at equally spaced points and stops at the first significant reading.

Number of looksNominal alphaApproximate actual alpha
15%5%
25%8%
55%14%
105%19%
205%25%
Continuous5%Approaches 100%
Approximate false positive rate by number of interim looks

The inflation grows quickly at first and then more slowly, which is why even a few casual looks at a dashboard materially change the reliability of a conclusion.

Forms of peeking in practice

Peeking takes several forms, and not all of them involve an explicit early stop. The common thread is that the decision rule depends on interim results that the original design did not account for.

Form of peekingWhat happensMain consequence
Early stopping on significanceTest ends at first p below 0.05Inflated false positives
Extending a flat testRun continues until a result appearsInflated false positives
Stopping on a bad trendPromising variant killed earlyLost true effects
Metric shopping at interimPrimary metric changed after lookingSelective reporting bias
Dashboard-driven decisionsStakeholders act on live p-valuesInformal, untracked looks
Common forms of peeking and their effect

Extending a test that has not reached significance is the mirror image of stopping early and is equally harmful. Both practices let chance fluctuations choose the stopping time, which biases the outcome toward significance.

Effect on estimates, not only on p-values

Peeking also biases the estimated effect size. A test stopped at the moment its statistic first crosses a threshold tends to stop at a random high point, so the reported lift is systematically larger than the true lift. This phenomenon is often called the winner’s curse or truncation bias.

The consequence is visible after launch: a feature that showed a 4% conversion lift in an early-stopped test frequently delivers a much smaller gain in production. Teams then blame the novelty effect or seasonality, when the actual cause was a biased stopping rule. Confidence intervals computed with fixed-horizon formulas after peeking are also too narrow, so they understate the real uncertainty.

Valid alternatives to fixed-horizon testing

Valid monitoring is possible when the analysis method is designed for repeated looks. These approaches, grouped under the name sequential testing, spend the error budget across interim analyses so that the overall false positive rate stays at the nominal level.

MethodHow it controls errorTypical use
Group sequential designPlanned looks with adjusted boundariesClinical trials, scheduled reviews
Alpha spending functionDistributes alpha over information timeFlexible look timing
Always-valid inferenceConfidence sequences valid at any timeContinuous product dashboards
Mixture sequential probability ratio testLikelihood ratio with a mixing priorOnline experimentation platforms
Bayesian decision rulesPosterior thresholds with expected lossDecision-focused product teams
Methods that permit interim analysis

Boundaries such as O’Brien-Fleming are very strict at early looks and close to the nominal threshold at the final look, which preserves most of the statistical power. Pocock boundaries use a constant, stricter threshold at every look and stop earlier on large effects, at the cost of a larger maximum sample size.

Bayesian monitoring is sometimes presented as immune to peeking. That claim is only partly true: posterior probabilities remain coherent under optional stopping, but if a team still judges the procedure by its frequentist false positive rate, repeated checking of a posterior threshold also inflates that rate.

How to prevent the peeking problem

Prevention combines pre-registration of the analysis plan with tooling that either hides or corrects interim results. The plan should state the primary metric, the minimum detectable effect, the required sample size and the stopping rule before the first user is exposed.

SituationRecommended approachReason
Fixed traffic, no urgencyFixed horizon, single final analysisSimplest and most powerful
Need to stop harmful variantsGuardrail monitoring with strict boundsSafety without full peeking cost
Stakeholders watch live resultsAlways-valid p-valuesEvery look remains valid
Few planned review meetingsGroup sequential boundariesHigh power, controlled alpha
Large effect expected quicklyPocock-style early stoppingFaster decisions on clear wins
Decision guide for monitoring an experiment
  • Compute the required sample size in advance from the baseline rate, minimum detectable effect and statistical power.
  • Run the test for whole weekly cycles to avoid day-of-week bias, even when using sequential methods.
  • Show interim results with sequentially valid intervals or label them clearly as not decision-grade.
  • Log every interim look so that reviewers can audit the stopping decision.
  • Treat early stops for harm separately through guardrail metrics, which protect users without licensing early wins.

Common misconceptions about peeking

A frequent misconception is that looking is harmful in itself. Merely viewing interim data does not change the error rate; the damage comes from acting on the view by stopping, extending or changing the metric. Monitoring sample ratio mismatch or data quality during a test is therefore legitimate and recommended.

Another misconception holds that large samples protect against peeking. They do not: the inflation depends on the number of looks and the decision rule, not on traffic volume. A related error is to correct peeking with a simple Bonferroni division of alpha, which is valid but overly conservative because successive looks are highly correlated. Peeking is also distinct from the multiple comparisons problem, which concerns many metrics or variants evaluated once, although both inflate false discoveries in a similar way.

In plain words

Imagine flipping a fair coin and deciding in advance to call it unfair only if it shows a very lopsided result after 1,000 flips. That rule is fair. Now imagine checking after every 10 flips and stopping the moment the count looks lopsided. Sooner or later, a streak will appear by chance, and the fair coin will be declared unfair.

The peeking problem is exactly this. Checking a test again and again and stopping at the first good-looking result makes chance look like a real effect. The fix is either to wait until the planned end or to use a method that was built for checking along the way.

A real-world example

An online retailer tests a new checkout button against the current one. The plan calls for two weeks and about 80,000 visitors per variant to detect a 2% relative lift in conversion. On day three, the product manager opens the dashboard, sees a 6% lift with a p-value of 0.03, and asks the team to ship the new button immediately.

The analyst points out that the test was designed for one final analysis, and the platform has already shown results daily. The team lets the test finish. At the planned end, the lift has shrunk to 0.4% with a p-value of 0.61, a result consistent with no effect. The early signal was random fluctuation amplified by peeking.

After this episode, the team switches its experimentation platform to always-valid confidence sequences. Managers can now check results every day, and a test stops early only when the sequential boundary is crossed, keeping the overall false positive rate at 5%.