ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Introduction to Diffusion Models for Generative AI
Chapter 1: Generative Modeling Fundamentals
Overview of Generative Models
Motivation for Diffusion Models
The Core Idea: Noise and Denoise
Probabilistic Framework Introduction
Quiz for Chapter 1
Chapter 2: The Forward Diffusion Process
Defining the Markov Chain
Gaussian Noise Schedule
Mathematical Formulation per Step
Sampling from Intermediate Steps
Properties of the Forward Process
Practice: Simulating Forward Diffusion
Quiz for Chapter 2
Chapter 3: The Reverse Diffusion Process
The Goal: Reversing the Markov Chain
Approximating the Reverse Transition
Parameterizing the Reverse Process with Neural Networks
Predicting the Noise Component
Mathematical Formulation of the Denoising Step
Quiz for Chapter 3
Chapter 4: Model Architecture and Training
The U-Net Architecture for Noise Prediction
Integrating Timestep Information
Defining the Training Objective
Simplified Training Loss Derivation
The Training Algorithm
Hands-on Practical: Setting up the U-Net
Quiz for Chapter 4
Chapter 5: Sampling and Generation Process
Generating Data from Noise
The DDPM Sampling Algorithm
Understanding Sampling Variance
Introduction to Faster Sampling: DDIM
The DDIM Sampling Algorithm
Trade-offs Between DDPM and DDIM
Practice: Implementing Sampling Loops
Quiz for Chapter 5
Chapter 6: Conditional Generation with Diffusion Models
Motivation for Conditional Generation
Classifier Guidance
Classifier-Free Guidance (CFG)
Implementing Classifier-Free Guidance
Text Conditioning Basics
Architecture Modifications for Conditioning
Hands-on Practical: Applying Guidance
Quiz for Chapter 6

Gaussian Noise Schedule

The forward diffusion process is a Markov chain that gradually injects noise into data x0x_0x0​ over TTT discrete timesteps. A significant aspect of this process is controlling how much noise is added at each step. This isn't done with random amounts; instead, a carefully defined plan known as the noise schedule is followed.

The noise schedule is a sequence of variance values, denoted as β1,β2,...,βT\beta_1, \beta_2, ..., \beta_Tβ1​,β2​,...,βT​. Each βt\beta_tβt​ determines the variance of the Gaussian noise added when transitioning from state xt−1x_{t-1}xt−1​ to xtx_txt​. These values are hyperparameters, meaning they are chosen before training the model. They are not learned during the training process itself.

Think of the noise schedule as setting the "intensity" of the noising process at each step. The values of βt\beta_tβt​ are typically chosen such that:

  1. They are small, ensuring that the change between consecutive steps xt−1x_{t-1}xt−1​ and xtx_txt​ is limited.
  2. They increase gradually over the timesteps, so more noise is added in later steps compared to earlier ones.
  3. The cumulative effect over TTT steps is sufficient to transform the original data distribution into something very close to a standard Gaussian distribution (isotropic noise).

Defining the Schedule Values

The original Denoising Diffusion Probabilistic Models (DDPM) paper proposed a linear schedule, where βt\beta_tβt​ increases linearly from a small starting value βstart\beta_{start}βstart​ (e.g., 10−410^{-4}10−4) to a larger ending value βend\beta_{end}βend​ (e.g., 0.020.020.02) over TTT steps (often T=1000T=1000T=1000).

The formula for a linear schedule is:

βt=βstart+(t−1)βend−βstartT−1for t=1,...,T\beta_t = \beta_{start} + (t-1) \frac{\beta_{end} - \beta_{start}}{T-1} \quad \text{for } t = 1, ..., Tβt​=βstart​+(t−1)T−1βend​−βstart​​for t=1,...,T

While simple and effective, other schedules have been developed. A popular alternative is the cosine schedule, introduced in the "Improved Denoising Diffusion Probabilistic Models" paper. This schedule changes more slowly near the beginning and end of the process, potentially leading to better performance and preventing the signal from being destroyed too quickly early on.

The cosine schedule is defined using related quantities αt=1−βt\alpha_t = 1 - \beta_tαt​=1−βt​ and αˉt=∏i=1tαi\bar{\alpha}_t = \prod_{i=1}^t \alpha_iαˉt​=∏i=1t​αi​. It sets αˉt\bar{\alpha}_tαˉt​ based on a cosine function and then derives the corresponding βt\beta_tβt​:

