Papers
Topics
Authors
Recent
Search
2000 character limit reached

Conditional Maximum Mean Discrepancy (CMMD)

Updated 14 July 2026
  • Conditional Maximum Mean Discrepancy (CMMD) is a kernel-based metric that quantifies differences between conditional distributions via RKHS embeddings and the Hilbert–Schmidt norm.
  • It is applied non-parametrically in generative modeling, image classification, domain adaptation, and causal analysis by comparing conditional embedding operators.
  • CMMD variants use operator-smoothing and regularization techniques to manage bias-variance trade-offs while ensuring identifiability under characteristic kernels.

Searching arXiv for recent and foundational papers on Conditional Maximum Mean Discrepancy and related kernel-embedding formulations. Conditional Maximum Mean Discrepancy (CMMD) is a kernel-based discrepancy for comparing conditional distributions through reproducing kernel Hilbert space (RKHS) embeddings. In its original formulation, CMMD is the Hilbert–Schmidt norm between two conditional embedding operators, so that two conditionals are identified by the vanishing of this operator difference under characteristic-kernel and regularity assumptions (Ren et al., 2016). Subsequent work has broadened the term to a family of conditional-distribution metrics indexed by an operator-smoothing level, with three named special cases—CMMD0_0, CMMD1_1, and CMMD2_2—as well as closely related pointwise and averaged variants such as MCMD and AMCMD (Moskvichev et al., 4 May 2026, Goff et al., 23 Oct 2025, Broadbent et al., 14 Apr 2025). Across this literature, CMMD functions as a non-parametric tool for generative modeling, image classification, domain adaptation, distribution compression, model averaging, and causal transferability analysis.

1. Operator-theoretic foundation

Let XXX \in \mathcal X and YYY \in \mathcal Y be random variables, with RKHSs F\mathcal F and G\mathcal G induced by kernels kxk_x and kyk_y. The basic construction uses the cross-covariance and auto-covariance operators

CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,

and defines the conditional embedding operator by

1_10

This operator satisfies 1_11 and 1_12 (Ren et al., 2016).

For two conditional distributions 1_13 and 1_14 with embedding operators 1_15 and 1_16, the population CMMD is

1_17

If 1_18 is characteristic and mild conditions hold, 1_19 if and only if the conditional laws agree (Ren et al., 2016).

The empirical estimator is obtained from finite samples by replacing the population operators with regularized kernel estimators. Given samples

2_20

and Gram matrices 2_21 together with cross-Gram terms, one defines

2_22

and the empirical CMMD expands into a trace expression involving only Gram matrices: 2_23 with 2_24 and 2_25 (Ren et al., 2016).

A classification-specialized formulation embeds labels or predicted soft labels in an RKHS and computes the discrepancy between a “true” conditional distribution 2_26 and a predicted conditional distribution 2_27. In that setting, the same operator form is written as a CMMD loss between source and target conditional embeddings and is used directly as a training criterion (Ren et al., 2020).

A later unifying treatment writes the difference of conditional mean operators as

2_28

and defines a level-2_29 CMMD by

XXX \in \mathcal X0

This places several previously separate constructions into one hierarchy (Moskvichev et al., 4 May 2026).

Variant Definition Emphasis
CMMDXXX \in \mathcal X1 XXX \in \mathcal X2 conditional mean operators
CMMDXXX \in \mathcal X3 XXX \in \mathcal X4 conditional mean embeddings
CMMDXXX \in \mathcal X5 XXX \in \mathcal X6 joint mean embeddings
MCMD XXX \in \mathcal X7 fixed query point XXX \in \mathcal X8
AMCMD XXX \in \mathcal X9 averaged CME discrepancy

The hierarchy obeys explicit inequalities: YYY \in \mathcal Y0 If YYY \in \mathcal Y1, then YYY \in \mathcal Y2 (Moskvichev et al., 4 May 2026). The accompanying interpretation is that multiplication by YYY \in \mathcal Y3 smooths differences in low-density directions of the covariate distribution.

The pointwise MCMD fixes a query YYY \in \mathcal Y4 and compares two conditional distributions only at that covariate value: YYY \in \mathcal Y5 Because the kernel on YYY \in \mathcal Y6 is characteristic, MCMD is nonnegative, symmetric, satisfies the triangle inequality, and vanishes if and only if the two conditional laws at YYY \in \mathcal Y7 coincide (Goff et al., 23 Oct 2025).

AMCMD introduces an additional weighting law YYY \in \mathcal Y8 on the covariate space: YYY \in \mathcal Y9 When F\mathcal F0 differs from the observed marginals, AMCMD can focus on particular regions of F\mathcal F1. Under characteristic F\mathcal F2, mutual absolute continuity, and regular versions of the conditionals, AMCMD is zero if and only if the two conditional laws agree for F\mathcal F3-almost every F\mathcal F4; with bounded Radon–Nikodym derivatives it also satisfies the triangle inequality and defines a metric on conditional laws (Broadbent et al., 14 Apr 2025).

