Robust-by-Design Distributional Learning from Contaminated Samples

Nevena Gligić, Arya Farahi

TL;DR

Contamination-Corrected Maximum Mean Discrepancy (CC-MMD) is a novel framework for learning from "dirty" datasets where target samples are mixed with unknown contaminants. By combining abundant but noisy "proxy" scores with a tiny subset of high-quality human audits, CC-MMD mathematically recovers the clean signal, allowing models to ignore the "junk" without discarding the rest of the valuable data.

What Problem Does This Paper Address?

Modern machine learning thrives on massive datasets, but these are rarely "pure." Whether it's scraped web text, astronomical catalogs, or ancient DNA samples, the data we observe is often a contaminated mixture: a combination of the target population we care about and "interlopers" from a different distribution.

Standard approaches fail in two ways:

  1. Naive Learning: If you train on the whole mixture, your model's objective is biased. It tries to match the "average" of the mixture, leading to incorrect predictions or blurry generative results.
  2. Audit-Only Learning: If you only use a small, manually verified "clean" subset, you throw away the vast majority of your data, leading to high variance and poor generalization.

The authors tackle this "abundant noisy supervision vs. sparse trusted labels" regime, seeking a way to use the entire dataset while still targeting the latent clean distribution.

Methods

The core contribution is CC-MMD, a "design-based" estimator for Maximum Mean Discrepancy (MMD). MMD is a popular metric for comparing two distributions based on kernel functions.

The "secret sauce" of CC-MMD is how it handles the contaminated pool. It assumes every data point has a proxy score (e.g., a classifier's confidence that a point is "clean"). Crucially, this proxy doesn't have to be perfect or even well-calibrated.

The algorithm then:

  • Takes a small, uniformly random audited subset where the true labels (clean vs. contaminant) are known.
  • Calculates the residuals (the difference between the true label and the noisy proxy) for this subset.
  • Uses Horvitz-Thompson reweighting—a classic technique from survey sampling—to "rectify" the kernel sums of the entire dataset.

This process effectively "subtracts out" the expected bias introduced by the contaminants. The authors prove that this estimator is design-unbiased, meaning that on average, it recovers the exact MMD you would have gotten if you had perfect labels for every single point in your massive dataset.

Datasets

The authors evaluated CC-MMD across several challenging scenarios:

  • Synthetic 2D Mixtures: Gaussian clusters arranged in a circle, contaminated by a structured spatial gradient of noise.
  • UCI Concrete Compressive Strength: A real-world regression task where 28-day cured concrete is the target, and early-cured concrete (which has different properties but overlapping features) acts as the contaminant.
  • Image Generation (MNIST): Clean MNIST digits were contaminated with either K-MNIST (Japanese characters) or Omniglot (various alphabets) at high rates (up to 60%).

Key Insights and Ideas

  • Robustness by Design, Not Just Stability: Unlike "robust" losses (like Huber) that try to limit the influence of outliers, CC-MMD changes the target of the optimization. It doesn't just resist the contaminant; it mathematically removes its effect from the objective function.
  • Proxies Don't Need to Be Perfect: A fascinating finding is that even a very weak proxy (just slightly better than a coin flip) significantly reduces the variance of the estimator. The audit handles the bias; the proxy handles the efficiency.
  • No Assumptions on the "Junk": Because the method is design-based, it makes zero structural assumptions about the contaminating distribution. The "junk" can be anything, as long as the kernel remains bounded.

Key Results

CC-MMD consistently outperformed all baselines, often matching the performance of an "Oracle" that has access to perfect labels.

  • MMD Estimation: As shown in Figure 1, while Naive MMD becomes increasingly biased as contamination ($\epsilon$) grows, CC-MMD stays centered near the true value, proving its unbiasedness.
Figure 1: MMD estimation under increasing contamination. Naïve MMD becomes increas- ingly biased as ϵ grows, whereas CC–MMD tracks the oracle and is less variable than the audit-only estimator.
  • Regression: In the contaminated linear regression task (Table 1), CC-MMD achieved the lowest parameter error, with a 35% lower $\ell_2$ error than the strongest baseline (Audit-only).
Table 1: Regression task benchmarking. CC-MMD is centered on true parameters and has the smallest spread.
  • Generative Modeling: When training image generators (IAF, VAE, GMMN) on 60% contaminated data, CC-MMD reduced the test MMD by 23x on K-MNIST and over 200x on Omniglot compared to uncorrected baselines. It successfully forced the models to generate clean MNIST digits despite the training pool being mostly "junk."
Figure 3: Generative modeling on MNIST. Comparison of test MMD2 (top) and FID (bottom) at ϵ = 0.60.

Limitations and Future Work

  • Computational Complexity: Like standard MMD, exact computation scales quadratically ($O(N^2)$) with the number of samples. While the authors suggest that existing scalable approximations (like Random Fourier Features) can be adapted, they haven't yet demonstrated this at extreme scales.
  • High-Dimensional Scaling: The relationship between the required audit sample size and data dimensionality remains an open question.
  • Single Contaminant Source: The current study focuses on settings with one primary contaminating distribution. Real-world data might have multiple, overlapping sources of contamination that require more complex proxy models.

Overall, CC-MMD provides a principled, statistically rigorous bridge between small-scale "gold standard" data and large-scale "noisy" data, making it a powerful tool for the era of web-scale, post-hoc curated datasets.

Summary updated

Abstract

Modern data analysis pipelines increasingly rely on large datasets assembled through retrieval, scraping, automated filtering, and post-hoc curation, where the observed sample is often a contaminated mixture rather than the target population. Standard distributional objectives either ignore contamination and converge to the wrong target, or retain only a small trusted subset and discard most of the data. We study supervised and unsupervised learning when a clean reference sample is compared with a pooled sample from $r=(1-ε)q+εz$, where $q$ is the latent target distribution and $z$ is an unknown contaminant. Motivated by settings with noisy membership scores for all observations and exact labels for a small audited subset, we propose contamination-corrected maximum mean discrepancy (CC-MMD), a design-based estimator that combines proxy scores with audited residual corrections to recover the oracle MMD that would have been computed from the latent clean sample. CC-MMD requires no calibration assumption on the proxy scores and no structural assumptions on the contaminant beyond standard kernel regularity. We prove finite-population design-unbiasedness of the corrected kernel sums, establish asymptotic normality of the audit correction, and show consistency for the target discrepancy $\mathrm{MMD}^2(p,q;k)$. Empirically, CC-MMD tracks the oracle under increasing contamination, improves parameter recovery and prediction in contaminated regression, and enables generative models trained on heavily corrupted mixtures to recover the clean target distribution. These results show that contaminated data need not be discarded or treated as the estimand. With sparse trusted labels and abundant noisy supervision, distributional objectives can be made robust by design.
BibTeX
@inproceedings{gligic2026robust,
  author = {Nevena Gligić and Arya Farahi},
  title = {{Robust-by-Design Distributional Learning from Contaminated Samples}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=A4wtdukFKi},
}
Figure