Foundations and Trends® in Computer Graphics and Vision > Vol 17 > Issue 1

Step-by-Step Diffusion: An Elementary Tutorial

By Preetum Nakkiran, Apple, USA, preetum@nakkiran.org | Arwen Bradley, Apple, USA | Hattie Zhou, Apple, USA and Mila, University of Montreal, Canada | Madhu Advani, Apple, USA

 
Suggested Citation
Preetum Nakkiran, Arwen Bradley, Hattie Zhou and Madhu Advani (2025), "Step-by-Step Diffusion: An Elementary Tutorial", Foundations and TrendsĀ® in Computer Graphics and Vision: Vol. 17: No. 1, pp 1-75. http://dx.doi.org/10.1561/0600000114

Publication Date: 07 Apr 2025
© 2025 P. Nakkiran et al.
 
Subjects
Denoising,  Learning and statistical methods,  Deep learning
 

Free Preview:

Download extract

Share

Download article
In this article:
1. Fundamentals of Diffusion
2. Stochastic Sampling: DDPM
3. Deterministic Sampling: DDIM
4. Flow Matching
5. Diffusion in Practice
Appendices
Acknowledgements
References

Abstract

We present an accessible first course on the mathematics of diffusion models and flow matching for machine learning. We aim to teach diffusion as simply as possible, with minimal mathematical and machine learning prerequisites, but enough technical detail to reason about its correctness. Unlike most tutorials on this subject, we take neither a Variational Auto Encoder (VAE) nor a Stochastic Differential Equations (SDE) approach. In fact, for the core ideas we will not need any SDEs, Evidence-Based-Lower-Bounds (ELBOs), Langevin dynamics, or even the notion of a score. The reader need only be familiar with basic probability, calculus, linear algebra, and multivariate Gaussians.

This tutorial has five parts, each relatively self-contained. Section 1 presents the fundamentals of diffusion: the problem we are trying to solve and an overview of the basic approach. Sections 2 and 3 show how to construct a stochastic and deterministic diffusion sampler, respectively, and give intuitive derivations for why these samplers correctly reverse the forward diffusion process. Section 4 covers the closely-related topic of Flow Matching, which can be thought of as a generalization of diffusion that offers additional flexibility (including what are called rectified flows or linear flows). Finally, in Section 5 we return to diffusion and connect this tutorial to the broader literature while highlighting some of the design choices that matter most in practice, including samplers, noise schedules, and parametrizations.

DOI:10.1561/0600000114
ISBN: 978-1-63828-534-2
88 pp. $65.00
Buy book (pb)
 
ISBN: 978-1-63828-535-9
88 pp. $160.00
Buy E-book (.pdf)
Table of contents:
1. Fundamentals of Diffusion
2. Stochastic Sampling: DDPM
3. Deterministic Sampling: DDIM
4. Flow Matching
5. Diffusion in Practice
Appendices
Acknowledgements
References

Step-by-Step Diffusion: An Elementary Tutorial

This monograph presents an accessible first course on diffusion models and flow matching for machine learning, aimed at a technical audience with no diffusion experience.

There are many existing resources for learning diffusion models. The goal of this tutorial is to teach diffusion as simply as possible, with minimal mathematical and machine learning prerequisites, but in enough detail to reason about its correctness. Unlike most tutorials on this subject, in this work neither a Variational Auto Encoder (VAE) nor a Stochastic Differential Equations (SDE) approach is taken. In fact, for the core ideas in this tutorial, no SDEs, Evidence-Based-Lower-Bounds (ELBOs), Langevin dynamics, or even the notion of a score are needed. The reader need only be familiar with basic probability, calculus, linear algebra, and multivariate Gaussians. The intended audience for this tutorial is technical readers at the level of at least advanced undergraduate or graduate students, who are learning diffusion for the first time and want a mathematical understanding of the subject.

This tutorial has five parts, each relatively self-contained, but covering closely related topics. Section 1 presents the fundamentals of diffusion: the problem we are trying to solve and an overview of the basic approach. Sections 2 and 3 show how to construct a stochastic and deterministic diffusion sampler, respectively, and give intuitive derivations for why these samplers correctly reverse the forward diffusion process. Section 4 covers the closely-related topic of Flow Matching, which can be thought of as a generalization of diffusion that offers additional flexibility (including what are called rectified flows or linear flows). Finally, Section 5 returns to diffusion and connects this tutorial to the broader literature while highlighting some of the design choices that matter most in practice, including samplers, noise schedules, and parametrizations.

 
CGV-114