Abstract
To adapt kernel two-sample and independence testing to complex structured data, aggregation of multiple kernels is frequently employed to boost testing power compared to single-kernel tests. However, we observe a phenomenon that directly maximizing multiple kernel-based statistics may result in highly similar kernels that capture highly overlapping information, limiting the effectiveness of aggregation. To address this, we propose an aggregated statistic that explicitly incorporates kernel diversity based on the covariance between different kernels. Moreover, we identify a fundamental challenge: a trade-off between the diversity among kernels and the test power of individual kernels, i.e., the selected kernels should be both effective and diverse. This motivates a testing framework with selection inference, which leverages information from the training phase to select kernels with strong individual performance from the learned diverse kernel pool. We provide rigorous theoretical statements and proofs to show the consistency on the test power and control of Type-I error, along with asymptotic analysis of the proposed statistics. Lastly, we conducted extensive empirical experiments demonstrating the superior performance of our proposed approach across various benchmarks for both two-sample and independence testing.
Introduction
In the field of non-parametric statistics, kernel-based tests such as the Maximum Mean Discrepancy (MMD) and the Hilbert-Schmidt Independence Criterion (HSIC) serve as the gold standard for comparing distributions and detecting dependencies. These tests rely on a "kernel" function to define similarity between data points. However, the effectiveness of these tests is heavily dependent on the specific kernel selected.
To address the difficulty of choosing a single optimal kernel, researchers often aggregate multiple kernels (e.g., Gaussian kernels with varying bandwidths). While this approach aims to capture diverse features of the data, it often falls victim to the "dilution effect." This occurs when redundant kernels capture overlapping information or when "weak" kernels—those unable to distinguish between distributions—dilute the overall sensitivity of the test. The DUAL framework, presented at NeurIPS 2025, introduces a novel approach to kernel aggregation that prioritizes diversity and selection to overcome these limitations.
The Problem: Redundancy and Dilution
When comparing high-dimensional datasets or checking for complex dependencies, a single kernel often fails to capture all relevant nuances. The conventional strategy of aggregating a large bank of kernels assumes that more information is always better. However, the authors identify two primary failure modes in this strategy:
- Redundancy: If ten kernels in an aggregate capture the same underlying data structure, they do not provide ten times the insight; they simply increase the noise floor.
- Weak Links: Including kernels that have low individual power can drag down the overall performance of the aggregated statistic, making it harder to reject the null hypothesis even when a true difference exists.
To maintain strict control over the Type-I error (the probability of a false positive) while maximizing power, a framework must find kernels that are both individually powerful and mutually complementary.
The DUAL Framework
The Diverse U-statistic Aggregation with Learned kernels (DUAL) framework rests on two methodological pillars designed to navigate the trade-off between diversity and individual kernel power.
1. Learning Diverse Kernels
Rather than simply summing test statistics, DUAL treats kernel aggregation similarly to portfolio optimization. The framework computes a covariance matrix of the U-statistics derived from different kernels. By incorporating this covariance into a Mahalanobis-style aggregated statistic, the model explicitly penalizes redundancy. If two kernels are highly correlated, the system downweights their joint contribution. This forces the optimization process to find a pool of kernels that capture diverse, non-overlapping features of the data.
2. Selection Inference via Data Splitting
To solve the "weak kernel" problem, DUAL employs a rigorous selection inference process using a train-test split:
- Training Phase: Kernels are optimized to maximize the diversity-aware aggregated statistic, creating a candidate pool of powerful and distinct kernels.
- Testing Phase: The framework evaluates the "sign" of the kernel statistics on the training data. Only those components that show consistent evidence across both data splits are included in the final test.
To determine the final p-value, DUAL utilizes a Wild Bootstrap method. This ensures that the framework maintains non-asymptotic control over the Type-I error, even after the complex process of selecting kernels based on the training data.
Experimental Evaluation
The authors evaluated DUAL across a variety of challenging benchmarks for both two-sample and independence testing:
- Two-sample Testing: Benchmarks included the BLOB dataset (complex local structures), MNIST vs. DCGAN (comparing real vs. synthetic digits), and ImageNet vs. ImageNetV2 (detecting subtle distribution shifts).
- Independence Testing: Benchmarks included the Higgs physics dataset and multi-view image dependencies using MNIST and CIFAR-10.
Key Results
- Superior Power: MMD-DUAL and HSIC-DUAL consistently achieved higher test power than state-of-the-art baselines like MMD-Agg or MMD-FUSE. On the BLOB dataset, DUAL reached near-perfect power with significantly fewer samples than competing methods.
- Robustness: The optimization process proved robust to initialization. Even when starting with randomly chosen kernels, DUAL successfully recovered a powerful kernel pool.
- Ablation Studies: Experiments confirmed that both the "Diversity" (D) and "Selection" (S) components are vital. Removing either component resulted in a significant drop in performance, validating the integrated DUAL approach.
Conclusion and Future Work
DUAL demonstrates that diversity is not just a heuristic but a statistical necessity for effective kernel aggregation. By formally navigating the power-diversity trade-off and implementing selection inference, DUAL provides a more sensitive and reliable tool for non-parametric testing.
While the framework introduces some computational overhead—specifically $O(n^2)$ complexity relative to sample size and $O(c^3)$ for the kernel bank size $c$—the gains in statistical power often outweigh these costs. Future research may extend this selection inference logic to goodness-of-fit testing and explore more advanced ensemble-regularized optimization techniques to further scale the approach.
Summary updated