A nonparametric two-sample test using a parametric integral probability metric

Yuha Park, Yongdai KimarXiv 2026

TL;DR

The paper introduces PReLU-TST, a new two-sample test that uses a single-node neural network with a learnable slope to detect differences between probability distributions. Despite its simple parametric architecture, the authors prove the test is fully nonparametric and achieves superior statistical power in high-dimensional settings where traditional methods often fail.

What Problem Does This Paper Address?

In statistics and machine learning, the "two-sample test" asks a fundamental question: Are these two sets of data drawn from the same underlying distribution? This is critical for everything from detecting "data drift" in production models to comparing treatment effects in clinical trials.

Existing tools face a trade-off. Classical nonparametric tests (like the Kolmogorov-Smirnov test) struggle in high dimensions. Modern methods like Maximum Mean Discrepancy (MMD) or Wasserstein distance are popular but have blind spots; for example, MMD is often poor at detecting changes in scale (variance), and Wasserstein distance suffers from the "curse of dimensionality," becoming incredibly slow to converge as the number of features grows. The authors sought a test that is computationally efficient, theoretically robust, and sensitive to a wide variety of distributional shifts.

Methods

The authors build their test on a new Integral Probability Metric (IPM). An IPM measures the distance between two distributions by finding a "discriminator" function that maximizes the difference in expected values between the two samples.

The core innovation is the Parametric ReLU (PReLU) discriminator class. Instead of using a complex deep network, they use a single-node neural network: $$f(z) = \phi_\ell(\theta^\top z + \mu)$$ Where:

  • $\theta$ and $\mu$ are standard weight and bias parameters.
  • $\phi_\ell$ is a Leaky ReLU activation function where the slope $\ell$ is learnable.

By allowing the slope $\ell$ to vary (specifically between -1 and 0.5), the test can adapt its "shape" to the data. If the distributions differ by a simple mean shift, the optimizer can pick a slope that mimics a linear test. If they differ by variance, it can pick a slope that mimics a mean-absolute-deviation test.

To determine if a measured difference is statistically significant, the authors use a permutation test, which involves repeatedly shuffling the labels of the two samples to build an empirical "null distribution."

Datasets

The researchers evaluated PReLU-TST against a battery of baselines using:

  • Simulated Shifts: Nine different scenarios covering location shifts (mean changes), scale changes (variance changes), and complex XOR-type structures across dimensions $d \in \{2, 4, 8, 16\}$.
  • High-Dimensional Simulations: Testing performance when the number of features ($d=512$) exceeds the number of samples.
  • Real-world Tabular Data: Four benchmark datasets (Adult, Covertype, Loan, Thyroid) used to see if the test could distinguish real data from synthetic data generated by a GAN (Generative Adversarial Network).
  • The Yearbook Dataset: A collection of American high school portraits from 1905 to 2013. The authors used 512-dimensional feature vectors (embeddings) from a ResNet-18 model to detect shifts in facial features across different decades.

Key Insights and Ideas

  • Parametric Simplicity, Nonparametric Power: It is mathematically surprising that a single-node parametric discriminator can distinguish any two distinct probability measures. The authors prove this consistency, showing that you don't need a "deep" network to create a robust nonparametric test.
  • Beating the Curse of Dimensionality: Unlike Wasserstein-based tests, PReLU-IPM achieves a parametric convergence rate of $O(n^{-1/2})$. This means the amount of data needed to get a reliable estimate doesn't explode as you add more dimensions.
  • The Boundary Property: A key computational insight (Proposition 5) is that the optimal slope $\ell$ will always be at the extreme ends of the allowed range (e.g., -1 or 0.5). This drastically simplifies the optimization process, as you only need to check the boundaries rather than searching the entire continuum of slopes.
  • Solving XOR: Single-layer networks are famously unable to solve the XOR problem in classification. However, in the context of distribution testing, the authors show that PReLU-TST handles XOR-type shifts exceptionally well, outperforming much more complex models.

Key Results

  • Superior Power: In almost all simulated scenarios (location, scale, and XOR shifts), PReLU-TST achieved higher statistical power than MMD, Wasserstein-TST, and various rank-based tests, especially as the dimensionality increased.
  • Yearbook Analysis: On the high-dimensional image embedding task, PReLU-TST was the most sensitive at detecting subtle temporal shifts in portraits (e.g., changes in hairstyles and smiles between the 1960s and 1980s).
  • Efficiency: The test maintained competitive performance even in "small-sample" regimes (as few as 20 samples), where deep-learning-based tests often fail to train effectively.

Limitations and Future Work

  • Heavy Tails: The test performs poorly on distributions with "heavy tails" (like a Student’s t-distribution with very low degrees of freedom). Because ReLU functions are unbounded, they are sensitive to outliers in the tails of a distribution.
  • Outlier Sensitivity: The authors explicitly note that PReLU-TST is not recommended when the data is known to contain significant outliers.
  • Future Directions: The authors suggest exploring "semi-parametric" discriminators—perhaps replacing the ReLU with a more complex but still constrained function—to balance the benefits of simple parametric models with the expressiveness of deep learning. They also aim to extend this to conditional two-sample tests, which are useful for causal inference.

Summary updated

BibTeX
@misc{park2026nonparametric,
  author = {Yuha Park and Yongdai Kim},
  title = {{A nonparametric two-sample test using a parametric integral probability metric}},
  year = {2026},
  eprint = {2606.16941},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.16941},
}

Loading related content...

Figure