Deep and Hierarchical Implicit Models

Dustin Tran, Rajesh Ranganath, David M. BleiarXiv 2017

Abstract

Implicit models, such as simulators and generative adversarial networks (GANs), offer immense flexibility but lack the structured reasoning of hierarchical Bayesian models. This paper introduces Hierarchical Implicit Models (HIMs), a framework that integrates complex latent structures into implicit modeling. To address the resulting intractable likelihoods, we propose Likelihood-Free Variational Inference (LFVI), a scalable algorithm utilizing ratio estimation. Our results across ecology, classification, and symbolic sequence tasks demonstrate that LFVI provides superior accuracy and scalability compared to traditional likelihood-free methods.

Introduction

In many scientific and engineering domains, the most accurate models are "simulators"—processes that can generate data but do not provide a tractable probability density function (likelihood). Examples range from climate simulations to population genetics. While powerful, these implicit models face two primary challenges: a lack of internal structure for incorporating priors or hierarchies, and a reliance on inference methods like Approximate Bayesian Computation (ABC) that fail to scale with data size or parameter dimensionality.

Hierarchical Implicit Models (HIMs)

We propose Hierarchical Implicit Models (HIMs) to bridge the gap between flexible simulators and structured Bayesian modeling. In a standard directed graphical model, the likelihood $p(x | z, \beta)$ is explicitly defined. In a HIM, this likelihood is replaced by a deterministic function $g(z, \beta, \epsilon)$ that transforms random noise $\epsilon$ into an observation $x$. This formulation allows for the inclusion of global parameters $\beta$ and local latent variables $z_n$, enabling the use of neural networks or physical simulators as components within a larger hierarchical structure.

Comparison of standard vs. implicit graphical models.

Likelihood-Free Variational Inference (LFVI)

Performing inference in HIMs is challenging because the likelihood is unavailable. Standard Variational Inference (VI) optimizes the Evidence Lower Bound (ELBO), which requires the log-likelihood. We introduce Likelihood-Free Variational Inference (LFVI), which bypasses this requirement using ratio estimation.

LFVI trains a "ratio estimator"—essentially a classifier—to distinguish between samples generated by the model and those from the variational posterior $q$. The output of this classifier serves as a proxy for the log-likelihood ratio, providing the necessary gradients for stochastic optimization. Notably, LFVI allows the variational family $q$ itself to be implicit, further increasing the model's flexibility. This approach transforms the inference problem into a minimax game, drawing a direct parallel to the training of Generative Adversarial Networks (GANs).

Experimental Results

We evaluated LFVI on several benchmarks, including ecological simulations, classification, and grammar-based sequence generation.

Ecological Modeling: Lotka-Volterra

We applied LFVI to a predator-prey simulator (Lotka-Volterra) scaled to 100,000 time series. Traditional ABC methods struggle at this scale. As shown in the figure below, LFVI (denoted as VI Log and VI Hinge) produced marginal posteriors for parameters $\beta_1$ and $\beta_2$ that were significantly more concentrated around the true values than those from Rejection, MCMC, or SMC-ABC. Furthermore, the negative log probability of the true parameters decreased steadily, indicating robust convergence.

Parameter estimation results for the Lotka-Volterra model.

Bayesian GANs and Sequence Learning

The HIM framework allows us to interpret GANs as Bayesian models. By placing priors on the weights of a GAN, we created "Bayesian GANs" that outperformed standard Bayesian Neural Networks on MNIST, achieving a test error of 0.0136 compared to 0.0311. Additionally, deep implicit models successfully learned to generate arithmetic expressions following a context-free grammar by injecting noise into the hidden states of a Recurrent Neural Network (RNN).

Conclusion

Hierarchical Implicit Models and Likelihood-Free Variational Inference provide a powerful toolkit for modern Bayesian analysis. By leveraging ratio estimation, we can perform structured inference on models previously considered "black boxes." Future work will focus on improving the stability of the ratio estimator, which remains a critical factor in the success of the inference process.

Summary updated

BibTeX
@misc{tran2017deep,
  author = {Dustin Tran and Rajesh Ranganath and David M. Blei},
  title = {{Deep and Hierarchical Implicit Models}},
  year = {2017},
  eprint = {1702.08896},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1702.08896},
}
Figure