[Paper Review] A Complete Recipe for Stochastic Gradient MCMC
This paper introduces a complete, general framework for constructing stochastic gradient MCMC samplers using two matrices—positive semidefinite diffusion and skew-symmetric curl matrices—that guarantee the correct target distribution as the invariant measure. The method unifies existing continuous-dynamic MCMC samplers, enables systematic derivation of new ones (e.g., SGRHMC), and demonstrates improved efficiency and scalability on synthetic and streaming Wikipedia data.
Many recent Markov chain Monte Carlo (MCMC) samplers leverage continuous dynamics to define a transition kernel that efficiently explores a target distribution. In tandem, a focus has been on devising scalable variants that subsample the data and use stochastic gradients in place of full-data gradients in the dynamic simulations. However, such stochastic gradient MCMC samplers have lagged behind their full-data counterparts in terms of the complexity of dynamics considered since proving convergence in the presence of the stochastic gradient noise is non-trivial. Even with simple dynamics, significant physical intuition is often required to modify the dynamical system to account for the stochastic gradient noise. In this paper, we provide a general recipe for constructing MCMC samplers--including stochastic gradient versions--based on continuous Markov processes specified via two matrices. We constructively prove that the framework is complete. That is, any continuous Markov process that provides samples from the target distribution can be written in our framework. We show how previous continuous-dynamic samplers can be trivially "reinvented" in our framework, avoiding the complicated sampler-specific proofs. We likewise use our recipe to straightforwardly propose a new state-adaptive sampler: stochastic gradient Riemann Hamiltonian Monte Carlo (SGRHMC). Our experiments on simulated data and a streaming Wikipedia analysis demonstrate that the proposed SGRHMC sampler inherits the benefits of Riemann HMC, with the scalability of stochastic gradient methods.
Motivation & Objective
- To address the challenge of constructing valid stochastic gradient MCMC samplers that maintain the correct invariant distribution despite noisy gradients.
- To unify diverse continuous-dynamic MCMC methods—such as HMC, SGLD, and SGHMC—under a single, systematic framework.
- To provide a constructive recipe for designing new MCMC samplers with provable correctness, reducing reliance on ad hoc physical or geometric intuition.
- To enable the development of state-adaptive samplers, such as stochastic gradient Riemann Hamiltonian Monte Carlo (SGRHMC), by leveraging the framework’s completeness.
- To demonstrate the practical scalability and efficiency of the proposed framework on high-dimensional and streaming data, including a real-world Wikipedia topic modeling application.
Proposed method
- Formalize continuous Markov processes via two matrices: a positive semidefinite diffusion matrix $\mathbf{D}(\mathbf{z})$ and a skew-symmetric curl matrix $\mathbf{Q}(\mathbf{z})$, where $\mathbf{z} = (\theta, r)$ includes model parameters and auxiliary variables.
- Define the SDE dynamics explicitly in terms of the target distribution and these two matrices, ensuring the desired stationary distribution is achieved.
- Prove the framework is complete: any continuous Markov process with the target invariant distribution can be expressed in this form, and vice versa.
- Construct full-data and minibatch variants of the sampler by replacing full-data gradients with stochastic gradients from data subsamples.
- Use the framework to systematically derive and validate new samplers, including SGRHMC, by specifying appropriate $\mathbf{D}(\mathbf{z})$ and $\mathbf{Q}(\mathbf{z})$ matrices.
- Implement boundary reflection and parameterization techniques (e.g., expanded mean for Dirichlet priors) to maintain positivity and numerical stability in practical applications.
Experimental results
Research questions
- RQ1Can a general, systematic framework be developed to construct stochastic gradient MCMC samplers that provably maintain the correct target distribution?
- RQ2To what extent can existing MCMC samplers like SGLD, SGHMC, and Riemann HMC be unified and re-derived using a single mathematical structure?
- RQ3Can the framework be used to design new, efficient samplers such as stochastic gradient Riemann Hamiltonian Monte Carlo (SGRHMC) without ad hoc modifications?
- RQ4How does the inclusion of both geometric (Riemannian) preconditioning and Hamiltonian dynamics affect sampling efficiency in high-dimensional, correlated posteriors?
- RQ5What is the empirical performance of the proposed framework on large-scale, streaming data, such as Wikipedia topic modeling with latent Dirichlet allocation?
Key findings
- The proposed framework is complete: any continuous Markov process with the desired invariant distribution can be expressed using the two-matrix formulation of $\mathbf{D}(\mathbf{z})$ and $\mathbf{Q}(\mathbf{z})$.
- Existing samplers such as SGLD, SGHMC, and Riemann HMC can be trivially re-derived in the framework by identifying their corresponding $\mathbf{D}(\mathbf{z})$ and $\mathbf{Q}(\mathbf{z})$ matrices.
- The proposed SGRHMC sampler inherits the benefits of both Riemannian geometry and Hamiltonian dynamics, significantly improving mixing efficiency on correlated, high-dimensional posteriors.
- On synthetic data, SGRHMC outperforms SGLD and SGHMC in exploring complex, correlated distributions, with faster convergence and better mixing.
- In a streaming Wikipedia analysis using LDA, SGRHMC achieved lower perplexity and competitive runtime compared to SGLD, SGHMC, and SGRLD, demonstrating scalability and robustness.
- The average runtime per 100 Wikipedia documents was 0.806s for SGRHMC, comparable to other methods, indicating that the computational overhead of the new sampler remains manageable.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.