No history yet

Introduction to Diffusion Models

What Are Diffusion Models?

Diffusion models are a type of generative AI that create new data, like images or audio, from scratch. Think of a sculptor who starts with a block of marble and carefully chips away until a statue emerges. Diffusion models work in a similar, but reversed, way. They start with pure randomness—digital noise, like the static on an old TV—and methodically refine it step-by-step until a clear, coherent image appears.

The core idea is to systematically destroy structure in data, and then learn a process to restore it. This restoration process is what allows the model to generate new data.

This process is inspired by thermodynamics, which describes how particles spread out or diffuse over time. In AI, the model learns how to reverse this diffusion, moving from chaos back to order.

Lesson image

The entire workflow involves two key phases: the forward process and the reverse process.

1. The Forward Process (Adding Noise) During its training, the model takes a clean, high-quality image and gradually adds small amounts of random noise over many steps. It continues until the original image is completely lost in a sea of static. The model carefully observes this process of decay, learning exactly how the image transitions to noise at each stage.

2. The Reverse Process (Removing Noise) This is where the generation happens. The model starts with a completely random pattern of noise. Then, using what it learned during the forward process, it begins to reverse the steps. It subtly removes noise, then a little more, and a little more, slowly revealing structure and detail. After many small refinements, a brand new image emerges from the initial randomness.

A Different Approach to Creation

Diffusion models are not the only type of generative model, but their approach is unique. To understand what makes them special, it helps to compare them to two other popular models: Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs).

Model TypeCore IdeaAnalogy
GANsA generator and a discriminator compete. The generator tries to fool the discriminator with fakes.An art forger trying to create a painting that can fool an expert art critic.
VAEsData is compressed into a simpler form (latent space) and then reconstructed.Writing a detailed summary of a book, then trying to rewrite the entire book using only the summary.
Diffusion ModelsA model learns to reverse a process of gradually adding noise to an image.A time-lapse video of a dissolving sugar cube, played in reverse to show the cube re-forming.

GANs are known for their sharp results but can be difficult and unstable to train—the forger and critic can get locked in a stalemate. VAEs are more stable but sometimes produce blurrier or less detailed results because information is lost during the compression stage.

Diffusion models offer a powerful alternative. Their slow, iterative denoising process often leads to higher-quality and more diverse outputs than other models. While this step-by-step approach can be slower, the results have set a new standard for what generative AI can achieve.

Now, let's test your understanding of these core concepts.

Quiz Questions 1/4

What is the fundamental starting point for a diffusion model when it generates a new image?

Quiz Questions 2/4

In the context of diffusion models, the 'forward process' is responsible for _______, while the 'reverse process' is responsible for _______.

By learning to reverse the process of decay, diffusion models have unlocked a new way to create detailed and imaginative content from nothing but noise.