Diffusion Models: Generating Data by Reversing Noise
Think of diffusion models as learning to reverse a "random walk." They take a clean data point, gradually add noise until it's unrecognizable, and then train a model to reverse that process step-by-step. This allows them to start with pure noise and guide it back into a coherent sample that resembles the original dataset. The footgun is that this multi-step reversal makes generation computationally intensive compared to single-pass models.
### The Mental Model A diffusion model learns to create data by reversing a process of gradual noising. Think of it as learning how to restore a photograph that has been slowly degraded by static. The model doesn't see the original, clean photo during restoration; it only learns the statistical path from pure static back to something that *looks like* a photo from its training set. It models data generation as a guided "random walk" from chaos to structure.
### How It Works A diffusion model has two core processes: 1. **Forward Diffusion Process:** A fixed, predefined process that gradually adds noise to a sample from the dataset over a series of steps. This is the "random walk" away from clean data into pure noise. 2. **Reverse Sampling Process:** This is the trained neural network. Its job is to predict and reverse one step of the noising process. Given a noisy sample, it learns to estimate the slightly less noisy version.
To generate new data, the model starts with a tensor of pure random noise and repeatedly applies the learned reverse process, stepping it back towards the learned data distribution until a clean, new sample emerges.
### When to Use It * When the goal is to generate high-quality, novel data that closely matches the distribution of a complex dataset. * For tasks where the quality and diversity of generated samples are more critical than the speed of generation.
### When NOT to Use It * In applications requiring real-time or very fast generation. The iterative sampling process is computationally expensive and slow. * When you need a simple latent space. The path from noise to data is complex and not easily interpretable.
### One Canonical Example Imagine a model trained on a dataset of handwritten digits. The forward process takes an image of a '7' and adds noise to it over 500 steps until it's just static. The model is trained to predict the noise added at any given step. To generate a new digit, the model starts with a random static image and runs its reverse process 500 times. At each step, it subtracts its predicted noise, slowly forming a coherent image of a digit that never existed in the original dataset.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.