Minimax optimal testing by classification

Patrik R. Gerber, Yanjun Han, Yury Polyanskiy

Abstract

Classifier-Accuracy Testing (CAT) is a widely adopted machine learning-based heuristic for hypothesis testing, particularly in fields where explicit probability densities are unavailable but simulators are accessible. This paper provides a rigorous theoretical foundation for CAT, demonstrating that it achieves minimax optimal sample complexity across several fundamental statistical problems, including Goodness-of-Fit, Two-Sample Testing, and Likelihood-Free Hypothesis Testing. By analyzing CAT through a "separating set" framework, the authors show that simple binary classifiers are sufficient to achieve the best possible performance in the worst-case scenario, even in high-dimensional and non-parametric settings.

1. Introduction

In modern scientific inquiry—ranging from particle physics to climate science—researchers frequently encounter "likelihood-free" scenarios. In these cases, the underlying probability density functions of the data are unknown, but high-fidelity "black box" simulators are available to generate synthetic samples. Traditional statistical methods, such as the Kolmogorov-Smirnov or chi-squared tests, often struggle in these high-dimensional or non-parametric contexts because they require explicit density formulations.

To address this, practitioners have turned to Classifier-Accuracy Testing (CAT). The procedure is intuitive:

  1. Generate synthetic data from your "null" and "alternative" models.
  2. Train a machine learning classifier to distinguish between them.
  3. Run your real-world data through this classifier.
  4. If the classifier is significantly better than random guessing on the real data, reject the null hypothesis.

While CAT was instrumental in landmark discoveries like the Higgs boson, its theoretical optimality remained unproven. This paper bridges that gap, establishing that CAT is not merely a convenient hack but a minimax optimal approach—meaning it achieves the best possible performance any test could achieve in the worst-case scenario.

2. The CAT Framework

The authors evaluate CAT across three primary statistical tasks:

  • Goodness-of-Fit (GoF): Determining if a dataset originates from a specific known distribution.
  • Two-Sample Testing (TS): Determining if two independent datasets originate from the same distribution.
  • Likelihood-Free Hypothesis Testing (LFHT): Given two simulators and a dataset, identifying which simulator produced the data.

The theoretical analysis centers on the concept of a "separating set." A binary classifier defines a set $S$ in the sample space; any observation falling within $S$ is assigned to the alternative hypothesis. The effectiveness of the test is determined by the "separation"—the difference in probability mass assigned to $S$ by the two distributions—relative to the variance of the indicator function. The authors propose specific strategies for learning these sets, such as using $L^2$-projections for smooth densities.

3. Key Theoretical Insights

The paper yields several surprising insights into the nature of optimal testing:

3.1 The Sufficiency of Binary Classification

A common intuition in machine learning is that continuous outputs (like log-density ratios or soft probabilities) provide more information than hard binary labels. However, this research proves that for achieving minimax optimality, simple binary classification is sufficient. This simplifies the requirements for the types of models needed to perform optimal testing.

3.2 The Power of Imbalance

In standard classification tasks, balanced datasets are usually preferred. The authors find that in high-dimensional or non-parametric testing, imbalanced classifiers are often necessary. These are classifiers that are extremely conservative or "picky" about labeling a sample as belonging to the alternative class. This imbalance is a critical component in reaching optimal sample complexity in complex data spaces.

3.3 Closing the Gap in LFHT

The paper provides a significant contribution to Likelihood-Free Hypothesis Testing by resolving the sample complexity in the $m \ge n$ regime (where $m$ is the number of simulated samples and $n$ is the number of real samples). The authors provide tight bounds that were previously unknown in the statistical literature.

4. Results and Performance

The authors demonstrate that CAT matches (or nearly matches) the minimax optimal rates across various distribution classes. Crucially, these results hold not just for average cases, but also in the high-probability regime (where the error probability $\delta$ is very small), showing that CAT is robust.

Problem Distribution Class CAT Performance (Sample Complexity)
GoF / TS Discrete ($k$) Matches optimal $n \approx \frac{\sqrt{k}}{\epsilon^2}$
LFHT Discrete ($k$) Resolves complexity for the $m \ge n$ regime
GoF / TS Smooth Density ($\beta, d$) Matches known $n \approx \epsilon^{-(2\beta + d/2)/\beta}$ rate
GoF / TS Gaussian Sequence ($s$) Matches known $n \approx \epsilon^{-(2s + 1/2)/s}$ rate

5. Conclusion and Future Directions

This work validates the use of machine learning classifiers as a rigorous tool for statistical hypothesis testing. By proving that CAT is minimax optimal, the authors provide a theoretical justification for a practice already widespread in the physical sciences.

However, several challenges remain. In the regime of very large alphabet sizes ($k$) for discrete distributions, the current CAT construction includes extra logarithmic factors ($\log k$) that may be unnecessary. Furthermore, while the paper addresses sample optimality, the computational complexity of training these classifiers remains a practical hurdle. Finally, bridging the gap between the "idealized" classifiers used in these proofs and the specific architectures used in practice (e.g., deep neural networks or Random Forests) is a promising avenue for further study.

Summary updated

BibTeX
@inproceedings{gerber2023minimax,
  author = {Patrik R. Gerber and Yanjun Han and Yury Polyanskiy},
  title = {{Minimax optimal testing by classification}},
  booktitle = {Conference on Learning Theory},
  year = {2023},
}
Figure