Score Matching with Missing Data

Josh Givens, Song Liu, Henry Reeve

Abstract

Score matching is a powerful alternative to Maximum Likelihood Estimation for learning the shape of a distribution without calculating the intractable normalizing constant. However, standard score matching assumes complete training data. This paper introduces a framework for "marginal score matching," enabling the learning of score functions from incomplete samples. We propose two complementary approaches: Marginal Importance Weighting (Marg-IW) for low-dimensional settings with theoretical convergence guarantees, and Marginal Variational Score Matching (Marg-Var) for high-dimensional complex distributions. Our methods outperform traditional imputation and EM-based baselines across synthetic and real-world benchmarks, including financial and biological datasets.

Introduction

Score matching has become a cornerstone for energy-based models and modern diffusion processes by learning the gradient of the log-density (the score function). Despite its utility, real-world data is frequently incomplete. Traditional approaches like zero-imputation or simple marginalization often fail to capture the complex dependencies between observed and missing variables. While specific solutions exist for diffusion models, a general, model-agnostic framework for score matching with missing data has been lacking.

Methods: Marginal Score Matching

We propose matching the score of the marginal distribution of observed data. Two primary algorithms are introduced:

  1. Marginal Importance Weighting (Marg-IW): This method utilizes an artificial proposal distribution to estimate the marginal score via importance sampling. It is mathematically straightforward and provides theoretical finite-sample bounds, making it ideal for lower-dimensional settings or limited data.
  2. Marginal Variational Score Matching (Marg-Var): To address the "curse of dimensionality" in high-dimensional spaces, Marg-Var employs an auxiliary variational model to approximate the conditional distribution of missing data. By utilizing a "gradient-first" identity, we avoid biased nested expectations common in EM-like approaches.

This framework is flexible, supporting parametric models, neural networks, and variants such as Truncated, Sliced, and Denoising score matching.

Experimental Results

The methods were evaluated on synthetic truncated Gaussians, non-Gaussian ICA models, and real-world datasets including S&P 100 stock prices and Yeast genetic expression data.

Convergence and Sample Efficiency

As shown in Figure 1, both Marg-IW and Marg-Var demonstrate consistent convergence as sample size increases. Marg-IW, in particular, tracks closely with the true marginal score, supporting the theoretical convergence rate claims of approximately $1/\sqrt{n}$.

Fisher Divergence vs Sample Size for different methods.

High-Dimensional Performance

In high-dimensional settings, the limitations of importance sampling and naive baselines become apparent. Figure 2 illustrates that as the dimension increases, Marg-Var maintains significantly lower error in parameter estimation compared to Marg-IW, EM, and the "Zeroed" baseline, which fails by ignoring dependencies between dimensions.

Theta Error vs Dimension, highlighting Marg-Var's robustness in high dimensions.

Graphical Model Recovery

On the S&P 100 and Yeast datasets, Marg-Var achieved superior Area Under the Curve (AUC) for edge detection. It proved particularly effective at identifying "hubs" in star-shaped networks where traditional marginalization fails.

Discussion and Conclusion

Our work highlights the "Zeroing Trap," where naive imputation leads to non-convergence. We provide a robust alternative through Marg-IW and Marg-Var. While Marg-IW offers theoretical guarantees for smaller problems, Marg-Var serves as a scalable workhorse for high-dimensional structural learning. Future work includes reducing the computational overhead of these methods and integrating them into large-scale generative diffusion modeling.

Summary updated

BibTeX
@inproceedings{givens2025score,
  author = {Josh Givens and Song Liu and Henry Reeve},
  title = {{Score Matching with Missing Data}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=mBstuGUaXo},
}
Figure