Abstract
In the wake of the reproducibility crisis, ensuring that statistical tests yield consistent results across independent trials has become a priority. This paper establishes a rigorous framework for replicable distribution testing, where randomized algorithms must produce the same output with high probability when given different samples from the same distribution but the same random seed. We provide near-optimal sample complexity bounds for fundamental tasks including uniformity, closeness, and independence testing. Our work introduces a novel "Sample Random Walk" methodology for lower bounds that circumvents previous requirements for algorithmic symmetry, alongside algorithmic techniques like random thresholding and averaged statistics to achieve replicability.
Introduction
The "reproducibility crisis" has highlighted a critical vulnerability in scientific research: the inability to replicate findings across different laboratories or datasets. In response, the formal notion of replicable algorithms was introduced (Impagliazzo et al., 2022). An algorithm is considered replicable if, when executed on two independent, identically distributed (i.i.d.) datasets using the same internal random seed, it outputs the same result with high probability ($1-\rho$).
While replicability has been explored in the context of machine learning, its application to distribution testing—the task of determining whether a distribution possesses a specific property (e.g., uniformity) or is significantly "far" from it—remained largely uncharacterized. Previous research was often restricted to "symmetric" algorithms, which are invariant to domain relabeling. This paper provides a comprehensive analysis of the sample complexity costs required to make distribution tests replicable for any algorithm.
Methodological Innovations
1. The Sample Random Walk (Lower Bound Framework)
To establish fundamental limits on replicability, we developed a new lower-bound technique called the Sample Random Walk. Traditionally, proving lower bounds for distribution testing required assuming the algorithm was symmetric. Our approach constructs a "meta-distribution" of hard-to-distinguish instances and analyzes the acceptance probability of a tester as it moves through the space of possible sample sets. By showing that any replicable tester's acceptance probability must concentrate around its expectation, we can prove lower bounds that apply to all possible testers, effectively removing the symmetry constraint.
2. Algorithmic Design for Stability
To achieve replicability in practice, we utilize two primary algorithmic strategies:
- Random Thresholding: For closeness testing, standard algorithms often rely on a fixed threshold for a test statistic $Z$. To prevent small variations in data from flipping the result, we compare $Z$ to a threshold $r$ chosen uniformly at random from a specific range. This "blurs" the decision boundary, ensuring that two different samples are unlikely to fall on opposite sides of the threshold.
- Averaged Statistics: Independence testing presents a unique challenge due to high variance introduced by "flattening" procedures used for heavy elements. We address this by using an averaged version of the test statistic, inspired by differential privacy, to stabilize the output before applying a random threshold.
Main Results
Our research provides tight characterizations of the sample complexity ($m$) required for three fundamental testing tasks, where $n$ is the domain size, $\epsilon$ is the distance parameter, and $\rho$ is the replicability parameter.
Uniformity Testing
We settle an open question regarding the cost of replicability for uniformity. The sample complexity is established as: $$\Theta\left(\frac{\sqrt{n}}{\epsilon^2 \rho} + \frac{1}{\epsilon^2 \rho^2}\right)$$
Closeness Testing
We establish a near-optimal bound for testing if two unknown distributions $p$ and $q$ are identical: $$\tilde{\Theta}\left(\frac{n^{2/3}}{\epsilon^{4/3} \rho^{2/3}} + \frac{\sqrt{n}}{\epsilon^2 \rho} + \frac{1}{\epsilon^2 \rho^2}\right)$$
Independence Testing
We provide the first replicable tester for independence (testing if a joint distribution is a product of its marginals) with a sample complexity of: $$\tilde{O}\left(\frac{n_1^{2/3}n_2^{1/3}}{\rho^{2/3}\epsilon^{4/3}} + \frac{\sqrt{n_1 n_2}}{\rho\epsilon^2} + \frac{1}{\epsilon^2\rho^2}\right)$$
Discussion and Future Work
A significant conceptual discovery of this work is the link between replicable testing and high-confidence testing. We found that the sample complexity for a replicable test with parameter $\rho$ mirrors the complexity of standard testing with a very high success probability (error $\delta$), where $\rho^{-1}$ roughly corresponds to $\sqrt{\log(1/\delta)}$.
Despite these advances, several avenues for future research remain. While our independence tester is near-optimal in terms of sample complexity, it requires "sample-polynomial" time; future work should investigate if linear-time replicable independence testers are possible. Additionally, while we have established near-optimal upper bounds for independence testing, a formal matching lower bound remains an open theoretical challenge. Finally, the possibility of a generic, black-box reduction between high-probability testers and replicable testers remains a major open question in the field.
Summary updated