Evidence lower bound

Last updated

In variational Bayesian methods, the evidence lower bound (often abbreviated ELBO, also sometimes called the variational lower bound [1] or negative variational free energy) is a useful lower bound on the log-likelihood of some observed data.

Contents

The ELBO is useful because it provides a guarantee on the worst-case for the log-likelihood of some distribution (e.g. ) which models a set of data. The actual log-likelihood may be higher (indicating an even better fit to the distribution) because the ELBO includes a Kullback-Leibler divergence (KL divergence) term which decreases the ELBO due to an internal part of the model being inaccurate despite good fit of the model overall. Thus improving the ELBO score indicates either improving the likelihood of the model or the fit of a component internal to the model, or both, and the ELBO score makes a good loss function, e.g., for training a deep neural network to improve both the model overall and the internal component. (The internal component is , defined in detail later in this article.)

Definition

Let and be random variables, jointly distributed with distribution . For example, is the marginal distribution of , and is the conditional distribution of given . Then, for a sample , and any distribution , the ELBO is defined as

The ELBO can equivalently be written as [2]

In the first line, is the entropy of , which relates the ELBO to the Helmholtz free energy. [3] In the second line, is called the evidence for , and is the Kullback-Leibler divergence between and . Since the Kullback-Leibler divergence is non-negative, forms a lower bound on the evidence (ELBO inequality)

Motivation

Variational Bayesian inference

Suppose we have an observable random variable , and we want to find its true distribution . This would allow us to generate data by sampling, and estimate probabilities of future events. In general, it is impossible to find exactly, forcing us to search for a good approximation.

That is, we define a sufficiently large parametric family of distributions, then solve for for some loss function . One possible way to solve this is by considering small variation from to , and solve for . This is a problem in the calculus of variations, thus it is called the variational method.

Since there are not many explicitly parametrized distribution families (all the classical distribution families, such as the normal distribution, the Gumbel distribution, etc, are far too simplistic to model the true distribution), we consider implicitly parametrized probability distributions:

This defines a family of joint distributions over . It is very easy to sample : simply sample , then compute , and finally sample using .

In other words, we have a generative model for both the observable and the latent.

Now, we consider a distribution good, if it is a close approximation of :

since the distribution on the right side is over only, the distribution on the left side must marginalize the latent variable away.

In general, it's impossible to perform the integral , forcing us to perform another approximation.

