Kernel Quantile Discrepancies
- Kernel Quantile Discrepancies are defined via RKHS directional quantile embeddings that generalize mean embeddings to capture distributional quantiles.
- They aggregate directional quantile differences across levels using weighting measures, yielding near-linear estimators for effective two-sample testing.
- KQDs ensure identifiability and enhanced separation power under weaker kernel conditions compared to MMD, making them applicable even with non-characteristic kernels.
Kernel Quantile Discrepancies (KQDs) are a family of kernel-based probability metrics built from kernel quantile embeddings (KQEs), rather than from kernel mean embeddings alone. In the RKHS formulation introduced in "Kernel Quantile Embeddings and Associated Probability Metrics" (Naslidnyk et al., 26 May 2025), a distribution is represented through directional quantiles of the canonical feature map, and discrepancies are obtained by aggregating quantile differences across quantile levels and RKHS directions. This construction extends the mean-based logic of the maximum mean discrepancy (MMD), yields probability metrics under weaker kernel assumptions than MMD, recovers kernelised sliced Wasserstein distances when quantile levels are uniformly weighted, and admits near-linear estimators that were shown to be competitive in two-sample testing (Naslidnyk et al., 26 May 2025).
1. RKHS quantiles and kernel quantile embeddings
Let be a Borel space, let be a measurable positive definite kernel, and let be its RKHS with unit sphere . Writing the canonical feature map as , each direction induces an RKHS linear functional
For a probability measure , the pushforward is therefore the one-dimensional distribution of when 0 (Naslidnyk et al., 26 May 2025).
The directional kernel quantile embedding at quantile level 1 is
2
where 3 is the univariate 4-quantile of the real-valued law 5. Hence KQEs are obtained by first projecting 6 onto a one-dimensional RKHS direction, then taking an ordinary univariate quantile, and finally re-embedding that scalar quantile along the same direction. The family
7
is the KQE of 8.
A centered variant is also defined. If 9 denotes the kernel mean embedding, then
0
Centering restores location equivariance for quantiles of 1. For discrepancies between two distributions, however, the location non-equivariance of the uncentered KQE cancels, so the uncentered form is typically used (Naslidnyk et al., 26 May 2025).
These objects are generalized quantiles in a precise sense. They are standard univariate quantiles computed after projection in 2. In finite-dimensional 3, they coincide with multivariate directional quantiles of the feature vector. This places KQEs alongside projection-based multivariate quantile constructions, but specifically in RKHS geometry.
2. Discrepancy families and their relation to MMD and sliced Wasserstein
Given 4, a measure 5 on 6, and a direction 7, the directional discrepancy is
8
Because both embeddings are scalar multiples of 9, the RKHS norm simplifies to
0
KQDs arise by aggregating these one-dimensional discrepancies over directions (Naslidnyk et al., 26 May 2025).
| Object | Definition | Role |
|---|---|---|
| 1-KQD2 | 3 | Expected discrepancy over directions |
| sup-KQD4 | 5 | Maximal directional discrepancy |
| Centered variants | Replace 6 by 7 | Adds an MMD-related mean term |
The weighting measure 8 determines how quantile levels are emphasized. The default choice is Lebesgue measure 9 on 0, but alternative densities can up- or down-weight tails. With 1, the directional discrepancy becomes exactly a one-dimensional Wasserstein distance:
2
Consequently,
3
and
4
These are kernelised analogues of expected sliced Wasserstein and max-sliced Wasserstein. When 5, 6, and 7 is uniform on the Euclidean unit sphere, they recover standard expected sliced Wasserstein and max-sliced Wasserstein (Naslidnyk et al., 26 May 2025).
The comparison with MMD is structural. The squared MMD is
8
so MMD compares means in RKHS, whereas KQDs compare directional quantiles. For 9 and 0, the centered expected KQD satisfies
1
with an analogous identity for sup-KQD. The accompanying thesis describes the centered construction as a “mid-point” interpolant between MMD and sliced-Wasserstein-type terms, in a sense analogous to Sinkhorn divergences, though with flexible kernel choice rather than an entropic regularization scheme tied to the energy distance (Naslidnyk, 25 Feb 2026).
3. Identifiability and probability-metric structure
The central theoretical claim is that KQEs determine distributions under weaker conditions than those usually required for MMD. The relevant assumptions are:
- 2 is Hausdorff, separable, and 3-compact;
- 4 is continuous and separating on 5, meaning 6 for 7.
Under these assumptions, the paper proves an RKHS analogue of the Cramér–Wold theorem: the map
8
is injective, and the kernel is therefore quantile-characteristic (Naslidnyk et al., 26 May 2025).
A further theorem establishes that every mean-characteristic kernel is quantile-characteristic, but not conversely. The converse fails; bounded-degree polynomial kernels are given as examples of kernels that are not mean-characteristic but are quantile-characteristic under the RKHS Cramér–Wold theorem. The immediate consequence is that KQDs can separate distributions in settings where MMD cannot. Whenever 9, an injective KQD also yields 0, but the reverse implication need not hold.
The metric statements follow from the injectivity result together with full-support conditions on the aggregation measures. If 1 has full support on 2, then sup-KQD3 is a distance. If, in addition, 4 has full support on 5, then 6-KQD7 is a distance. A concrete example of such a direction law is the pushforward to 8 of a centered Gaussian measure on 9 with non-degenerate covariance operator (Naslidnyk et al., 26 May 2025).
This weaker dependence on kernel assumptions is one of the main distinctions from MMD. MMD is a probability metric only when the kernel is characteristic. KQDs, by contrast, are probability metrics under continuous, separating kernels together with support assumptions on 0 and 1. This suggests that the quantile representation is not merely an alternative parameterization of the same information carried by the RKHS mean; it is strictly richer in separation power for some non-characteristic kernels.
4. Estimation, computational schemes, and statistical guarantees
For samples 2 and a fixed direction 3, the empirical KQE is based on order statistics of the projected values 4. Denoting by 5 the 6-th order statistic,
7
Thus empirical KQEs require projection and sorting rather than pairwise kernel summation (Naslidnyk et al., 26 May 2025).
For the expected discrepancy, a Monte Carlo estimator draws directions 8 and computes
9
where 0 is the density of 1. When 2, 3.
A practical sampling scheme for directions uses a centered Gaussian measure 4 on 5 with covariance operator
6
for a reference measure 7 with full support. With reference points 8 and 9, one forms
0
normalizes 1, projects the data along 2, sorts the projected values, and averages the resulting directional discrepancies. Per direction, the cost is 3 for evaluations, 4 for 5 via 6, and 7 for sorting. The total cost is
8
and taking 9 yields an overall 00 estimator (Naslidnyk et al., 26 May 2025).
Statistically, the empirical KQE has the classical 01 rate for fixed 02 and 03 when the density of 04 is bounded away from zero. For 05-KQD06, if 07 has a density and 08 and 09, then with probability at least 10,
11
with 12. For 13, the same 14 rate is attainable under integrability conditions on 15 and 16 (Naslidnyk et al., 26 May 2025).
For two-sample testing, the statistic is typically calibrated by permutation. The pooled sample is relabeled 17 times, with the paper using values such as 18, and the empirical 19-quantile is used to control Type I error at level 20, such as 21. The reported experiments show that near-linear 22-KQD often outperforms near-linear MMD approximations, while quadratic centered 23-KQD performs similarly to quadratic MMD statistics (Naslidnyk et al., 26 May 2025).
5. Empirical behavior and practical deployment
The empirical study includes several benchmark regimes. In a power-decay experiment with 24 and 25, sample size 26, and dimension ranging from 27 to 28, near-linear 29-KQD exhibited the slowest power decay among the reported methods, outperforming near-linear MMD-Multi and remaining competitive with quadratic-time MMD. In a one-dimensional Laplace-versus-Gaussian experiment with polynomial kernel degree 30, MMD failed because matched moments yielded identical KMEs, whereas KQDs gained power with sample size and detected the difference. On Galaxy MNIST and CIFAR-10 versus CIFAR-10.1, near-linear KQDs were reported to outperform near-linear MMD-Multi, while quadratic centered 31-KQD and quadratic MMD showed similar power. Runtime measurements aligned with the 32 analysis, and Type I error was controlled at the nominal level under permutation calibration (Naslidnyk et al., 26 May 2025).
Practical guidance in the paper and thesis is correspondingly explicit. Any continuous, separating kernel suffices for KQD to be a metric; characteristicness is not required. RBF and Laplacian kernels are presented as good defaults, with the median heuristic for RBF bandwidth. Polynomial kernels are also admissible and are especially useful for demonstrating the gap between mean-characteristicness and quantile-characteristicness (Naslidnyk, 25 Feb 2026).
The choice of 33 controls sensitivity across the distribution. Uniform 34 recovers kernelised sliced Wasserstein. Non-uniform 35 can emphasize tails or central mass. The direction distribution 36 requires special care because there is no uniform measure on the sphere of an infinite-dimensional RKHS; the Gaussian construction on 37 addresses this directly. A practical reference measure is the balanced empirical mixture 38, though Gaussian or uniform reference distributions scaled by the data interquartile range are also proposed (Naslidnyk et al., 26 May 2025).
The papers further recommend 39 for near-linear computation, increasing 40 when lower Monte Carlo variance is desired. With respect to 41, the stated guidance is that 42 is more robust to outliers, while 43 is often a good practical trade-off and aligns with one-dimensional 44. In practice, 45-KQD is described as simpler and stable, whereas exact optimization of sup-KQD is costly and NP-hard in general (Naslidnyk et al., 26 May 2025).
A common misconception is that KQDs are simply MMD with a different estimator. The construction and theorems do not support that interpretation. KQDs replace mean comparison by a directional-quantile representation and can separate distributions under strictly weaker kernel assumptions than MMD. Another misconception is that the expected discrepancy depends on a canonical “uniform” distribution over RKHS directions; in infinite-dimensional 46, such a uniform measure does not exist, which is why the Gaussian pushforward construction is central.
6. Related quantile-based kernel constructions, limitations, and open directions
KQDs sit within a broader landscape of quantile-based kernel methods, but adjacent constructions are not identical. On the one-dimensional real line, the MMD with the negative distance kernel 47 coincides with the energy distance up to an additive constant. In "Wasserstein Gradient Flows of MMD Functionals with Distance Kernel and Cauchy Problems on Quantile Functions" (Duong et al., 2024), this discrepancy is recast in quantile space via an isometric embedding of 48 into the cone of quantile functions in 49. That work provides an explicit convex functional on quantiles, a subdifferential characterized through the target CDF, existence and uniqueness of the associated gradient flow, invariant sets, instantaneous smoothing for certain targets, and efficient implicit Euler updates by bisection. The relation is conceptual rather than definitional: it shows that some kernel discrepancies admit especially transparent quantile-space formulations in one dimension, whereas KQDs as introduced in (Naslidnyk et al., 26 May 2025) are RKHS directional-quantile metrics for general Borel spaces.
A separate line of work uses similar language in a regression setting. In "fastkqr: A Fast Algorithm for Kernel Quantile Regression" (Tang et al., 2024), the phrase “kernel quantile discrepancy principle” refers to fitting conditional quantile functions by minimizing the pinball loss with RKHS regularization, together with exact finite-smoothing algorithms and spectral acceleration. That object concerns conditional prediction and asymmetric residuals, not unconditional probability metrics between distributions. The distinction matters because the KQD literature addresses two-sample comparison, identifiability, and probability-metric structure, whereas kernel quantile regression addresses estimation of conditional quantiles.
The principal limitations of KQDs are also explicit in the source material. Sorting is required in every sampled direction, so the method trades quadratic pairwise kernel summation for repeated projection-and-order-statistic computations. Monte Carlo variance depends on the number of sampled directions 50. Exact sup-KQD optimization is expensive. For 51, retaining 52 rates requires additional regularity conditions involving 53. The choices of 54 and 55 introduce hyperparameters, and the topology induced by KQD, including its relation to weak convergence, remains an open problem in the thesis summary (Naslidnyk, 25 Feb 2026).
Open directions stated in the papers include improved KQE and KQD estimators, adaptive or learned direction sampling, better quadrature over 56, kernel selection for test power, conditional quantile embeddings in RKHS, stronger finite-sample guarantees for 57, and more principled optimization procedures for approximating sup-KQD. Taken together, these indicate that KQDs are best understood as a new RKHS representation of probability measures based on directional quantiles: one that strictly generalizes mean embeddings in separation power for some kernels, connects naturally to sliced Wasserstein geometry, and preserves scalable nonparametric estimation (Naslidnyk et al., 26 May 2025).