# Kernel Selection is Model Selection: A Unified Complexity-Penalised Approach for MMD Two-Sample Tests

*Yijin Ni, Xiaoming Huo*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/153658) · [OpenReview](https://openreview.net/forum?id=JhQRP9MfR8) · [alphaXiv](https://www.alphaxiv.org/abs/2605.06883) · [Open on the map](../papers.html#p153658)

Category: [Causality, Privacy & Learning Theory](../pcat/11.md) › [Conformal Prediction](../pgroup/35.md) · Type: new method · Keywords: kernel selection, model selection, complexity penalisation, two-sample testing, uniform concentration bound, grid-free optimisation

## Summary
CP-MMD introduces a complexity-penalised criterion that enables grid-free kernel selection for MMD two-sample tests while preserving Type-I validity and maximising test power.

## Explained to a 5-year-old
We have a game where we want to know if two groups of things are the same or different. The game uses a special rule that depends on a shape called a kernel. Choosing the best shape is hard because we have to look at the data. The new idea makes a rule that automatically picks the best shape while staying fair. This helps the game work better and be more accurate.

## Explained to a 5-year-old, longer
Imagine you have two piles of objects, maybe apples and oranges. You want to know if the two piles are the same kind or different. To decide, you compare them using a rule that looks at how similar they look. That rule needs a special tool called a kernel to work. The kernel can be shaped in many ways, like a brush that can be thick or thin. Picking the perfect brush is tricky because you have to think about the objects you are comparing. If you pick a brush that is too fancy, you might get confused and make the wrong decision. If you pick a brush that is too simple, you might miss important differences. The new idea creates a smart rule that automatically chooses the best brush without guessing. It also makes sure the rule stays fair, so you never say the piles are different when they are actually the same. This way the comparison works better and gives more reliable answers. It helps scientists and engineers compare data in many fields, like medicine or finance.

## For a technical reader
The paper reframes kernel selection for two-sample testing as a model selection problem, addressing the statistical issue of optimisation bias. It introduces a uniform concentration bound that penalises the complexity of the kernel search space, enabling direct optimisation over continuous parametric kernels without discrete grids. This yields a criterion that preserves Type-I error control while maximising true test power. The method is validated on linear, polynomial, and deep kernel families, showing comparable or superior performance to existing approaches.

## Problem
Choosing a kernel for the Maximum Mean Discrepancy statistic is crucial for test power, but data-driven optimisation breaks the i.i.d. assumption and leads to overfitting or limits scalability. Existing approaches either ignore dependence or rely on finite grids, preventing continuous optimisation of rich kernel families.

## Method
The approach formulates kernel selection as a model selection problem and derives a complexity-penalised criterion based on a uniform concentration inequality that bounds the post-optimisation distribution. This penalty absorbs optimisation cost, allowing direct maximisation over continuous parametric kernel classes without grids.

## Results
The approach achieves test power that matches or exceeds existing methods across linear, polynomial, and deep kernel regimes.

## Contributions
It provides a theoretical framework that unifies kernel selection with model selection, yields a grid-free optimisation criterion with unconditional Type-I validity, and demonstrates superior power on a range of kernel families.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/153658)
