[Paper Review] On Contrastive Learning for Likelihood-free Inference
This paper unifies two prominent likelihood-free inference methods—Score-based Ratio Estimation (SRE) and Normalizing Flow-based Posterior Estimation (SNPE-C)—under a general contrastive learning framework, demonstrating their equivalence when trained with the same objective. The key contribution is showing that both methods optimize the same contrastive objective, enabling direct comparison and practical recommendations, with SNPE-C offering advantages in posterior sampling due to its normalized density output.
Likelihood-free methods perform parameter inference in stochastic simulator models where evaluating the likelihood is intractable but sampling synthetic data is possible. One class of methods for this likelihood-free problem uses a classifier to distinguish between pairs of parameter-observation samples generated using the simulator and pairs sampled from some reference distribution, which implicitly learns a density ratio proportional to the likelihood. Another popular class of methods fits a conditional distribution to the parameter posterior directly, and a particular recent variant allows for the use of flexible neural density estimators for this task. In this work, we show that both of these approaches can be unified under a general contrastive learning scheme, and clarify how they should be run and compared.
Motivation & Objective
- To clarify the relationship between two major classes of likelihood-free inference methods: density ratio estimation via classification (SRE) and conditional density estimation (SNPE-C).
- To unify these methods under a single contrastive learning framework, revealing their underlying equivalence.
- To provide practical guidance on when to use each method, especially regarding posterior sampling and simulation efficiency.
- To identify open challenges in likelihood-free inference, such as high rejection rates in SNPE-C with compact-support priors.
Proposed method
- Proposes a general contrastive learning framework that subsumes both SRE and SNPE-C as special cases.
- Uses a binary classification objective to estimate the density ratio $ r(\mathbf{x}, \bm{\theta}) = \frac{p(\mathbf{x}|\bm{\theta})}{p(\mathbf{x})} $, which is proportional to the posterior $ p(\bm{\theta}|\mathbf{x}) $.
- Reinterprets SNPE-C as a contrastive learning setup where the classifier is reparameterized as a conditional density estimator.
- Employs a shared neural network encoder to map $(\mathbf{x}, \bm{\theta})$ pairs into a shared representation space for both methods.
- Demonstrates that SRE can be generalized to multi-class classification, improving training stability and performance.
- Uses the same training codebase and objective to compare SRE and SNPE-C directly, ensuring fair evaluation.
Experimental results
Research questions
- RQ1Are SRE and SNPE-C fundamentally different methods, or can they be unified under a common learning framework?
- RQ2Does reparameterizing a classifier as a conditional density estimator significantly affect inference quality in likelihood-free settings?
- RQ3How do the sampling efficiencies of i.i.d. sampling (SNPE-C) versus MCMC (SRE) compare in practice?
- RQ4What are the practical trade-offs between using a classifier-based approach and a density estimator-based approach in likelihood-free inference?
- RQ5How do rejection rates in SNPE-C behave under compact-support priors, and what are the implications for posterior sampling?
Key findings
- SRE and SNPE-C are mathematically equivalent when trained under the same contrastive objective, with both optimizing the same density ratio estimation task.
- SNPE-C achieves performance comparable to SRE when trained with the same objective and codebase, validating the theoretical unification.
- SNPE-C enables efficient i.i.d. posterior sampling via its normalized density output, which is not available in SRE.
- Despite similar performance, SNPE-C suffers from high rejection rates (e.g., ~1% acceptance rate) when the prior has compact support, making i.i.d. sampling up to 100× slower than MCMC.
- SRE outperforms SNL in the M/G/1 task, and has an advantage in high-dimensional observation spaces due to not requiring modeling the observation density.
- The study confirms that MCMC sampling remains viable for SNPE-C when rejection rates are too high, but i.i.d. sampling is preferred when feasible.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.