CC-MMD: Correcting MMD When Your Data Is a Contaminated Mixture
Contaminated data need not be discarded or treated as the estimand: with sparse trusted labels and abundant noisy supervision, a design-based correction can make distributional objectives target the latent clean component.
On this page
A buyer holds 1 million scraped rows and a vendor-supplied confidence score, yet must decide whether to accept the lot. The usual advice splits two ways: trust the score and keep only the top few thousand rows, or take everything and assume the noise averages out. Both routes lose information. Gligić and Farahi propose a third: treat the score as a rough weight, audit a small random subset by hand, and use those exact labels to correct the distributional objective itself. They call it CC-MMD [1].
Most teams pick one of two bad options
The default assumption is that dirty data leaves you two choices: filter it or swallow it. Filtering means setting a threshold on the proxy score and keeping the high-confidence rows. Swallowing means taking the full pool and betting that noise cancels at scale. Both sound reasonable until you write down what the pooled sample actually is.
The paper models the observed pool as r = (1−ε)q + εz. Here q is the target distribution you want, z is an unknown contaminant, and ε is the contamination rate. You never see the indicator telling you whether a given row came from q or from z. What you do have is a proxy score for every row and exact labels on a small audited subset [1].
- Keep only high scores or only the audited rows: sample size collapses from N to m, variance grows, and low-scoring but genuine target rows get cut along with the junk.
- Keep everything: the objective converges to MMD²(p, r) rather than MMD²(p, q), and no amount of extra data fixes the gap once ε is large.
- What both routes share: they treat noisy full-coverage information and trusted sparse information as mutually exclusive.
The paper's claim is that these two information sources are complements, not substitutes. The full pool supplies coverage and low variance; the audit supplies an unbiased anchor for the correction.
What CC-MMD actually estimates, and which terms it touches
MMD is a kernel-based distance between two distributions. Squared and expanded, it has three terms: kernel similarity within the clean reference sample, kernel similarity within the target sample, and the cross term between them. Contamination only reaches the last two. The first term is untouched.
| Term | Directly computable? | What CC-MMD does |
|---|---|---|
| p-p (within clean reference) | Yes, all X come from p | Left alone, computed as is |
| q-q (within target sample) | No, the pool mixes in z | Proxy scores as base, audited residual correction added |
| p-q (clean sample vs target) | No, same problem | Same correction, with weight N/m |
The interesting part is how the second and third terms get fixed. Most debiasing schemes require the proxy score to be a calibrated posterior, meaning the number equals the probability that the row comes from the target given its features. The paper explicitly does not assume this. Scores come from classifiers fit on finite, possibly shifted data, and conditional calibration is essentially unverifiable in high dimensions. The score is treated as a rough weight, nothing more.
The actual correction quantity is the residual Δ_j = I_j − Ĩ_j, the gap between the true label and the proxy score on audited points. That gap is knowable only where you audited, so the correction starts there and is scaled back up to the full pool through the sampling design.
How a small audited subset gets scaled up into a full correction
The audit set L is a simple random sample without replacement from the N pooled indices, with size m ≪ N, so each point enters with probability m/N. Because the sampling mechanism is known, one audited point stands in expectation for N/m points of the same kind. That is exactly what Horvitz–Thompson weighting does: the residual terms are multiplied by N/m so that, in expectation, they equal the full residual sum.
Theorem 2.1 in the paper states precisely this: the corrected q-q and p-q kernel sums are design-unbiased for their oracle counterparts, where the oracle is what you would have computed had you known which rows were clean. The result assumes nothing about proxy quality. Scores can be poor, and the expectation still lines up, provided the audit is random [1].
One distinction matters here. Design unbiasedness holds for the kernel sums, not for the final ratio-form estimator. A ratio of two unbiased quantities is still biased, so the paper handles that layer separately with a ratio linearization, then layers on asymptotic normality and consistency for the population target MMD²(p,q;k).
What it beat: 200 repeated regressions and a generative task at ε=0.60
The empirical work comes in three layers. The first is a contamination sweep in simulation: as the contamination rate climbs, a naive MMD computed directly on the mixed pool drifts away from the oracle, while CC-MMD tracks the oracle throughout. That is a directional result, not a single headline percentage, and it should not be read as one.
The second layer is contaminated linear regression with five estimators compared side by side: ordinary least squares, Huber regression, Tukey biweight regression, a plain MMD estimator, and CC-MMD. Parameter recovery is measured over 200 independent realizations. CC-MMD improves both parameter recovery and prediction, which matters because it shows the correction propagates into a downstream model rather than only cleaning up a reported metric.
The third layer is high-dimensional generative modeling, with the main result at ε=0.60, meaning six of every ten training rows are contamination. Models trained with CC-MMD still recover the clean target distribution. Three ablations accompany it: the contamination rate ε, the quality of the proxy scores, and the audit sample size m. Those three are exactly the variables a procurement team can negotiate over.
- LLM-assisted filtering of political content: a classifier scores each document, a small sample goes to human review.
- Galaxy population inference: a galaxy catalog with stars mixed in, a classic astronomical interloper problem.
- Species-distribution inference from environmental DNA: samples carrying genetic material from non-target species.
These three are motivating vignettes showing the setting is common, not experiments that were run. Keep them separate when reading results [1].
When this method fails
First, the audit has to be random. The theorem rests on simple random sampling without replacement. If reviewers only take the easy, clearly separable cases, the residuals are no longer an unbiased stand-in for the full pool and the correction fails.
Second, proxy scores have to cover the whole pool. The correction starts from the deviation of the full proxy-weighted sum from the oracle sum. If only part of the rows carry scores, the existing algebra cannot fill the gap.
Third, the kernel needs to be bounded or satisfy the corresponding moment conditions. No structural assumption is placed on the contaminant z, but that convenience is purchased with kernel boundedness. With an unbounded kernel, regularity has to be re-established under the mixture.
Fourth, the ratio estimator is itself biased. In finite samples, use the asymptotic normality result to build an interval rather than reporting the point estimate as unbiased, and expect variance to widen noticeably when m is small.
The method does not apply when there are no trusted labels at all, when audits cannot be sampled randomly, or when the contamination is not a separate distribution mixed in but a systematic shift of q itself. The model r=(1−ε)q+εz assumes an independent contaminating component; it is out of scope when the target has moved. Back to the buyer's decision: the paper does not say accept or reject. It says accept, and write the number of randomly audited rows into the contract.
