Conformal C2ST: Turning weak classifiers into strong two-sample tests
Not on the map. Why?
Abstract (arXiv)
The two-sample testing problem, a fundamental task in statistics and machine learning, seeks to determine whether two sets of samples, drawn from underlying distributions p and q, are in fact identically distributed (i.e. whether p=q). A popular and intuitive approach is the classifier two-sample test (C2ST), where a classifier is trained to distinguish between samples from p and q. Yet despite simplicity of the C2ST, its reliability hinges on access to a near-Bayes-optimal classifier, a requirement that is rarely met and difficult to verify. This raises a major open question: can a weak classifier still be useful for two-sample testing? We show that the answer is a definitive yes. Building on the work of Hu and Lei (2024), we analyze two conformal variants of the C2ST that convert the scores from any trained classifier -- even if weak, biased, or overfit -- into exact, finite-sample p-values. We establish two key theoretical properties of the conformal C2ST: (i) finite-sample Type-I error control, and (ii) non-trivial power that degrades gently in tandem with the error of the trained classifier. The upshot is that even poorly performing classifiers can yield powerful and reliable two-sample tests. This general framework finds a powerful application in Bayesian inference, particularly for validating Neural Posterior Estimation (NPE) models, where the task of comparing a learned posterior approximation q(θ mid y) to the true posterior p(θ mid y) can be framed as a two-sample test. Empirically, the Conformal C2ST outperforms classical discriminative tests across a wide range of benchmarks for this task. Our results establish the conformal C2ST as a practical, theoretically grounded diagnostic tool.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 16 of its 26 references that are in the map. First posted on arXiv 22 Jul 2025.
Builds on
16 of 26 references.
References · 16
- 2020Denoising Diffusion Probabilistic Modelscited by 21,076
- 2016Density estimation using Real NVPcited by 2,042
- 2019Normalizing Flows for Probabilistic Modeling and Inferencecited by 1,323
- 2016Distribution-Free Predictive Inference For Regressioncited by 668
- 2016Revisiting Classifier Two-Sample Testscited by 268
- 2018Validating Bayesian Inference Algorithms with Simulation-Based Calibrationcited by 124
- 2023Flow Matching for Scalable Simulation-Based Inferencecited by 101
- 2024All-in-one simulation-based inferencecited by 74
- 2022Compositional Score Modeling for Simulation-based Inferencecited by 48
- 2023Sampling-Based Accuracy Testing of Posterior Estimators for General Inferencecited by 46
- 2016Classification accuracy as a proxy for two sample testingcited by 42
- 2023MMD-FUSE: Learning and Combining Kernels for Two-Sample Testing Without Data Splittingcited by 33
4 more
- 2020A Two-Sample Conditional Distribution Test Using Conformal Prediction and Weighted Rank Sumcited by 19
- 2022Simulation-Based Calibration Checking for Bayesian Computation: The Choice of Test Quantities Shapes Sensitivitycited by 19
- 2018Global and Local Two-Sample Tests via Regressioncited by 11
- 2024Conditional diffusions for amortized neural posterior estimationcited by 7
Built on by
Citing papers per year: 2025: 1.
1 paper.