Abstract
Nonparametric kernel two-sample tests are a cornerstone of statistical analysis, allowing researchers to determine if two datasets are drawn from the same distribution without making restrictive parametric assumptions. However, these tests can inadvertently expose sensitive individual-level data. This paper introduces the first comprehensive framework for performing kernel two-sample tests under the constraints of $(\epsilon, \delta)$-differential privacy. By leveraging finite-dimensional analytic representations of probability measures and the Analytic Gaussian Mechanism, we develop test statistics that preserve privacy while maintaining high statistical power. Our evaluation across synthetic and real-world datasets demonstrates that these private tests require only a modest increase in sample size to achieve utility comparable to non-private baselines.
Introduction
In domains such as healthcare and social science, the ability to compare two groups—for instance, patients in a clinical trial versus a control group—is vital. Kernel two-sample tests are favored for their flexibility and lack of rigid distributional assumptions. Despite their utility, the complex dependence of these tests on raw data poses a significant privacy risk. In high-dimensional or small-sample settings, aggregate statistics can potentially be inverted to reveal the presence or attributes of specific individuals.
Traditional "naive" approaches to privacy, such as adding noise directly to raw data, often fail in high-dimensional spaces because the required noise scales with the diameter of the input space, effectively destroying the test's utility. This work addresses the need for a privacy-preserving framework that maintains the sensitivity of the test to distributional differences while providing rigorous privacy guarantees.
Methodology and Privacy Settings
The core of the proposed framework involves moving from infinite-dimensional Hilbert space embeddings to finite-dimensional analytic representations. This transition allows the formulation of a test statistic based on the mean and covariance of feature vectors, which is more amenable to privacy-preserving mechanisms.
The authors define two distinct operational settings based on the level of trust between entities:
- Trusted-Curator (TC) Setting: A central, trusted authority has access to both datasets ($D_x$ and $D_y$). This curator computes the test statistic and releases a privatized version, or privatizes the underlying mean and covariance before release.
- No-Trusted-Entity (NTE) Setting: In this more restrictive scenario, two data owners hold separate datasets and do not trust each other or the final tester. Each owner must independently privatize their local statistics before they are aggregated by the tester.
To achieve $(\epsilon, \delta)$-differential privacy, the framework employs the Analytic Gaussian Mechanism. Three primary noise injection strategies are explored: perturbing the mean and covariance components, perturbing the final scalar test statistic, or adding noise directly to feature vectors. A critical technical hurdle overcome in this work is the rigorous sensitivity analysis of the kernel test statistic, which dictates the precise amount of noise required to mask any single individual's contribution.
Key Insights: The Asymptotic Trap
A significant finding of this research is the failure of standard asymptotic theory under privacy constraints. In non-private settings, the null distribution of the test statistic typically follows a chi-squared ($\chi^2$) distribution as the sample size grows. However, the authors discovered that using this standard $\chi^2$ distribution in private tests leads to "massively inflated" Type I errors (false positives). The privacy-preserving noise widens the null distribution beyond what the standard theory predicts.
To rectify this, the authors introduced a non-asymptotic correction. By approximating the null distribution as a weighted sum of chi-squared variables—accounting for the variance of the injected noise—they successfully stabilized the Type I error rate, ensuring the test remains valid under privacy.
Empirical Results
The framework was evaluated on several synthetic benchmarks, including Same Gaussian (SG) for error rates, and Gaussian Mean/Variance Differences (GMD/GVD) and "Blobs" for statistical power.
Key results include:
- Utility and Power: The private tests demonstrate high utility, requiring only a relatively modest increase in sample size to match the power of non-private tests.
- Privacy-Power Trade-off: As the privacy budget $\epsilon$ decreases (indicating stronger privacy), the power of the test naturally declines. The "Perturbing Test Statistic" (TCS) method was found to be particularly robust, often maintaining higher power than component-wise perturbation.
- Real-World Application: On the IMDb-WIKI celebrity age dataset, the private Mean Embedding (ME) test successfully distinguished between age groups (under 25 vs. 25-35) with maximal power, even under high privacy regimes, without risking the exposure of individual image data.
Limitations and Future Work
While the framework is a significant step forward, it currently requires the use of bounded kernels (e.g., Gaussian) and bounded weighting functions to ensure finite sensitivity. Applying these methods to unbounded data would necessitate clipping, which may impact performance. Additionally, the choice of hyperparameters, such as the regularization parameter $\gamma_n$, is critical; improper tuning can miscalibrate the null distribution. Future research may explore private optimization of test locations and kernel parameters to further enhance the power of nonparametric private testing.
Summary updated