Mental model

Sequential Testing & SPRT

A method for making reliable decisions by analyzing data as it arrives and stopping as soon as enough evidence is gathered.

Discover

Myth or Fact: To run a valid A/B test, you must decide on the exact number of users to include *before* you start collecting data.

Is a fixed sample size always required?

Let's see how this changes the way we gather evidence.

Understand

Understand

The idea that you must set a sample size in advance is a myth for certain statistical methods. Sequential testing allows you to analyze results as data comes in and stop the moment you have a confident answer. Instead of committing to survey 1,000 people, you check after each response to see if the evidence is strong enough to favor one conclusion over another. This is like tasting soup as you cook; you add salt, stir, taste, and repeat, stopping as soon as it's perfect, not after a pre-decided number of tastes.

Ask this: Could I make this decision with less information if I checked my progress along the way?

Full explanation

Full explanation

Sequential testing provides a framework for making decisions under uncertainty without committing to a fixed sample size upfront. This is particularly useful when data collection is expensive or time-consuming. The process begins by defining two competing hypotheses (e.g., 'New feature increases engagement' vs. 'New feature has no effect') and the acceptable error rates for the decision.

Based on these inputs, two decision boundaries are established before the test begins. After each new piece of data is collected, a statistical score—typically a 'likelihood ratio' that measures the cumulative evidence—is updated. This running score is then compared against the pre-set boundaries.

If the score crosses the upper boundary, the test stops and the first hypothesis is accepted. If it crosses the lower boundary, the test stops and the second hypothesis is accepted. If the score remains between the boundaries, data collection continues. This methodical process ensures that any decision to stop early is statistically valid and not just a result of premature 'peeking' at the data.

This method yields a conclusion that meets a desired level of confidence, often much faster and with fewer resources than a traditional fixed-sample test. For example, in manufacturing, a factory can test products one by one. If the first five are flawless, the test might signal to stop and approve the batch. Similarly, an e-commerce site can test a new layout and stop the moment one version's outperformance crosses a pre-defined evidence threshold, rather than waiting for a full week of data.

Research

Research

The Sequential Probability Ratio Test (SPRT), developed by Abraham Wald during WWII, is provably the most efficient statistical test for deciding between two hypotheses, requiring the fewest samples on average for a given level of accuracy. The core principle of accumulating evidence until a decision threshold is crossed has proven fundamental in many fields.

  • Wald (1945) first formulated the SPRT to test munitions, showing it minimizes the average sample number needed for a decision compared to any fixed-sample test with the same error probabilities. [1]
  • Modern tech companies use sequential methods for large-scale A/B testing. Rather than naively peeking, these methods use 'always-valid p-values' or pre-specified stopping boundaries that allow for continuous monitoring and valid early stopping, which accelerates innovation by reducing the time needed to get a reliable answer. [2] (2017)
  • Research in neuroscience suggests the brain makes perceptual decisions similarly. Neurons appear to accumulate sensory evidence over time, with a decision triggered once this signal reaches a critical threshold, mirroring the logic of sequential analysis. [3] (2007)

Limitations

Limitations

While efficient, sequential testing has limitations. First, the final sample size is not known in advance, which can complicate planning and budgeting for experiments. Second, the classic SPRT is designed for binary choices (A vs. B) and becomes more complex for multiple alternatives. Finally, the test's duration can be highly sensitive to the initial data stream; a run of ambiguous early data can sometimes prolong the test unnecessarily.

Try it

Synthesize

Choose a pattern from the guide, then pick an action to try with it.

Which pattern stands out?

What will you try?

Choose a pattern above to select an action.

Sources

Sources

Try it

Check your understanding

A team is A/B testing a new app feature and wants to declare a winner as quickly as possible. Which approach is best suited for this goal?

Show the guide's explanation

Answer: Sequential testing

Sequential testing is designed to reach a statistically valid conclusion with the minimum amount of data necessary, making it ideal for situations where speed is critical.

In a sequential test, what is the correct action if the accumulated evidence is not yet strong enough to cross either the 'accept A' or 'accept B' boundary?

Show the guide's explanation

Answer: Continue collecting more data

The core principle of the process is to continue sampling as long as the evidence remains within the inconclusive region between the two pre-defined decision boundaries.

The common advice to 'never peek at your data' during an A/B test is a necessary rule for fixed-sample tests. Why can this rule be broken with sequential methods?

Show the guide's explanation

Answer: Because sequential methods are specifically designed with statistical rules for continuous monitoring and early stopping

Unlike traditional tests where peeking inflates error rates, sequential methods use mathematically sound rules, such as pre-defined stopping boundaries or always-valid p-values, that are designed for continuous analysis. This makes early stopping a valid feature, not a bug.

Keep exploring

Find another idea for the decision in front of you.

The complete Reframo library is free to read. Explore another guide whenever you are ready.