Langevin Diffusion Tutorial: Hands-on Introduction¶
Diffusion models have generated a lot of excitement in recent years as powerful generative models that allow to generate novel images from text prompts (see Stable Diffusion), molecules, or proteins. Diffusion models rely on Stochastic Differential Equations, a hard to digest mathematical concept for somehow new to the field. Therefore, I want to provide a bit more intuition to SDEs. In this tutorial, we will study a specific stochastic differential equation: the Langevin diffusion - a fundamental SDE to understand diffusion models. In the next tutorial, we will then dive deeper into Ito-SDEs - the basis for most concepts.
Introduction to Langevin diffusion. The Langevin diffusion has been discovered in physics to describe the motion of particles driven by random and deterministic forces. Due to the random forces, it is a stochastic process that in generative AI describes the evolution of a probability distribution over time. It is named after the French mathematician Paul Langevin, who first introduced the concept in the early 20th century.
In the context of generative modeling, the Langevin diffusion is often used as a way to sample from a probability distribution $p(\mathbf{x})$ that is difficult to sample from directly. $p$ can be the distribution of random portraits of people - and we can generate a novel image from it. The following are examples of images generated by a Langevin diffusion from Song and Ermon 2019 trained on the MNIST dataset (left), the CelebA dataset (middle), and CIFAR-10 (right):