NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Robust Kernel Hypothesis Testing under Data Corruption

Antonin Schrab, Ilmun Kim

Abstract

We propose a general method for constructing robust permutation tests under data corruption. The proposed tests effectively control the non-asymptotic type I error under data corruption, and we prove their consistency in power under minimal conditions. This contributes to the practical deployment of hypothesis tests for real-world applications with potential adversarial attacks. For the two-sample and independence settings, we show that our kernel robust tests are minimax optimal, in the sense that they are guaranteed to be non-asymptotically powerful against alternatives uniformly separated from the null in the kernel MMD and HSIC metrics at some optimal rate (tight with matching lower bound). We point out that existing differentially private tests can be adapted to be robust to data corruption, and we demonstrate in experiments that our proposed tests achieve much higher power than these private tests. Finally, we provide publicly available implementations and empirically illustrate the practicality of our robust tests.

Introduction

Standard non-parametric tests, such as the Maximum Mean Discrepancy (MMD) for two-sample testing and the Hilbert-Schmidt Independence Criterion (HSIC) for independence testing, rely on the exchangeability of data under the null hypothesis. However, real-world data is often subject to corruption from sensor failures, outliers, or adversarial attacks. Even a small fraction of corrupted samples can break exchangeability, causing standard permutation tests to suffer from inflated Type I errors (false positives). In such cases, the test rejects the null hypothesis due to data "dirtiness" rather than true distributional differences.

The Robust DC Procedure

To address this, we introduce the Robust DC (Data Corruption) procedure. This method modifies classical permutation tests to maintain validity under corruption without requiring random noise injection, unlike methods based on Differential Privacy (DP).

The procedure involves two key steps:

  1. Sensitivity Analysis: Calculating the global sensitivity ($\Delta_T$) of the test statistic, which measures the maximum change in the statistic when a single data point is modified.
  2. Threshold Adjustment: The rejection threshold is adjusted based on the expected maximum number of corrupted samples ($r$). A null hypothesis is rejected only if the observed statistic $T_0$ exceeds the $(1-\alpha)$-quantile $q$ of the permuted statistics by a margin: $$T_0 > q + 2r\Delta_T$$

This approach leads to the development of dcMMD and dcHSIC, which are robust versions of their respective kernel tests.

Experimental Evaluation

We evaluated the DC procedure on both synthetic and real-world datasets:

  • Gaussian Mean Shift: Synthetic data used to simulate controlled distributional differences and corruption levels.
  • IMDb Movie Reviews: A high-dimensional ($d = 3330$) real-world dataset where corruption was simulated by replacing reviews with samples from a different distribution.

Key Results

The experiments demonstrate that the DC procedure effectively controls false positives while maintaining high power. As shown in the figure below, standard MMD fails immediately under corruption, showing a 100% rejection rate even when the null is true. In contrast, dcMMD maintains the target significance level $\alpha$ as long as the number of corrupted samples is within the specified robustness parameter $r$. Furthermore, dcMMD exhibits significantly higher power than the differentially private alternative (dpMMD), reaching perfect detection much faster as the number of corrupted samples increases.

Rejection rates for dcMMD, dpMMD, and MMD under varying corruption levels for Gaussian and IMDb datasets.

Theoretical Insights

A significant theoretical contribution of this work is proving that the robust test achieves the minimax optimal rate in the low-corruption regime. This means that protection against corruption is achieved without sacrificing the ability to detect subtle distributional differences. However, robustness involves a trade-off: as the parameter $r$ increases, the test becomes more conservative. If $r$ approaches the total sample size $n$, the test will naturally cease to reject any null hypothesis, reflecting the fact that an adversary could have replaced the entire dataset.

Conclusion

The DC procedure provides a robust framework for kernel hypothesis testing that is both theoretically sound and practically effective. By accounting for potential data corruption in the rejection threshold, we enable reliable testing in adversarial or noisy environments. Future work includes extending this framework to more computationally efficient kernel tests and exploring robustness for other metrics like Wasserstein distance.

Summary updated

BibTeX
@inproceedings{schrab2025robust,
  author = {Antonin Schrab and Ilmun Kim},
  title = {{Robust Kernel Hypothesis Testing under Data Corruption}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=DOFjKvgsvE},
}
Figure