HomeMachine Learning & Neural NetworksLangevin Dynamics and Score-Based Generative Models

🌫️ 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.

Machine Learning & Neural Networks3DModerate60 FPS
langevin-dynamics-score-based-lab ↗ Open standalone

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.

⚙ Under the hood

Watch scattered particles organize onto a target manifold as annealed score-guided steps plus noise pull them toward high-density regions.

langevin dynamicsscore-based generative modelscore matchingdiffusion modelsstochastic gradientmachine-learning

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)