No history yet

Introduction to Diffusion Models

Starting with Noise

Imagine a sculptor starting with a block of marble. They don't add clay to build a statue; they chip away at the stone to reveal the figure within. Diffusion models, a powerful type of generative AI, work in a surprisingly similar way. They start with pure, random noise—like a TV screen full of static—and carefully refine it, step by step, until a coherent image, sound, or piece of text emerges.

The idea is simple: The algorithm first turns complex images in the training data set into simple noise—akin to going from a blob of ink to diffuse light blue water—and then teaches the system how to reverse the process, turning noise into images.

These models are the engine behind many popular AI tools that create art, music, and more. Their goal is to generate new data that looks like the data they were trained on. To learn how to create, they first learn how to destroy.

The Two-Step Process

The core of a diffusion model is a two-part process: a forward process that adds noise, and a reverse process that removes it. The model only learns during the reverse process, but it needs the forward process to understand what noise looks like.

The Forward Process: Adding Noise This is a fixed, straightforward procedure. We take a clean image from our training data—say, a picture of a cat—and gradually add a tiny amount of random noise to it over hundreds or thousands of steps. At the end, the original image is completely gone, replaced by pure static. It’s like watching a sugar cube dissolve in water. The model observes this degradation at every step, learning what a slightly noisy cat, a very noisy cat, and a completely unrecognizable noisy cat look like.

Lesson image

The Reverse Process: Learning to Denoise This is where the learning happens. The model is trained to reverse the forward process. It's given a noisy image and asked to predict the noise that was added to create it. By subtracting its prediction, it takes a small step back toward the original, clean image. The model repeats this, starting with pure random noise and working backward, step by step, removing a little bit of noise at a time until a new, clear image takes shape. It isn't memorizing the original images; it's learning the general patterns and structures within the data.

A Brief History

The core ideas behind diffusion models aren't entirely new; they originated in thermodynamics and statistical physics. The concepts were adapted for machine learning in a 2015 paper, but the models were computationally expensive and didn't attract much attention.

That changed in 2020 when researchers from UC Berkeley introduced a new framework called Denoising Diffusion Probabilistic Models (DDPMs). Their work simplified the training process and demonstrated that these models could generate images with quality rivaling the best methods at the time. This breakthrough sparked a wave of innovation, leading to the powerful text-to-image models like Stable Diffusion, DALL-E 2, and Midjourney that are widely used today.

This research surge has expanded the use of diffusion models far beyond images into fields like audio synthesis, drug discovery, and time-series forecasting.

Ready to test your understanding?

Quiz Questions 1/4

The process of a diffusion model generating an image is often compared to a sculptor creating a statue from a block of marble. What does the initial block of marble represent in this analogy?

Quiz Questions 2/4

During the reverse process, the model is trained to predict the ____ that was added to an image at each step.

Diffusion models represent a significant leap forward in generative AI. By mastering the simple process of adding and removing noise, they have unlocked new possibilities for creating complex and high-quality data from scratch.