页面简介
Diffusion models generate images, video, and audio by removing noise step by step. How they work, the main types, examples, and how they compare to LLMs.
正文摘录
Back to GlossaryWhat are diffusion models? How they work, types, and examplesDiffusion models generate images, video, and audio by removing noise step by step. How they work, the main types, examples, and how they compare to LLMs.Editor: Andy MunsUpdated October 2026A diffusion model is a generative AI model that creates new data, most often images, by starting from random noise and removing it step by step. The model learns this from the opposite process: real training examples are buried in noise a little at a time, and the model is trained to predict the noise added at each step. Generation repeats that prediction, starting from pure noise, until a new sample remains.In its standard form, a diffusion model is trained on one task: predicting the noise in a noisy input. In Ho, Jain and Abbeel's 2020 paper, one image took 1,000 of those predictions.The same loop generates images in Stable Diffusion and DALL-E 2, video in OpenAI's Sora, and speech in several text-to-speech systems.What is a diffusion model?A diffusion model is a generative AI model that makes data by learning to undo a gradual noising process.Generative adversarial networks, variational autoencoders and the autoregressive transformers behind large language models are the other main types.Diffusion models get their name from physics. Sohl-Dickstein and colleagues introduced the method in 2015, borrowing from non-equilibrium thermodynamics.Their forward process spreads the data's structure out until none is left, the way a drop of ink diffuses through water.In psychology, the same name belongs to the drift-diffusion model of two-choice decisions, an unrelated idea. This page covers the generative AI sense.How do diffusion models work?A diffusion model works through two processes: a fixed forward process that adds noise to data until nothing recognizable is left, and a learned reverse process that removes it.The forward process needs no training. At each step it shrinks the sample slightly and adds a little Gaussian noise, the bell-curve random noise of statistics. Each step depends only on the one before, so the process is a Markov chain.Ho and colleagues used 1,000 steps. The noise variance added per step rose linearly from 0.0001 to 0.02, and each step scaled the sample by the square root of 1 minus that variance.Those small steps compound. The original's weight at any step is the square root of the product of (1 minus the variance) over every step so far, and the noise weight is the square root of 1 minus that product.At step 500 the noisy image is 0.28 times the original plus 0.96 times fresh noise. By step 1,000 the original's weight is under 0.01.Because that formula needs only the clean image, the noisy version at any step can be computed in one jump.Training the reverse process, a neural network, uses that shortcut. Training picks a real image and a random step, noises the image to that step in one jump, and asks the network to predict the noise that was added.The loss is the squared difference between the true noise and the network's guess. It simplifies the full objective, a sum of KL divergence terms. Ho and colleagues found the simpler loss gave better images.Generation runs the network once per sampling step. The model starts from pure noise, predicts the noise in it, and removes one step's share of that prediction, which lands it at the next noise level down.A DDPM, the original form, uses one sampling step per noise level: 1,000 network passes per image in Ho's setup. It also adds a little fresh random noise back at each step, which makes each run random.What architecture do diffusion models use?A diffusion model's denoiser is a neural network with three inputs, the noisy sample, the step number and any condition such as a text prompt, and one output: its estimate of the noise.Image models first used a U-Net, a convolutional network that shrinks an image to a compact representation and expands it back, with shortcuts between layers of matching size.Newer image and video models use a transformer as the denoiser. Peebles and Xie replaced the U-Net with a diffusion transformer that treats patches of a compressed image as tokens. Image quality improved steadily as they made it larger.OpenAI describes Sora as a diffusion transformer too. The transformer is the network inside; diffusion is how that network generates. "Diffusion model or transformer" is not an either-or choice.How do diffusion models generate images from text?A text-to-image diffusion model feeds an encoded version of the prompt to the denoiser at every step, so each noise estimate is pulled toward images that match the words.A separate text encoder turns the prompt into a sequence of vectors first. Stable Diffusion uses the text encoder from CLIP, a model trained to match images with their captions. Imagen uses T5, a text-only language model.The denoiser reads the prompt vectors through cross-attention layers, which let each region of the image draw on the words most relevant to it. Rombach and colleagues added these layers so one model could take text, layouts or other inputs.Classifier-free guidance, from Ho and Salimans, makes the model follow the prompt more closely. At each step the model makes two noise estimates, one with the prompt and one without, and pushes the result further in the prompt's direction.A higher guidance setting tracks the prompt more closely and gives less variety.Stable Diffusion runs that guided loop on a compressed version of the image, called a latent, instead of on the pixels. A decoder then turns the final latent into the full image.Types of diffusion modelsThe main types of diffusion models are denoising diffusion probabilistic models (DDPMs), score-based models, latent diffusion models and flow-matching models.The types differ along three axes: what the network predicts, the space it works in (pixels or a compressed latent space) and the sampler used to generate.Denoising diffusion probabilistic models (DDPMs)A DDPM is the discrete-step version: a fixed noise schedule, a network that predicts the noise, and one network pass per step.Ho, Jain and Abbeel introduced it in 2020. Their model reached an FID of 3.17 on CIFAR-10, a state-of-the-art score for image quality where lower is better.Score-based and SDE modelsA score-based model learns the score: the direction in which a noisy sample should move to look more like real data. Song and Ermon trained one across many noise levels in 2019 and sampled by following it from high noise to low.Song and colleagues then showed in 2021 that score-based models and DDPMs are two versions of one framework. A stochastic differential equation adds noise in continuous time, and a matching reverse equation, driven by the score, removes it.The targets are interchangeable. Ho and colleagues showed that predicting the noise is equivalent to estimating the score, and Esser and colleagues rewrote the flow-matching loss as a noise-prediction loss.Latent diffusion modelsA latent diffusion model runs diffusion on an autoencoder's compressed version of the data. Rombach and colleagues introduced it because pixel-space models often took hundreds of GPU days to train and sampled slowly.Stable Diffusion is the best-known latent diffusion model.Flow matching and rectified flowFlow matching trains the network to predict a velocity: the direction and speed that move a sample from noise toward data along a path chosen in advance.Lipman and colleagues showed that diffusion's noising paths are one special case of flow matching, and that straighter paths trained and sampled faster. This page counts flow-matching models in the diffusion family for that reason.Rectified flow, from Liu and colleagues, makes the same bet on straight paths. Esser and colleagues scaled rectified-flow transformers for text-to-image generation and reported better results than standard diffusion formulations.Faster samplers and distilled modelsFaster samplers cut the number of steps without retraining the model. DDIM, from Song, Meng and Ermon, reuses a DDPM's training but drops the fresh noise at each step.Dropping the noise makes DDIM's sampling deterministic and lets it take larger jumps. It produced images 10 to 50 times faster in wall-clock time.Consistency models, from Song and colleagues, map noise to data in a single step. They can be trained on their own or distilled from an existing diffusion model, which means training a fast model to copy a slow one's results.Examples and applications of diffusion modelsExamples of diffusion models include Stable Diffusion, DALL-E 2 and Imagen for images, Sora for video, DiffWave and Grad-TTS for audio, and RFdiffusion for protein design.For images, DALL-E 2 turns a caption into a CLIP image embedding, then uses a diffusion model to turn that embedding into the picture, according to Ramesh and colleagues.Image editing runs the same loop on an existing picture. SDEdit, from Meng and colleagues, noises an input such as a rough sketch and denoises it into a realistic image with the same layout.Diffusion-based style transfer noises a photo the same way and lets a style prompt guide the redraw.Video models extend diffusion across frames. Video diffusion from Ho and colleagues extended the image architecture to video in 2022. Sora denoises patches that span space and time.In audio, DiffWave, from Kong and colleagues, is a vocoder: starting from white noise, it generates the waveform for a given mel spectrogram.DiffWave's 200-step version matched a WaveNet vocoder in listening tests, 4.44 against 4.43 mean opinion score. A version with about six steps ran orders of magnitude faster than WaveNet, which generates one sample at a time.Diffusion also cleans speech. In diffusion-based speech enhancement, Richter and colleagues start the reverse process from the noisy recording mixed with Gaussian noise, not pure noise, and need 30 steps.In biology, RFdiffusion, from Watson and colleagues, fine-tunes a protein struct