Latent Diffusion Models
Running the many small denoising steps of a diffusion model directly on full-resolution data is expensive; latent diffusion first compresses data into a small learned space with an autoencoder and does all the diffusion work there instead, only decoding back to full resolution once at the end.
Prerequisites: Denoising Diffusion Probabilistic Models, Variational Autoencoders
A standard diffusion model runs dozens to hundreds of denoising steps, and each step is a full forward pass of a large network over the entire data — every pixel of a high-resolution image, say. Most of that computation is spent on fine, perceptually minor detail that doesn't affect the overall content of the image much. Latent diffusion's insight: do the expensive, many-step diffusion process in a much smaller compressed space instead, and only pay the cost of full resolution once, at the very end, when a separately-trained decoder expands the result back out.
The analogy: editing a thumbnail, then upscaling once
Imagine editing a large photo by first shrinking it to a thumbnail, making every compositional change — cropping, color balance, retouching — on the tiny thumbnail where each edit is nearly instant, and only enlarging back to full resolution once you're satisfied, using a separate high-quality upscaler that fills back in fine detail. You do all the expensive, iterative decision-making cheaply, and pay the cost of full resolution exactly once, at the end, rather than on every single edit along the way.
The architecture: compress, diffuse, decode
Latent diffusion uses three pieces, trained mostly separately: an encoder compressing data into a smaller latent ; a diffusion model that runs its entire forward-noising and reverse-denoising process on , not ; and a decoder mapping the final denoised latent back to data space, . The diffusion loss is the same denoising objective as ordinary diffusion, just evaluated in latent space:
In words: at a random noise level , add noise to the latent to get , ask the network to predict that noise back out, and penalize the error — identical in form to ordinary diffusion, but every quantity lives in the small latent space instead of pixel (or price-path) space.
Worked example 1: the compute saving, in numbers
Suppose a 512×512×3 image has values, and the autoencoder compresses by a factor of 8 in each spatial dimension down to a 64×64×4 latent, values — about 48x fewer values per diffusion step. If a single denoising network pass costs roughly proportional to input size, and generation requires 50 such passes, pixel-space diffusion pays that full cost 50 times over -sized inputs, while latent diffusion pays it 50 times over -sized inputs plus one single encode and one single decode pass at full resolution — the 50 expensive iterative steps get almost 50x cheaper, at the cost of two extra full-resolution passes total.
Worked example 2: why the latent has to be a good compression first
Suppose the autoencoder is trained poorly and its latent space loses fine structure the decoder can't recover — reconstructing a clean image with no diffusion involved already yields visible blur or missing detail, say a reconstruction error equivalent to 15% pixel-wise deviation. No matter how well the diffusion model performs within that latent space (even a perfect denoiser reaching the exact right ), the final output is capped by that same 15% reconstruction gap, because the decoder simply cannot produce detail the encoder discarded. This is why latent diffusion models train the autoencoder first, to a high reconstruction standard, before ever training the diffusion model on top of it — diffusion quality can never exceed the autoencoder's own reconstruction ceiling.
Think of the compression factor here the way you'd think of a compounding rate applied in reverse — instead of one input growing over many steps, latent diffusion shrinks the space each step operates in once, up front, so every one of the many repeated steps that follow is cheap by the same multiplicative factor.
Latent diffusion compresses data into a small learned latent space with a pretrained autoencoder, runs the entire iterative noising-and-denoising process there instead of on full-resolution data, and decodes back to full resolution only once at the end — cutting the cost of the expensive, repeated part of diffusion by the compression factor.
What this means in practice
Latent diffusion is why modern high-resolution image and audio diffusion models are computationally feasible at all; the same architecture generalizes to any high-dimensional financial data — a full limit order book snapshot or a high-frequency multi-asset panel — where compressing to a smaller learned representation before running iterative generation makes an otherwise-prohibitive compute budget practical.
The autoencoder is trained (and frozen) before the diffusion model, and it is easy to forget that its reconstruction quality sets a hard ceiling on final output quality — a diffusion model can be trained flawlessly and still produce results capped by blur or missing detail baked into the compression stage. Reconstruction quality of the frozen autoencoder should always be checked and reported separately from diffusion sample quality, not assumed to be perfect.
Related concepts
Practice in interviews
Further reading
- Rombach et al., High-Resolution Image Synthesis with Latent Diffusion Models (2022)