← Parminces
Holderrieth & Erives — MIT 6.S184 (2026)

An Introduction to Flow Matching
and Diffusion Models

The mathematical foundations behind Stable Diffusion, FLUX, Movie Gen, and LLaDA — rebuilt chapter by chapter as interactive lessons.

7
Chapters
30+
Simulations
60+
Quizzes

This interactive companion covers the complete pipeline — from probability paths and vector fields to classifier-free guidance, diffusion transformers, variational autoencoders, and discrete diffusion models for language. Each chapter features step-by-step derivations, working Python code, and interactive Canvas simulations.

Part I: Mathematical Foundations
Chapter 1

Introduction to Generative Modeling

Objects as vectors, data distributions, sampling, guided generation, the generative modeling problem.

Chapter 2

Flow and Diffusion Models

ODEs, SDEs, probability paths, vector fields, Gaussian paths, noise schedules, simulation.

Chapter 3

Flow Matching

Conditional vector fields, the marginalization trick, CFM loss, simulation-free training.

Chapter 4

Score Functions & Score Matching

Score functions, score-velocity duality, denoising score matching, Langevin dynamics, DDPM.

Part II: Building Real Systems
Chapter 5

Guidance

Vanilla guidance, classifier guidance, classifier-free guidance (CFG), guidance scale, training with label dropping.

Chapter 6

Large-Scale Generators

Fourier features, patchification, DiT blocks, U-Net, VAEs, latent diffusion, Stable Diffusion 3, Movie Gen.

Chapter 7

Discrete Diffusion Models

CTMCs, rate matrices, factorized models, discrete probability paths, discrete flow matching, MDLM.