3. Estimation, convergence, and testing

The empirical estimation of CMMD and its variants is dominated by kernel ridge-type inversions. For CMMDF\mathcal F5, CMMDF\mathcal F6, CMMDF\mathcal F7, and general level-F\mathcal F8 estimators, the standard constructions use Gram matrices such as F\mathcal F9 and regularized inverses G\mathcal G0 or G\mathcal G1, with closed-form trace expressions for the resulting discrepancies (Moskvichev et al., 4 May 2026).

For pointwise MCMD, one estimates conditional embeddings by regularized least squares: G\mathcal G2 and then computes

G\mathcal G3

Under boundedness assumptions on G\mathcal G4 and G\mathcal G5 with G\mathcal G6, the conditional mean embedding error is G\mathcal G7, and the plug-in MCMD estimator is consistent with the same induced rate (Goff et al., 23 Oct 2025).

For AMCMD, a closed-form estimator is obtained by expanding the RKHS norm and rearranging traces: G\mathcal G8 with computational cost G\mathcal G9. Under bounded universal kxk_x0, bounded kxk_x1, smoothness of the true conditional operators, and regularization kxk_x2 with kxk_x3, this estimator converges at rate

kxk_x4

(Broadbent et al., 14 Apr 2025).

A distinct development is the doubly robust estimator for CMMD. It introduces an indicator kxk_x5 and propensity kxk_x6, forms pseudo-outcomes that combine inverse-propensity weighting with regression-style conditional mean models, and assembles an operator kxk_x7 whose Hilbert–Schmidt norm yields DR-CMMDkxk_x8 and whose trace form yields DR-CMMDkxk_x9. The doubly robust property is that consistency is retained if either the propensity estimator converges or the conditional mean regression model converges (Moskvichev et al., 4 May 2026).

CMMD also supports hypothesis testing. When kyk_y0, one can pool the samples, randomly split them into two groups, recompute the discrepancy, and obtain an empirical null by bootstrap. When kyk_y1, the same work proposes conditional resampling: for each sample, resample a Bernoulli label using kyk_y2, reassign the sample to kyk_y3 or kyk_y4, recompute CMMD, and approximate the null distribution that way (Moskvichev et al., 4 May 2026).

4. Deep-learning objectives: generative modeling and image classification

The first explicit deep-learning use of CMMD was in Conditional Generative Moment-Matching Networks (CGMMN), which train a conditional generator kyk_y5 by stochastic gradient descent so that the generated conditional distribution matches the data conditional distribution under empirical CMMD (Ren et al., 2016). The loss depends on the generated outputs only through Gram matrices on the response variables, and gradients are computed by back-propagation through the trace form. The paper evaluates CGMMN on predictive modeling, contextual generation, and Bayesian dark knowledge, and reports competitive performance across these tasks (Ren et al., 2016).

In image classification, CMMD is used differently: the discrepancy is computed between the true label conditional distribution and the model’s predicted label conditional distribution. The main issue identified for this setting is that a fixed Gaussian or Laplace kernel on raw inputs often fails to distinguish within-class from between-class samples. To address this, the Kernel Learning Network (KLN) replaces kyk_y6 by kyk_y7, where kyk_y8 is a learnable injective map implemented by the encoder of an auto-encoder and kyk_y9 is a fixed characteristic kernel on the latent representation. The resulting objective is

CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,0

and, in the semi-supervised case,

CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,1

where

CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,2

Training proceeds by mini-batch stochastic gradient descent or Adam on disjoint mini-batches CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,3 and CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,4, latent features CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,5, current pseudo-labels CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,6, the corresponding Gram matrices, and the total loss (Ren et al., 2020).

Theoretical support for KLN comes from two statements: a characteristic kernel composed with an injective map remains characteristic, and the auto-encoder penalty encourages the encoder to have a left inverse on the data manifold. This suggests that the learned compound kernel preserves the discriminative guarantees associated with characteristic kernels while improving class separation (Ren et al., 2020).

On MNIST, SVHN, CIFAR-10, and CIFAR-100, the reported supervised test error rates are lower for KLN than for CGMMN-CNN:

Dataset CGMMN-CNN error (%) KLN error (%)
MNIST 0.45 0.39
SVHN 2.01 1.56
CIFAR-10 6.61 5.15
CIFAR-100 24.84 22.63

The same study reports semi-supervised errors of CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,7 on MNIST with 100 labels, CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,8 on SVHN with 1,000 labels, and CXX=E[ϕx(X)ϕx(X)]μxμx,CYX=E[ϕy(Y)ϕx(X)]μyμx,C_{XX}=E[\phi_x(X)\otimes \phi_x(X)]-\mu_x\otimes \mu_x,\qquad C_{YX}=E[\phi_y(Y)\otimes \phi_x(X)]-\mu_y\otimes \mu_x,9 on CIFAR-10 with 4,000 labels. Ablations replacing the jointly learned encoder with identity, PCA, or a pre-trained auto-encoder produce much worse accuracy, and kernel histograms show substantially cleaner same-class versus different-class separation under KLN (Ren et al., 2020).

