Variational Noise-Contrastive Estimation

Benjamin Rhodes, Michael U. Gutmann

Abstract

Unnormalised latent variable models are a broad and flexible class of statistical models. However, learning their parameters from data is intractable, and few estimation techniques are currently available for such models. To increase the number of techniques in our arsenal, we propose variational noise-contrastive estimation (VNCE), building on NCE which is a method that only applies to unnormalised models. The core idea is to use a variational lower bound to the NCE objective function, which can be optimised in the same fashion as the evidence lower bound (ELBO) in standard variational inference (VI). We prove that VNCE can be used for both parameter estimation of unnormalised models and posterior inference of latent variables. The developed theory shows that VNCE has the same level of generality as standard VI, meaning that advances made there can be directly imported to the unnormalised setting. We validate VNCE on toy models and apply it to a realistic problem of estimating an undirected graphical model from incomplete data.

Introduction

In modern machine learning, researchers often seek to combine the flexibility of unnormalized models (energy-based models) with the explanatory power of latent variable models. Unnormalized models avoid the computational burden of a partition function, while latent variables can capture underlying structures like missing data or hidden topics. However, combining these two approaches leads to a "doubly-intractable" problem: the marginal likelihood requires integrating out latent variables, and the model itself lacks a normalization constant.

Standard techniques like Variational Inference (VI) address latent variables but require normalized models. Conversely, Noise-Contrastive Estimation (NCE) handles unnormalized models but assumes all variables are observed. This paper introduces Variational Noise-Contrastive Estimation (VNCE) to bridge this gap, providing a principled framework for training unnormalized models with latent variables.

Methodology: The Variational Twist on NCE

The core of VNCE is the derivation of a variational lower bound for the NCE objective. NCE typically frames density estimation as a supervised classification task: distinguishing true data from artificial noise. When latent variables $z$ are present, the true data density $p(x)$ is unknown. VNCE introduces a variational distribution $q(z|x)$ to approximate the posterior of these hidden variables.

Distributions of latent variables (z), observed data (x), and two types of noise (P_y^1, P_y^2) used in toy experiments.

The resulting objective, $J_{VNCE}(\theta, q)$, is optimized with respect to both model parameters $\theta$ and variational parameters. The authors prove several key properties:

  1. Equivalence: If the variational distribution is perfect, maximizing the VNCE bound is equivalent to maximizing the original NCE objective.
  2. Divergence Minimization: VNCE minimizes a specific $f$-divergence between the true and approximate posterior.
  3. Convergence to VI: As the ratio of noise to data ($\nu$) increases, the VNCE objective converges to standard Variational Inference, minimizing the KL divergence.

Experimental Validation

The authors evaluated VNCE using toy 2D Gaussian mixtures and synthetic 20-dimensional Undirected Graphical Models (UGMs).

Toy Models and Posterior Approximation

The toy experiments visualized how VNCE approximates posteriors compared to standard VI. As shown in the comparison below, VNCE's performance depends on the choice of noise distribution and the noise ratio $\nu$.

Comparison of posterior approximations for True, VI, and VNCE across different noise distributions and ratios.

Handling Incomplete Data

A significant application of VNCE is estimating models from incomplete data, where missing values are treated as latent variables. On UGM tasks with varying levels of missingness (0% to 50%), VNCE demonstrated robust performance. While standard NCE with mean imputation failed significantly as missingness increased beyond 40%, VNCE maintained high accuracy (AUC), performing comparably to the "gold standard" Monte Carlo Maximum Likelihood Estimation (MC-MLE) without requiring complex hyperparameter tuning for samplers.

Conclusion

VNCE extends the reach of variational methods to the unnormalized setting. By demonstrating that VNCE shares the same level of generality as standard VI, the authors open the door for integrating modern advancements like the reparameterization trick into energy-based modeling. While sensitive to noise distribution choice, VNCE offers a stable, principled alternative to existing doubly-intractable estimation techniques.

Summary updated

BibTeX
@inproceedings{rhodes2019variational,
  author = {Benjamin Rhodes and Michael U. Gutmann},
  title = {{Variational Noise-Contrastive Estimation}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2019},
  url = {https://openreview.net/forum?id=9x6SmspaYHb},
}
Figure