Langevin dynamics is mathematical model of molecular systems that can be used as a method for sampling from a distribution .

Langevin Equation

The Langevin equation is

where we have particle position , particle velocity , and noise . This is also commonly written as

where is Brownian motion, making a noise term. Generalizing this form, we have

is called the drift coefficient, and is the diffusion coefficient.

MCMC Sampling

In machine learning, Langevin dynamics refers to a 🎯 Markov Chain Monte Carlo method that uses the above equation to sample from distribution . Specifically, our transition is

where . is sampled from an arbitrary prior distribution, and as approaches and the number of iterations approaches infinity, converges to a sample from . Note that the only term we need in the transition step is the score function , which can be trained via 🎼 Score Matching.