Abstract
Sequential hypothesis testing is a cornerstone of modern data science, particularly in applications like A/B testing and clinical trials. However, traditional methods often struggle with heterogeneous data sources and rigid parametric assumptions. This paper introduces Active Sequential Nonparametric Two-Sample Testing (ASN2T), a framework that adaptively selects the most informative data sources to accelerate the detection of distributional differences. By integrating a "testing-by-betting" approach with a vanishing $\epsilon$-greedy selection strategy, the authors provide a robust method that guarantees Type-I error control while significantly reducing the expected sample size required to reach a statistically significant conclusion.
Introduction
In many real-world scenarios, such as online A/B testing for recommendation engines, data is not uniform. Users are often segmented by geography, device type, or behavior, creating multiple heterogeneous data sources. When testing whether a new treatment (Version B) differs from a control (Version A), some segments may exhibit a pronounced difference quickly, while others may remain indistinguishable for long periods.
Traditional sequential tests typically rely on likelihood ratios and parametric assumptions (e.g., Gaussian distributions), which are often violated in practice. Furthermore, most existing nonparametric tests are passive, sampling from sources uniformly or focusing on a single stream. The challenge addressed in this research is active selection: how can an algorithm adaptively identify and sample from the most "informative" source to reject a null hypothesis as fast as possible?
The ASN2T Framework
The proposed ASN2T procedure operates at the intersection of sequential analysis and multi-armed bandits. It is built upon three foundational pillars:
1. Testing-by-Betting
Rather than relying on traditional p-values, ASN2T utilizes the "testing-by-betting" paradigm. The test maintains a "wealth" process, $W_t$, representing the evidence against the null hypothesis ($H_0$). The decision-maker places bets on the alternative hypothesis ($H_1$). Under $H_0$, the wealth process is a non-negative martingale, meaning its expected value does not grow over time. However, if $H_1$ is true, the wealth grows at an exponential rate. The test terminates and rejects $H_0$ as soon as the wealth crosses a pre-defined threshold $1/\alpha$, where $\alpha$ is the desired significance level.
2. Adaptive Source Selection (Vanishing $\epsilon$-greedy)
To optimize the growth of wealth, the algorithm must decide which source to sample at each time step $t$. ASN2T employs a vanishing $\epsilon$-greedy strategy to balance two competing needs:
- Exploitation: Sampling the source that currently demonstrates the highest empirical distance between its Version A and Version B distributions.
- Exploration: Occasionally sampling other sources (with a probability $\epsilon(t)$ that decays over time) to ensure that a potentially more informative source is not missed due to initial noise.
3. Nonparametric Witness Functions
To maintain its nonparametric nature, the framework uses a class of test functions, known as "witness functions," to measure the discrepancy between distributions. These functions (often derived from Kernel Maximum Mean Discrepancy or $L_2$ norms) identify the specific features of the data that best highlight the difference between the two samples without requiring a pre-specified distribution shape.
Theoretical Contributions and Results
As a theoretical contribution to the field of mathematical statistics, the paper provides several rigorous proofs regarding the performance of ASN2T:
- Type-I Error Control: The authors prove that the probability of falsely rejecting the null hypothesis is strictly bounded by $\alpha$, regardless of the adaptive sampling strategy used.
- The Power-One Property: They guarantee that if a difference truly exists in at least one source, the test will eventually stop and reject the null hypothesis with probability one.
- Asymptotic Efficiency: A key insight is the "gain of adaptivity." The authors demonstrate that as $\alpha \to 0$, the ASN2T procedure is asymptotically as efficient as a test that knows the best source in advance. It is strictly faster than passive tests that distribute samples across sub-optimal sources.
- Sample Size Bounds: The research provides non-asymptotic upper bounds on the expected stopping time, showing it is inversely proportional to the squared distance (distinguishability) of the most informative source.
Discussion and Future Directions
The ASN2T framework represents a significant step forward in making sequential testing more practical for complex, real-world environments. By treating the distinguishability of a source as a time-varying "reward," the authors bridge the gap between hypothesis testing and bandit theory.
However, certain limitations remain. The current selection policy assumes some knowledge of the "sub-optimality gap" between sources. Future research may explore "gap-free" strategies, such as Upper Confidence Bound (UCB) approaches, to remove this requirement. Additionally, as the complexity of the witness function class increases, the computational cost of updating the betting strategy at every step may become a factor for high-frequency data streams. Extending the framework to handle varying sampling costs or time-sensitive source availability also presents an interesting avenue for further study.
Summary updated