A Stochastic Differential Equation (SDE) is a differential equation in which one or more terms is a stochastic process, resulting in a solution that is also a stochastic process. In diffusion models, an SDE provides a continuous-time framework that generalizes the discrete forward and reverse processes, describing the data corruption as a gradual drift and diffusion of noise. The forward SDE transforms data into pure noise, while the reverse-time SDE defines the generative denoising path.
Glossary
Stochastic Differential Equation (SDE)

What is a Stochastic Differential Equation (SDE)?
A mathematical framework for modeling continuous-time stochastic processes, central to the theory of score-based and diffusion generative models.
The SDE framework unifies Denoising Diffusion Probabilistic Models (DDPMs) and score-based generative models under a single theory. The drift coefficient dictates the deterministic component of the transformation, while the diffusion coefficient scales the stochastic Wiener process (Brownian motion). Training involves learning a score network to approximate the gradient of the log data density, enabling the numerical simulation of the reverse SDE for sample generation via methods like Euler-Maruyama discretization.
Key Components of an SDE in Diffusion
A Stochastic Differential Equation (SDE) provides a continuous-time framework for diffusion models, describing the data corruption (forward) and generation (reverse) processes as trajectories influenced by both deterministic drift and random noise.
Drift Coefficient
The drift coefficient, often denoted as f(x_t, t), is the deterministic component of the SDE. It defines the predictable, average direction of change for the data variable x_t over an infinitesimal time step.
- In the forward process, the drift is typically designed to push the data towards zero or a prior distribution.
- In the reverse process, the learned drift guides the denoising trajectory back towards the data manifold.
- It is analogous to the mean of the transition kernel in discrete-time diffusion models.
Diffusion Coefficient
The diffusion coefficient, denoted as g(t), controls the magnitude of the stochastic (noise) term in the SDE. It is a scalar function of time that determines how much random noise is injected at each instant.
- It governs the variance schedule of the corruption process.
- A common choice is g(t) = √(dβ/dt), linking it to the noise schedule β(t) from discrete models.
- In the variance-exploding SDE formulation, g(t) increases over time, while in the variance-preserving SDE, it is coupled with the drift to keep total variance constant.
Wiener Process (Brownian Motion)
The Wiener process, W_t (or dB_t), is the source of continuous random noise in the SDE. Its infinitesimal increments dW_t are normally distributed with mean zero and variance dt.
- It provides the fundamental stochastic driver for the forward corruption: dx = f(x,t)dt + g(t)dW.
- The reverse-time SDE, used for generation, involves a backward Wiener process and a correction term dependent on the score function.
- This mathematical object formalizes the continuous addition of Gaussian noise, generalizing the discrete noise addition steps in models like DDPM.
Score Function
The score function, ∇_x log p_t(x), is the gradient of the log-probability of the data distribution at time t. It is the critical learned quantity that steers the reverse SDE.
- The reverse-time SDE for generation is: dx = [f(x,t) - g(t)² ∇_x log p_t(x)] dt + g(t) dW̄.
- The term -g(t)² ∇_x log p_t(x) is a drift correction that points towards regions of high data density.
- A neural score network s_θ(x_t, t) is trained to approximate this function, typically via score matching or as a noise prediction network.
Probability Flow ODE
The Probability Flow Ordinary Differential Equation (ODE) is a deterministic counterpart to the reverse-time SDE that shares the same marginal probability distributions p_t(x) at every time t.
- It is derived by removing the stochastic noise term from the reverse SDE: dx = [f(x,t) - ½ g(t)² ∇_x log p_t(x)] dt.
- This ODE defines a deterministic sampling trajectory, enabling faster samplers and exact likelihood computation.
- It connects diffusion models to continuous normalizing flows, where the learned score defines the flow's vector field.
Time Variable
The continuous time variable t ∈ [0, T] parameterizes the entire diffusion trajectory, replacing the discrete timestep index. Time flows from t=0 (data distribution) to t=T (approximate noise distribution).
- The drift f(x,t) and diffusion g(t) coefficients are explicitly functions of time.
- The score network s_θ(x_t, t) is conditioned on time, often via sinusoidal embeddings or learned embeddings.
- The choice of T and the functional forms of f and g define the specific SDE formulation (e.g., Variance Preserving, Variance Exploding).
SDE vs. Discrete-Time Diffusion Frameworks
A comparison of the continuous-time Stochastic Differential Equation (SDE) framework and discrete-time diffusion models (e.g., DDPM) for data generation, highlighting foundational differences in formulation, sampling, and theoretical grounding.
| Framework Feature | Stochastic Differential Equation (SDE) | Discrete-Time Diffusion (e.g., DDPM) |
|---|---|---|
Mathematical Foundation | Continuous-time stochastic calculus; Itô or Stratonovich integrals. | Discrete-time Markov chain; fixed sequence of Gaussian transitions. |
Forward Process Formulation | Defined by a drift and diffusion coefficient: dx = f(x,t)dt + g(t)dw. | Defined by a fixed noise schedule: x_t = √(ᾱ_t)x_0 + √(1-ᾱ_t)ε. |
Time Variable | Continuous, t ∈ [0, T]. | Discrete, indexed by timesteps k ∈ {0, 1, ..., K}. |
Reverse Process Sampling | Solves a reverse-time SDE or its associated Probability Flow ODE. | Iteratively applies a learned denoising function x_{k-1} = μ_θ(x_k, k). |
Sampling Flexibility | High; enables adaptive step solvers and trade-offs between stochastic (SDE) and deterministic (ODE) paths. | Lower; typically locked into the predefined number of timesteps K, though accelerated samplers (DDIM) exist. |
Theoretical Connection | Directly linked to score-based generative modeling and continuous normalizing flows. | Derivable as a discretization of an underlying SDE under a specific noise schedule. |
Primary Training Objective | Score matching (estimating ∇_x log p_t(x)). | Variational lower bound (ELBO) or simplified noise prediction loss. |
Parameterization of Model | Score network s_θ(x, t) ≈ ∇_x log p_t(x). | Noise prediction network ε_θ(x_t, t) or mean prediction network μ_θ(x_t, t). |
Frequently Asked Questions
A continuous-time framework for modeling the forward and reverse processes in diffusion models, where the data corruption and generation are described by differential equations with a stochastic (noise) component.
A Stochastic Differential Equation (SDE) is a mathematical framework that describes the evolution of a system over continuous time, where the dynamics are governed by both a deterministic drift component and a random diffusion component driven by a Wiener process (Brownian motion). In the context of diffusion models, SDEs provide a unified, continuous-time perspective for the forward noising process and the reverse generative process. The forward SDE gradually corrupts data into pure noise, while the corresponding reverse-time SDE describes how to denoise a sample back into data from the target distribution. This formulation generalizes discrete-time diffusion models and connects them to concepts in score-based generative modeling and probability flow ODEs.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Stochastic Differential Equations (SDEs) provide the continuous-time mathematical framework for diffusion models. These related concepts define the specific processes, objectives, and architectures built upon this foundation.
Forward Process
The fixed Markov chain in a diffusion model that gradually adds Gaussian noise to a data sample over a series of timesteps, transforming it into pure noise. This is the corruption process modeled by the forward SDE.
- Mathematically, it's defined by a stochastic differential equation:
dx = f(x, t)dt + g(t)dw, wheredwis a Wiener process (Brownian motion). - The noise schedule determines the coefficients
fandg, controlling the rate of corruption. - The process ends at a predefined terminal time
T, where the data distribution is transformed into a tractable prior (e.g., standard Gaussian).
Reverse Process
The learned generative trajectory that iteratively denoises a sample of pure noise, reversing the forward SDE to synthesize new data from the target distribution. This is the solution to the reverse-time SDE.
- Training involves learning a score function or a noise prediction network to approximate the drift term of the reverse SDE.
- Sampling simulates the reverse SDE starting from noise, using numerical solvers like Euler-Maruyama.
- The challenge is that the reverse SDE depends on the score of the data distribution, which must be estimated from data.
Score Matching & Score Function
A training objective where a neural network (score network) learns to estimate the gradient of the log probability density of the data—the score function ∇_x log p(x).
- The score points toward regions of higher data density.
- In the SDE framework, the reverse process drift term is
f(x,t) - g(t)² ∇_x log p_t(x). Thus, learning the score is essential for reversing the diffusion. - Denoising Score Matching is a practical variant that trains the network to predict the noise added during the forward process, which is proportional to the score.
Probability Flow ODE
An ordinary differential equation (ODE) derived from the reverse-time SDE of a diffusion model. It describes a deterministic sampling trajectory that shares the same marginal probability distributions as the stochastic process.
- Formulation: Given the reverse SDE
dx = [f(x,t) - g(t)² ∇_x log p_t(x)]dt + g(t)dw, the corresponding ODE isdx = [f(x,t) - ½ g(t)² ∇_x log p_t(x)]dt. - Benefits: Enables fast, deterministic samplers, exact likelihood computation, and latent space interpolation.
- Connection: This ODE is the foundation for Consistency Models, which learn to map any point on an ODE trajectory directly to its origin.
Noise Schedule
A predefined function that controls the variance of the Gaussian noise added at each step in the forward SDE, determining the progression from data to noise.
- In the SDE
dx = f(x, t)dt + g(t)dw, the functiong(t)is the noise scale. - Common schedules include linear, cosine, and sigmoid, affecting training stability and sampling speed.
- A Variance-Exploding schedule lets the variance grow unbounded, while a Variance-Preserving schedule constrains total variance to 1.
- The schedule is a critical design choice impacting the curvature of the probability path and the difficulty of the reverse process.
Consistency Models
A class of generative models that learn to map any point on a Probability Flow ODE trajectory directly back to its origin (the data point), enabling one or few-step generation.
- Core Idea: Enforce self-consistency—if you apply the ODE solver from two different points on the same trajectory to the same end time, you should arrive at the same point.
- Training: Can be distilled from a pretrained diffusion model (Consistency Distillation) or trained from scratch (Consistency Training).
- Result: A model that performs high-quality generation in minimal steps by leveraging the deterministic ODE framework derived from the SDE.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us