## Early Stopping Based on Repeated Significance

Eric Bax, Arundhyoti Sarkar, and Alex Shtoff Yahoo!

Abstract For a bucket test with a single criterion for success and a fixed number of samples or testing period, requiring a p -value less than a specified value of α for the success criterion produces statistical confidence at level 1 -α . For multiple criteria, a Bonferroni correction that partitions α among the criteria produces statistical confidence, at the cost of requiring lower p -values for each criterion. The same concept can be applied to decisions about early stopping, but that can lead to strict requirements for p -values. We show how to address that challenge by requiring criteria to be successful at multiple decision points.

## I. INTRODUCTION

In an AB test , we compare two treatments. In online user studies, we often refer to AB tests as bucket tests , with each user assigned to a bucket - a set of users given the same treatment. When comparing a new treatment to an established one, we refer to the set of users receiving the new treatment as the test bucket and the set of users receiving the established treatment as the control bucket . Buckets may also be called arms of a study - a common usage in medical studies.

However, early stopping introduces the potential for a temporal form of data dredging [1], [2], [3]: selecting a stopping time based on indicators of statistical significance affects whether those indicators are accurate. A set of methods to address that challenge are called always-valid bounds or continuous monitoring methods [4], [5], [6], [7], [8]. They give stopping conditions that offer confidence for any number of samples or at any time during an AB test. The methods in this paper give stopping conditions that offer confidence for a limited number of potential stopping points, called decision points, so they are group sequential methods [9], [10], [11], [12], [13], [14], which are also called interim analysis methods [15], [16], [17]. The methods in this paper use the group sequential method strategy of 'spending' a type I error budget [18], [14]. To ensure generality and ease of use, the methods emphasize simplicity - they do not rely on assumptions about the joint distributions of p -values among successive decision points or across different criteria, so they avoid the need to confirm those assumptions for each AB test.

In the simplest case, we decide before running an AB test how long to run it (in terms of time or number of observations), a single criterion for treatment success, such as the statement 'the new treatment increases revenue per page view compared to the established treatment,' and a desired level of confidence, for example 99%. Then, when the test completes, we get a p -value for the statement from the AB-testing system, and if it is 1% or less, then we roll out the new treatment to all users. In this simple case, we can subtract our desired level of confidence (99%) from 100% to get the p -value required to achieve that confidence: 100% - 99% = 1%, which may be expressed as p ≤ 0 01 . .

This simple case does not fully capture how analysts work with buckets. In some cases, we want to be confident (statistically speaking) that multiple statements are true, for example we may want 95% confidence that the new treatment increases revenue while also not increasing the rate of short dwelltime clicks. We may also want to observe the bucket results periodically, and, if we can do so with confidence, stop the bucket early, either confident that we should implement the new treatment or that we should avoid it. In product optimization, early stopping speeds time to market for individual features and also allows more potential features to be tested. In medical studies, early stopping allows people in the control arm of a study to receive useful treatments faster, or it stops administering failed treatments to people in the experimental arm more quickly than running the test to completion.

In this paper, we offer some analysis to help the practitioner decide when to use the methods described here. For 20 or fewer decision points during an AB test (eg a three-week test with daily decisions after the first week), we show that the simplest methods described here tend to outperform alwaysvalid bounds. For more decision points, we show that requiring a small time period of continued success before stopping tends to make the methods in this paper more effective than alwaysvalid bounds.

This note also offers some strategies to develop test plans for AB testing with multiple criteria and the potential for early stopping. The strategies are straightforward, allowing the practitioner to understand why they work, to mediate tradeoffs between tactics, and to create test plans with confidence.

Section II reviews tools to bound probabilities of conjunctions of multiple events and how to apply those tools to testing with multiple success criteria. Section III reviews how to apply those ideas to sequential testing - testing with the possibility of early stopping while controlling type I error (false positives). Section IV examines how requiring multiple statistically significant results before stopping a test early can ease the p -value requirements for those results. Section V explores how to apply repetition requirements effectively as the number of decision points increases, even up to a potential decision point after each new observation: the realm of continuous monitoring. Section VI analyzes how to control type II error (false negatives) via α -spending methods combined with requiring repetition for early stopping. Section VII concludes this paper with a discussion of directions for future work.

Fig. 1. Worst Case . If six statements each have probability at most δ of being incorrect, then the probability that the combined statement: 'statement 1 and statement 2 and . . . and statement 6' is incorrect may be as high as 6 δ , because only one statement has to be incorrect for the 'and' of all 6 to be incorrect. The worst case is that failures are disjoint - like how spreading six carpets so that they do not overlap covers as much area as possible. (Figure from [19].)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-1f0f9894-6fe2-4b0b-b115-27f539329c96.jpg)

## II. MULTIPLE CRITERIA, BONFERRONI, AND BOOLE

Suppose you and your five closest friends rent some bicycles for the afternoon. If there is a 5% chance of each bicycle breaking down during your ride, how (statistically) confident are you that the trip will be completed without incident?

The answer depends on the relationships between the breakdown probabilities for the different bicycles. Suppose breakdowns are completely correlated - for example, we ride together, and that 5% is the probability that we will choose to bike through an area with so much broken glass that we are all certain to get flat tires. Then we are 95% confident that we will all avoid breakdowns. That is the best case.

