Hierarchical Variational Models

Rajesh Ranganath, Dustin Tran, David M. Blei

TL;DR

Hierarchical Variational Models (HVMs) provide a powerful framework for capturing complex dependencies between latent variables in Bayesian models. By placing a "variational prior" on the parameters of a standard mean-field distribution, HVMs allow for highly expressive approximations while maintaining the efficiency and "black box" nature of modern variational inference.

What Problem Does This Paper Address?

In Bayesian statistics, researchers often want to find the posterior distribution—the probability of hidden (latent) variables given the observed data. Because this is usually mathematically impossible to calculate exactly, we rely on Variational Inference (VI) to approximate it.

However, the standard approach, known as mean-field VI, assumes that all latent variables are entirely independent of one another. While this makes the math tractable and the computation fast, it is a massive oversimplification. In reality, latent variables are often highly correlated. This "independence straightjacket" leads to poor approximations and prevents models from capturing the true underlying structure of the data. The central challenge is: how do we create a more flexible, correlated variational distribution without making the computation prohibitively expensive or losing the ability to handle discrete variables?

Methods: Introducing HVMs

The authors propose Hierarchical Variational Models (HVMs) to solve this problem. The core innovation is treating the variational parameters (usually denoted as $\lambda$) not as fixed, independent values, but as random variables themselves.

Comparison of Mean-Field and Hierarchical Variational Models
  1. The Hierarchy: You start with a simple base distribution (like a mean-field Gaussian or Poisson). Then, you place a variational prior $q(\lambda; \theta)$ over its parameters. The final HVM is the marginal distribution formed by integrating out those parameters.
  2. Expressive Priors: Because the prior is placed on the parameters, you can use sophisticated tools like Normalizing Flows or Mixtures of Gaussians to induce complex correlations, even if the underlying latent variables are discrete.
  3. The Hierarchical ELBO: Standard VI optimizes the Evidence Lower Bound (ELBO). For HVMs, the entropy term becomes mathematically messy. To solve this, the authors introduce an auxiliary distribution $r(\lambda | z)$—essentially a "model of the parameters given the variables"—to create a tractable lower bound.
  4. Inverse Flows: To keep the algorithm "black box" and efficient, they develop "inverse flows" for the auxiliary distribution $r$. This ensures that the computational cost scales linearly with the number of latent variables, just like simpler methods.

Key Insights

  • Hierarchy as a Proxy for Correlation: Just as hierarchical Bayesian models induce dependencies in data, hierarchical variational models induce dependencies in latent variables. This allows the model to "shrink" estimates toward each other, capturing global structure.
  • Normalizing Flows for Discrete Data: Normalizing flows are usually restricted to continuous variables because they rely on differentiable transformations. HVMs bypass this by applying the flow to the parameters of a discrete distribution (like the rate of a Poisson), effectively bringing the power of flows to discrete latent variable models.
  • Local Learning: By carefully structuring the auxiliary distribution $r$, the authors ensure that updates remain "local." The model doesn't need to look at every variable at once to update a single parameter, which is vital for scaling to large-scale "Big Data" problems.

Key Results

The authors evaluated HVMs using a simulated 2D correlated discrete distribution, as well as text corpora from The New York Times (NYT) and Science magazine to test Deep Exponential Families (DEFs).

  • Higher Fidelity: In the toy 2D example, the HVM successfully captured multiple "modes" (peaks) in the probability distribution. In contrast, the mean-field approach collapsed into a single, inaccurate blob.
2D discrete distribution comparison showing HVM capturing multimodality
  • Better Generalization: On the NYT and Science datasets, HVMs consistently achieved lower held-out perplexity (a measure of how well the model predicts unseen data) compared to state-of-the-art mean-field Black Box Variational Inference (BBVI).
  • Fixing Multi-layer Failures: Mean-field VI famously struggles with multi-layer Poisson models, often performing worse as more layers are added. HVMs reversed this trend, showing that capturing dependencies is crucial for making deep probabilistic models work. On average, HVMs improved perplexity by about 180 points over the baseline.

Limitations and Future Work

  • Choice of Prior: While HVMs are flexible, performance still heavily depends on choosing a good variational prior. The authors suggest that more work is needed to automate this choice.
  • Tightness of the Bound: The use of the auxiliary distribution $r$ introduces an approximation. If $r$ is not flexible enough, the gap between the HVM's ELBO and the true log-likelihood might remain large.
  • Reinforcement Learning Connections: The authors briefly mention potential applications in reinforcement learning (specifically for "regularizing" policies), which remains an open and promising area for future research.

Summary updated

BibTeX
@inproceedings{ranganath2016hierarchical,
  author = {Rajesh Ranganath and Dustin Tran and David M. Blei},
  title = {{Hierarchical Variational Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2016},
  url = {https://openreview.net/forum?id=BJWNMnb_Zr},
}
Figure