🌫️ Langevin Dynamics and Score-Based Generative Models
Explore how Langevin dynamics uses the gradient of a log-probability density — the score function — plus injected noise to walk random samples toward the high-probability regions of a data distribution, the mathematical engine behind diffusion models.
The simulation visualizes a 2D probability landscape as a vector field of score arrows, showing how particles injected with Gaussian noise drift and jitter along the score gradient until their positions settle into the true shape of the underlying distribution rather than piling up at a single peak.
🔬 What It Demonstrates
The simulation visualizes a 2D probability landscape as a vector field of score arrows, showing how particles injected with Gaussian noise drift and jitter along the score gradient until their positions settle into the true shape of the underlying distribution rather than piling up at a single peak.
🎮 How to Use
Choose a target distribution, drag the step-size (epsilon) and noise-scale sliders to see how drift versus jitter changes the trajectories, then press play to release a cloud of random particles and watch annealed Langevin steps sculpt them into the distribution's shape.
💡 Did You Know?
The equations were first written down in 1908 by Paul Langevin to explain Brownian motion, the random jiggling of pollen grains in water — more than a century later, the same drift-plus-noise mathematics became the sampling engine inside image-generating diffusion models like Stable Diffusion.
Watch scattered particles organize onto a target manifold as annealed score-guided steps plus noise pull them toward high-density regions.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install