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. This paper introduces Variational Noise-Contrastive Estimation (VNCE), a framework that combines the classification-based approach of Noise-Contrastive Estimation with the lower-bound optimization of Variational Inference.
Introduction
Flexible statistical modeling often relies on two powerful paradigms: latent variable models (LVMs) and unnormalized (energy-based) models. LVMs explain observed data through hidden factors, while unnormalized models avoid the computational burden of calculating a partition function during model design. However, combining these approaches results in "doubly intractable" models where both the marginal likelihood and the normalizing constant are unknown. Standard Maximum Likelihood Estimation (MLE) is inapplicable in these scenarios, and existing alternatives like Contrastive Divergence are often tailored to specific architectures.
Methodology: Bridging NCE and VI
To address this, we propose Variational Noise-Contrastive Estimation (VNCE). This method extends Noise-Contrastive Estimation (NCE)—which transforms density estimation into a supervised classification task between data and noise—to models with latent variables.
The core of VNCE is the introduction of a variational distribution $q(z|x)$ to approximate the intractable posterior of the latent variables. We derive a variational lower bound for the NCE objective, analogous to the Evidence Lower Bound (ELBO) in standard Variational Inference (VI). This allows for simultaneous optimization of model parameters $\theta$ and variational parameters.
As illustrated in the figure above, the choice of noise distribution $P_y$ is critical. The noise must sufficiently overlap with the data distribution to provide a meaningful contrastive signal for the classifier to learn the underlying data density.
Theoretical Foundations
A key contribution of this work is the theoretical link between VNCE and Bayesian inference. We prove that the VNCE objective minimizes a specific $f$-divergence between the true and approximate posterior. Crucially, as the ratio of noise to real data ($\nu$) increases, this $f$-divergence converges to the Kullback-Leibler (KL) divergence, which is the standard objective in traditional VI. This ensures that VNCE is not merely a heuristic but a principled approximation method that inherits the generality of standard Variational Inference.
Experimental Evaluation
We evaluated VNCE across several tasks, including a 2D toy model, Mixtures of Gaussians (MoG), and Truncated Gaussian Graphical Models.
Posterior Approximation
In the 2D toy model, we visualized the quality of the approximate posterior. The results demonstrate that VNCE successfully recovers the true posterior structure. Notably, as the noise ratio $\nu$ increases or the noise distribution becomes more sophisticated (Noise 2), the VNCE posterior becomes increasingly indistinguishable from the true posterior and standard VI results.
Stability and Missing Data
In MoG experiments, VNCE demonstrated superior stability compared to standard NCE, being less prone to falling into local optima. Furthermore, in the context of Truncated Gaussian Graphical Models with missing data, VNCE significantly outperformed NCE with mean imputation. While standard NCE's performance degraded to near-random levels (AUC ~0.5) as missingness reached 50%, VNCE maintained high accuracy in recovering the underlying graph structure by treating missing values as latent variables.
Conclusion
VNCE provides a general-purpose framework for learning unnormalized latent variable models. By bridging contrastive learning and variational inference, it offers a stable and theoretically grounded alternative to Monte Carlo MLE. Because it is compatible with modern VI techniques like the reparameterization trick, VNCE is well-positioned for application in high-dimensional deep learning models where "doubly intractable" problems are common.
Summary updated