Skip to main content
QUICK REVIEW

[Paper Review] Oops I Took A Gradient: Scalable Sampling for Discrete Distributions

Will Grathwohl, Kevin Swersky|arXiv (Cornell University)|Feb 8, 2021
Generative Adversarial Networks and Image SynthesisComputer Science41 references8 citations
TL;DR

This paper introduces Gibbs-With-Gradients, a scalable MCMC sampling method for discrete distributions that uses gradients of the unnormalized log-density function to guide proposal distributions in Metropolis-Hastings updates. By leveraging gradient information from continuous relaxations of discrete variables, the method achieves orders-of-magnitude faster mixing than standard Gibbs sampling, especially in high-dimensional models like Ising, Potts, and deep energy-based models on discrete data, outperforming both variational autoencoders and baseline energy-based models.

ABSTRACT

We propose a general and scalable approximate sampling strategy for probabilistic models with discrete variables. Our approach uses gradients of the likelihood function with respect to its discrete inputs to propose updates in a Metropolis-Hastings sampler. We show empirically that this approach outperforms generic samplers in a number of difficult settings including Ising models, Potts models, restricted Boltzmann machines, and factorial hidden Markov models. We also demonstrate the use of our improved sampler for training deep energy-based models on high dimensional discrete data. This approach outperforms variational auto-encoders and existing energy-based models. Finally, we give bounds showing that our approach is near-optimal in the class of samplers which propose local updates.

Motivation & Objective

  • To address the inefficiency of standard MCMC samplers like Gibbs sampling in high-dimensional discrete models, where most single-site updates yield no change.
  • To develop a general-purpose, scalable sampling strategy that exploits gradient information from continuous relaxations of discrete distributions.
  • To enable effective training of deep energy-based models (EBMs) on high-dimensional discrete data such as text and images, where traditional MCMC is infeasible.
  • To demonstrate that gradient-informed proposals can outperform even samplers that exploit hard-coded block independence structures.
  • To provide a near-optimal, locally-informed sampling framework for discrete distributions that is computationally efficient and broadly applicable.

Proposed method

  • Proposes a Metropolis-Hastings sampler that uses gradients of the unnormalized log-density function with respect to continuous inputs to estimate likelihood ratios for discrete moves.
  • Uses a Taylor series approximation of the underlying continuous function to estimate the ratio of proposal probabilities for neighboring discrete states.
  • Applies these estimated likelihood ratios to construct a proposal distribution that biases updates toward likely-changing variables, improving acceptance rates.
  • Integrates the gradient-informed proposal into a Gibbs sampler framework, where the choice of which variable to update is guided by gradient magnitude to favor more active dimensions.
  • Employs a stochastic, adaptive proposal distribution over indices, where the probability of selecting a variable is proportional to its gradient magnitude, reducing wasted computation.
  • Uses the method within Persistent Contrastive Divergence (PCD) for training deep energy-based models on discrete data, enabling non-autoregressive generation and flexible conditioning.

Experimental results

Research questions

  • RQ1Can gradient information from continuous relaxations of discrete distributions improve MCMC sampling efficiency in high-dimensional discrete models?
  • RQ2Does a gradient-informed proposal distribution outperform standard Gibbs sampling and other generic samplers in models with complex discrete structure?
  • RQ3Can this method enable effective training of deep energy-based models on high-dimensional discrete data such as text and images?
  • RQ4How does the performance of the proposed sampler compare to variational autoencoders and existing energy-based models on discrete data?
  • RQ5Is the proposed method near-optimal among local-update MCMC samplers for discrete distributions?

Key findings

  • The Gibbs-With-Gradients sampler achieves acceptance rates above 70% when sampling from a 10,000-vocabulary language model, making it at least 3,500 times more efficient than standard Gibbs sampling.
  • On the MNIST dataset, the method significantly outperforms generic samplers in Ising and Potts models, demonstrating faster mixing and better convergence.
  • In training deep energy-based models on image and text data, the method enables successful non-autoregressive generation and outperforms both variational autoencoders and baseline energy-based models.
  • The method achieves a test-set log-likelihood of -77.16 on a shortened Penn Treebank dataset, outperforming a uniform baseline (-184.21) and a categorical baseline (-100.05), and approaching the performance of an autoregressive LSTM (-74.0).
  • The approach is shown to outperform samplers that exploit hard-coded block independence in some cases, indicating that gradient information can compensate for missing structural knowledge.
  • Theoretical bounds show that the method is near-optimal within the class of samplers that propose local updates, validating its 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.