5. Domain adaptation, compression, and model averaging

In domain adaptation, CMMD arises as a special case of a unified joint MMD (JMMD) when the label kernel is chosen as the Kronecker-delta kernel

1_100

Under that choice, the unified trace formula becomes a sum of classwise MMD terms and recovers the standard class-conditional alignment objective (Wang et al., 2021).

The same work identifies two drawbacks. First, class-conditional alignment may degrade the feature–label dependence that benefits classification, because it minimizes the discrepancy between joint feature-label embeddings without explicitly preserving the domain-specific dependence norms. Second, CMMD and its weighted variant are sensitive to label-distribution shift: if 1_101, the resulting classwise mean alignment can be incorrect. The proposed remedies are a modified MMD matrix

1_102

which incorporates Hilbert–Schmidt independence criterion terms to promote dependence, and a robust label-kernel 1_103 whose entries implement per-class reweighting by the ratio 1_104 (Wang et al., 2021).

For distribution compression, AMCMD supplies a direct target for preserving conditional distributions rather than only the joint distribution. This leads to Average Conditional Kernel Herding (ACKH), a greedy linear-time algorithm, and Average Conditional Kernel Inducing Points (ACKIP), a jointly optimized alternative with the same linear dependence on the original sample size. The same paper introduces joint-distribution baselines JKH and JKIP; empirically, ACKIP outperforms both joint distribution compression and greedy conditional compression, while JKIP consistently outperforms JKH (Broadbent et al., 14 Apr 2025).

For conditional generative model averaging, CMMD is used in a sample-based, likelihood-free setting. Given candidate generators 1_105 and mixture weights 1_106, the empirical cMMD loss is

1_107

StaticMA constrains the weights to be fixed in 1_108 and solves a convex quadratic program over the simplex, while MoEMA parameterizes input-adaptive weights through a softmax neural-network gate and optimizes the same objective by SGD or Adam. The framework establishes in-sample and out-of-sample asymptotic optimality for StaticMA and MoEMA, together with consistency of the estimated adaptive weight function under regularity conditions (Gong et al., 5 Jul 2026).

6. Causal transferability, empirical behavior, and practical considerations

MCMD is used as an atomic component in the Structural Causal Model Distance (SCMD). For two structural causal models, SCMD sums pairwise interventional discrepancies, each of which reduces to MCMD when no additional adjustment set is required. This construction is designed to capture differences in causal effects in addition to observational distributional differences (Goff et al., 23 Oct 2025).

Two toy cases in the SCMD study illustrate the role of conditional discrepancies. In a linear-Gaussian case with the same graph but different slope parameters, MCMD detects the parametric shift directly through the change in 1_109. In a second case with reversed graph structure but the same observational joint distribution, both 1_110 and 1_111 are nonzero, so SCMD is positive although observational MMD is zero (Goff et al., 23 Oct 2025).

Several recurring interpretive points emerge across the literature. One is terminological: CMMD does not denote a single unique construction. Depending on the paper, it may refer to an operator norm between conditional mean operators, an average of pointwise conditional mean embedding differences, a pointwise conditional discrepancy, or a special label-kernel instance of a joint-distribution discrepancy (Moskvichev et al., 4 May 2026). A second is that more smoothing is not uniformly preferable. In synthetic experiments for level-1_112 CMMD, extra smoothing hurts power in one setting and helps up to a point in another, making the bias–variance trade-off induced by 1_113 explicit (Moskvichev et al., 4 May 2026). A third is that conditional alignment objectives can have side effects: in domain adaptation they may reduce discriminability or mis-handle label shift unless additional corrections are introduced (Wang et al., 2021).

The practical recommendations in the cited work are correspondingly technical. Characteristic kernels are central because they ensure identifiability of conditional laws; typical choices include Gaussian, Laplacian, and Matérn kernels, while mixtures of Gaussian kernels at multiple scales are used in KLN (Moskvichev et al., 4 May 2026, Ren et al., 2020). Regularization 1_114 ensures stable inversion of empirical covariance operators, with conditions such as 1_115 and 1_116 used for consistency statements (Moskvichev et al., 4 May 2026). Naïve estimators are typically 1_117 because of matrix inversions, motivating low-rank approximations such as Nyström and random Fourier features, distributed or mini-batch variants, and primal-form computations when 1_118 is finite-dimensional (Ren et al., 2016, Moskvichev et al., 4 May 2026).

Taken together, these developments position CMMD not as a single formula but as a kernel-embedding framework for conditional-distribution comparison. Its common core is the use of RKHS structure to represent and compare conditional laws non-parametrically; its differences lie in whether one compares operators, pointwise embeddings, averaged embeddings, or joint embeddings, and in how those objects are estimated and optimized for a particular task.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Conditional Maximum Mean Discrepancy (CMMD).