Unlike normalizing flows, it’s not possible to exactly evaluate the probability of a sample with the VAE, which describes this probability as:

In principle, we could approximate this probability using the Monte Carlo estimate by drawing samples from and computing:

However, the curse of dimensionality means that almost all values of that we draw would have a very low probability . We would have to draw an enormous number of samples to get a reliable estimate. A better approach is to use importance sampling.

Here, we sample from an auxiliary distribution , evaluate , and rescale the resulting values by probability under the new distribution:

where now we draw the samples from . If is close to the region of where the has high likelihood, then we will focus the sampling on the relevant area of space and estimate much more efficiently.

The product that we are trying to integrate is proportional to the posterior distribution by Bayes’ Rule. Hence, a sensible choice of auxiliary distribution is the variational posterior computed by the encoder.

In this way, we can approximate the probability of new samples. With sufficient samples, this will provide a better estimate than the lower bound and could be used to evaluate the quality of the model by evaluating the log-likelihood of test data. Alternatively, it could be used as a criterion for determining whether new examples belong to the distribution or are anomalous.