αˉt=f(t)f(0)wheref(t)=cos⁡((tT+s)/(1+s)⋅π2)2\bar{\alpha}_t = \frac{f(t)}{f(0)} \quad \text{where} \quad f(t) = \cos\left( \left( \frac{t}{T} + s \right) / (1+s) \cdot \frac{\pi}{2} \right)^2αˉt​=f(0)f(t)​wheref(t)=cos((Tt​+s)/(1+s)⋅2π​)2

Here, sss is a small offset (e.g., 0.0080.0080.008) to prevent βt\beta_tβt​ from being too small near t=0t=0t=0. Once αˉt\bar{\alpha}_tαˉt​ is calculated for all ttt, the individual βt\beta_tβt​ values can be recovered:

βt=1−αˉtαˉt−1\beta_t = 1 - \frac{\bar{\alpha}_t}{\bar{\alpha}_{t-1}}βt​=1−αˉt−1​αˉt​​

The choice of schedule impacts how quickly information from the original data x0x_0x0​ is obscured. A schedule that adds noise too aggressively early on might make the reverse process harder to learn. Conversely, adding too little noise overall might not sufficiently transform the data into a simple prior distribution by step TTT.

Let's visualize how these two common schedules compare for T=1000T=1000T=1000 steps, with βstart=0.0001\beta_{start}=0.0001βstart​=0.0001 and βend=0.02\beta_{end}=0.02βend​=0.02 for the linear schedule, and s=0.008s=0.008s=0.008 for the cosine schedule derived to approximately match the noise level at TTT.

Variance (βt\beta_tβt​) added at each timestep for linear and cosine schedules over T=1000T=1000T=1000 steps. The cosine schedule adds noise more slowly initially and accelerates towards the end compared to the linear schedule.

Role in the Markov Step

Recall from the previous section that the forward process step is defined by the conditional probability q(xt∣xt−1)q(x_t | x_{t-1})q(xt​∣xt−1​). This transition is defined as adding Gaussian noise with a specific mean and variance:

q(xt∣xt−1)=N(xt;1−βtxt−1,βtI)q(x_t | x_{t-1}) = \mathcal{N}(x_t; \sqrt{1 - \beta_t} x_{t-1}, \beta_t \mathbf{I})q(xt​∣xt−1​)=N(xt​;1−βt​​xt−1​,βt​I)

Here, the noise schedule value βt\beta_tβt​ directly sets the variance of the Gaussian noise added at timestep ttt. The mean is scaled by 1−βt\sqrt{1 - \beta_t}1−βt​​ to ensure the overall variance of the data doesn't explode. Since βt\beta_tβt​ is small, 1−βt\sqrt{1 - \beta_t}1−βt​​ is slightly less than 1, gradually shrinking the contribution of the previous state xt−1x_{t-1}xt−1​.

In summary, the Gaussian noise schedule {βt}t=1T\{\beta_t\}_{t=1}^T{βt​}t=1T​ is a sequence of pre-defined hyperparameters controlling the magnitude of noise added at each step of the forward diffusion process. Its design (e.g., linear, cosine) and the range of values are important choices that influence the trajectory from data to noise and affect the subsequent learning of the reverse process. We will see later how these βt\beta_tβt​ values, and related quantities derived from them, appear in both the training objective and the sampling process.

  • Denoising Diffusion Probabilistic Models, Jonathan Ho, Ajay Jain, Pieter Abbeel, 2020 Advances in Neural Information Processing Systems (NeurIPS) DOI: 10.48550/arXiv.2006.11239 - The foundational paper that introduces the Denoising Diffusion Probabilistic Models (DDPM) framework and the linear noise schedule.
  • Elucidating the Design Space of Diffusion-Based Generative Models, Tero Karras, Miika Aittala, Timo Aila, Samuli Laine, 2022 Advances in Neural Information Processing Systems (NeurIPS) DOI: 10.48550/arXiv.2206.00364 - Analyzes the various design choices for diffusion models, including how noise schedule parameterizations impact training and sampling efficiency and quality.

© 2026 ApX Machine Learning