MLModels

MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026)

by MIT CSAIL

AdvancedCourseFree~12-15 hours self-paced (5 lectures + 3 PyTorch labs); taught over MIT's January IAP term

Derive flow matching and diffusion from the SDEs up, then build a latent diffusion model from scratch.

Start LearningAdded Aug 13, 2026 · Updated Aug 13, 2026

Overview

MIT 6.S184, taught during the January IAP term and published in full online, is a mathematically rigorous introduction to the flow and diffusion models behind modern image, video and audio generators. Lectures run in order: Flow and Diffusion Models; Flow Matching; Score Functions and Score Matching; Classifier-free Guidance; Latent Spaces and Neural Network Architectures; and Discrete Diffusion Models. Three PyTorch lab notebooks track the lectures - working with ODEs and SDEs, then flow matching and score matching, then a diffusion transformer and VAEs - and by the end students have built a latent diffusion model from scratch. Lectures are delivered by MIT PhD student Peter Holderrieth, with labs run by Ron Shprints and Ezra Erives; the course notes have been published as the self-contained arXiv tutorial 'An Introduction to Flow Matching and Diffusion Models' (arXiv:2506.02070), most recently revised in March 2026, so the written material stands alone even without the lectures. The course deliberately teaches the underlying stochastic differential equations and the Fokker-Planck equation rather than stopping at high-level intuition, which is what distinguishes it from most diffusion tutorials and what practitioners praised when the course reached 400 points on Hacker News. Notes, slides and lab notebooks are free to download and the 2026 lecture recordings are posted to YouTube. It assumes linear algebra, multivariate calculus, basic probability, Python and some prior PyTorch experience.

At a Glance

Topic
ML
Level
Advanced
Format
Course
Cost
Free
Duration
~12-15 hours self-paced (5 lectures + 3 PyTorch labs); taught over MIT's January IAP term
Provider
MIT CSAIL
Hands-on
Yes — code/exercises
Certificate
None

What You’ll Learn

  • Derive flow and diffusion models from ordinary and stochastic differential equations
  • Train a generative model with the conditional flow matching objective in PyTorch
  • Implement score matching and understand how score functions drive the denoising process
  • Apply classifier-free guidance to steer conditional generation toward a prompt
  • Build a latent diffusion model from scratch using a VAE and a diffusion transformer
  • Handle discrete diffusion models for non-continuous data such as text tokens
  • Simulate ODEs and SDEs numerically inside the three guided lab notebooks

Highlights

  • The lecture notes are published as a self-contained arXiv tutorial (arXiv:2506.02070), revised March 2026, so they stand alone as a textbook
  • Three PyTorch labs build up to a working latent diffusion model rather than a toy demo
  • Teaches the actual mathematics - SDE reversal, the Fokker-Planck equation - instead of hand-waving, which is exactly what the Hacker News discussion singled out
  • Everything is free and ungated: notes, slides, lab notebooks and the 2026 lecture recordings on YouTube
  • Covers the same flow matching objective used by large-scale systems such as Stable Diffusion and current video models

Who It’s For

Best For

  • ML engineers moving from LLM work into image, video or audio generation
  • Researchers who need the derivations behind diffusion rather than a library wrapper
  • PyTorch practitioners who want to train and modify a diffusion model from scratch

Prerequisites

  • Linear algebra, multivariate calculus and basic probability theory
  • Comfortable with Python and some prior experience with PyTorch
  • Deep learning fundamentals - this is not an introductory ML course, and the material is genuinely math-heavy

FAQ

What is MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026)?

A mathematically rigorous MIT course on the flow and diffusion models that power modern image, video and audio generators, published free in full. It is aimed at engineers and researchers who already know deep learning and want the derivations, not the API surface. After the five lectures and three PyTorch labs you will have built a latent diffusion model from scratch and be able to train and steer your own generative models.

Is MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026) free?

MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026) is free to access.

What level is MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026) for?

MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026) is aimed at a advanced audience. Recommended background: Linear algebra, multivariate calculus and basic probability theory, Comfortable with Python and some prior experience with PyTorch, Deep learning fundamentals - this is not an introductory ML course, and the material is genuinely math-heavy.

How long does MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026) take?

Expect roughly ~12-15 hours self-paced (5 lectures + 3 PyTorch labs); taught over MIT's January IAP term. Most learners work through it at their own pace.

What will I learn from MIT 6.S184: Introduction to Flow Matching and Diffusion Models (2026)?

You'll learn: Derive flow and diffusion models from ordinary and stochastic differential equations; Train a generative model with the conditional flow matching objective in PyTorch; Implement score matching and understand how score functions drive the denoising process; Apply classifier-free guidance to steer conditional generation toward a prompt; Build a latent diffusion model from scratch using a VAE and a diffusion transformer; Handle discrete diffusion models for non-continuous data such as text tokens; Simulate ODEs and SDEs numerically inside the three guided lab notebooks.

Topics

diffusion modelsflow matchinggenerative aipytorchstochastic differential equations

Sources

This page was written from 3 sources, 2 on domains other than diffusion.csail.mit.edu.

  1. 1.diffusion.csail.mit.eduindexvendor
  2. 2.arxiv.org2506.02070
  3. 3.news.ycombinator.comitem