Since (Bayes' Rule), it suffices to find a good approximation of . So define another distribution family and use it to approximate . This is a discriminative model for the latent.

The entire situation is summarized in the following table:

: observable: latent
approximable, easy
, easy
approximable, easy

In Bayesian language, is the observed evidence, and is the latent/unobserved. The distribution over is the prior distribution over , is the likelihood function, and is the posteriordistribution over .

Given an observation , we can infer what likely gave rise to by computing . The usual Bayesian method is to estimate the integral , then compute by Bayes' rule . This is expensive to perform in general, but if we can simply find a good approximation for most , then we can infer from cheaply. Thus, the search for a good is also called amortized inference.

All in all, we have found a problem of variational Bayesian inference.

Deriving the ELBO

A basic result in variational inference is that minimizing the Kullback–Leibler divergence (KL-divergence) is equivalent to maximizing the log-likelihood:

where is the entropy of the true distribution. So if we can maximize , we can minimize , and consequently find an accurate approximation . To maximize , we simply sample many , i.e. use Importance sampling

where is the number of samples drawn from the true distribution. This approximation can be seen as overfitting. [note 1] In order to maximize , it's necessary to find :

This usually has no closed form and must be estimated. The usual way to estimate integrals is Monte Carlo integration with importance sampling:

where is a sampling distribution over that we use to perform the Monte Carlo integration. So we see that if we sample , then is an unbiased estimator of . Unfortunately, this does not give us an unbiased estimator of , because is nonlinear. Indeed, we have by Jensen's inequality,

In fact, all the obvious estimators of are biased downwards, because no matter how many samples of we take, we have by Jensen's inequality:

Subtracting the right side, we see that the problem comes down to a biased estimator of zero:

At this point, we could branch off towards the development of an importance-weighted autoencoder [note 2] , but we will instead continue with the simplest case with :

The tightness of the inequality has a closed form:

We have thus obtained the ELBO function:

Maximizing the ELBO

For fixed , the optimization simultaneously attempts to maximize and minimize . If the parametrization for and are flexible enough, we would obtain some , such that we have simultaneously

Since

we have

and so

In other words, maximizing the ELBO would simultaneously allow us to obtain an accurate generative model and an accurate discriminative model . [5]

Main forms

The ELBO has many possible expressions, each with some different emphasis.

This form shows that if we sample , then is an unbiased estimator of the ELBO.

This form shows that the ELBO is a lower bound on the evidence , and that maximizing the ELBO with respect to is equivalent to minimizing the KL-divergence from to .

This form shows that maximizing the ELBO simultaneously attempts to keep close to and concentrate on those that maximizes . That is, the approximate posterior balances between staying close to the prior and moving towards the maximum likelihood .

This form shows that maximizing the ELBO simultaneously attempts to keep the entropy of high, and concentrate on those that maximizes . That is, the approximate posterior balances between being a uniform distribution and moving towards the maximum a posteriori .

Data-processing inequality

Suppose we take independent samples from , and collect them in the dataset , then we have empirical distribution .


Fitting to can be done, as usual, by maximizing the loglikelihood :

Now, by the ELBO inequality, we can bound , and thus

The right-hand-side simplifies to a KL-divergence, and so we get:

This result can be interpreted as a special case of the data processing inequality.

In this interpretation, maximizing is minimizing , which upper-bounds the real quantity of interest via the data-processing inequality. That is, we append a latent space to the observable space, paying the price of a weaker inequality for the sake of more computationally efficient minimization of the KL-divergence. [6]

Related Research Articles

<span class="mw-page-title-main">Euler's formula</span> Complex exponential in terms of sine and cosine

Euler's formula, named after Leonhard Euler, is a mathematical formula in complex analysis that establishes the fundamental relationship between the trigonometric functions and the complex exponential function. Euler's formula states that, for any real number x, one has

In statistics, maximum likelihood estimation (MLE) is a method of estimating the parameters of an assumed probability distribution, given some observed data. This is achieved by maximizing a likelihood function so that, under the assumed statistical model, the observed data is most probable. The point in the parameter space that maximizes the likelihood function is called the maximum likelihood estimate. The logic of maximum likelihood is both intuitive and flexible, and as such the method has become a dominant means of statistical inference.

In mechanics and geometry, the 3D rotation group, often denoted SO(3), is the group of all rotations about the origin of three-dimensional Euclidean space under the operation of composition.

<span class="mw-page-title-main">Spherical harmonics</span> Special mathematical functions defined on the surface of a sphere

In mathematics and physical science, spherical harmonics are special functions defined on the surface of a sphere. They are often employed in solving partial differential equations in many scientific fields. A list of the spherical harmonics is available in Table of spherical harmonics.

<span class="mw-page-title-main">Gamma distribution</span> Probability distribution

In probability theory and statistics, the gamma distribution is a versatile two-parameter family of continuous probability distributions. The exponential distribution, Erlang distribution, and chi-squared distribution are special cases of the gamma distribution. There are two equivalent parameterizations in common use:

  1. With a shape parameter k and a scale parameter θ
  2. With a shape parameter and an inverse scale parameter , called a rate parameter.
<span class="mw-page-title-main">Inverse trigonometric functions</span> Inverse functions of sin, cos, tan, etc.

In mathematics, the inverse trigonometric functions are the inverse functions of the trigonometric functions. Specifically, they are the inverses of the sine, cosine, tangent, cotangent, secant, and cosecant functions, and are used to obtain an angle from any of the angle's trigonometric ratios. Inverse trigonometric functions are widely used in engineering, navigation, physics, and geometry.

<span class="mw-page-title-main">Theta function</span> Special functions of several complex variables

In mathematics, theta functions are special functions of several complex variables. They show up in many topics, including Abelian varieties, moduli spaces, quadratic forms, and solitons. As Grassmann algebras, they appear in quantum field theory.

<span class="mw-page-title-main">Stellar dynamics</span>

Stellar dynamics is the branch of astrophysics which describes in a statistical way the collective motions of stars subject to their mutual gravity. The essential difference from celestial mechanics is that the number of body

In mathematics, the Mahler measureof a polynomial with complex coefficients is defined as

<span class="mw-page-title-main">Inverse-gamma distribution</span> Two-parameter family of continuous probability distributions

In probability theory and statistics, the inverse gamma distribution is a two-parameter family of continuous probability distributions on the positive real line, which is the distribution of the reciprocal of a variable distributed according to the gamma distribution.

In information theory, the cross-entropy between two probability distributions and over the same underlying set of events measures the average number of bits needed to identify an event drawn from the set if a coding scheme used for the set is optimized for an estimated probability distribution , rather than the true distribution .

An autoencoder is a type of artificial neural network used to learn efficient codings of unlabeled data. An autoencoder learns two functions: an encoding function that transforms the input data, and a decoding function that recreates the input data from the encoded representation. The autoencoder learns an efficient representation (encoding) for a set of data, typically for dimensionality reduction.

A ratio distribution is a probability distribution constructed as the distribution of the ratio of random variables having two other known distributions. Given two random variables X and Y, the distribution of the random variable Z that is formed as the ratio Z = X/Y is a ratio distribution.

The derivatives of scalars, vectors, and second-order tensors with respect to second-order tensors are of considerable use in continuum mechanics. These derivatives are used in the theories of nonlinear elasticity and plasticity, particularly in the design of algorithms for numerical simulations.

<span class="mw-page-title-main">Wrapped normal distribution</span>

In probability theory and directional statistics, a wrapped normal distribution is a wrapped probability distribution that results from the "wrapping" of the normal distribution around the unit circle. It finds application in the theory of Brownian motion and is a solution to the heat equation for periodic boundary conditions. It is closely approximated by the von Mises distribution, which, due to its mathematical simplicity and tractability, is the most commonly used distribution in directional statistics.

In probability theory and directional statistics, a wrapped probability distribution is a continuous probability distribution that describes data points that lie on a unit n-sphere. In one dimension, a wrapped distribution consists of points on the unit circle. If is a random variate in the interval with probability density function (PDF) , then is a circular variable distributed according to the wrapped distribution and is an angular variable in the interval distributed according to the wrapped distribution .

In quantum information theory, the Wehrl entropy, named after Alfred Wehrl, is a classical entropy of a quantum-mechanical density matrix. It is a type of quasi-entropy defined for the Husimi Q representation of the phase-space quasiprobability distribution. See for a comprehensive review of basic properties of classical, quantum and Wehrl entropies, and their implications in statistical mechanics.

In statistics, the variance function is a smooth function that depicts the variance of a random quantity as a function of its mean. The variance function is a measure of heteroscedasticity and plays a large role in many settings of statistical modelling. It is a main ingredient in the generalized linear model framework and a tool used in non-parametric regression, semiparametric regression and functional data analysis. In parametric modeling, variance functions take on a parametric form and explicitly describe the relationship between the variance and the mean of a random quantity. In a non-parametric setting, the variance function is assumed to be a smooth function.

<span class="mw-page-title-main">Variational autoencoder</span> Deep learning generative model to encode data representation

In machine learning, a variational autoencoder (VAE) is an artificial neural network architecture introduced by Diederik P. Kingma and Max Welling. It is part of the families of probabilistic graphical models and variational Bayesian methods.

In machine learning, diffusion models, also known as diffusion probabilistic models or score-based generative models, are a class of latent variable generative models. A diffusion model consists of three major components: the forward process, the reverse process, and the sampling procedure. The goal of diffusion models is to learn a diffusion process that generates the probability distribution of a given dataset. They learn the latent structure of a dataset by modeling the way in which data points diffuse through their latent space.

References

  1. Kingma, Diederik P.; Welling, Max (2014-05-01). "Auto-Encoding Variational Bayes". arXiv: 1312.6114 [stat.ML].
  2. Goodfellow, Ian; Bengio, Yoshua; Courville, Aaron (2016). "Chapter 19". Deep learning. Adaptive computation and machine learning. Cambridge, Mass: The MIT press. ISBN   978-0-262-03561-3.
  3. Hinton, Geoffrey E; Zemel, Richard (1993). "Autoencoders, Minimum Description Length and Helmholtz Free Energy". Advances in Neural Information Processing Systems. Morgan-Kaufmann. 6.
  4. Burda, Yuri; Grosse, Roger; Salakhutdinov, Ruslan (2015-09-01). "Importance Weighted Autoencoders". arXiv: 1509.00519 [stat.ML].
  5. Neal, Radford M.; Hinton, Geoffrey E. (1998), "A View of the Em Algorithm that Justifies Incremental, Sparse, and other Variants", Learning in Graphical Models, Dordrecht: Springer Netherlands, pp. 355–368, doi:10.1007/978-94-011-5014-9_12, ISBN   978-94-010-6104-9, S2CID   17947141
  6. Kingma, Diederik P.; Welling, Max (2019-11-27). "An Introduction to Variational Autoencoders". Foundations and Trends in Machine Learning. 12 (4). Section 2.7. arXiv: 1906.02691 . doi:10.1561/2200000056. ISSN   1935-8237. S2CID   174802445.

Notes

  1. In fact, by Jensen's inequality, The estimator is biased upwards. This can be seen as overfitting: for some finite set of sampled data , there is usually some that fits them better than the entire distribution.
  2. By the delta method, we have
    If we continue with this, we would obtain the importance-weighted autoencoder. [4]