Paper introduces Latent diffusion models, which improves efficiency and quality of DMs, instead of working at pixel level, they utilize latent space which drastically reduces computational costs while preserving high visual fidelity.
What does conditioning/conditional generation means?
Unconditional generation:
Conditional generation:
Conditioning means generating output based on some conditions

Recap: Attention = What parts of input are most relevant at any moment
Cross Attention?
Is an attention mechanism where the queries come from one input/modality, keys and queries come from different input/modality. Allows one input to learn and incorporate relevant information from another input
Self-Attention?
Special case of attention where QKV all come from same input allows us to capture dependencies regardless of their distance in the same sequence
Tou whats Attention?
Umbrella term under which cross attention and self attention comes, Q and KV can come from different sources or can be from the same source doesn’t matter.
Whats wrong with image synthesis before?
- High resolution image synthesis is computationally expensive
- GANs struggle with mode collapse
- Diffusion models SOTA performance but very computationally expensive
Why computational efficiency important?
- Training DMs take hundreds/thousands of GPU days
- Only organizations with access to massive computational resources can afford to train or use these models
- Leads to high carbon emission
Key contributions of this paper
- Their approach scales better to high-dimensional data by using mild-compression
- Despite matching performance on SOTA models, reduces computational power
- Extremely faithful reconstructions
- Incorporates different input modalities using cross attention mechanism
- Provides link to pretrained latent diffusion models
Existing solutions for image generation tasks
- VQVAEs converts images into latent space then uses autoregressive models to generate images, another study extends VQVAE by learning a joint distribution over image and text tokens, another study uses conditionally invertible functions to map between different latent spaces to provide flexibility across domains
- VQGANs adds adversarial loss instead of VAEs
- Diffusion models exist but are compute heavy
Method
Compression stage: auto encoder compresses the high-dim image into low-dim latent, involves an autoencoder
Generation stage: diffusion model operates within this latent space performing generative process, involves a UNET and cross attention mechanism
How does the architecture does the conditioning?
Can do
Z = latent representation
Y = conditioning input (text, semantic maps)
Author augments Unet backbone with a cross-attention mechanism which involves conditioning input y and projects in into intermediate representation
Cross attention layer integrates intermediate representation into Unets intermediate layers using attention formulae


Experiments
- Experimented with downsampling factors 1,2,4,8,16,32
LDM1 represents pixel based diffusion model without any compression
LDM2 to LDM32 represents increasing levels of compression
- Each model were trained on a single NVIDIA A100 GPU, underwent same number of training steps, number of parameters was kept the same
- Evaluated on MS-COCO, dataset for text-to-image generation
FID scores (the lower the better) were best at LDM-8, LDM-32 had very high FID scores
Text prompts are encoded using BERT tokenizer, representation is injected into UNET through multi head cross attention layers
Trained on low res, and can generalize to higeher resolutions during inference because Unet is fully convolutional, once trained on 256^2 we can sample on bigger images wihtout training.
