Sample-Optimal Identity Testing with High Probability

Ilias Diakonikolas, Themis Gouleakis, John Peebles, Eric Price

TL;DR

Standard black-box amplification (running a test repeatedly and taking the majority vote) is provably suboptimal for high-confidence distribution identity testing when error probability $\delta = o(1)$. This paper introduces a simple, sample-optimal tester based directly on the empirical total variation distance, establishing that the optimal sample complexity is $\Theta\left(\frac{1}{\varepsilon^2} \left(\sqrt{n \log(1/\delta)} + \log(1/\delta)\right)\right)$.

What Problem Does This Paper Address?

In distribution identity testing, an algorithm draws samples from an unknown distribution $p$ supported on $n$ elements and must determine whether $p$ is identical to a known reference distribution $q$, or whether it is $\varepsilon$-far from $q$ in total variation distance ($d_{\mathrm{TV}}(p, q) \ge \varepsilon$), succeeding with probability at least $1 - \delta$.

While the constant-error regime ($\delta = 1/3$) is classically known to require $\Theta(\sqrt{n}/\varepsilon^2)$ samples, the high-confidence regime ($\delta \to 0$) has historically been treated via black-box amplification. Amplification repeats the basic tester $\mathcal{O}(\log(1/\delta))$ times, scaling sample complexity by a multiplicative factor of $\log(1/\delta)$. In scenarios demanding extreme confidence (such as multiple-hypothesis testing or $p$-value calibration where $\delta \ll 1$), this multiplicative penalty is excessively loose and suboptimal.

Methods

The paper focuses first on uniformity testing ($q = U_n$) and leverages Goldreich's reduction to extend results to arbitrary reference distributions $q$:

  • Empirical Plug-in Estimator: The tester computes the empirical total variation distance $S = d_{\mathrm{TV}}(\widehat{p}, U_n) = \frac{1}{2} \sum_{i=1}^n |\frac{X_i}{m} - \frac{1}{n}|$ (where $X_i$ is the count of domain element $i$) and rejects uniformity if $S$ exceeds a calibrated threshold $t$.
  • Strong Convexity of the Expectation: Bounding the gap $\mu(p) - \mu(U_n)$ analytically is difficult because no clean closed form exists for $\mu(p)$. The authors view the expected test statistic as a function of $p$, compute its diagonal Hessian in closed form via generating functions, and use the strong convexity around $U_n$ to establish tight lower bounds on the expectation gap.
  • Concentration Analysis via Stochastic Domination: Using majorization theory, the authors prove that any convex, symmetric statistic of the empirical histogram stochastically dominates when $p$ majorizes $q$. This reduces worst-case analysis to distributions supported on at most two or three mass values. Concentration is then established using McDiarmid's inequality for $m \ge n$ and a refined Bernstein-type McDiarmid bound for $m < n$.
  • Lower Bounds: Information-theoretic lower bounds are proven using Poissonization and bounding the Hellinger distance between product distributions over coordinates.

Datasets

Not discussed in the paper. As a purely theoretical work, the paper does not use empirical benchmarks or datasets.

Key Insights and Ideas

  • Vindication of the "Plug-In" Estimator: Prior folklore suggested that thresholding the empirical total variation distance $d_{\mathrm{TV}}(\widehat{p}, U_n)$ could not work with sublinear samples ($m \ll n$) because $\widehat{p}$ is far from $p$. The authors show that while the estimate itself is biased and far from the true distance, its expectation under $U_n$ is strictly and provably smaller than under any $\varepsilon$-far distribution.
  • Sub-multiplicative Error Dependence: Rather than scaling the whole sample bound by $\log(1/\delta)$, the $\log(1/\delta)$ factor appears inside the square root alongside $n$: $\sqrt{n \log(1/\delta)}/\varepsilon^2$. This yields an exponential improvement over naive repetition for small $\delta$ before eventually transitioning to the learning bound $\Theta(n/\varepsilon^2)$ when $\delta \le 2^{-\Theta(n)}$.
  • Failure of Previous Statistics: Classical collision-counting and $\chi^2$-based testers fail in the high-confidence regime because their test statistics are non-Lipschitz; a few samples landing in the same bucket cause massive variance spikes under the null hypothesis. The empirical $\ell_1$-distance is $1/m$-Lipschitz, ensuring robust tail bounds.
  • Tractable Worst-Case Evaluation: The majorization result implies that worst-case distributions for any convex, symmetric test statistic have only two coordinate values: $\alpha n$ coordinates of $(1 + \varepsilon/\alpha)/n$ and the rest $(1 - \varepsilon/(1 - \alpha))/n$. This reduces the search space of worst-case distributions over an infinite simplex down to just $n$ candidates.

Key Results

  • Optimal Sample Complexity: The worst-case sample complexity of $(\varepsilon, \delta)$-identity testing is tightly characterized as: $$\Theta\left( \frac{1}{\varepsilon^2} \left( \sqrt{n \log(1/\delta)} + \log(1/\delta) \right) \right)$$ for all $n \ge 2$, $\varepsilon \in (0, 1)$, and $\delta \in (0, 1)$.

  • Quadratic Speedup over Naive Amplification: For error probabilities $\delta \ge 2^{-\Theta(n)}$, the sample dependence on $\delta$ improves quadratically from $\log(1/\delta)$ to $\sqrt{\log(1/\delta)}$.

Limitations and Future Work

  • Scope of Properties: The results apply specifically to identity (and uniformity) testing. Developing sample-optimal testers in the high-confidence regime for other distribution properties—such as independence, monotonicity, or entropy estimation—remains open.
  • Empirical Validation: While the theoretical guarantees are minimax-optimal up to constant factors, practical implementations and empirical comparisons against non-asymptotic heuristics in real-world data settings were left for future experimental study.

Summary updated

BibTeX
@inproceedings{diakonikolas2018sample,
  author = {Ilias Diakonikolas and Themis Gouleakis and John Peebles and Eric Price},
  title = {{Sample-Optimal Identity Testing with High Probability}},
  booktitle = {ICALP},
  year = {2018},
  url = {https://openreview.net/forum?id=lnFDW7HZGCA1},
}
Figure