Variational Measure Preserving Flows

Yichuan Zhang, José Miguel Hernández-Lobato, Zoubin GhahramaniarXiv 2018

Abstract: Statistical inference methods are fundamentally important in machine learning. Most state-of-the-art inference algorithms are variants of Markov chain Monte Carlo (MCMC) or variational inference (VI). However, both methods struggle with limitations in practice: MCMC methods can be computationally demanding; VI methods may have large bias. In this work, we aim to improve upon MCMC and VI by a novel hybrid method based on the idea of reducing simulation bias of finite-length MCMC chains using gradient-based optimisation. The proposed method can generate low-biased samples by increasing the length of MCMC simulation and optimising the MCMC hyper-parameters, which offers attractive balance between approximation bias and computational efficiency. We show that our method produces promising results on popular benchmarks when compared to recent hybrid methods of MCMC and VI.

Introduction: The Inference Trade-off

In statistical inference, researchers traditionally face a choice between two paradigms: Markov Chain Monte Carlo (MCMC) and Variational Inference (VI). MCMC is considered the "gold standard" for accuracy because it is asymptotically unbiased; given sufficient time, it will eventually sample from the true target distribution. However, it is computationally expensive, requires long "burn-in" periods, and produces correlated samples.

Conversely, VI frames inference as an optimization problem, offering significant speed advantages. The drawback is inherent bias: VI typically fits the target distribution into a simplified parametric shape (e.g., a Gaussian), often failing to capture complex correlations or multi-modal structures. Ergodic Inference (EI) bridges this gap by optimizing the path of an MCMC chain to ensure rapid convergence to the target distribution.

The Ergodic Inference Framework

The core innovation of this work is the Ergodic Modified Lower Bound (EMLBO). Unlike previous hybrid approaches where the objective function becomes increasingly difficult to optimize as the MCMC chain length grows, the EMLBO remains tractable and directly quantifies sample bias.

Key components of the EI framework include:

  1. Dynamic Hyperparameter Tuning: EI utilizes gradients to automatically tune MCMC parameters—such as step size and variance in Hamiltonian Monte Carlo (HMC)—at every step of the chain.
  2. Entropy Constraint: To prevent the optimization from collapsing into a single point, the authors mandate that the initial distribution must have higher entropy than the target. This forces the chain to explore the state space rather than prematurely exploiting local optima.
  3. The Stop-Gradient Trick: Backpropagating through long MCMC chains is computationally intensive. The authors found that "stopping" the gradient at the input of each MCMC step accelerates training by up to 5x with negligible impact on final accuracy.
Expectation of log-density vs. chain length. Training significantly improves convergence speed towards the target (red line), with the stop-gradient trick maintaining performance.

Experimental Evaluation

The authors evaluated EI across synthetic benchmarks, Deep Generative Models (VAEs on MNIST), and Bayesian Neural Networks (BNNs) on UCI regression tasks.

Key Results

  • Visual and Statistical Accuracy: On complex 2D synthetic distributions, EI produced samples that were statistically indistinguishable from ground truth. Traditional Variational Inference (HVI) showed significant bias in these same scenarios.
  • Deep Learning Performance: In MNIST experiments, Hamiltonian Ergodic Inference (HEI) achieved a test log-likelihood of -81.43, outperforming standard VAEs (-83.57) and previous hybrid methods like HVI (-81.94).
  • BNN Superiority: On UCI regression tasks, HEI consistently outperformed Stochastic Gradient HMC (SGHMC), providing superior predictive log-likelihoods across multiple datasets (Boston Housing, Concrete, etc.).
The optimized distribution $P_9^*$ closely approximates the target distribution after only 9 steps.

Conclusion and Limitations

Ergodic Inference treats convergence as an active optimization goal rather than a passive property of a Markov chain. By optimizing the marginal distribution of the final state, it generates independent samples that are highly effective for downstream tasks. Furthermore, unlike standard VI, the bias in EI is guaranteed to decrease as the MCMC chain length increases.

The primary limitation is the Entropy Requirement: the user must ensure the initial distribution ($P_0$) is sufficiently broad. If the initial state is too narrow, the optimization may deteriorate. Future work will focus on automating the selection of these entropy hyperparameters and exploring more flexible MCMC kernels.

Summary updated

BibTeX
@misc{zhang2018variational,
  author = {Yichuan Zhang and José Miguel Hernández-Lobato and Zoubin Ghahramani},
  title = {{Variational Measure Preserving Flows}},
  year = {2018},
  eprint = {1805.10377},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.10377},
}
Figure