Optimization of Annealed Importance Sampling Hyperparameters

Shirin Goshtasbpour, Fernando Pérez-Cruz

Abstract: Annealed Importance Sampling (AIS) is a popular algorithm used to estimate the intractable marginal likelihood of deep generative models. Although AIS is guaranteed to provide unbiased estimates for any set of hyperparameters, common implementations rely on simple heuristics, such as the geometric average bridging distributions between the initial and target distributions, which affect estimation performance when the computational budget is limited. In order to reduce the number of sampling iterations, we present a parametric AIS process with flexible intermediary distributions defined by a residual density with respect to the geometric mean path. Our method allows parameter sharing between annealing distributions, the use of a fixed linear schedule for discretization, and amortization of hyperparameter selection in latent variable models. We assess the performance of Optimized-Path AIS (OP-AIS) for marginal likelihood estimation of deep generative models and compare it to more computationally intensive AIS.

1. Introduction

Estimating the marginal likelihood, or partition function, is a fundamental challenge in evaluating deep generative models such as Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs). While Annealed Importance Sampling (AIS) is considered the gold standard for providing unbiased estimates, its efficiency is often hampered by the reliance on a fixed geometric path heuristic. When computational resources are constrained, this heuristic can lead to high-variance estimates. This work introduces Optimized-Path AIS (OP-AIS), which parameterizes the annealing path to achieve high accuracy with significantly fewer sampling steps.

2. Methodology

2.1 Parameterized AIS Path

The core innovation of OP-AIS is the replacement of the fixed geometric path with a learnable, continuous density path $\gamma(t, z)$, where $t \in [0, 1]$. The log-density is augmented with a learnable term $u_\phi(x, z, t)$ parameterized by a Deep Neural Network (DNN). This "twisting" of the path allows the model to learn an optimal transition between the initial and target distributions.

2.2 Optimization Objectives

The authors investigate two primary objectives for training the path parameters: Inverse KL-divergence and Jefferys Divergence. While Inverse KL is common, it often exhibits "mode-seeking" behavior, potentially leading to biased estimates by ignoring parts of the distribution. In contrast, Jefferys Divergence—a symmetrized version of KL—is shown to be superior as it simultaneously minimizes both bias and variance by accounting for the reverse process.

2.3 Differentiable Sampling

To enable gradient-based optimization (e.g., via the Adam optimizer), the method utilizes reparameterizable Markov kernels, such as Hamiltonian Monte Carlo (HMC) or the Metropolis-Adjusted Langevin Algorithm (MALA). This allows for backpropagation through the sampling process to update the neural path parameters $\phi$.

3. Experimental Evaluation

3.1 Benchmarks

The method was evaluated on synthetic 2D distributions (e.g., rings and moons) to test navigation across energy barriers, and on high-dimensional data using Binarized MNIST for various latent variable models, including VAEs, IWAEs, GANs, and BiGANs.

3.2 Efficiency and Performance

A key finding is that OP-AIS with only 16 steps can achieve negative log-likelihood (NLL) estimates comparable to or better than vanilla AIS using 1024 steps. This represents a massive reduction in computational overhead for equivalent accuracy. Furthermore, OP-AIS provided tighter bounds for GANs and BiGANs, which are traditionally difficult to evaluate due to their sharp, non-Gaussian distributions.

3.3 Amortization

By parameterizing the continuous time path, the model shares parameters across the entire annealing process. Once optimized on a subset of data, the path can be amortized across new samples, making it highly efficient for large-scale evaluation tasks compared to running a massive, 10,000-step vanilla AIS for every instance.

4. Conclusion

Optimized-Path AIS demonstrates that "smarter" annealing steps are more effective than simply increasing the number of steps. By leveraging neural networks to parameterize the transition path and optimizing via Jefferys Divergence, OP-AIS provides a robust and efficient framework for marginal likelihood estimation in complex generative models, effectively bridging the gap between computational budget and estimation accuracy.

Summary updated

BibTeX
@inproceedings{goshtasbpour2022optimization,
  author = {Shirin Goshtasbpour and Fernando Pérez-Cruz},
  title = {{Optimization of Annealed Importance Sampling Hyperparameters}},
  booktitle = {ECML/PKDD},
  year = {2022},
  url = {https://openreview.net/forum?id=LAEYm6GVHg},
}
Figure