Abstract
In distribution testing, the classic uniformity test determines whether an unknown distribution $p$ is uniform or $\epsilon$-far from uniform. While optimal sample complexities for this task are well-established, standard algorithms often lack replicability—the guarantee that independent researchers using the same method on the same data source will reach identical conclusions. This paper introduces the first replicable algorithm for uniformity testing, achieving a sample complexity that scales linearly with the replicability parameter. By transitioning from traditional collision-based statistics to a Total Variation (TV) distance approach combined with random thresholding, the authors provide a robust framework that remains stable even in the "gray area" of near-boundary distributions.
Introduction
The "replication crisis" has highlighted a critical need for algorithms that produce consistent results across independent trials. In the context of randomized algorithms, this is formalized as replicability: if two scientists run the same algorithm on independent samples from the same distribution, they should output the same result with probability at least $1-\rho$.
Uniformity testing—deciding if a distribution $p$ over $n$ elements is uniform—is a cornerstone of property testing. While the optimal sample complexity of $\Theta(\sqrt{n}/\epsilon^2)$ is known, standard testers are notoriously volatile. When a distribution lies in the "gray area"—neither perfectly uniform nor significantly far from it—small variations in samples can lead one researcher to "Accept" and another to "Reject." This paper addresses this instability by developing a tester that ensures consistency across all possible input distributions.
The Challenge of the "Gray Area"
Traditional uniformity testers typically rely on collision counting or $\chi^2$ statistics. These methods are highly sensitive to "heavy" elements—items that appear with slightly higher frequency than $1/n$. These elements introduce significant variance into the test statistic.
In a standard testing regime, a fixed threshold is used to decide between hypotheses. If the test statistic for a distribution falls near this threshold, the inherent randomness of sampling makes the outcome essentially a coin flip. To achieve replicability, an algorithm must ensure that the statistic rarely falls near the decision boundary, or that the boundary itself is managed in a way that preserves consensus.
Methodology: TV Distance and Random Thresholding
The authors depart from $\ell_2$-based statistics, which are prone to variance spikes, and instead utilize a Total Variation (TV) distance statistic:
$$S = \frac{1}{2} \sum_{i=1}^n \left| \frac{X_i}{m} - \frac{1}{n} \right|$$
where $X_i$ represents the count of element $i$ in $m$ samples. The TV statistic is more robust than collision-based metrics because it depends linearly on the counts $X_i$, mitigating the impact of heavy elements.
Shared Randomness and Thresholding
To ensure different researchers reach the same conclusion, the algorithm employs shared randomness. Instead of a fixed threshold, the researchers use a common random seed to pick a threshold $r$ from a predefined range.
The core "Aha!" moment of the paper lies in the relationship between the variance and the expectation of the TV statistic. The authors prove that in scenarios where the variance of $S$ is high, its expected value also increases significantly. This ensures that even if the statistic is noisy, it will likely land far above the randomly selected threshold, leading to a consistent "Reject" result across different sample sets.
Key Results and Complexity
The paper provides both upper and lower bounds for replicable uniformity testing, focusing on the class of symmetric algorithms (algorithms whose output is invariant under permutation of the element labels).
Upper Bound
The proposed replicable tester achieves a sample complexity of: $$\tilde{O}\left( \frac{\sqrt{n}}{\epsilon^2 \rho} + \frac{1}{\rho^2 \epsilon^2} \right)$$ This represents a significant improvement over previous "black-box" replicability transformations, which typically incurred a quadratic overhead ($\rho^{-2}$). This algorithm achieves a nearly linear dependence on the replicability parameter $\rho$ in the dominant term.
Lower Bound
The authors establish a nearly matching lower bound for symmetric algorithms, proving that the $\sqrt{n}/(\epsilon^2 \rho)$ term is a fundamental requirement for replicability in this setting. This suggests that their proposed method is essentially optimal for the most common class of testers.
Extension to Identity Testing
The results are not limited to uniformity. The authors demonstrate that their techniques extend to identity testing—determining if $p$ matches a specific, known distribution $q$—with only constant factor losses in complexity.
Conclusion and Future Work
This work provides a theoretical foundation for stable, replicable distribution testing. By moving to TV-based statistics and utilizing shared random thresholds, the authors solve the volatility problem inherent in the "gray area" of uniformity testing.
Future research may explore whether asymmetric algorithms can bypass the established lower bounds. Additionally, applying these replicable techniques to other properties, such as testing for independence or closeness between two unknown distributions, remains an open and promising direction for the field.
Summary updated