Adaptation of the Independent Metropolis-Hastings Sampler with Normalizing Flow Proposals

James A. Brofos, Marylou Gabrié, Marcus A. Brubaker, Roy R. Lederman · DOI

Abstract

Markov Chain Monte Carlo (MCMC) methods are a powerful tool for computation with complex probability distributions. However, the performance of such methods is critically dependent on properly tuned parameters, most of which are difficult if not impossible to know a priori for a given target distribution. Adaptive MCMC methods aim to address this by allowing the parameters to be updated during sampling based on previous samples from the chain at the expense of requiring a new theoretical analysis to ensure convergence. In this work, we extend the convergence theory of adaptive MCMC methods to a new class of methods built on a powerful class of parametric density estimators known as normalizing flows. In particular, we consider an independent Metropolis-Hastings sampler where the proposal distribution is represented by a normalizing flow whose parameters are updated using stochastic gradient descent. We explore the practical performance of this procedure on both synthetic settings and in the analysis of a physical field system and compare it against both adaptive and non-adaptive MCMC methods.

Introduction

Markov Chain Monte Carlo (MCMC) is the workhorse of Bayesian inference, but its efficiency depends entirely on the "proposal distribution"—the rule used to suggest the next state in the chain. If the proposal doesn't match the target distribution well, the chain moves slowly or gets stuck. Adaptive MCMC attempts to solve this by updating the proposal's parameters on the fly based on previous samples. However, changing the proposal based on the chain's history violates the Markov property. Without careful mathematical constraints, an adaptive chain might never converge to the true target distribution. This paper provides a rigorous theoretical framework and empirical validation for using Normalizing Flows (NFs) as adaptive proposal distributions in the Independent Metropolis-Hastings (IMH) sampler.

Methodology: Adaptive IMH with Normalizing Flows

The authors focus on the Independent Metropolis-Hastings (IMH) algorithm. Unlike random-walk methods that move locally, IMH draws proposals independently from a global distribution. Its efficiency relies on the proposal being a "good enough" global approximation of the target.

Conceptual overview of the adaptive IMH process with Normalizing Flows.

Key Innovations: 1. Normalizing Flow Proposals: They use NFs—differentiable, invertible mappings that transform a simple base distribution into a complex one—to represent the proposal $\tilde{\Pi}_\theta$. 2. Pseudo-Likelihood Adaptation: Instead of needing the true target's normalization constant, they update the NF parameters $\theta$ using Stochastic Gradient Descent (SGD) to maximize the "pseudo-likelihood" of the samples already accepted by the chain. 3. Theoretical Convergence: The core contribution is extending the theory of diminishing adaptation and containment to NF-based IMH. They prove that if the updates to the NF parameters become smaller over time and the proposal maintains sufficient coverage, the chain is guaranteed to be ergodic.

Experimental Evaluation

The authors evaluated their approach on several challenging synthetic and physical benchmarks, including a 50-dimensional Brownian Bridge, a 2D Multimodal Mixture, Neal’s Funnel, and a 100-dimensional $\phi^4$ Field Theory system from statistical mechanics. These benchmarks test the sampler's ability to handle high dimensionality, extreme curvature, and multimodality.

Results and Discussion

The NF-adaptive IMH consistently outperformed standard baselines like the Adaptive Random Walk (Haario) and Preconditioned Langevin dynamics.

Performance metrics for the Brownian Bridge experiment: (a) Kolmogorov-Smirnov Statistics, (b) ESS per Second, and (c) Acceptance Probability.

As shown in the performance metrics above, the acceptance probability for NF-based methods (c) climbs rapidly toward 1.0, while traditional methods often plateau at much lower values. In the Brownian Bridge experiment, the NF-IMH achieved an Effective Sample Size (ESS) per second (b) nearly 10x higher than Langevin methods. In the $\phi^4$ field experiment, while local samplers (Langevin) got stuck in a single mode, the NF-adaptive sampler successfully learned both modes and jumped between them, recovering the correct statistical weights.

Conclusion

While the NF-adaptive IMH shows great promise, it is not without limitations. "Mode collapse" can still occur if the initial chain doesn't find all relevant regions of the distribution, often requiring a broad initial proposal. Additionally, while the ESS per second is high, training the neural network adds computational overhead. The trade-off is most beneficial for targets where the density evaluation itself is expensive. Future work will look into extending these rigorous bounds to unbounded spaces and further optimizing the training process.

Summary updated

BibTeX
@inproceedings{brofos2022adaptation,
  author = {James A. Brofos and Marylou Gabrié and Marcus A. Brubaker and Roy R. Lederman},
  title = {{Adaptation of the Independent Metropolis-Hastings Sampler with Normalizing Flow Proposals}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
}
Figure