Can independent Metropolis beat crude Monte Carlo?

Siran Liu, Petros Dellaportas, Michalis K. Titsias · DOI

Introduction

In Bayesian statistics, the "gold standard" for calculating expectations over a target distribution $\pi$ is i.i.d. sampling, often referred to as Crude Monte Carlo (CMC). However, because the target distribution is typically known only up to a normalizing constant, researchers usually rely on Markov Chain Monte Carlo (MCMC) methods. The conventional wisdom is that MCMC is a "second-best" alternative because it produces dependent samples, which generally increases the variance of the resulting estimators compared to i.i.d. samples.

This paper challenges that narrative. The authors demonstrate that by using control variates derived from the Poisson equation, an Independent Metropolis (IM) sampler can actually achieve lower asymptotic variance than i.i.d. sampling. This counter-intuitive result suggests that the dependency in MCMC, usually viewed as a drawback, can be leveraged as a powerful feature for variance reduction.

The Innovation: Control Variates via the Poisson Equation

The Independent Metropolis sampler draws proposals from a density $q$ that is independent of the current state. The authors' approach to improving this sampler rests on two main pillars: exploiting the Markovian structure and adaptive learning.

1. Leveraging the Poisson Equation

To reduce variance, the authors utilize "control variates"—terms with a known expectation (usually zero) that are added to an estimator to cancel out noise. Traditionally, these require knowing the expectation of the variate under the target distribution, which is precisely what is unknown in Bayesian tasks.

The authors solve this by looking at the Poisson equation associated with the Markov chain. They prove that the optimal control variate is related to the solution of this equation. Crucially, they show that as the proposal distribution $q$ approaches the target $\pi$, the function of interest $F$ itself becomes an excellent approximation for this solution. By incorporating information from both the current state and the proposed state—even if that proposal is rejected—they create a new estimator, $\mu_{n,IMCV}$, that utilizes the "wasted" information in the Metropolis-Hastings step.

2. Adaptive Learning

For the control variate to be effective, the proposal $q$ must be a good approximation of $\pi$. The authors introduce an Adaptive Independent Metropolis algorithm that learns the optimal proposal distribution on the fly. Using stochastic gradient descent and the "reparameterization trick" (common in variational inference), the algorithm minimizes the KL divergence between the proposal and the target during the sampling process. This ensures that the sampler becomes increasingly efficient as the chain progresses.

Experimental Results

The authors evaluated their method across several benchmarks, ranging from synthetic toy examples to complex Bayesian tasks.

  • Bayesian Model Selection: In a non-conjugate linear regression problem, the method achieved a Variance Reduction Factor (VRF) as high as 4763x compared to Crude Monte Carlo for high-dimensional models.
  • Logistic Regression: Testing on classic datasets (Ripley, Pima Indian, Heart, and German), the adaptive IMCV estimator consistently provided VRFs between 2.7 and 57.2 over standard IM.
  • Gaussian Process (GP) Regression: On the Boston Housing and Pendulum datasets, the method proved effective at estimating kernel hyperparameters, maintaining significant efficiency gains even as dimensions increased.

Key Insights

  • Beating i.i.d. Sampling: Theorem 2 of the paper provides the rigorous conditions under which MCMC is strictly better than i.i.d. sampling. This occurs because the control variates effectively use rejected proposals to cancel out the variance inherent in the sampling process.
  • Dependency as a Feature: The dependency between samples in MCMC is what allows for the construction of the zero-expectation terms needed for these control variates. In this framework, the Markovian nature of the chain is an asset rather than a liability.
  • Computational Efficiency: The method requires almost no extra computational overhead, as it utilizes values (like acceptance ratios) that the standard Metropolis algorithm already calculates.

Limitations and Future Directions

While the results are promising, the method has specific requirements. It assumes that the expectation of the function $F$ under the proposal density $q$ is analytically available, which limits $q$ to specific families like Gaussians or mixtures of Gaussians. Additionally, the adaptive algorithm requires a "burn-in" phase to learn the target distribution, which may be challenging for highly multi-modal targets.

Future work may explore combining this variance reduction technique with large-scale parallel computing, as the independent nature of the proposals makes the IM sampler "embarrassingly parallelizable."

Summary updated

BibTeX
@misc{liu2024can,
  author = {Siran Liu and Petros Dellaportas and Michalis K. Titsias},
  title = {{Can independent Metropolis beat crude Monte Carlo?}},
  year = {2024},
  eprint = {2406.17699},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.17699},
}
Figure