In the worst case, the failure events are disjoint - if one bicycle breaks, the others do not. For example, suppose the bicycle shop has 20 bicycles, 19 never break down, and one breaks down on every trip. By taking out six bicycles at random, the probability that we select the bad bicycle is 6 out of 20, which is 30%. In this worst case, each bicycle has a 5% chance of being the bad one, so the probability that one of our six is the bad one is six times 5%, which is 30%. That leaves us only 70% confident of an incident-free outing. (See Figure 1.)

Without deeper insight into the relationships between failures, we need to assume the worst case: that failure probabilities for individual criteria sum to give the failure probability for the conjunction of the criteria. So, to maintain a confidence level of 1 -α over multiple criteria, we have to require that their p -values sum to α or less. If m is the number of statements, then we can require each p -value to be α m or less:

$$p \leq \frac { \alpha } { m }. \quad \ \ \ \ \ \ ( 1 ) \quad b e q$$

If that occurs, then we have our desired confidence in the conjunction of the criteria.

As an example, suppose we want a bucket test to yield 95% confidence that we meet both a revenue criterion and a user- experience criterion before implementing a new feature for a website. Then the allowed failure probability is α = 0 05 . , since 100% - 95% = 5%. So if we require the p -values for both statements to be 2.5% (= 0.025) or less, then we can proceed to roll out the treatment with 95% confidence that both the revenue and user-experience criteria will be met.

Dividing α by the number of criteria m to get the required p -value for each criterion is called a Bonferroni correction [20]. As we have shown, it is based on the idea that the sum of probabilities of events is a bound on the probability of the union of events. (If the events are disjoint, then that bound is the probability of the union.) That sum bound is known as Boole's inequality [21], [22].

We can also partition α unequally over the criteria and still achieve 1 -α confidence. In general, for any α 1 + . . . + α m = 1 with all α i nonnegative, if we require

$$p \leq \alpha _ { i }$$

for each criterion i , then all criteria hold, with confidence 1 -α . Equivalently, the probability of type I error, also called a falsepositive result, is at most α . To see why, consider that the probability of a type I error for criterion i is at most α i , so we can apply the sum bound to show that the probability of a type I error for any criterion is at most the sum α 1 + . . . + α m . In a sense, α is a type I error 'budget' that we 'spend' [18], [14] over the criteria to get required p -values.

## III. EARLY STOPPING

Suppose we plan to run an AB test for up to two weeks, and we will check the bucket criteria each day, with the check based on data collected since the start of the test. Based on a daily check, we may decide to stop the AB test early. Then the test has a decision point each day. (To clarify, measurements for the bucket criteria may be observed more often than daily and still we have only one decision point per day if the other observations do not contribute to stopping decisions.) The data boundaries for decisions must be determined a priori, for example measurements over the first 24 hours of data, then the first 48 hours of data, etc. Similarly, for a test that is to run until a thousand observations are gathered, the decision points can be after gathering each hundred observations. (Decision points are sometimes called interim analyses in clinical trial literature [15], [16], [17], [14].) In a later section, we discuss how to handle AB testing without determining the time or amount of data for the entire test a priori, and hence potentially having an unknown number of decision points.

Here are some theorems that enable early stopping with confidence:

Theorem 1. Let d be the number of decision points and m be the number of bucket criteria. Then requiring p -values

$$p \leq \frac { \alpha } { d m }$$

at least once for each criteria i gives confidence 1 -α that all criteria hold.

Proof. Apply the Bonferroni inequality. The probability that the AB testing system incorrectly reports that a criterion holds at a decision point with a p -value of α dm or less is at most α dm . So the probability of any incorrect assertion with a p -value of α dm or less, about any criterion at any decision point, is at most the sum of those probabilities over the number of criteria times the number of decision points:

$$d m \frac { \alpha } { d m } = \alpha.$$

Using a more general approach to budgeting α and allowing different numbers of decision points for different criteria gives a more general theorem:

Theorem 2. Let m be the number of criteria and let d i be the number of decision points for criterion i . Let

$$\sum _ { i = 1 } ^ { m } \sum _ { t = 1 } ^ { d _ { i } } \alpha _ { i t } = \alpha \quad \quad \quad ( 5 ) \quad \text{ to } y \quad \text{ }$$

for nonnegative values α it . Then requiring p -values

$$p \leq \alpha _ { i t } \quad \ \ \ \ \ ( 6 ) \quad \text{if } s$$

at at least one decision point for each criterion gives confidence 1 -α that all criteria hold.

Proof. The probability that criterion i has p -value α it or less at decision point t and the criterion does not hold out of sample is at most α it . Applying the sum bound (Boole's inequality), the probability that any criterion i has p -value α it or less at any decision point t and the criterion does not hold is at most the sum of α it values: α . So, if each criterion i meets its p -value requirement at any of its decision points, then all criteria hold out of sample, with probability at least 1 -α .

Theorems 1 and 2 allow early stopping because they only require each criterion to meet its p -value requirement once. After that, we have our required confidence without needing to continue the test.

## IV. REQUIRING REPETITION

With many decision points d and several criteria m for bucket success, the product dm can be large. So requiring p -values below α dm in Theorem 1 may require more resources than we wish. Similarly, budgeting α over multiple decision points for each of multiple criteria in Theorem 2 may leave us with small values α it , meaning stringent p -value requirements, and hence possibly requiring a larger or longer test than we wish. There is a way to readjust the odds in our favor, so to speak, and we can do so by supplying a mathematical foundation for something that many analysts already do: require conditions to be met over several decision points before making a final decision.

Recall our example of bicycles that fail with 5% probability each. Suppose you and three friends are taking some bicycles for a week of riding out in the desert. Together, the four of you take six bicycles, load them on a trailer, and drive it out

Fig. 2. Allowing Failures/Requiring Repetition . If six statements each have probability at most δ of being incorrect, then the worst-case probability that three or more are incorrect is 2 δ . The worst case is that any failure is simultaneous with two others - with six carpets, laying them three-thick only covers an area equal to two carpets. (Figure from [19].)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-a980a514-1005-4b20-a452-34d86eba8252.jpg)

