AI Glossary / Statistics and probability / Advanced
Sequential probability ratio test
Definition
The sequential probability ratio test, or SPRT, compares the accumulating likelihood of observations under two specified hypotheses. After each observation or allowed update, it stops in favor of one hypothesis if the likelihood ratio crosses a corresponding boundary; otherwise, it continues sampling. The classical formulation tests two simple hypotheses, each specifying a complete data distribution.
What it means
Instead of committing to one final sample size, the procedure follows how strongly the observations favor one specified model over the other.
The ratio is not the probability that a hypothesis is true. It compares how well two models account for the observed data. A stopping decision is also conditional on the assumptions and hypotheses supplied; it does not establish that either model perfectly describes reality.
How it works
For independent observations with densities or probability masses f0 and f1, define the ratio after n observations as L_n = product of f1(x_i)/f0(x_i). Start at L_0 = 1. Multiply by the next observation's ratio, or equivalently add its log-ratio to a running log-likelihood ratio.
Choose a lower boundary below one and an upper boundary above one. Stop in favor of H0 at or below the lower boundary, stop in favor of H1 at or above the upper boundary, and continue between them.
Common Wald approximations use upper boundary (1 - beta)/alpha and lower boundary beta/(1 - alpha), where alpha and beta are desired error levels. These formulas are approximations, not universal guarantees of exact error control. Overshooting boundaries matters; actual operating characteristics require appropriate calibration or verification. An imposed maximum sample size also needs a specified, evaluated terminal rule.
Three practical examples
1. Quality evaluation: compare two specified success-rate models while inspecting successive items, using a sampling procedure suited to the actual observations.
2. AI benchmark planning: accumulate independent task outcomes to distinguish specified performance levels, checking whether the independence and stable-probability assumptions are plausible.
3. Simulation research: stop a sequence of simulation runs when the evidence crosses calibrated boundaries, rather than repeatedly applying an ordinary fixed-sample significance test.
Think of it this way
Think of a running evidence balance. Every observation changes the balance according to how expected it was under each model. A sufficiently large movement in either direction triggers a decision, while observations that pull in different directions can prolong the process.
Worked example
Consider a fictional binary-outcome evaluation. Let success be S and failure be F. Specify independent outcomes with H0: success probability 0.3 and H1: success probability 0.6.
For an S, the likelihood-ratio multiplier is 0.6/0.3 = 2. For an F, it is 0.4/0.7 = 4/7, approximately 0.571429.
To illustrate the common approximate design, set desired alpha = 0.05 and beta = 0.10. The upper boundary is 0.90/0.05 = 18. The lower boundary is 0.10/0.95 = 2/19, approximately 0.105263. This example demonstrates the resulting arithmetic, without claiming that these approximate boundaries attain those error rates exactly.
Suppose the observations arrive as S, S, S, F, S, S. Starting at one, the ratios are:
After observation 1: 2.
After observation 2: 4.
After observation 3: 8.
After observation 4: 8 times 4/7 = 32/7, approximately 4.571429.
After observation 5: 64/7, approximately 9.142857.
After observation 6: 128/7, approximately 18.285714.
The first five values remain between the boundaries. At observation six, the ratio exceeds 18, so this illustrated rule stops in favor of H1. The ratio overshoots the boundary rather than landing exactly on it.
Check the same result directly from the data likelihoods. The specified six-outcome sequence contains five successes and one failure. Its probability under H1 is 0.6 to the fifth power times 0.4, or 0.031104. Under H0 it is 0.3 to the fifth power times 0.7, or 0.001701. Their ratio is again 128/7.
Now consider a different path consisting entirely of failures. After four failures, the ratio is (4/7) to the fourth power, approximately 0.106622, still slightly above the lower boundary. After five failures, it is approximately 0.060927, below the boundary. This path stops in favor of H0 after five observations.
They do not determine the average sample size or the error probabilities, which depend on all possible paths. Nor does the favorable six-observation path prove that the true success probability is exactly 0.6. A probability between the two specified values remains a possible real-world situation outside these simple hypotheses.
The observations are invented, and the approximate design is not a validated operational testing plan. A practical implementation must check its distributional assumptions, boundaries and any truncation rule before claiming performance guarantees.
Illustrative case study
Fictional Birch Evaluation receives an automated report describing the worked ratio of 18.285714 as an “18.3-to-1 probability that the new system is good.” Its reviewer replaces that wording with the likelihood comparison between the two specified success-rate models.
Birch also requests verification of the stopping rule's actual error rates and checks whether repeated tasks share dependencies.
Common misconceptions and mistakes
"The likelihood ratio is posterior odds." Posterior odds additionally depend on prior odds within a Bayesian model.
"The approximate Wald boundaries always deliver the stated error rates exactly." Boundary overshoot and design details require attention.
"Every new observation strengthens the same conclusion." A failure lowers the ratio in this example.
"Accepting H0 proves it is true." It is the procedure's decision between specified alternatives, not certainty about reality.
Business use
State the hypotheses in operational terms and explain why those performance levels matter. Document how observations are sampled, when the statistic is updated and what happens if resources run out before a boundary is crossed.
For AI-assisted reports, verify the ratio's orientation: reversing the numerator reverses its evidential direction. Check numerical calculations and calibration separately. Correct arithmetic on a single observed path does not establish error control for the complete procedure.
People also ask
Must the sample size be known in advance?
The stopping size can vary; a resource cap needs an explicit rule.
Can logarithms be used?
Yes; products become sums and boundaries are transformed consistently.
Is this identical to a fixed-sample likelihood-ratio test?
No; the sequential stopping rule is part of the procedure.
Check your understanding
Why does a success multiply the ratio by two?
Answer: It is twice as probable under H1 as under H0.
Why does the failure at observation four reduce the ratio?
Answer: Its multiplier is 4/7, below one.
When does the illustrated six-outcome path stop?
Answer: At observation six, when 128/7 exceeds 18.
Related terms
- Sequential analysis
- Type I error
- Type II error
- likelihood ratio
- simple hypothesis
- stopping boundary
- overshoot
- average sample number
Learn next
Calculate the stopping point for an all-success path using the same approximate boundaries. Explain why that one path cannot establish the procedure's average sample size.
More in Statistics and probability
- Separation test - A separation test is an early-phase statistical decision procedure intended to help decide whether further research is worth pursuing.
- Sequence effect - A sequence effect occurs when experiencing one condition influences a person's response to another condition presented later.
- Sequence model - A sequence model represents relationships in ordered data, where the position or history of observations matters to the task.
- Sequential studies - Sequential studies divide an investigation into distinct phases and allow findings from one phase to influence the design or purpose of later phases.
- Seriousness check - A seriousness check asks research participants to report whether they are participating seriously, rather than merely inspecting a study or providing...
- Set balancing - Set balancing is the problem of dividing a collection of items into two groups so that specified features are distributed as evenly as possible.
Sources
Philip B. Stark, Statistics 240 notes, Wald's SPRT and its derivation, pages 54–58: https://www.stat.berkeley.edu/~stark/Teach/S240/Notes/lec1.pdf
Lasse Fischer and Aaditya Ramdas, Improving Wald's (approximate) sequential probability ratio test by avoiding overshoot, author abstract: https://arxiv.org/abs/2410.16076
Previous: Sequential pattern mining Next: Sequential studies