Mathematics for AI and Machine Learning

Foundations for modern AI and machine learning

SGLD

Chapter 18 Dynamics & diffusion

Chapter 18: Langevin Dynamics and Sampling — Stochastic Gradient Langevin Dynamics

From the book

Chapter 18: Langevin Dynamics and Sampling. In the chapter mind map this icon labels Stochastic Gradient Langevin Dynamics. The discussion below is excerpted and lightly edited from § Stochastic Gradient Langevin Dynamics (SGLD) in Mathematics for AI and Machine Learning.

The standard Langevin dynamics algorithm requires computing the exact gradient of the log-density $\nabla_{\mathbf{x}} \log p(\mathbf{x})$ at each iteration. However, in modern machine learning scenarios with large datasets, this presents significant challenges:

  • Computational Cost: Computing gradients using the entire dataset (full-batch) is prohibitively expensive for large-scale models and datasets
  • Memory Constraints: Storing the entire dataset in memory is often impossible
  • Online Learning: Many applications require learning from streaming data where the full dataset is never available

What this drawing shows

What you see. Mini-batch gradient (green) drives a noisy Langevin chain (purple); animation extends the sample path with drift (blue) plus noise (red) steps.

In the mind map. Chapter 18 — Stochastic Gradient Langevin Dynamics. See From the book above for definitions, figures, and worked examples.

Where to read next

Open Chapter 18 companion →

Read the full definitions, figures, and worked examples in Chapter 18: Langevin Dynamics and Sampling — see the mind-map node Stochastic Gradient Langevin Dynamics.

PNG Icons

Textless (256×256 px)
PNG 256×256 px Copy PNG URL
Textless (64×64 px)
PNG 64×64 px Copy PNG URL
Textless (32×32 px)
PNG 32×32 px Copy PNG URL

Animated GIFs

Animated GIF (256×256 px)
GIF 256×256 px Copy GIF URL
Animated GIF (128×128 px)
GIF 128×128 px Copy GIF URL
Animated GIF (64×64 px)
GIF 64×64 px Copy GIF URL