Stochastic Dynamics
modeling randomness through time-dependent processes, differential equations, and sampling techniques
Core Concepts Covered
- Markov processes and time-dependent stochastic systems
- Stochastic Differential Equations (SDEs) and diffusion models
- Sampling methods: Monte Carlo and MCMC
1. Markov Processes and Stochastic Chains
In many machine learning applications (such as sequence generation, reinforcement learning, or generative diffusion models), physical states evolve over time with an element of randomness. We model these time-dependent noisy systems using Stochastic Processes.
• The Markov Property: A stochastic process has the Markov property (or is 'memoryless') if its future state depends strictly on its *present* state, and is independent of its entire past history. Formally:
• Markov Chains: Discrete-time Markov processes operating on discrete state spaces. We represent transition probabilities from any state to inside a square Transition Matrix where rows sum to exactly .
Weather Chain Example: Suppose we have a 2-state weather system: Sunny () and Rainy (). Let the transition matrix be:
This means if today is Sunny, there is an chance tomorrow is Sunny, and a chance it rains. If today is Rainy, there is a chance tomorrow is Sunny. Over infinite days, the weather probabilities settle into a stable Stationary Distribution satisfying :
Since probabilities must sum to 1 (), we solve: . Thus, over infinite time, the climate is guaranteed to be Sunny of the time, regardless of today's weather!
2. Stochastic Differential Equations & Langevin Dynamics
While standard calculus models smooth, deterministic curves, physical systems fluctuate randomly. We model continuous-time noisy trajectories using Stochastic Differential Equations (SDEs).
An SDE adds a stochastic noise term (governed by a Brownian motion / Wiener process ) to a standard deterministic differential equation:
where represents the deterministic drift (forces pulling the system toward a trend), and represents the stochastic diffusion (fluctuations or noise surrounding the trend).
• Langevin Dynamics: A specialized SDE modeling the physical thermal motion of particles suspended in fluid. In machine learning, Langevin dynamics is incredibly powerful because it allows us to draw samples from highly complex, unnormalized probability distributions using only their gradients (the 'score' function ): By taking derivative steps towards high-probability densities while injecting continuous Wiener noise , the path explores and samples the entire target distribution safely.
3. Sampling Methods & Denoising Diffusion Models
In Generative AI, we often need to generate samples from highly complex, high-dimensional probability distributions (like the distribution of all realistic human faces).
• Monte Carlo Sampling: Simulates random experiments repeatedly to approximate deterministic parameters (for instance, estimating the area of a circle by throwing random darts inside a bounding square).
• Markov Chain Monte Carlo (MCMC): A class of algorithms (like Metropolis-Hastings) that constructs a custom Markov chain whose stationary distribution is exactly our target distribution , allowing us to sample from complex spaces by walking along the chain.
• Denoising Diffusion Probabilistic Models (DDPM): The stochastic foundation behind modern generative image models. A forward diffusion process gradually degrades an input image into pure Gaussian noise by adding noise in tiny SDE steps. The model then learns a reverse process—using neural networks to estimate and subtract noise at each step, stochastically regenerating highly realistic images from pure noise.
Interactive Practice Quiz
Test your understanding with instant feedback
