NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sharp Bounds for Generalized Uniformity Testing

Ilias Diakonikolas, Daniel M. Kane, Alistair Stewart

Introduction

In the realm of distribution property testing, standard uniformity testing is a foundational problem: given samples from a distribution $p$ over a known domain of size $n$, can we determine if $p$ is perfectly uniform or $\epsilon$-far from it? This classic problem is well-understood, requiring $\Theta(\sqrt{n}/\epsilon^2)$ samples.

However, practical scenarios often present a more complex challenge. What if the domain size $n$ is unknown? Or what if the distribution is uniform over an arbitrary, unknown subset of the domain? This is known as generalized uniformity testing. Without a fixed $n$ to calibrate expectations, the problem becomes significantly harder. While prior work introduced this problem and provided initial bounds, a mathematical gap remained. This paper resolves that gap by establishing the first mathematically tight ("sharp") bounds for generalized uniformity testing, revealing the exact statistical price of not knowing the domain size.

The Challenge of an Unknown Domain

In standard uniformity testing, algorithms heavily rely on the known domain size $n$ to estimate collision probabilities and other statistical moments. When $n$ is removed from the equation, these algorithms fail. Previous research by Batu and Canonne [BC17] established that generalized uniformity testing is possible, but their upper and lower bounds did not match. This paper provides matching bounds, proving that the worst-case sample complexity scales with $n^{2/3}$ rather than the $\sqrt{n}$ seen in standard testing—a substantial "penalty" for the unknown domain.

Methodology: A Two-Pronged Algorithmic Strategy

To achieve optimal sample complexity, the authors propose a computationally efficient, two-part algorithm that dynamically switches strategies based on the proximity parameter $\epsilon$ and the estimated norms of the distribution.

1. Moment Estimation (Large $\epsilon$)

For larger values of $\epsilon$, the algorithm leverages a powerful mathematical identity: for any uniform distribution, the third power sum $F_3(p)$ is exactly equal to the square of the second power sum $F_2(p)$ (i.e., $\|p\|_3^3 = (\|p\|_2^2)^2$). The authors prove that this relationship is highly robust. If a distribution is even slightly far from uniform, the gap between $F_3$ and $F_2^2$ grows rapidly.

To exploit this, the authors developed refined, unbiased estimators for these power sums. Unlike generic estimators, these are optimized by first verifying that higher-order moments are not "exploding," allowing the algorithm to efficiently detect deviations from uniformity.

2. Conditional Testing (Small $\epsilon$)

For small $\epsilon$, the moment-based approach becomes too sample-expensive. Instead, the algorithm employs a conditional testing strategy. It first draws a set of samples to identify a subset $S$ of the domain. It then restricts its focus to the conditional distribution—the distribution of elements only within that observed subset—and runs a standard uniformity tester on it. The theoretical heavy lifting here involves proving that if the original global distribution was $\epsilon$-far from uniform, the conditional distribution on the sampled subset will likely remain far from uniform.

Establishing the Lower Bound

Because this is a theoretical work, it does not rely on empirical datasets. Instead, to prove that their algorithmic upper bounds are optimal, the authors utilize the shared information method. By employing Poissonization techniques, they construct highly specific synthetic families of "YES" (uniform) and "NO" (far-from-uniform) distributions. They demonstrate that these two families are statistically indistinguishable to any algorithm unless the sample size meets their derived lower bound.

Key Results and Insights

The paper's primary contribution is the establishment of the sharp sample complexity bound for generalized uniformity testing:

$$ \Theta\left(\frac{1}{\epsilon^{4/3}\|p\|_3} + \frac{1}{\epsilon^2\|p\|_2}\right) $$

This result yields several critical insights:

  • The Power of Norms: The sample complexity is fundamentally tied to the $\ell_2$ and $\ell_3$ norms of the underlying distribution. This represents a major paradigm shift from standard testing, where complexity is traditionally stated in terms of the domain size $n$.
  • Computational Efficiency: The proposed tester is not merely sample-optimal; it is also computationally efficient, running in time nearly linear with respect to the number of samples.
  • Information-Theoretic Optimality: The matching lower bound confirms that no algorithm, regardless of its computational power or strategy, can succeed with fewer samples.

Future Directions

While this paper definitively solves the generalized uniformity testing problem, it opens several avenues for future theoretical exploration:

  • Other Symmetric Properties: A natural next step is to extend these "unknown domain" techniques to other symmetric properties, such as closeness (testing if two unknown distributions are identical) or independence.
  • Instance Optimality: The current bounds are minimax optimal (worst-case over distributions with specific norms). Future research could explore "instance-optimal" testing, where an algorithm adapts its sample size to the specific, easiest-to-test features of the actual distribution it is analyzing.
  • Beyond Discrete Domains: Extending these norm-based testing concepts from discrete probability distributions to continuous domains or structured data remains a compelling open challenge.

Summary updated

BibTeX
@inproceedings{diakonikolas2018sharp,
  author = {Ilias Diakonikolas and Daniel M. Kane and Alistair Stewart},
  title = {{Sharp Bounds for Generalized Uniformity Testing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=SyZXeubOZr},
}
Figure