A Universal Marginalizer for Amortized Inference in Generative Models

Laura Douglas, Iliyan Zarov, Konstantinos Gourgoulias, Chris Lucas, Chris Hart, Adam Baker, Maneesh Sahani, Yura Perov, Saurabh JohriarXiv 2017

TL;DR

This paper introduces a "Universal Marginalizer" (UM), a single neural network capable of approximating all conditional marginal distributions in a Bayesian Network, regardless of which variables are observed. This UM can then be used to significantly improve the efficiency of importance sampling for inference in complex generative models.

What Problem Does This Paper Address?

Inference in complex probabilistic graphical models (like Bayesian Networks) is crucial for tasks such as medical diagnosis. However, exact inference is often computationally intractable. Approximate methods like variational inference are fast but inexact, while Monte Carlo methods like importance sampling are asymptotically exact but can be slow. A key challenge arises when the set of observed variables (evidence) differs across data instances. Traditional methods often require retraining or re-running inference for each new set of observations, which is inefficient. This paper tackles the problem of amortizing inference costs by developing a single model that can handle varying observational evidence and provide efficient approximate posterior marginals.

Methods

The core innovation is the Universal Marginalizer (UM), a neural network trained to predict the marginal posterior probability of every node in a Bayesian Network, given any subset of observed nodes.

Here's how it works:

  1. Data Generation: Unbiased samples are drawn from the Bayesian Network using ancestral sampling.
  2. Masking: To simulate varying observations, a subset of nodes in these samples are "masked" (hidden). This masking can be deterministic or probabilistic, helping the network generalize to different evidence configurations.
  3. Training: The masked samples and their corresponding original (unmasked) values are fed into a neural network. The network is trained using a cross-entropy loss to predict the probability of each node's state, effectively learning to approximate the conditional marginals $P(X_i | X_{\text{observed}})$.
  4. Amortized Inference: Once trained, this single UM can take any set of observed variables and their values as input and output approximate marginal probabilities for all other variables.

The paper then leverages this UM for Importance Sampling (IS):

  • Sequential Universal Marginalizer Importance Sampling (SUM-IS): The UM is used to generate sequential proposals for importance sampling. Instead of a single proposal distribution, the UM provides conditional probabilities for each node in topological order, creating a more informed proposal distribution that can lead to lower variance.
  • Hybrid Proposals: A simpler, yet effective, approach combines the UM's marginal predictions with traditional ancestral sampling proposals. This hybrid approach uses a mixture model where the mixing parameter $\beta$ controls the balance between the UM's prediction and the ancestral sampling proposal.

Datasets

Not discussed in the paper. The authors generate synthetic data from a Bayesian Network for training and evaluation.

Key Insights and Ideas

  • A Single Network for All Marginals: The concept of a "Universal Marginalizer" is powerful. Training one network to approximate all conditional marginals for any set of observations is a significant step towards amortized inference.
  • Masking as a Generalization Tool: Probabilistically masking nodes during training is an effective way to teach the network to handle diverse and incomplete evidence, mimicking real-world scenarios where observations vary.
  • UM for Better Importance Sampling: Using the UM's outputs as proposals in importance sampling (SUM-IS and hybrid methods) dramatically improves sampling efficiency compared to using simple priors or even standard IS. This is because the UM provides a much more accurate estimate of the target posterior distribution.
  • Hybrid Approach Balances Efficiency and Accuracy: The hybrid proposal method offers a practical trade-off. By mixing UM predictions with ancestral sampling, it achieves high accuracy with fewer samples than pure ancestral sampling, significantly reducing computational cost.

Key Results

  • The UM, trained on synthetic data, can effectively approximate conditional marginals.
  • The hybrid importance sampling scheme, using the UM, achieves significantly higher correlation and Effective Sample Size (ESS) with far fewer samples compared to standard importance sampling. For example, a hybrid proposal with $\beta=0.25$ reaches 95% correlation in 250,000 samples, whereas standard IS requires 2 million samples for 92% correlation.
  • The hybrid approach with $\beta=0.25$ yields an ESS of 11779 with 2 million samples, compared to 7678 for standard IS ($\beta=0.0$).

Limitations and Future Work

  • Computational Cost of SUM-IS: While SUM-IS offers good proposals, its sequential nature can be computationally intensive, depending on the parallelization strategy.
  • Hybrid Parameter $\beta$: The paper explores fixed values for the mixing parameter $\beta$ in the hybrid proposal. Future work could involve making $\beta$ a function of the sampled state and observations for even better adaptation.
  • Encoding Schemes: The paper briefly mentions exploring different encoding schemes for observed/unobserved nodes, suggesting further research into optimal representations.
  • Generalizing to Non-Binary Variables: The current work focuses on binary variables. Extending the UM to handle continuous or mixed variable types would be a natural next step.

Summary updated

BibTeX
@misc{douglas2017universal,
  author = {Laura Douglas and Iliyan Zarov and Konstantinos Gourgoulias and Chris Lucas and Chris Hart and Adam Baker and Maneesh Sahani and Yura Perov and Saurabh Johri},
  title = {{A Universal Marginalizer for Amortized Inference in Generative Models}},
  year = {2017},
  eprint = {1711.00695},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.00695},
}
Figure