On using the most convenient probability metric (i.e. KL divergence) to do variational inference.
There is nothing novel here. But everyone who is doing variational inference has to work through this just once, and I’m doing so here.
Yuge Shi’s introduction is the best short intro that gets to state-of-the-art. The canonical intro is Matthews (2017) who did a thesis on it. Murphy (2012) sec 21.2 is also pretty good.
We often want a variational approximation to the marginal (log-)likelihood (a.k.a. “evidence”) for some probabilistic model with observations unobserved latent factors , model parameters and variational parameters .
Here’s one. The steps are all elementary, although realising you would want to take those steps is not, IMO.
For convenience, we assume everything has a density with respect to some unspecified dominating measure over and , which is usually an OK assumption.
is called the free energy or Evidence Lower Bound.
We can understand this as a decomposition of the total marginal evidence into two parts which are sort-of-interpretable. represents the cost of approximating the exact distribution over latents with the distribution. We can’t actually evaluate this in general but for fancy enough it could be small.
The other bit, , represents an objective we can actually maximize, which motivates a whole bunch of technology. We can stop there and think of it as just that, or we can break it up further. The traditional next step if we want to decompose further is to observe that
This suggests we might intuit maximising the ELBO as maximising the data-conditional likelihood of the latents whilst penalising them for diverging too far from the prior on those latents. I find a marginal prior on the latents to be a weird concept here and this particular formulation makes my head hurt.
Yuge Shi, summarising Hoffman and Johnson (2016) and Mathieu et al. (2019) observes that we can break this down in a way which makes the per-observation latents into a coding problem. Suppose we index our observations by , and they are independent. Then we can write this bad boy using the marginal .
is entropy.
Another way to rewrite the ELBO is as The log joint what physics people call the “negative energy”. This version highlights that a good posterior approximation must assign most of its probability mass to regions of low energy (i.e. high joint probability). At the same time the entropy term in the ELBO prevents from collapsing to an atom, unlike in, say, a MAP estimate.
Next thing, Importance weighted sampling in variational inference. Also a recommendation from Yuge Shi, see Adam Kosiorek’s What is wrong with VAEs? which finds autoencoders via importance sampling.
References
Blei, Kucukelbir, and McAuliffe. 2017.
“Variational Inference: A Review for Statisticians.” Journal of the American Statistical Association.
Burda, Grosse, and Salakhutdinov. 2016.
“Importance Weighted Autoencoders.” In
arXiv:1509.00519 [Cs, Stat].
Cremer, Morris, and Duvenaud. 2017.
“Reinterpreting Importance-Weighted Autoencoders.” In
ICLR 2017.
Gelman, Carlin, Stern, et al. 2013.
Bayesian Data Analysis. Chapman & Hall/CRC texts in statistical science.
Hoffman, and Johnson. 2016.
“ELBO Surgery: Yet Another Way to Carve up the Variational Evidence Lower Bound.” In
Advances In Neural Information Processing Systems.
Huggins, Kasprzak, Campbell, et al. 2019.
“Practical Posterior Error Bounds from Variational Objectives.” arXiv:1910.04102 [Cs, Math, Stat].
Jordan. 1999. Learning in Graphical Models.
Kingma, Diederik P., and Welling. 2019.
An Introduction to Variational Autoencoders. Foundations and Trends in Machine Learning.
Li, and Turner. 2016.
“Rényi Divergence Variational Inference.” In
Advances in Neural Information Processing Systems.
MacKay. 2002. Information Theory, Inference & Learning Algorithms.
Mathieu, Rainforth, Siddharth, et al. 2019.
“Disentangling Disentanglement in Variational Autoencoders.” In
International Conference on Machine Learning.
Murphy. 2012. Machine learning: a probabilistic perspective. Adaptive computation and machine learning series.
Rainforth, Kosiorek, Le, et al. 2019.
“Tighter Variational Bounds Are Not Necessarily Better.” arXiv:1802.04537 [Cs, Stat].
Wainwright, Martin, and Jordan. 2005. “A Variational Principle for Graphical Models.” In New Directions in Statistical Signal Processing.
Wainwright, Martin J., and Jordan. 2008.
Graphical Models, Exponential Families, and Variational Inference. Foundations and Trends® in Machine Learning.
Yedidia, Jonathan S., Freeman, and Weiss. 2000. “Generalized Belief Propagation.” In Proceedings of the 13th International Conference on Neural Information Processing Systems. NIPS’00.
Yedidia, J.S., Freeman, and Weiss. 2003.
“Understanding Belief Propagation and Its Generalizations.” In
Exploring Artificial Intelligence in the New Millennium.