Skip to main content
QUICK REVIEW

[Paper Review] Meta-Learning for Stochastic Gradient MCMC

Wenbo Gong, Yingzhen Li|arXiv (Cornell University)|Jun 12, 2018
Domain Adaptation and Few-Shot LearningComputer Science38 references18 citations
TL;DR

This paper introduces the first meta-learning framework for automatically designing stochastic gradient MCMC (SG-MCMC) samplers with learnable dynamics, extending Hamiltonian dynamics via neural networks to parameterize state-dependent drift and diffusion matrices. The learned sampler generalizes across datasets and architectures, outperforming standard SG-MCMC methods in Bayesian neural network inference with faster convergence and better sampling efficiency.

ABSTRACT

Stochastic gradient Markov chain Monte Carlo (SG-MCMC) has become increasingly popular for simulating posterior samples in large-scale Bayesian modeling. However, existing SG-MCMC schemes are not tailored to any specific probabilistic model, even a simple modification of the underlying dynamical system requires significant physical intuition. This paper presents the first meta-learning algorithm that allows automated design for the underlying continuous dynamics of an SG-MCMC sampler. The learned sampler generalizes Hamiltonian dynamics with state-dependent drift and diffusion, enabling fast traversal and efficient exploration of neural network energy landscapes. Experiments validate the proposed approach on both Bayesian fully connected neural network and Bayesian recurrent neural network tasks, showing that the learned sampler out-performs generic, hand-designed SG-MCMC algorithms, and generalizes to different datasets and larger architectures.

Motivation & Objective

  • To automate the design of SG-MCMC samplers tailored to specific probabilistic models, particularly Bayesian neural networks.
  • To overcome the need for manual physical intuition in designing SG-MCMC dynamics that preserve the correct stationary distribution.
  • To enable generalization of learned samplers across different datasets, network architectures, and task complexities.
  • To develop a meta-learning framework that trains a sampler on simple tasks and transfers it to complex, high-dimensional posterior distributions.
  • To improve sampling efficiency and convergence speed in Bayesian deep learning by learning optimal dynamics for traversal through complex energy landscapes.

Proposed method

  • Proposes a meta-learned SG-MCMC sampler that extends Hamiltonian dynamics with neural network parameterized drift and diffusion matrices.
  • Uses a continuous SDE formulation with learnable functions for the drift (curl matrix) and diffusion (diffusion matrix), ensuring the target posterior remains the stationary distribution.
  • Employs a meta-learning objective where the sampler is trained on a distribution of tasks (e.g., different datasets or architectures) to learn generalizable dynamics.
  • Trains the sampler using unrolled trajectories in a bilevel optimization setup, where the inner loop simulates the SG-MCMC dynamics and the outer loop updates the meta-parameters via gradient descent on validation performance.
  • Parameterizes the diffusion matrix using a product of two neural networks: one for adaptive friction and one for momentum control, enabling dynamic adjustment based on energy and gradient direction.
  • Applies the learned sampler to both fully connected and recurrent neural networks, evaluating performance on Bayesian inference tasks with test NLL and convergence speed.

Experimental results

Research questions

  • RQ1Can meta-learning be used to automatically design SG-MCMC samplers with optimal dynamics for Bayesian neural network inference?
  • RQ2Can a meta-learned sampler generalize across different datasets and network architectures without retraining?
  • RQ3Does a learned dynamics sampler outperform hand-designed SG-MCMC algorithms like SGHMC and SGLD in sampling efficiency and accuracy?
  • RQ4How do the learned drift and diffusion matrices adapt to different regions of the energy landscape (e.g., high vs. low energy areas)?
  • RQ5Can the meta-learned sampler maintain performance when applied to tasks with different data distributions or sequence structures, such as in RNNs?

Key findings

  • The meta-learned sampler achieved faster convergence than SGHMC and comparable performance to Santa and Adam on the Piano-midi dataset, with similar speed at early training stages.
  • On the MuseData dataset, the meta sampler achieved better final test NLL than SGHMC, demonstrating superior performance in long-horizon sampling.
  • The meta sampler generalized successfully to the Nottingham and JSB chorales datasets, though performance was slightly worse than other methods, likely due to distributional differences from training data.
  • Removing the offset term β in the friction network (NNSGHMC-s) reduced overfitting and improved test NLL on JSB to 8.40, showing improved robustness.
  • The learned diffusion matrix dynamically adjusted friction: higher in low-energy regions to prevent divergence and lower in high-energy regions to maintain momentum, based on gradient and momentum sign alignment.
  • The meta-learned sampler outperformed generic SG-MCMC methods like SGLD and SGHMC in both Bayesian fully connected and recurrent neural networks, confirming its generalization and efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.