Looking early without fooling yourself
Everybody looks at a running test. The damage comes from stopping when it looks good. There is a right way to look, and it is older than the web.
A test is planned for two weeks. On day three the dashboard shows the new design ahead, with a p-value under 0.05. The product manager asks the reasonable question: if it is significant, why wait?
Because the 5% promise only holds if you look once. A p-value is not a running score that settles down to the truth. Under no effect at all, it wanders. Give it enough chances and it will dip below 0.05 at some point, purely by chance, and if your rule is to stop the first time it does, you will stop on a false win far more often than one time in twenty.
See it happen
Start with a single test of a change that does nothing at all. Every day, someone opens the dashboard and checks how much better or worse version B looks. If B crosses the “significant” line, the test is called a win and shipped.
What checking every day does to a test
How to read itLeft to right are the 28 days of a test; up means B looks better, down means worse. The two horizontal lines are where a result counts as significant. Go through the steps in order, and change how often someone checks, to see how often a change that does nothing crosses a line purely by chance.
—
Go through the five steps in order. One test looks harmless: the line wanders, and sometimes it touches the winner line on some day before drifting back. Ten tests show it is not bad luck: a few of them cross. A thousand tests show what that means in total. Checked every day for four weeks and stopped at the first crossing, more than one in four tests of a change that does nothing ends with a “significant” result. Checked weekly, about one in eight. The 5% promise only holds for “once, at the end”.
These numbers are not new. Peter Armitage, C. K. McPherson and B. C. Rowe worked them out for clinical trials in 1969: 8% with two looks, 14% with five, 19% with ten, 25% with twenty.
It happened at Airbnb
In 2014 Jan Overgoor described a real test at Airbnb: raising the top of the price filter on the search page from $300 to $1,000. After seven days the p-value touched 0.05, with the new filter apparently 4% better. Anyone checking that day would have called it a win. The test kept running, and the final effect was practically zero: the early “win” was noise. Airbnb responded by having its platform demand much stronger evidence early in a test and relax the requirement as the test runs, the same idea as step 4 above.
The change Airbnb tested
How to read itWireframes, not the real page. The only difference is the top of the price slider, drawn in blue: $300 in A, $1,000 in B.
The maths
Call t the information fraction, the share of the planned sample seen so far (t = 1 at the end). Under no effect, the z-score at t behaves like Z(t) = W(t)/√t, where W is a Brownian motion: the continuous version of a random walk, a running total of many small independent coin-flip-like steps. Its value at successive looks is strongly correlated, but not perfectly, so each look is a partly new chance to cross ±1.96.
The same idea with a coin
Without the Brownian motion: toss a coin 1,000 times and keep a running score, +1 for heads and −1 for tails. The score after 1,000 tosses contains the score after 500. They are the same walk, looked at twice. A test’s z at successive looks is like that: one running total, rescaled each time.
That is why looks are neither independent nor identical. Five completely fresh chances at 5% would give 1 − 0.95⁵ = 23% false alarms. Five looks at exactly the same number would give 5%. Five looks at a growing total give 14%: in between, and much closer to the bad end than people expect.
The probability of crossing at least once over K equally spaced looks has no closed form; it is computed by integrating the density of the continuing paths look by look. The planner and the simulator use exactly this recursion.
Option one: do not look
The simplest fix is discipline. Decide the sample size, run the full number of whole weeks, analyse once.
It is statistically clean and organisationally fragile. Real businesses need to stop a test that is breaking something, and real people find it hard to ignore a dashboard. A rule that depends on nobody ever being tempted is a weak rule.
Option two: plan your looks
Medicine faced the same problem in the 1970s, with higher stakes: you cannot keep giving patients a drug that is already clearly harmful, or withhold one that is already clearly saving lives, just because the protocol says wait.
The answer was the group sequential design. Stuart Pocock in 1977 and Peter O’Brien and Thomas Fleming in 1979 proposed stricter thresholds for early looks; in 1983 Gordon Lan and David DeMets made it flexible with alpha spending, a budget of false positive risk that you spend across the looks as data arrives.
Step 4 of the simulator uses an O’Brien–Fleming-type boundary: the red lines almost disappear, and the false win rate goes back to about 5%, however often you look. Step 5 shows the payoff: real effects still get found, and many of them stop early.
The idea behind it is simple enough to say without formulas. Think of the 5% as a budget of risk for the whole test. Every look spends some of it, because every look is a chance to be fooled. Early looks are the dangerous ones, since with few people the numbers swing the most, so they get a tiny slice and a very high bar. Later looks, with calmer numbers, get more. By the final look most of the budget is still there, which is why its bar is barely higher than the usual one. Add up the slices and you have spent 5%, no more, however the looks were arranged.
Five planned looks cost about 2.5% more users at most, and if the effect is real, the test ends on average 18% sooner.
Looks go on whole weeks
Stopping early does not cancel chapter 6’s rule about whole weeks. A test that stops on its fourth day has the number of people for that look but not the mix: it has met only some kinds of day. So put every planned look on a whole-week boundary, and do not stop for a win before the first full week, or the second if your customers take a long time to decide. Stopping for harm is the exception: a broken page is stopped the moment it is seen. In practice this means a site that would reach its full sample in a month gets three or four looks, not twenty; more looks than weeks buys almost nothing.
An early stop exaggerates, too
Chapter 6 showed that small tests that come out significant overestimate the effect. A test stopped at an early look is, at that moment, a small test that cleared a high bar, and the same thing happens. Take a real 5% improvement and the five-look design below: the tests that stop at the second look report, on average, a lift of about 11%, roughly twice the truth; those that stop at the third report about 7%. Only tests that run to the later looks report something close to 5%. When a test stops early, treat the measured size as optimistic: plan on less, or ask for an estimate adjusted for the early stop, which statisticians know how to compute but most dashboards do not show.
The numbers for five looks
O’Brien–Fleming type spending, α = 0.05 two-sided, 80% power, looks at 20%, 40%, … 100% of the maximum sample. Stop if |z| exceeds
4.88 · 3.36 · 2.68 · 2.29 · 2.03
Maximum sample: 1.025 × the fixed design. Expected sample if the effect equals the MDE: 0.82 ×. If the effect is larger, it stops sooner still.
Pocock type (Lan–DeMets spending that imitates Pocock’s flat boundaries): boundaries around 2.4, easier to stop early, but the maximum sample grows to about 1.21 ×. Pocock’s original design, with exactly equal boundaries of 2.41, needs 1.23 ×.
What the five numbers mean
- |z|
- z without its sign: how many standard errors from zero, in either direction.
- 4.88
- The line at the first look. Noise alone crosses it about once in a million tests, so stopping here costs almost nothing.
- 2.03
- The line at the last look: barely above the usual 1.96. The early looks used up very little of the 5%.
- 1.025 ×
- The price of the four early looks: 2.5% more people at most, for the right to stop early.
In the shop of chapter 6: 154,000 per version becomes at most 158,000. If the effect really is the 5% planned for, the test stops after 126,000 on average (0.82 × 154,000).
The shape of the O’Brien–Fleming boundary matches how most teams want to behave. Early on, only an overwhelming result can stop the test, which protects against the noisy first days. By the last look the threshold is almost back to the familiar 1.96, so a test that runs to the end loses very little.
Georgi Georgiev built his AGILE method on these designs, adding the option to stop for futility when a test clearly cannot reach its goal, and reports that conversion tests reach conclusions 20% to 80% faster than fixed designs with the same error guarantees. The planner sizes these designs: choose the number of looks and it reports the maximum sample, the expected sample, and the boundary to use at each look.
Option three: look whenever you like
A newer family of methods allows truly continuous monitoring: always-valid p-values and confidence sequences, developed by Ramesh Johari, Leo Pekelis and David Walsh and by Steven Howard, Aaditya Ramdas and colleagues.
Several commercial platforms use them. The price of being allowed to look after every single visitor is lower power for the same sample, so for a team that analyses once a day or once a week, a group sequential design with a few planned looks usually gets to an answer with fewer users. Georgiev compares the two families in detail.
Let a machine do the looking
Humans are bad at watching a dashboard without reacting to it. Machines are good at it. Mature experimentation platforms take the looking away from people in two ways.
- Watching for damage, all the time. The platform checks guardrails such as errors, crashes, page speed and revenue continuously, and alerts the team, or switches the test off, when one of them clearly breaks. Nobody has to remember to look, and nobody is tempted to look at the deciding metric while doing it. Watching for damage is not peeking: stopping because something is clearly broken does not inflate the false win rate. Stopping early because it is winning does.
- Applying the right threshold at every look. When the platform knows how many looks are planned, it shows each result against the boundary for that look, not against 1.96. A result that has not crossed its boundary is simply shown as “not yet”, however good it looks. Airbnb built exactly this after the price-filter test above.
Options two and three are the statistics such a machine runs. You can apply them by hand, but they work best when nobody has to.
What about Bayesian methods?
Some tools claim that Bayesian statistics make peeking safe. Whether that is true depends on what you want to be safe from.
A Bayesian posterior does not need correcting for the number of looks in its own terms, but if your question is “how often will this procedure ship a change that does nothing?”, stopping when the posterior looks good inflates that rate just as stopping on a p-value does. This book takes the frequentist line because it answers that question directly; the debate is real and the sources below give both sides.
Why not a bandit?
Many testing tools offer a multi-armed bandit, named after a gambler choosing between slot machines.
Instead of a fixed split, it moves traffic towards whichever version is doing better as the test runs. It is built for a different goal: earning as much as possible during the test, rather than learning how big the difference is. That trade has a price. Because the split keeps changing, the groups are no longer comparable across days, so the estimate of the effect is biased and the weekly mix of chapter 6 is lost; a version starved of traffic early may never get the chance to show it was better; and guardrails and the sample ratio check are hard to read when the ratio is meant to drift. Bandits fit short-lived choices where the learning does not need to outlive the test, such as which of five headlines to show on today’s story. For a change you will live with for years, a fixed split gives you the answer you will act on.
In practice
Four rules that let you look at a running test without fooling yourself.
- Decide the maximum duration and the number of looks before launch, and write them in the test plan.
- Use the boundary for that look, not 1.96, whenever you look for a result.
- Monitor guardrails daily for damage; that is not peeking.
- If you must stop for business reasons at an unplanned moment, report the result as inconclusive unless it clears the boundary for that look.
What we’ve learned
- Checking often and stopping at the first significant result multiplies false wins.
- Watching guardrails for damage is fine; stopping early because it looks good is not.
- Planned looks with stricter early thresholds let you stop early without the penalty.
- Let the platform watch: automatic boundaries and alerts beat human willpower.
Sources
- Overgoor, J. (2014). Experiments at Airbnb. Airbnb Engineering. The price filter example and dynamic p-value thresholds.
- Armitage, P., McPherson, C. K. and Rowe, B. C. (1969). Repeated significance tests on accumulating data. Journal of the Royal Statistical Society A 132(2).
- Pocock, S. J. (1977). Group sequential methods in the design and analysis of clinical trials. Biometrika 64(2).
- O’Brien, P. C. and Fleming, T. R. (1979). A multiple testing procedure for clinical trials. Biometrics 35(3).
- Lan, K. K. G. and DeMets, D. L. (1983). Discrete sequential boundaries for clinical trials. Biometrika 70(3).
- Georgiev, G. Z. (2017). Efficient A/B Testing in Conversion Rate Optimization: The AGILE Statistical Method. And Statistical Methods in Online A/B Testing (2019); “Fully Sequential vs Group Sequential Tests”, Analytics-Toolkit blog.
- Johari, R., Koomen, P., Pekelis, L. and Walsh, D. (2017). Peeking at A/B tests: why it matters, and what to do about it. KDD 2017.
- Howard, S. R., Ramdas, A., McAuliffe, J. and Sekhon, J. (2021). Time-uniform, nonparametric, nonasymptotic confidence sequences. Annals of Statistics 49(2).