Abstract
Kernel mean embeddings represent probability distributions as points in a high-dimensional Reproducing Kernel Hilbert Space (RKHS). While effective, these methods are notoriously sensitive to kernel hyperparameters, particularly in unsupervised settings where cross-validation is unavailable. This paper introduces the Bayesian Kernel Embedding (BKE) framework, which places a Gaussian Process prior over the embedding. This allows for principled hyperparameter optimization through a closed-form marginal pseudolikelihood, significantly outperforming standard heuristics like the "median heuristic" in tasks such as hypothesis testing and causal discovery.
Introduction
Kernel methods are fundamental in non-parametric statistics, enabling tasks like two-sample testing and independence testing. The kernel mean embedding is central to these methods, but its reliance on manually tuned hyperparameters—like the bandwidth—is a significant weakness. In the absence of a supervised loss function, the "median heuristic" is commonly used but often fails to capture the relevant scales of the data. This work addresses this gap by casting kernel embedding estimation as a Bayesian inference problem.
The Bayesian Kernel Embedding (BKE) Framework
The authors propose treating the mean embedding $\mu(x)$ as a latent function with a Gaussian Process (GP) prior. To ensure the prior is well-defined within the RKHS, they employ a specific covariance structure ($r_\theta$). By defining a conjugate likelihood that links the true mean embedding to the empirical mean estimator (motivated by the Central Limit Theorem), they derive a full posterior distribution for the embedding.
This Bayesian approach provides two key advantages:
- Uncertainty Quantification: It offers a posterior distribution rather than a point estimate, allowing for uncertainty assessment in the "witness function" (the difference between embeddings).
- Shrinkage as a Posterior Mean: The posterior mean naturally incorporates shrinkage, providing a Bayesian justification for frequentist regularization techniques.
Bayesian Kernel Learning (BKL)
The primary contribution is a principled method for hyperparameter selection called Bayesian Kernel Learning (BKL). Because the model is conjugate, the authors derive a closed-form marginal pseudolikelihood. Maximizing this objective allows for the automatic discovery of optimal kernel parameters, such as lengthscales, directly from the data. This serves as a superior "drop-in" replacement for the median heuristic.
Experimental Results
The BKL method was evaluated against the median heuristic across several benchmarks. In a "Grid of Gaussians" two-sample test, BKL successfully identified differences in distribution where the median heuristic failed completely.
In real-world applications, BKL was applied to the Ozone dataset for causal structure discovery. Using the PC algorithm, BKL correctly identified the causal link from Temperature to Ozone, a relationship missed by previous state-of-the-art methods relying on standard heuristics.
Discussion and Limitations
While BKL provides a robust alternative to heuristics, it introduces computational challenges. The matrix inversions required for the marginal likelihood lead to $O(n^3)$ complexity, limiting its direct application to very large datasets. Future work aims to integrate scalable GP approximations, such as Random Fourier Features or Nyström methods, to extend BKL to big data regimes.
Conclusion
By moving from point estimation to a Bayesian framework, this work provides a theoretically grounded and practically superior method for learning kernel embeddings. BKL eliminates the need for sub-optimal heuristics, offering a principled approach that enhances the power and reliability of kernel-based unsupervised learning.
Summary updated