to your campsite. You never bike so far that you cannot walk back if a bicycle fails, but you want to have enough bicycles that all four of you can go out on the next ride together even if some bicycles fail on previous rides. Since you have four people and six bicycles, having two bicycles fail is acceptable - you still have four left, so everyone can still ride.

How confident, statistically speaking, can you be that you can all keep riding, given that each bicycle has a 5% probability of failing during the trip? Since you can allow two bicycle failures and still all ride, overall failure is now defined as having three or more bicycles fail. The worst-case relationship among bicycle failures is that any one failure is part of three failing on the same trip. In that case, the probability of three or more failing is 5% times 2 = 10%. (See Figure 2.) So we have 90% confidence that at least four bicycles will survive the trip. (The idea of allowing some failures in order to improve confidence is sometimes called nearly uniform validation [23], [19].)

In general, the probability of r or more events is bounded by the sum of event probabilities divided by r . In the worst case, each event occurrence is part of a simultaneous occurrence of exactly r events. Imagine having a type of carpet you hate, because it is so deep and squishy that it is difficult to walk upon. If you have 6 of those carpets and each can cover 5% of your floor, then together they might cover 30% of your floor. But if you decide you don't mind the depth and squishiness unless you have to step on three of those carpets piled on top of each other, then the worst case is two piles of three that each cover 5%, for a total of 10% of your floor.

Stated as a theorem:

Theorem 3. Let d be the number of decision points and m be the number of bucket criteria. Then requiring p -values

$$p \leq \frac { \alpha r } { d m }$$

at least r times for each criterion gives confidence 1 -α that all criteria hold.

Fig. 3. Different Numbers of Repetitions . Suppose we have two criteria for bucket success, and we require the first to hold three times and the second to hold twice to declare the test a success. Suppose there are d = 6 decision points and each statement that a criterion holds has probability δ of being incorrect. Then an incorrect conclusion from the bucket requires either incorrect statements that criterion one holds at three different decision points (white 'carpets' piled three-deep) or incorrect statements that criterion two holds at two different decision points (gray 'carpets' piled two-deep). So the probability of bucket success without the criteria actually both holding is at most 5 δ .

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-4e48133c-21da-421b-bbd6-42ce60ee5a85.jpg)

Proof. Use nearly uniform validation. The probability of the event that the AB testing system incorrectly reports that a criterion holds at a decision point with a p -value of αr dm or less is at most αr dm . So the probability of at least r such events is the number of events divided by r :

$$\frac { d m } { r } \frac { \alpha r } { d m } = \alpha. \quad \quad \quad ( 8 ) \quad \quad \quad$$

If there are fewer than r such events, then requiring that each criterion hold r times means that the AB system is correct about each criterion at least once.

For a more general approach to α -budgeting, allow different numbers of decision points for different criteria, and require different numbers of repetitions for different criteria. (Refer to Figure 3 for a specific example.)

Theorem 4. Let m be the number of criteria, let d i be the number of decision points for criterion i , and let r i be the number of repetitions required for criterion i . Let

$$\sum _ { i = 1 } ^ { m } \sum _ { t = 1 } ^ { d _ { i } } \alpha _ { i t } = \alpha \quad \$$

for nonnegative values α it . Then requiring p -values

