The Peeking Problem and Optional Stopping
Summary
A fixed-horizon -value is only valid at the sample size chosen before looking at data. A/B dashboards recompute after every visitor, and users stop the first time . The stopping time is then a function of the data, the event "" becomes "", and the type I error climbs far above . Johari, Pekelis & Walsh report that with 10,000 samples it “can easily increase fivefold”; in the limit the law of the iterated logarithm guarantees a false rejection with probability one. The cure is not to forbid looking, because early stopping is genuinely valuable, but to report quantities whose guarantee holds at every stopping time: always-valid p-values and confidence sequences.
Overview
Johari et al. (Sec. 1) argue that the classical -value succeeded in industry because it is a good user interface: the platform publishes one number, and each user applies her own threshold with no knowledge of the experiment’s internals. That contract holds only “when p-values and confidence intervals are used as intended”. On an online platform the user also controls the experimental design, in particular the sample size, and adjusts it in response to the very statistics she is reading. The paper’s Figure 1 is an A/A test (treatment identical to control) on a commercial dashboard whose “chance to beat baseline” wanders above 95%: a false positive created by nothing except continuous monitoring.
The incentive to peek is rational. Long experiments carry opportunity cost; harmful treatments should be aborted quickly (Larsen et al. Sec. 5 cite this as the main reason platforms want optional stopping); and most users do not know the effect size they are looking for, so they cannot fix a horizon by a power calculation in advance. “The ability to trade off maximum detection with minimum run-time dynamically is a crucial benefit of the availability of real-time data.”
Main Content
Decision rule, fixed-horizon test, sequential test (Johari et al. Sec. 3) ^def-decision-rule
Let be i.i.d. from with filtration , and test . A decision rule is a pair with a (possibly infinite) stopping time for and an -measurable rejection indicator. It is fixed-horizon if is deterministic. A sequential test is a family that is nested ( non-increasing and non-decreasing in ) with .
Fixed-horizon p-value ^def-fixed-pvalue
For the UMP test with statistic and critical value , . All that type I error control needs is super-uniformity at the chosen :
This is a statement about one pre-specified . It says nothing about for a data-dependent .
Why peeking inflates error
A peeker who stops at rejects whenever any of the looks is significant:
Each look has marginal error ; the union is strictly larger, and although successive -statistics are highly correlated the union keeps growing with the number of looks.
Sampling to a foregone conclusion ^thm-foregone
Let be a sum of i.i.d. mean-zero, unit-variance observations and . By the law of the iterated logarithm, almost surely, so for any fixed critical value
A patient peeker rejects a true null with certainty. A boundary can only be valid uniformly in time if it grows at least like ; Howard et al.’s Corollary 1 is the matching nonasymptotic statement, and it is why the boundaries in Confidence Sequences have a or factor.
Howard et al.’s Figure 1 shows this for Rademacher data: the cumulative miscoverage of pointwise 95% CLT intervals keeps climbing over observations to many times the nominal 0.05 (10,000 replications), whereas a curved uniform boundary holds its miscoverage under 0.05 for all simultaneously.
Behavioural amplifiers
Kohavi et al. (2012, Sec. 3.3) describe how the same arithmetic misleads even without formal testing. With , the cumulative estimate on day 1 has a 67% chance (day 2: 55%) of lying outside the final 21-day 95% band even when the true effect is zero. Because cumulative estimates are autocorrelated they drift smoothly back towards the truth, and feature owners read the drift as a trend (“it is about to cross zero”). Real novelty and primacy effects exist but are rare; in their experience no experiment went from significantly negative to significantly positive. Peeking is thus one branch of the Garden of Forking Paths: the stopping rule is an analysis decision made after seeing data, a canonical researcher degree of freedom. And since the peeker stops at a moment when the estimate is unusually far from zero, the reported effect is exaggerated, a type M error, even when the effect is real.
The menu of remedies
- Discipline. Fix by power analysis and look once. Valid, but discards the benefit of streaming data and is rarely obeyed; pre-registering the stopping rule is the procedural version of this.
- Group sequential designs (Pocock 1977; O’Brien & Fleming 1979; Lan & DeMets 1983 alpha-spending). Pre-specify interim looks and split across them. Standard in clinical trials and “rapidly gaining in popularity” for OCEs (Larsen et al. Sec. 5), but the looks must be planned and a maximum sample size fixed.
- Wald’s SPRT (1945). For simple vs , monitor and stop to reject when , stop to accept when , otherwise continue. It terminates with probability one and needs about half the fixed-sample on average, but requires a point alternative, and as an interface it is a “black box” until the single stopping time: it gives no inference at other times and must be tuned to one user’s power/run-time preference (Johari et al. Sec. 2.1).
- Always-valid inference. Replace the point alternative by a mixture to get a test of power one, and publish it as a -value process valid at any stopping time. See Always-Valid p-values and the mSPRT; the interval-valued dual is Confidence Sequences.
- Bayesian monitoring. Posterior probabilities do not depend on the stopping rule as a matter of coherence (the likelihood principle), and Deng et al. (2016) use Bayesian testing for OCEs (Larsen Sec. 5). But the frequentist false-positive rate of “stop when ” is inflated in the same way as peeking at -values, so a platform that promises error rates still needs option 2 or 4. See Forking Paths and Bayesian Approaches.
- Bandits. If the goal is to maximise reward during the test rather than to estimate an effect, adaptive allocation (Multi-Armed Bandits and Thompson Sampling - Overview) is the right tool. Johari et al. (Sec. 2.3) note that platforms usually also want a confidence interval on the losing variant for cost-benefit and roadmap decisions, which is why hypothesis testing remains dominant.
What optional stopping costs
There is no free lunch (Larsen et al. Sec. 5): uniform validity is paid for with wider intervals at any given (within roughly a factor of two of the CLT width; see Confidence Sequences); early stopping leaves sub-segment (heterogeneous effect) analyses underpowered; the point estimate at a data-dependent stopping time is biased away from zero; and monitoring many guardrail metrics simultaneously compounds with multiplicity.
Examples
Simulation (own illustration, not from the papers). 4,000 A/A experiments, standard-normal observations each, two-sided -test at , rejecting if any look is significant:
| Monitoring schedule | False positive rate |
|---|---|
| Final look only | 0.052 |
| 5 equally spaced looks | 0.145 |
| 10 looks (every 1,000) | 0.203 |
| Every 100 observations | 0.375 |
| Every observation from | 0.604 |
| mSPRT, , every observation | 0.035 |
Ten innocuous-looking weekly check-ins quadruple the error rate, consistent with the “fivefold” figure in Johari et al.; continuous monitoring makes a false positive more likely than not. The last row previews Always-Valid p-values and the mSPRT.
import numpy as np
rng = np.random.default_rng(0)
S = np.cumsum(rng.standard_normal((4000, 10_000)), axis=1)
n = np.arange(1, 10_001)
z = np.abs(S) / np.sqrt(n)
looks = np.arange(999, 10_000, 1000) # 10 looks
print((z[:, looks] > 1.96).any(axis=1).mean()) # ~0.20, not 0.05Connections
- Online Experimentation - Overview — where peeking sits among the statistical challenges of OCEs.
- Always-Valid p-values and the mSPRT — the constructive solution in -value form.
- Confidence Sequences — the same guarantee in interval form, nonparametric.
- Garden of Forking Paths and Researcher Degrees of Freedom — optional stopping as a data-contingent analysis choice.
- Type S and Type M Errors — stopping on significance selects exaggerated estimates.
- Multiple Testing Corrections — peeking is multiplicity over time; metrics and variants add multiplicity over hypotheses.
- Sequential and Adaptive BED — the Bayesian design-side view of adapting an experiment to accumulating data.
- Delayed and Censored Feedback - Overview — with delayed conversions, early looks are biased as well as noisy, since recent cohorts are incompletely observed.