$$p \leq \alpha _ { i t } r _ { i } \quad \quad \ \ ( 1 0 ) \ \stackrel { \cdot } { \text{real}$$

at at least r i decision points for each criterion i gives confidence 1 -α that all criteria hold.

Proof. The probability that criterion i has p -value α r it i or less at decision point t and the criterion does not hold out of sample is at most α r it i . So, by nearly uniform validation, the probability that criterion i has p -value α r it i or less at r i or more decision points, and the criterion does not hold out of sample, is at most

$$\frac { \sum _ { t = 1 } ^ { d _ { i } } \alpha _$$

Using the sum bound (Boole's inequality), the probability that that occurs for at least one of the m criteria is at most the sum of those probabilities:

$$\sum _ { i = 1 } ^ { m } \sum _ { t = 1 } ^ {$$

So, if each criterion i meets its p -value requirement at any r i of its decision points, then all criteria hold out of sample, with probability at least 1 -α .

Theorems 3 and 4 allow early stopping: after each criterion meets its p -value requirement the required number of times, the test can be stopped with probability at most α of a type I error. Theorems 3 and 4 exchange less stringent p -value requirements than Theorems 1 and 2 for requiring repetition.

Theorem 4 can be useful if some criteria are likely to require more time or samples while others are likely to be met easily and continue to hold. The decisions about how many repetitions to require need to be made a priori, but in many cases information is available about how quickly p -values tend to decrease and settle for different metrics and their criteria. That information enables a priori optimization of the test plan.

## V. CONTINUOUS MONITORING AND GENERAL RESULT

Consider an AB test with a single criterion ( m = 1 ) that may last as long as 20 days. Suppose we decide to divide α equally over d decision points and require 5% repetition: r = 0 05 . d . Then, by Theorem 3, the p -value requirements are

$$p \leq \frac { \alpha } { d } r = \frac { \alpha } {$$

Note that the required p -value is independent of the number of decision points. It is the same whether the decision points are daily ( d = 20 ), hourly ( d = 480 ), or with each new observation, which is the setting for continuous monitoring [4], [5], [6], [7], [8]. In each case, the test yields the same level of confidence: 1 -α . In short, requiring significance for a fixed fraction of decision points allows us to increase the number of decision points without limit and maintain the same level of confidence.

In general, for a fixed rate of repetition u = r d , adjusting r to maintain u as d increases maintains a fixed significance requirement ( p ≤ uα ) and a fixed level of confidence 1 -α . If the decision points are evenly spaced over the experiment (in time or in number of observations), and the required p -value persists once it is achieved, then adding decision points only extends the length of the experiment before early stopping by up to u of the length of the experiment.

In our earlier example, with u = 0 05 . , using daily decision points ( d = 20 ) allow us to stop the experiment when the p -value requirement is first met. But using hourly or even perobservation decision points only requires us to persist for up to one day (5% of the experiment) after achieving significance for the first time, if significance continues to hold.

And this is in the worst case: that significance begins at the hour or observation that coincides with the daily check. Otherwise, some of the 5% of decision points with significance have already occurred by the daily check, so fewer than 5% remain before early stopping. Similarly, if significance fails to hold at first, then holds off and on for a part of the experiment, then holds for the remainder of the experiment, then it is possible to stop earlier with more decision points.

Note that requiring the criterion to hold with significance for a fixed fraction of the decision points in the test is different from stopping the experiment early if the criterion holds for a fixed fraction of the decision points that have occurred. The results in this section do not apply directly to that case; we address it next.

Theorem 5. Let u be a fixed repetition rate that we specify, let s be a minimum number of decision points for which we decide to run the test. If after the first t decision points, at least a fraction u of the p -values for a single criterion have

$$\begin{array} {$$

then the criterion holds out of sample with confidence at least 1 -α .

Proof. We will spend α over subtests with increasing length. Then we will apply the result from the smallest subtest of length at least t , applying early stopping from that subtest to our results.

Define a sequence of waypoints w k = 2 k s for k = 1 2 , , . . . . Waypoint w k is the endpoint for subtest k . Let α k = α 2 -k for k = 1 2 , , . . . . Let r k = uw k 2 . Then for each subtest, if at least r k of the first w k decision points have

$$\Phi _ { \ } p \leq \frac { \alpha _ { k } } {$$

then the probability that the criterion fails to hold out of sample is at most α k , by Theorem 3, with α set to α k , m = 1 since we have a single criterion, and d = w k .

Note that the sum of all α k values is α . So by the sum bound (Boole's inequality), all subtest results are valid, with probability at least 1 -α .

Let ˆ k be the least value such that w ˆ k is t or greater. Then w ˆ k &lt; 2 t , so having significance for at least u of the t decision points meets the repetition requirement for the subtest, since

$$r _ { \hat { k } } = \frac { \hat { u } w _ { \hat { k } } } { 2 } < u t. \quad \quad \ \ ( 1 6 ) \begin{array} { c c } \text{ on } t \\ \text{ succ} \\ \text{ comm} \end{array}$$

It remains to show that the required p -value for subtest ˆ k is at least the p -value in the theorem.

$$\alpha _ { \hat { k } } r _ { \hat { k } } \, \quad \, \quad \, \quad \, ( 1 7 )$$

Expand α ˆ k and r ˆ k .

$$= \frac { \alpha 2 ^ { - \tilde { k } } } { w _ { \tilde { k } } } \frac { u w _ { \tilde { k } } } { 2 } \quad \quad \ \ ( 1 8 ) \quad \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$$

Cancel w ˆ k from the numerator and denominator.

$$= \frac { 1 } { 2 } \alpha u 2 ^ { - \hat { k } }$$

Multiply and divide by s.

$$= \frac { 1 } { 2 } \alpha u \frac { s } { 2 ^ { \hat { k } } s }$$

Since w ˆ k = 2 ˆ k s &lt; 2 t , this is

$$> \frac { 1 } { 2 } \frac { \alpha s u } { 2 t } = \alpha u \frac { s } { 4 t }.$$

With unlimited testing, stopping when u of the decision points seen so far are significant for the criterion (rather than significant for u of all decision points) makes the p -value requirements more stringent by a factor of s 4 t . That factor has a tunable parameter s . Selecting it mediates a tradeoff: increasing s increases the amount of testing required before early stopping is allowed, while making the p -value requirement less stringent.

The following theorem is a generalization of this result. It applies to tests with pre-specified maximum sizes as well as unlimited tests. To apply it to the conjunction of multiple criteria, partition α over the criteria, then apply this theorem to each one separately, and combine by Boole's inequality.

Theorem 6. Suppose there is a single criterion and v subtests, indexed by k = 1 , . . . , v , each with a repetition requirement r k , a starting decision point index a k , and an ending decision point index b k . Let

$$\sum _ { k = 1 } ^ { v } \sum _ { t = a _ { k } } ^ { b _ { k } } \alpha _ { k t } = \alpha$$

for nonnegative values α kt specified prior to testing. If at any decision point t , for any k , there are at least r k decision points in a , . . . , k min( t, b k ) with

$$p \leq \alpha _ { k t } r _ { k } \text{ \quad \ \ } \text{(3)}$$

then the criterion holds out of sample with confidence 1 -α .

Proof. For each subtest k , let α k = ∑ b k t = a k α kt . Apply Theorem 4, with m = 1 (single criterion), α = α k , α 1 t = α kt , and r = r k . Then the probability that subtest k succeeds (that there are r k decision points with the specified p -values in decision points [ a , b k k ] ) yet the criterion does not hold out of sample is at most α k . By Boole's inequality (the sum bound on the probability of a union), the probability that any subtest succeeds and the criterion fails to hold out of sample is the sum of α k over the subtests:

$$\sum _ { k = 1 } ^ { v } \alpha _ { k } = \sum _ { k = 1 } ^ { v } \sum _ { t = a _ { k } } ^ { b _ { k } } \alpha _ { k t } = \alpha.$$

Applying this theorem requires specifying subtests: repetition requirements r k , start and end decision point indices a k

Fig. 4. Z score required, by dm . Each Z score is the inverse of standard normal cdf for 1 -p 2 with p = α dm . The Z score required for significance under a uniform partition of α increases as the number of decision points d and criteria m increase, slicing α more finely. The plots begin at dm = 1 . The Z score required for dm = 1 is the Z score without the possibility of early stopping (one decision point at the end of the test) and for a single criterion. The required Z scores have decreasing marginal increases as dm increases.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-d0fcb8b8-5998-40a5-b29f-cdf5abf7afad.jpg)

and b k , and a partition of α into values α kt . Theorem 5 can be seen as a corollary of Theorem 6, and it illustrates that v need not be bounded. To prevent over-splitting α , it can be useful to limit the set of subtests, for example using b k = 2 k instead of b k = k and limit the scope of subtests, for example using low values for b k for low r k values.

Two strategies to spend α are uniform and geometric. Uniform spending is equal over divisions: subtests, decision points, or criteria. Geometric spending allocates a fraction of the remaining budget for each division: select a 'withdrawal rate' 0 &lt; w &lt; 1 and set α 1 = wα α , 2 = w (1 -w α ) , and in general α j = w (1 -w ) j -1 α . This allows an unbounded number of divisions. (Theorem 5 uses geometric spending with w = 1 2 .)

## VI. ANALYSIS AND TYPE II ERROR STRATEGY

The methods in this paper all guarantee that the probability of type I error (false positive) is at most α . But different choices of number of decision points and required numbers of repeats can lead to different probabilities of type II error (false negative). This section explores, in general terms, how α spending decisions and choices of required numbers of repeats relate to test sizes required to achieve type II error similar to that achieved without early stopping. It does so through the lens of Z scores required to achieve statistical significance, because Z scores are a more familiar way of thinking about significance than p -values for many practitioners.

Figure 4 shows the Z scores required for significance given confidence level 1 -α d , decision points, and m criteria, with α partitioned uniformly over the dm criteria by decision points, under the approximation that the criteria metrics have normal distributions. So Z is the inverse of the standard normal cdf for 1 -p 2 , with p the required p -value for significance: p = α dm . (The 2 in 1 -p 2 reflects two-sided criteria.)

Note that for α = 0 05 . and dm = 1 , the required Z score is approximately 2. This corresponds to the well-known 2 SEM (standard error of the mean) rule for tests with 95% confidence ( α = 5% ) and a single criterion ( m = 1 ) and one decision point ( d = 1 ), at the end of the test. (In the plotted lines, the first value for dm is one.) As dm increases, α is partitioned more finely, reducing the p -values, and hence increasing the Z values, required for significance.

Consider a criterion that the mean, over the observations collected in the test, of some metric is significantly greater than or less than zero. Let µ be the mean of the distribution that generates the observations, and let σ be the standard deviation. Let n be the number of observations collected prior to a decision point, and let ˆ µ be the mean and ˆ σ be the standard deviation over those observations. If

$$| \hat { \mu } | = \frac { Z \hat { \sigma } } { \sqrt { n } }$$

then the Z score at the decision point is Z . Solve for n :

$$n = Z ^ { 2 } \left ( \frac { \hat { \sigma } } { \hat { \mu } } \right ) ^ { 2 }.$$

For large numbers of observations, ˆ µ ≈ µ and ˆ σ ≈ σ , and

$$n \approx Z ^ { 2 } \left ( \frac { \sigma } { \mu } \right ) ^ { 2 }.$$

So the test size (in observations) required to achieve significance tends to be loosely proportional to Z 2 . (Loosely, because we are not accounting for ˆ µ and ˆ σ not being exactly µ and σ , respectively, or for ˆ µ and ˆ σ tending to be less noisy, and approximate µ and σ more closely, for more observations.) As a result, if we double the Z score required for significance, for example, then the probability of type II error becomes that of a test that has only about a quarter as many observations. (See Figure 5.)

Suppose a test has a single criterion ( m = 1 ) and we want 95% confidence α = 0 05 . . For a single decision point at the end of the test (no early stopping), we have Z ≈ 1 96 . required for significance. If, instead, we use 20 decision points with uniform α spending, then Z ≈ 3 02 . (See Figure 4.) In exchange for allowing early stopping at 19 points in addition to the end of the test, the probability of type II error becomes approximately that of a test (1 96 . / 3 02) . 2 ≈ 40% as long without early stopping.

One strategy to reduce the probability of type II error while maintaining the possibility of early stopping with confidence is to spend a large portion of α on the decision point at the end of the test, and spend α uniformly over the other decision points. (This is the general strategy of the Haybittle-Peto boundary for sequential testing [24], [10].) For example, suppose we allocate half of α = 0 05 . to the final decision point and the other half equally among 19 other decision points. For the final point, Z ≈ 2 24 . (the second value for the α = 0 05 . line in

Fig. 5. Z score and sample size impact for partitioning α . The top curve is the Z score required for statistical significance given the p -value required for statistical significance on the x -axis. The bottom curve is the approximate reduction in sample size (compared to p = 0 05 . ) for the purpose of achieving statistical significance to avoid type II error. (Each point in the lower curve is the square of the ratio of the Z score for p = 0 05 . to the Z -score for the p -value on the x -axis.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-7fc74603-9ab1-433a-814e-387a5d4ef244.jpg)

Figure 4), giving approximately the probability of type II error of a test (1 96 . / 2 24) . 2 ≈ 77% as long without early stopping. For the 19 other decision points, the required Z score for early stopping becomes approximately 3 21 . rather than the 3 02 . for uniform spending with d = 20 . Since (3 21 . / 3 02) . 2 ≈ 1 13 . , it may take approximately 13% longer to achieve this higher Z score in order to stop early.

To achieve similar results for a very large number of decision points, allocate a share of α (say θα for 0 &lt; θ &lt; 1 ) to the final decision point, then allocate the remainder to the other points, and require repetition over the other decision points but not over the final decision point. Then the test is a success if there is a significant result if for each criterion either ( p ≤ θα m ) at the final decision point or at least r of the other decision points have p ≤ (1 -θ αr ) ( d -1) m . Increasing θ decreases the probability of type II error but de-emphasizes early stopping.

Figure 6 shows Z values required for significance if a portion u = r d of the decision points are required to have significant results for test success, based on uniform α spending over decision points, for a single criterion. Requiring u of the results at decision points to be significant results gives the same Z score requirements as having d = 1 u decision points. So, for example, on the α = 0 05 . line in Figure 6, for u = 0 05 . , Z ≈ 3 02 . - the same value as for dm = 20 on the α = 0 05 . line in Figure 4.

Now we will briefly compare the method of requiring repeated significance to a recent always-valid method [8] (their Equation 8, page 8). That method requires Z score

$$\sqrt { \frac { 2 ( t \rho ^ { 2 } + 1 ) } { t \rho ^ { 2 } } \ln \left ( \frac { \sqrt { t \rho ^ { 2 } + 1 } } { \alpha } \right ) } \quad \quad ( 2 8 ) \quad \text{class} \quad \text{with}$$

Fig. 6. Z score required, by u . The Z score required for significance varies with the fraction of decision points u at which we require significance in order to stop the test with 1 -α confidence that a criterion holds out of sample. For comparison, without early stopping, and with α = 0 05 . , Z ≈ 2 is the required score. Requiring significance at 5% of decision points ( u = 0 05 . ) makes the required score Z ≈ 3 . Requiring a larger fraction of significant results has (gently) decreasing marginal returns in reducing required Z scores.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-dfdf56b5-20c9-470e-a27c-2627a4af6190.jpg)

and has a parameter ρ that controls the value of t at which the required Z score is minimized. This method has the advantage of not requiring repeated significance to stop early, and it does not require the test plan to specify a test size - the test may continue indefinitely. Figure 7 compares it to requiring a fraction u of the decision points to have

$$p \leq \alpha u,$$

with the number of observations and decision points determined before testing. Requiring 5% of decision points to have significance matches the performance of the always-valid method. If there are 20 decision points, then that allows early stopping at the first significant result. For a decision point at every observation, 100,000 of the 20 million observations would need significant results to allow early stopping with confidence.

## VII. DISCUSSION

This paper introduces the tool of requiring repeated significance to allow less-stringent requirements for significance during testing. We showed that doing so enables effective tests with many decision points, even decision points on a perobservation basis, to achieve continuous monitoring.

Several ideas in this paper have their roots in machine learning. Fixing a portion of decision points to set the number of required repetitions is similar to work in machine learning showing that selecting a fixed portion of classifiers for an equally-weighted Gibbs ensemble classifier has similar error bounds to selecting from a set of hypothesis classifiers with size the inverse of the portion, even if the actual hypothesis class is infinite [19]. The method in Section V for dealing with a test length that is unknown a priori is conceptually

Fig. 7. Z score required, continuous monitoring vs. requiring repetition . Comparison of significance requirements for early stopping for (1) a continuous monitoring method [8] that requires only one significant result and relies on each observation having limited impact on the p -value, and (2) requiring repeated significance. For this example: 20 million observations, up to 20 million decision points, a single criterion, and α = 0 05 . , requiring significance for 5% of the decision points matches the performance of the method that requires only a single significant result.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00908v1-figure-b337445b-8a95-4b4b-ba05-758a2bdcf7dd.jpg)

similar to luckiness frameworks [25], [26], which budget α in ever-thinner amounts over ever-larger hypothesis classes, and thus can supply error bounds for training over unbounded hypothesis classes.

In Section VI, we rely on a normal approximation to convert between p -values and Z scores. The purpose of using a normal approximation was to analyze how different numbers of observations relate to achieving different levels of significance in a general way. (The results in the other sections do not rely on normal approximations.) That said, bucket testing systems that use large numbers of observations, for example to tune website features, often use normal approximations to produce their p -values by first computing Z scores based on empirical means and standard deviations.

Other methods to compute p -values include binomial tail inversion [27], [28] and hypergeometric tail inversion [29], [30], [31] for rate-based criteria and using standard statistical software to compute cdf values for metrics with known distributions. In many testing systems, p -values are approximate, often using a normal approximation that treats empirical variance as the variance of the distribution. For non-approximate testing, consider using concentration inequalities: Bennet [32], Hoeffding [33] or McDiarmid [34] bounds, or empirical Bernstein bounds [35], solving for the probability of bound failure with bound range the boundary for a criterion to produce the equivalent of a p -value. It is worthwhile to understand how your testing system computes p -values, to evaluate how to use them effectively.

Similarly, many systems assume that test observations are drawn i.i.d. from a (possibly unknown) underlying distribution. It is advisable to examine that assumption and adjust testing accordingly. For example, for many websites users behave differently on weekends than on weekdays, so a suitable test plan may wait for a week, or at least one weekend day and one weekday, before the first decision point. And it may be worthwhile to err on the side of conservatism with confidence, knowing that the i.i.d. assumption underlying p -value computations does not quite hold, because of time-toeffect [36], time-series, and periodic effects . Also, it is useful to realize that even with bucket testing, there is a selection effect that, on average, makes out-of-sample results inferior to test results [37], [36], [38], [15].

Some continuous monitoring methods [8] rely on individual observations making small changes to metrics and those changes tending to shrink as a test progresses. For example, for a metric that averages over 0-1 (Bernoulli) variables, the running average for observation t is t -1 t times the previous running average, plus 1 t if the observation value is one, so later observations affect the running average less than earlier observations. Such properties imply that metric values become highly correlated from one observation to the next as the test progresses.

The methods in this paper do not rely on such an assumption; instead, by requiring repetition, they test to what extent such an assumption holds in practice. That enables us to apply the methods in this paper with fewer assumptions about criteria metrics, and without needing to use part of the sample or the α budget to verify those assumptions. In the future, it would be interesting to try to blend the two approaches in hopes of allowing earlier stopping with confidence for the most common types of metrics - averages over i.i.d. observations that occur over the course of the test.

To be clear, though, many metrics do not fit the model of a simple average over i.i.d. observations that continue to accrue during the test. For example, an average over website users of per-user averages does not fit that model precisely. Additional observations for regular users make smaller contributions to such a metric than initial observations for occasional users late in a test. And the total number of users that is the denominator for the metric may increase quickly at the start of the test then slowly or not at all later in the test. The approach in this paper, by not assuming an underlying model for how observations contribute to metrics over time, allows application without needing to evaluate whether such a model holds, though it does require that the p -values apply to the metric of interest.

In the future, it would also be interesting to investigate ways to defer decisions about how to spend some of α until a portion of the test is completed and still maintain test integrity. We learn from testing, so it would be useful to apply what we learn within the test, to the extent we can do so and still maintain type I error guarantees.

## REFERENCES

- [1] G. Davey Smith and S. Ebrahim. Data dredging, bias, or confounding. BMJ , 325(7378):1437-1438, 2002.
- [2] Ronald L. Wasserstein and Nicole A. Lazar. The asa statement on p-values: Context, process, and purpose. The American Statistician , 70(2):129-133, 2016.
- [3] S. S. Young and A. Karr. Deming, data and observational studies. Significance , 8(3):116-120, 2011.
- [4] Alex Deng, Jiannan Lu, and Shouyuan Chen. Continuous monitoring of a/b tests without pain: Optional stopping in bayesian testing. pages 243-252, 2016.
- [5] Ramesh Johari, Pete Koomen, Leonid Pekelis, and David Walsh. Always valid inference: Continuous monitoring of a/b tests. Operations Research , 70(3):1806-1821, 2021.
- [6] Akash Maharaj, Ritwik Sinha, David Arbour, Ian Waudby-Smith, Simon Z. Liu, Moumita Sinha, Raghavendra Addanki, Aaditya Ramdas, Manas Garg, and Viswanathan Swaminathan. Anytime-valid confidence sequences in an enterprise a/b testing platform. In Companion Proceedings of the ACM Web Conference 2023 , WWW '23 Companion, page 396-400, New York, NY, USA, 2023. Association for Computing Machinery.
- [7] Peter Gr¨ unwald, Rianne de Heide, and Wouter Koolen. Safe Testing. Journal of the Royal Statistical Society Series B: Statistical Methodology , page qkae011, 03 2024.
- [8] Ian Waudby-Smith, David Arbour, Ritwik Sinha, Edward H. Kennedy, and Aaditya Ramdas. Time-uniform central limit theory and asymptotic confidence sequences. 2024.
- [9] A. Wald. Sequential analysis . John Wiley, 1947.
- [10] R. Peto, M. C. Pike, P. Armitage, N. E. Breslow, D. R. Cox, S. V. Howard, N. Mantel, K. McPherson, J. Peto, and P. G. Smith. Design and analysis of randomized clinical trials requiring prolonged observation of each patient. i. introduction and design. British journal of cancer , 34(6):585-612, 1976.
- [11] Stuart J. Pocock. Group sequential methods in the design and analysis of clinical trials. Biometrika , 64(2):191-199, 1977.
- [12] Wang SK and Tsiatis AA. Approximately optimal one-parameter boundaries for group sequential trials. Biometrics , 43(1):193-199, 1987.
- [13] Christopher Jennison and Bruce W Turnbull. Group sequential methods with applications to clinical trials . Chapman &amp; Hall/CRC, Boca Raton, 2000.
- [14] Fraser I Lewis. An introduction to group sequential methods: planning and multi-aspect optimization. arXiv preprint arXiv:2303.01040 , 2023.
- [15] Lihong Huang, Fang Shao, Hao Yu, Jianling Bai, Feng Chen, and Ping Yu. Correctness of ef cacy estimation in early termination clinical trial. Int J Clin Exp Med , 10(1):1164-1171, 2017.
- [16] Michael Grayling, James Wason, and Adrian Mander. Group sequential clinical trial designs for normally distributed outcome variables. The Stata Journal: Promoting communications on statistics and Stata , 18:416-431, 06 2018.
- [17] J. D. Ciolino, A. M. Kaizer, and L. B Bonner. Guidance on interim analysis methods in clinical trials. Journal of clinical and translational science , 7(1), 2023.
- [18] K. K. Gordon Lan and D. L. Demets. Discrete sequential boundaries for clinical trials. Biometrika , 70:659-663, 1983.
- [19] Eric Bax and Farshad Kooti. Ensemble validation: Selectivity has a price, but variety is free. Baylearn , 2016.
- [20] C. E. Bonferroni. Teoria statistica delle classi e calcolo delle probabilit`. a Pubblicazioni del R Istituto Superiore di Scienze Economiche e Commerciali di Firenze , 1936.
- [21] George Boole. The Mathematical Analysis of Logic . 1847.
- [22] George Casella and Roger Berger. Statistical Inference . Duxbury Resource Center, June 2001.
- [23] E. Bax. Nearly uniform validation improves compression-based error bounds. Journal of Machine Learning Research , 9:1741-1755, 2008.
- [24] JL Haybittle. Repeated assessments of results in clinical trials of cancer treatment. Br. J. Radiol , 44(256):793-797, 1971.
- [25] J. Shawe-Taylor, P.L. Bartlett, R.C. Williamson, and M. Anthony. Structural risk minimization over data-dependent hierarchies. IEEE Transactions on Information Theory , 44(5):1926-1940, 1998.
- [26] J. Shawe-Taylor and N. Cristianini. Kernel Methods for Pattern Analysis . Cambridge University Press, 2004.
- [27] P. G. Hoel. Introduction to Mathematical Statistics . Wiley, 1954.
- [28] J. Langford. Tutorial on practical prediction theory for classification. Journal of Machine Learning Research , 6:273-306, 2005.
- [29] V. Chv´ atal. The tail of the hypergeometric distribution. Discrete Mathematics , 25(3):285-287, 1979.
- [30] Matthew Skala. Hypergeometric tail inequalities: ending the insanity. arXiv: Probability , 2013.
- [31] E. Bax and J. Donald. Sharp frequency bounds for sample-based queries. IEEE Big Data , pages 5983-5985, 2019.
- [32] G. Bennett. Probability inequalities for the sum of independent random variables. Journal of the American Statistical Association , 57(297):3345, 1962.
- [33] W. Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association , 58(301):1330, 1963.
- [34] C. McDiarmid. On the method of bounded differences. Suveys in Combinatorics, London Math. Soc. Lecture Notes , 141:148-188, 1989.
- [35] Andreas Maurer and Massimiliano Pontil. Empirical Bernstein bounds and sample-variance penalization. 22nd Annual Conference on Learning Theory (COLT) , 2009.
- [36] Stuart J. Pocock. When (not) to stop a clinical trial for benefit. JAMA , 294(17):2228-2230, 11 2005.
- [37] Eric Bax, Anand Kuratti, Preston McAfee, and Julian Romero. Comparing predicted prices in auctions for online advertising. International Journal of Industrial Organization , 30(1):80-88, 2012.
- [38] H. Wang, G. L. Rosner, and S. N. Goodman. Quantifying overestimation in early stopped clinical trials and the 'freezing effect' on subsequent research. Clinical trials (London, England) , 13(6):621-631, 2016.
Eric Bax Arundhyoti Sarkar Alex Shtoff
Early Stopping Based on Repeated Significance
For a bucket test with a single criterion for success and a fixed number of
samples or testing period, requiring a $p$-value less than a specified value of
$\alpha$ for the success criterion produces statistical confidence at level $1
- \alpha$. For multiple criteria, a Bonferroni correction that partitions
$\alpha$ among the criteria produces statistical confidence, at the cost of
requiring lower $p$-values for each criterion. The same concept can be applied
to decisions about early stopping, but that can lead to strict requirements for
$p$-values. We show how to address that challenge by requiring criteria to be
successful at multiple decision points.