Lecture 12 · Diffusion Models II: Latent Diffusion, Transformers, Control and Applications

Deep Unsupervised Learning · Lecture 12。个人学习讲义与配套实验,按主题整理并持续修订。

课程源码 ZIP ↓

个人整理的学习笔记,非官方讲义;课程来源与整理说明见课程介绍。配套示例未逐一运行验证。

本篇目录

Maps to: UC Berkeley CS294-158 Deep Unsupervised Learning (Spring 2024), Lecture 6 · Thu 2/22/2024 · Diffusion Models, second part (slides 41–67 and 92–210): text-to-image models (GLIDE, DALL·E 1, DALL·E 2 / unCLIP, DALL·E 3, Imagen), U-Net conditioning, latent diffusion and Stable Diffusion, Stable Video Diffusion, cascaded diffusion and Imagen Video, Diffusion Transformers, WALT, Sora, Stable Diffusion 3; image and video editing (SDEdit, Prompt-to-Prompt, DreamBooth, ControlNet, Tune-a-Video, Dreamix); using scores beyond images (DreamFusion, text-to-SVG, VideoAdapter); faster sampling (progressive distillation, denoising-diffusion GANs, MobileDiffusion, hourglass DiT, SDXL-Lightning); diffusion as pre-training (diffusion features, diffusion classifiers, EmerDiff); other fields (materials, planning with Diffuser, Diffusion Policy). Also the “strengths and weaknesses of unsupervised learning methods” of earlier offerings, as a side-by-side comparison of all model families. Homework 4, Question 3. Basis: The slides survey systems; these notes extract the mechanisms that recur (latent spaces and their scale, adaptive-norm conditioning, zero-initialized control branches, the forward-noise-then-denoise trick of editing, the “noise residual” gradient of score distillation, distillation targets, Bayes’ rule on denoising errors) and test each one on ShapeWorld — several with Lecture 11’s exact denoiser, so that a method can be judged without any learning error. Code: code/lecture12/ (4 scripts + latent.py; PyTorch (CPU); scripts 03–04 run in minutes, 01–02 take 15–25 minutes the first time (models cached)) Reading time: 4 hours including running the code


0. How to read this lecture

0.1 Learning goals

After this lecture you should be able to:

  1. Describe how text-to-image models are built from the pieces of Lecture 11 (GLIDE, DALL·E 2, Imagen, DALL·E 3) and what each design decision bought.
  2. Explain latent diffusion: why compress first, what the scale factor is for, and what the first stage’s KL weight does.
  3. Describe the Diffusion Transformer (patchify, adaLN-Zero) and how video models (WALT, Sora, cascades) extend it.
  4. Edit and control a pretrained model: SDEdit’s faithfulness / editability knob, inpainting by replacement vs resampling, ControlNet’s zero-initialized branch, Prompt-to-Prompt, DreamBooth.
  5. Explain score distillation (DreamFusion) as gradient descent of a renderer’s parameters along the diffusion model’s noise residual.
  6. Explain why progressive distillation and GAN-based few-step samplers work, and when a distilled student can beat the optimal denoiser.
  7. Use a diffusion model as a classifier and as a feature extractor.
  8. Compare all model families of the course on likelihood, sample validity, diversity and sampling cost.

0.2 Prerequisites and scope

AssumedIntroduced hereDeveloped later
Lecture 11 (DDPM, DDIM, ε / x₀ / v, guidance, the exact ShapeWorld denoiser)latent diffusion, DiT, editing, ControlNet, SDS, distillation, diffusion classifiersvideo generation (Lecture 17)
Lectures 8 and 10 (VQ-VAE, VQGAN — autoencoders as first stages)the family comparisonCLIP and multimodal models (Lecture 22)
Lecture 4 (Transformers, patch tokens)scaling and parallel training (Lecture 23)

0.3 Map

§1  text-to-image: GLIDE, DALL·E 1/2/3, Imagen
§2  latent diffusion and the first stage                                         ← code 01, Part 1
§3  architectures: U-Net conditioning, cascades, the Diffusion Transformer, video ← code 01, Parts 2-3
§4  editing a pretrained model: SDEdit, inpainting, Prompt-to-Prompt, DreamBooth  ← code 02, Parts 1-2
§5  adding control: ControlNet                                                    ← code 02, Part 3
§6  scores beyond images: DreamFusion, text-to-SVG, VideoAdapter                  ← code 04, Part 2
§7  fast sampling: progressive distillation, diffusion GANs, SDXL-Lightning        ← code 03
§8  diffusion as pre-training, and other fields                                   ← code 04, Part 1
§9  the model families side by side                                               ← code 04, Part 3
§10 summary   §11 pitfalls   §12 exercises   §13 further reading   §14 next lecture

0.4 Notation

As in Lecture 11: xt=αtx0+σtϵx_t = \alpha_t x_0 + \sigma_t\epsilon with the cosine schedule; ϵ^(xt,t,y)\hat\epsilon(x_t, t, y) a conditional noise prediction, ∅\varnothing the null condition, ww the guidance scale. z=E(x)z = E(x) an autoencoder latent, D(z)D(z) its decoder, ss the latent scale factor.

0.5 How the experiments are run

ShapeWorld throughout; models from Lecture 11 are reused from its cache (the unconditional pixel U-Net, the class-conditional one with classifier-free dropout, the 2-D vv-model) and Lecture 11’s exact denoiser E[x0∣xt]E[x_0 \mid x_t] serves as a perfect pretrained model for the editing experiments. Samples are judged with the exact yardsticks (valid, novel, flips, the right panel’s copy rate — 0.5625 in the true distribution) and Lecture 9’s feature-network scores. Everything is seeded and single-threaded; reruns print identical numbers.


1. Text-to-image

GLIDE (Nichol et al., 2022): a 3.5-billion-parameter text-conditional diffusion model at 64×64 plus a 1.5-billion-parameter upsampler to 256×256, with classifier-free guidance on captions instead of classes. They also tried CLIP guidance (classifier guidance with a CLIP model as the “classifier”), which worked less well than classifier-free guidance. Text-guided inpainting came almost for free.

DALL·E 1 (Ramesh et al., 2021) is not a diffusion model: a Transformer over text tokens followed by image tokens from a discrete VAE (KK = 8,192 codes, a VQ-VAE trained with the Gumbel-softmax relaxation), trained on 250 million text–image pairs; samples are re-ranked by CLIP. It showed that one autoregressive model can compose concepts in unusual combinations — Lecture 4’s multimodal Transformer at scale.

DALL·E 2 / unCLIP (Ramesh et al., 2022): generate a CLIP image embedding from the caption (a “prior”, itself a diffusion model), then decode it to an image with a GLIDE-like diffusion decoder conditioned on that embedding (64×64, then two upsamplers to 1024×1024, the upsamplers unconditioned). Classifier-free guidance by dropping the CLIP embedding 10% of the time and the caption 50% of the time. Because images go through CLIP’s embedding space, one can encode an image and decode variations, or interpolate between two images’ embeddings.

Imagen (Saharia et al., 2022): a frozen T5-XXL text encoder (trained on text only), a 64×64 base model and two super-resolution diffusion models (to 256 and 1024). Its key observations: large language models trained on text alone are very effective text encoders for image synthesis; scaling the text encoder helps fidelity and alignment more than scaling the image model; and an “efficient U-Net” puts more parameters at low resolution.

DALL·E 3 (Betker et al., 2023): the hypothesis that prompt-following failures come from noisy captions in the training data. So: train a bespoke image captioner, recaption the whole training set with detailed descriptions, and at sampling time let GPT-4 “upsample” short user prompts into detailed ones. The underlying model is a latent diffusion model similar to Stable Diffusion (§2). Remaining weaknesses: spatial relations and text rendering.

Recurring pieces: classifier-free guidance on text (Lecture 11 §9), cascades of resolutions (§3), and — from Stable Diffusion onwards — latent spaces (§2).


2. Latent diffusion

2.1 Why compress first

Pixels are expensive: most of a diffusion model’s work at 256×256 is spent on imperceptible detail. Rombach et al. (2022) split the job: an autoencoder compresses the image to a small latent (256×256×3 → 32×32×4, a factor 48 in numbers), and the diffusion model works in that latent. The idea is Lecture 10’s VQGAN with two changes: the latent is continuous (a diffusion model handles real values; no quantization), and the autoencoder is a VAE with a tiny KL weight (10−610^{-6}) — almost a plain autoencoder (reconstructions as good as possible), but the latent cannot drift to arbitrary scales. It is trained with VQGAN’s perceptual and patch-adversarial losses, so the decoder produces sharp details the diffusion model never has to model. The slides’ speed–quality trade-off: more compression is faster and eventually loses detail. Stable Diffusion: an 8× spatial downsampling VAE, a U-Net with self-attention, and text conditioning by cross-attention to CLIP text-encoder features.

2.2 The scale factor

Diffusion’s forward process mixes data with unit-variance noise: xt=αtx0+σtϵx_t = \alpha_t x_0 + \sigma_t\epsilon. If the latents have standard deviation 13, then at a “noisy” tt the signal still dominates, and the schedule’s meaning (its SNR curve) is distorted. Homework 4 Q3(a) therefore estimates one number — the standard deviation of all latent coordinates — divides latents by it before diffusion, and multiplies generated latents by it before decoding. (Stable Diffusion’s constant 0.18215 is the same idea.)

2.3 Experiment: a ShapeWorld latent space (script 01, Part 1)

A small convolutional VAE compresses each 12×24 image (288 pixels) to a 4 × 3 × 6 latent (72 numbers, a 4× reduction in each spatial direction), with a Bernoulli decoder and KL weight 10−610^{-6}; 3,000 steps:

quantityvalue
reconstruction (decoded encoder means) pixel-perfect on test images87.4% (0.64 bits per image at the end of training)
KL of the posterior to N(0,I)N(0, I)~7,000 nats per image — the tiny weight lets the latent drift far from the prior
standard deviation of all latent coordinates = scale factor13.27
latent range (1st / 99th percentile)−32.8 / 22.0

The latent is an excellent compressor (Lecture 8’s VQ-VAE with 18 tokens reconstructed 84.5% exactly) and is nothing like N(0,I)N(0, I): without the scale factor every “noisy” latent would still be mostly signal (Exercise 1). A calibration run with KL weight 10−310^{-3} gave the same reconstructions (87.6% exact), KL 707 nats and scale 3.95 — and no better diffusion samples with a 6,000-step DiT (2.0% / 4.3% valid vs 1.9% / 3.5%), so the homework’s tiny weight stays.


3. Architectures

Conditioning a U-Net. The time step (and a class or pooled text embedding) enters every residual block — by addition (homework 4) or, better, as per-channel scale and shift (“modulation”, adaptive group norm). Rich conditions such as text sequences enter through cross-attention: the feature map’s positions attend to the text tokens.

Cascades (Ho et al., 2022): one unconditional (or text-conditional) model at low resolution, then super-resolution diffusion models conditioned on the upsampled low-resolution image, each trained independently with resolution-specific hyperparameters. The trick that makes them work: conditioning augmentation — corrupt the low-resolution input during training (Gaussian blur at 128–256; or noise it with the forward process to a random level ss, “non-truncated conditioning augmentation”, best below 128), so that the upsampler is robust to the imperfect outputs of the stage below. Imagen Video (Ho et al., 2022) cascades in space and time (7 sub-models), trains jointly on images and videos, and uses conditioning augmentation throughout.

The Diffusion Transformer (Peebles & Xie, 2023): patchify the (latent) image into tokens, add 2-D sin-cos positions, run a Transformer, unpatchify. The conditioning (time + class embedding) modulates every block through adaptive layer norm: layer norm without its own affine parameters, then shift, scale and a residual gate computed from the conditioning vector — and with those projections initialized to zero (“adaLN-Zero”), every block starts as the identity. DiTs scale predictably: lower FID with more compute per sample (more depth/width or smaller patches).

Video: Stable Video Diffusion starts from Stable Diffusion, inserts temporal layers (1-D convolutions, temporal attention) and fine-tunes on heavily filtered video, captioned synthetically. WALT (Gupta et al., 2023): a 3-D CNN autoencoder that compresses space and time (the first frame encoded as an image, enabling joint image–video training), a Transformer with space-time factorized attention in the latent, zero terminal SNR (Lecture 11 §7.2), a variant of AdaLN, latent self-conditioning; 3 billion parameters. Sora (2024): a scaled-up diffusion Transformer on spacetime patches of a VAE latent — flexible resolutions and durations, probably trained with random conditioning for prediction and infilling. Stable Diffusion 3: an 8-billion-parameter diffusion Transformer trained with flow matching (a straight-line, vv-like objective).

3.1 Experiment: a class-conditional DiT in the latent (script 01, Parts 2–3)

A DiT over the 18 latent positions (patch size 1; hidden size 128, 4 heads, 4 blocks with adaLN-Zero; 1.26 million parameters), class = left shape kind dropped 10% of the time for classifier-free guidance, homework 4’s diffusion recipe, 15,000 steps. Samples: DDPM 50 steps in the latent, then the decoder; 100 per class:

guidance wwvalidrequested class (among valid)copy ratenovel validflipsFIDprecisionrecall
0 (unconditional)21.0%15.5%0.2318.0%4.63,1050.940.89
1 (conditional)37.8%99.7%0.7822.0%4.13,7230.950.85
240.8%99.7%0.9713.8%10.816,6920.860.75
40.6%100%1.000.2%51.139,3540.330.42

(the true copy rate is 0.56; FID between two real sets ~320–440.)

Real images and DiT samples at four guidance scales (columns: requested class)

  • Latent diffusion works: 21% valid unconditional samples and — conditioned — 38% valid with the requested shape 99.7% of the time, comparable to Lecture 11’s pixel U-Net (30%) from a model that diffuses 72 numbers instead of 288 pixels.
  • Guidance trades diversity for fidelity, then breaks. From w=1w = 1 to w=2w = 2 validity barely moves (38% → 41%) while the right panel copies the requested shape 97% of the time, novelty drops and FID quadruples — the slides’ FID / IS trade-off curve, with the mechanism visible: the class is a strong cue for both panels, and guidance exaggerates it. At w=4w = 4 the guided latents leave the region the decoder was trained on and the images fall apart — a failure mode specific to latent diffusion (a pixel model would at least produce saturated pixels).
  • Some valid samples are training images: at w=1w = 1, 37.8% valid but 22.0% valid and new.
  • Plan vs reality. A first run trained the DiT for 6,000 steps and gave 1.9% / 3.5% valid samples (unconditional / conditional) — the same lesson as Lecture 11’s U-Net: these models look converged long before their samples are.

What the latent buys (Part 3): one denoising step for 1,000 samples takes 0.10 s with the latent DiT and 0.57 s with Lecture 11’s pixel U-Net — 6× faster with 8× more parameters, because the Transformer works on 18 tokens while the U-Net convolves all 288 pixels at every layer. The decoder runs once per sample, not once per step. At ImageNet resolutions the same arithmetic is what made latent diffusion (and later DiTs) affordable.


4. Editing a pretrained model

A trained text-to-image model contains a great deal of knowledge about images; editing methods reuse it without retraining.

SDEdit (Meng et al., 2022): to edit an image x0x_0 towards a condition cc, run the forward process to some t0t_0 — xt0=αt0x0+σt0ϵx_{t_0} = \alpha_{t_0}x_0 + \sigma_{t_0}\epsilon — then the reverse process from t0t_0 to 0 with the condition cc. Small t0t_0: the result stays faithful to x0x_0 but cannot change much; large t0t_0: the condition wins and x0x_0 is forgotten. t0t_0 is the faithfulness / editability knob (the slides’ painting-to-photo example; applied frame by frame, the “made of wooden blocks” videos).

Prompt-to-Prompt (Hertz et al., 2022): to change content while keeping fine-grained structure, sample with the original and the edited prompt in parallel from the same noise and copy the cross-attention maps of the original into the edited run (attention maps of a text-to-image U-Net say which pixels each word controls). Real images are first inverted to noise with DDIM; reconstruction errors of that inversion (worse with strong guidance) are its main failure mode.

DreamBooth (Ruiz et al., 2023): given 3–5 photos of a specific subject, fine-tune the whole model to associate a rare token (“a [V] dog”) with it, with a prior-preservation loss on generic samples of the class so the model does not forget what dogs in general look like.

Video editing. Tune-a-Video (Wu et al., 2023) inflates a pretrained text-to-image model to video (k×k 2-D convolutions become 1×k×k 3-D ones; each frame’s self-attention also attends to earlier frames), fine-tunes only the attention query projections on a single video, then samples from that video’s DDIM inversion with an edited caption. Dreamix (Molad et al., 2023) uses a text-to-video model (Imagen Video) instead: SDEdit-style editing of a degraded video, after fine-tuning on the video and its frames with a rare token (mixed video–image fine-tuning).

Inpainting fills masked pixels. With an unconditional model, the simplest method replaces, at every reverse step, the known pixels by the known image noised to the current level, so the model only “invents” the rest. RePaint (Lugmayr et al., 2022) observed that the invented part then does not harmonize with the known part, and added resampling: after each step, jump back up one step with fresh noise and redo it, several times.

4.1 Experiments with the exact model (script 02, Parts 1–2)

Part 1 — SDEdit with a perfect model. 400 test images; the edit asks for the next shape kind on the left (square → frame, …, cross → square). The exact class-conditional model (Lecture 11’s exact denoiser with exact classifier guidance at scale 1, i.e. exact samples of p(x∣y)p(x \mid y)) is run from t0t_0 down to 0:

t0t_0validedited to the target kindleft size + position keptright panel kept
0.2100%100%30.2%100%
0.4100%100%28.5%99.2%
0.5100%100%25.5%96.8%
0.6100%100%19.5%87.2%
0.8100%100%7.8%22.2%
1.0100%100%2.8%0.2%

With a perfect model every edit is valid and of the requested kind (exact conditioning forces the class at any t0t_0). The faithfulness knob shows in the right panel, which nothing asks to change: kept almost always up to t0=0.5t_0 = 0.5, mostly lost from t0=0.8t_0 = 0.8 — the slides’ trade-off, measured. More surprising is the left shape’s geometry: even at t0=0.2t_0 = 0.2 only 30% keep size and position. At low noise SDEdit returns the image of the requested class closest in pixels to the input, and shapes of different kinds have different footprints — the square closest to a thin cross of size 4 is a smaller square. Faithful in pixels is not faithful in attributes.

Part 2 — inpainting. Keep the left panel of 400 test images and regenerate the right one, 50 steps. In the true distribution the right shape equals the left one with probability 0.5625:

modelresampling per stepleft panel unchangedright panel validright shape = left shape
exact model1 (plain replacement)100%100%0.318
exact model5 (RePaint)100%100%0.410
Lecture 11’s U-Net1100%55.0%0.150
Lecture 11’s U-Net5100%87.0%0.227

Even with a perfect model, plain replacement does not sample the conditional distribution: the regenerated panel follows the kept one far less often than it should (0.32 vs 0.56). The unknown half commits to a shape early, when the noised known half still says little, and later steps cannot undo it. Resampling gives it time to react (0.41 with 5 resamples; more would get closer). With the U-Net, resampling also repairs many shapes (55% → 87% valid right panels), but the left–right dependency is mostly lost — the same weakness as its unconditional samples’ copy rate (Lecture 11).


5. Adding control: ControlNet

To condition a pretrained text-to-image model on new inputs — Canny edges, depth maps, human poses, segmentation maps, sketches, low-resolution images — without retraining it and without destroying it on small datasets, ControlNet (Zhang, Rao & Agrawala, 2023) makes a trainable copy of the U-Net’s encoder, feeds it the control image through a zero-initialized convolution, and adds each of the copy’s feature maps to the frozen model’s skip connections through further zero-initialized 1×1 convolutions. At initialization every zero convolution outputs zero, so the controlled model is the pretrained model; training can only add information from the control image. Because the frozen model keeps its knowledge, ControlNets train robustly on datasets as small as a few thousand pairs.

5.1 Experiment (script 02, Part 3)

Control image: for every panel of a training image, a filled rectangle where its shape is (center ± size) — “put a shape of about this size here”. Base model: Lecture 11’s unconditional U-Net (10,000 steps), frozen. The ControlNet copy has 75,000 trainable parameters, trained 3,000 steps on (image, boxes) pairs. 400 samples for the boxes of 400 test images:

modelvalidflipsink pixels outside the boxesbox area inkedvalid with exactly the requested sizes and positions
base U-Net (no control)29.8%6.226.330%0%
U-Net + ControlNet61.0%1.80.151%57.2%

At initialization the controlled model is exactly the base model (checked bit for bit: every zero convolution outputs 0). After training, samples respect the boxes almost perfectly (0.1 stray ink pixels instead of 26), and — a bonus the plan did not expect — validity doubles (30% → 61%; 57% valid and at exactly the requested sizes and positions). Lecture 11 found that the U-Net’s errors concentrate at mid noise, where the image’s layout is decided; a control image that fixes the layout removes exactly that decision. Shape kinds are still the model’s choice (a box says nothing about square vs disk), which is why “box area inked” is about half.

SDEdit, inpainting, and ControlNet samples with their control boxes


6. Using scores beyond images

A diffusion model’s noise prediction is a scaled score, ϵ^≈−σt∇log⁡pt\hat\epsilon \approx -\sigma_t\nabla\log p_t (Lecture 11 §4): a direction that makes a noisy image more probable. Several methods use this direction to optimize other things.

DreamFusion (Poole et al., 2023): text-to-3D with no 3-D data. Start from a randomly initialized NeRF (a 3-D scene representation, Lecture 25); repeatedly render it from a random camera and lighting (64×64), noise the render, let a frozen text-to-image model (Imagen) predict the noise, and update the NeRF’s parameters θ\theta so the render becomes more probable under the caption. Differentiating the diffusion loss through the U-Net is brittle and expensive; DreamFusion drops the U-Net Jacobian, giving the score distillation sampling (SDS) gradient

∇θLSDS=Et,ϵ[w(t) (ϵ^(xt,t,y)−ϵ) ∂x∂θ],x=render(θ),\nabla_\theta \mathcal{L}_{\text{SDS}} = E_{t, \epsilon}\Big[w(t)\,\big(\hat\epsilon(x_t, t, y) - \epsilon\big)\,\frac{\partial x}{\partial\theta}\Big], \qquad x = \mathrm{render}(\theta),

with large classifier-free guidance. (The paper’s appendix shows this is the gradient of a weighted KL between the renderer’s noised distribution and the model’s.) VectorFusion (Jain, Xie & Abbeel, 2023) applies SDS to the control points of an SVG — any differentiable “renderer” works. VideoAdapter (Yang et al., 2023) treats diffusion models as energy-based models — a product of a large pretrained model and a small domain-specific one is sampled by adding their scores — to adapt text-to-video models to new domains (robot trajectories, egocentric video) without fine-tuning the large one.

6.1 Experiment: SDS through a superellipse renderer (script 04, Part 2)

A “renderer” with four parameters draws the same soft superellipse ∣x/r∣p+∣y/r∣p≤1\lvert x/r\rvert^p + \lvert y/r\rvert^p \le 1 in both panels: center, half-size rr, and the exponent pp, which morphs a diamond (p=1p = 1) into a disk (p=2p = 2) and a square (p→∞p \to \infty). It knows nothing about ShapeWorld; its parameters are optimized by SDS with Lecture 11’s class-conditional U-Net (guidance 7.5, w(t)=σt2w(t) = \sigma_t^2, 400 Adam steps), starting from p=1.6p = 1.6, r=3r = 3 in the middle:

requested classpp at the startpp at the endhalf-size rrthe feature network reads
square1.5218.0 (the maximum allowed)5.50 (maximum)square (1.00)
disk1.682.401.95disk (1.00)
diamond1.681.244.64disk (0.99)

The renders after score distillation

The frozen diffusion model steers the exponent the right way for every class — up for squares, near 2 for disks, down towards 1 for diamonds — through nothing but its noise residual. Two well-known SDS behaviours appear too: exaggeration (the square grows to the largest allowed size and the most extreme exponent — mode-seeking at large guidance, DreamFusion’s “over-saturated” look) and the limits of the renderer (its soft edge, needed for gradients, leaves the diamond blurry enough that a classifier reads it as a disk).


7. Fast sampling

Lecture 11 showed that even the optimal denoiser needs ~20 DDIM steps: a single Gaussian step cannot represent the multimodal reverse distribution over large intervals. Methods to sample faster attack exactly that:

  • Progressive distillation (Salimans & Ho, 2022): train a student to reproduce in one DDIM step what the teacher does in two; the student then becomes the teacher; repeat (1,024 → 512 → … → 4 steps). Why does the student succeed where a denoiser fails? A denoiser regresses x0x_0 given xtx_t, which has many answers (the mean is blurry); the student regresses the teacher’s deterministic two-step result, which has exactly one — ”p(x′∣xnoise)p(x' \mid x_{\text{noise}}) is more determined than p(xoriginal∣xnoise)p(x_{\text{original}} \mid x_{\text{noise}})”. The vv-parameterization (Lecture 11 §7) was introduced for this.
  • Denoising diffusion GANs (Xiao, Kreis & Vahdat, 2022): keep large steps but model each reverse step with a conditional GAN — the true reverse step q(xt−1∣xt)q(x_{t-1} \mid x_t) can be sampled by running the forward process on data, so a discriminator can compare the generator’s step with it. 4 steps.
  • MobileDiffusion (Zhao et al., 2023) and the hourglass diffusion Transformer (Crowson et al., 2024) make each step cheaper: transformers in the U-Net’s middle, self-attention only at low resolution, cross-attention everywhere, shared key–value projections, ReLU instead of softmax attention after fine-tuning, separable convolutions, fewer residual blocks; hierarchical (hourglass) Transformers for pixel-space high resolution.
  • SDXL-Lightning (Lin et al., 2024): progressive distillation with a GAN loss at small step counts — the MSE target becomes ambiguous again when one step must cover a complicated flow. The discriminator judges pairs (xt,denoised)(x_t, \text{denoised}), reuses the teacher’s encoder, and the training relaxes mode coverage to reduce “Janus” artifacts (a student with less capacity than its teacher); 128 → 32 steps with MSE, then 32 → 8 → 4 → 2 → 1 with the GAN loss; LoRA first, then full fine-tuning.

7.1 Experiment: progressive distillation on 2-D data (script 03)

Teacher: Lecture 11’s vv-prediction MLP on the 402-Gaussian smiley (exact density available). Six halvings, 1,500 training steps each, 64→32→⋯→164 \to 32 \to \cdots \to 1 DDIM steps. Sample quality of 2,000 points (real data: −log⁡pdata-\log p_{\text{data}} = 1.56, 1% “off the drawing”, sliced W1W_1 between two real sets 0.041):

DDIM stepsteacher: −log⁡p-\log p / off / sliced W1W_1distilled studentthe OPTIMAL denoiser
642.01 / 7.0% / 0.057—1.49 / 0.9% / 0.060
322.12 / 8.0% / 0.0442.06 / 7.3% / 0.0421.39 / 0.7% / 0.043
162.48 / 11.9% / 0.0802.20 / 8.6% / 0.0651.36 / 1.9% / 0.079
82.99 / 17.6% / 0.0842.28 / 9.4% / 0.0311.69 / 6.9% / 0.082
44.42 / 31.7% / 0.1922.44 / 11.3% / 0.0414.48 / 31.7% / 0.194
29.69 / 60.3% / 0.4112.74 / 14.6% / 0.05010.20 / 61.5% / 0.418
129.9 / 100% / 0.8833.21 / 18.4% / 0.04630.2 / 100% / 0.897

Teacher vs distilled student at 4 and 1 steps

  • With few steps the teacher fails exactly like the optimal denoiser (4 steps: 32% off; 1 step: every sample at the data’s mean) — discretization error that no better denoiser can fix.
  • The students keep the distribution: one step gives a recognizable smiley with sliced W1W_1 0.046 (real-vs-real 0.041) and 18% of samples off the drawing. At 8 steps or fewer every student beats even the optimal denoiser run with the same number of steps — a student is no longer a denoiser but an integrator of the ODE over a whole interval.
  • The price is a gradual loss of sharpness (−log⁡p-\log p 2.06 → 3.21 from 32 steps to 1): errors compound over the halvings. SDXL-Lightning switches to a GAN loss for the last halvings for this reason.

8. Diffusion as pre-training, and other fields

Diffusion features (Tang et al., 2023): to extract features from a real image, noise it to some tt and read the U-Net’s intermediate activations (averaged over several noise draws); cosine similarity of these features finds correspondences between images (the same part of different cats) without any supervision. The noise level trades semantics (high tt) against detail (low tt). EmerDiff (Namekata et al., 2024) turns such features into pixel-level segmentations (k-means on low-resolution feature maps, then perturb a feature and see which pixels of the generated image change).

Diffusion classifiers (Li et al., 2023; Clark & Jaini, 2023): a conditional diffusion model approximates p(x∣c)p(x \mid c); its denoising error is (up to weights and constants) −-ELBO ≈−log⁡p(x∣c)\,\approx -\log p(x \mid c). Bayes’ rule with a uniform prior picks the class (or caption) whose conditional model denoises the image best — a zero-shot classifier and an image–text matching score from a generative model.

Other fields. UniMat (Yang et al., 2023) generates crystal structures with a diffusion model over a periodic-table-shaped representation. Diffuser (Janner et al., 2022) plans by diffusing whole trajectories and guiding them towards high reward or goals. Diffusion Policy (Chi et al., 2023): robot demonstrations are multimodal (go left or right around an obstacle), which a Gaussian policy averages into a crash; diffusing over future action sequences represents both modes — it became a standard for visuomotor imitation learning.

8.1 Experiment: the diffusion classifier (script 04, Part 1)

Lecture 11’s class-conditional U-Net (class = left shape kind) as a zero-shot classifier: for each of 400 test images, average ∥ϵ−ϵ^(xt,t,y)∥2\lVert\epsilon - \hat\epsilon(x_t, t, y)\rVert^2 over KK shared (t,ϵ)(t, \epsilon) pairs for each of the 8 classes and pick the smallest.

(t,ϵ)(t, \epsilon) samples per image141664
accuracy54.8%77.2%89.5%94.5%
noise levels used (16 samples)0.02–0.20.2–0.40.4–0.60.6–0.80.8–0.98
accuracy58.5%68.5%82.7%86.8%73.0%

(Lecture 9’s supervised feature network: 99.8%; a linear probe on pixels: 63.3%; chance 12.5%.)

No classifier was ever trained, yet Bayes’ rule on the generative model reaches 94.5%. Each (t,ϵ)(t, \epsilon) sample is a noisy one-sample estimate of the −-ELBO, hence the steady gain with KK — and the cost: 64 × 8 = 512 network evaluations per image, why diffusion classifiers are slow in practice. The class is decided at mid noise (tt = 0.6–0.8), where fine detail is gone but the outline survives — the same noise levels where Lecture 11 located the U-Net’s mistakes and where §5’s ControlNet helped most.


9. The model families side by side

Earlier offerings of this course had a session on the “strengths and weaknesses of unsupervised learning methods”. With every family run on the same data, the comparison can be made with numbers (script 04, Part 3, collecting each lecture’s output):

model (lecture)−log⁡2p(x)-\log_2 p(x), bits per imagevalidnovel validFIDnetwork passes per sample
the truth: ShapeWorld itself (1)17.80 (entropy)100%87%323–437 (real vs real)—
gated PixelCNN (3)22.338% (100 samples)38%—288
Transformer on 2×2 patches (4)18.889.6%81.0%59072 (KV cache)
Glow + variational dequantization (6)≤ 94.7 (bound)0%0%—1
VAE, 16 latents (7)≤ 66.2 (ELBO); 61.0 IWAE0%0%17,5181
VQ-VAE 18 tokens + Transformer (8)≤ 37.6 (bound)26.1%20.8%1,59518 + 1
VQ-VAE 8 tokens + Transformer (10)21.1 for the codes (lossy)47.8%38.9%1,3608 + 1
VQGAN 8 tokens + Transformer (10)21.3 for the codes (lossy)19.9%14.0%9588 + 1
DCGAN (9)none0%0%19,0441
GAN + R1 (10)none0%0%14,8931
pixel diffusion U-Net, 160k parameters (11)(bound not computed)30.4%28.6%1,863100
latent DiT, unconditional (12)(bound not computed)21.0%18.0%3,10550 + decoder
exact optimal denoiser (11)—100%87.5%406100

What the table says about the families on this data and this budget:

  • Autoregressive models over good tokens are the clear winners when exactness matters: an exact likelihood within 1 bit of the entropy and 90% valid samples. Their cost is sequential sampling (one pass per token) — cheap here with 72 tokens and a KV cache, expensive for megapixel images.
  • Flows give exact likelihoods but, at this size, poor ones (95 bits) and no valid samples: invertibility is a heavy architectural constraint.
  • VAEs give a likelihood bound, one-pass sampling and a representation — and blur. As first stages (VQ-VAE, VQGAN, the latent-diffusion autoencoder) they are indispensable.
  • GANs sample in one pass and are sharp, but here never valid, with no likelihood and the worst coverage (recall ≤ 0.37).
  • Diffusion models cover the distribution best among the non-autoregressive models (precision / recall 0.90 / 0.94), generalize rather than memorize (Lecture 11), and are controllable (guidance, editing, ControlNet), at the price of many network passes — which distillation reduces to a few (§7).
  • Every score has blind spots (Lecture 9): the exact optimal denoiser for the training set would score FID 364 here, better than the truth’s 406, with 0% novel samples.

10. Summary

  1. Text-to-image systems assemble Lecture 11’s pieces: classifier-free guidance on captions (GLIDE), a CLIP-embedding prior and decoder (DALL·E 2), a frozen large text encoder and cascades (Imagen — the text encoder’s size matters most), and recaptioned training data (DALL·E 3). DALL·E 1 was an autoregressive Transformer over VQ tokens.
  2. Latent diffusion diffuses the latent of an autoencoder (a VAE with a tiny KL weight, trained with perceptual and adversarial losses); the latent must be rescaled to unit variance. On ShapeWorld a 72-number latent reconstructs 87% of images exactly.
  3. The Diffusion Transformer patchifies the latent and conditions every block by adaLN-Zero. Our DiT gave 21% valid unconditional and 38% valid conditional samples (99.7% of the requested class) at 1/6 of the pixel U-Net’s cost per step — after 15,000 steps (6,000 gave 2–4%). Guidance beyond w=1w = 1 over-copies the class (copy rate 0.97) and at w=4w = 4 breaks the decoder.
  4. Cascades (with conditioning augmentation) and video models (temporal layers, 3-D autoencoders, space-time Transformers, zero terminal SNR) extend the same pieces.
  5. SDEdit’s t0t_0 trades faithfulness for editability; even a perfect model changes what the edit does not ask for when shapes have different pixel footprints. Inpainting by replacement does not sample the conditional distribution even with a perfect model (copy rate 0.32 vs 0.56); RePaint’s resampling helps (0.41). Prompt-to-Prompt, DreamBooth, Tune-a-Video and Dreamix reuse attention maps, rare tokens, inflated architectures and DDIM inversion.
  6. ControlNet adds a condition to a frozen model through a zero-initialized copy of its encoder; ours started exactly at the base model, made samples respect bounding boxes (stray ink 26 → 0.1 pixels) and doubled validity (30% → 61%).
  7. Score distillation optimizes any differentiable renderer along the diffusion model’s noise residual (DreamFusion, VectorFusion); our superellipse moved towards square, disk and diamond as requested, with SDS’s typical exaggeration.
  8. Progressive distillation halves the steps repeatedly; a 1-step student kept the smiley (sliced W1W_1 0.046) where the teacher — and even the optimal denoiser — collapse to the mean. GAN-based distillation and cheaper architectures push further.
  9. A conditional diffusion model is a zero-shot classifier (94.5% with 64 noise samples; the class is decided at mid noise) and a feature extractor; diffusion also plans (Diffuser), controls robots (Diffusion Policy) and designs materials (UniMat).
  10. Across the course’s families on ShapeWorld: autoregressive models over good tokens win on likelihood and validity; diffusion gives the best coverage among parallel-per-pixel samplers and the most control; GANs and VAEs sample in one pass but produce no valid image here.

11. Common pitfalls

  1. Forgetting the scale factor in latent diffusion (or applying it on only one side): latents with standard deviation 13 make every noise level look clean, and decoded samples come out at the wrong scale.
  2. Training the diffusion model on sampled latents with a huge posterior variance — or on means when the decoder was trained on samples: use the same convention for encoding at training and decoding at sampling time (homework 4 uses the means).
  3. Guidance too strong. CFG and classifier guidance distort the conditional distribution (more copies of the class, less diversity) and, past a point, break samples altogether (script 01: w=4w = 4).
  4. SDEdit’s t0t_0 read as “how much semantics changes”. It controls how much of the pixel information survives; an edit at small t0t_0 may still change size or position if the requested content needs it (script 02).
  5. Plain replacement for inpainting. It keeps the known pixels but does not sample the conditional distribution of the unknown ones; resample (RePaint) or train an inpainting model.
  6. A ControlNet without zero initialization. A randomly initialized branch destroys the pretrained model’s behaviour on the first step; zero convolutions start it exactly at the base model (checked in script 02).
  7. Differentiating through the U-Net for score distillation. It is expensive and brittle; SDS uses the noise residual directly (and needs large guidance to give a clear direction).
  8. Distilling with a target that is still ambiguous. A student regressing x0x_0 from xtx_t learns a blur; progressive distillation’s target (the teacher’s deterministic two-step result) is unique — and below a few steps even that becomes hard, which is where GAN losses come in (SDXL-Lightning).
  9. Diffusion classifiers with independent noise per class. Using different (t,ϵ)(t, \epsilon) samples for different classes adds noise larger than the differences being compared; share them.

12. Exercises

Exercise 1 (the scale factor). Latents have standard deviation ss. Show that diffusing the unscaled latents with the cosine schedule is the same as diffusing the scaled ones with a different schedule, and compute its log SNR. Why does this hurt?

Answer

xt=αtz+σtϵ=s (αt(z/s)+(σt/s)ϵ)x_t = \alpha_t z + \sigma_t\epsilon = s\,(\alpha_t (z/s) + (\sigma_t/s)\epsilon): the scaled latent z/sz/s (unit variance) is diffused with signal αt\alpha_t and noise σt/s\sigma_t/s, so log⁡SNR\log\mathrm{SNR} is shifted up by 2log⁡s2\log s at every tt (+5.2 nats for s=13.3s = 13.3). The whole schedule is far “cleaner” than designed: at t=1−10−4t = 1 - 10^{-4} the latent is not destroyed, the model never learns to generate from pure noise, and sampling starts from a distribution it has not seen.

Exercise 2 (adaLN-Zero). Show that a DiT block with its modulation projection initialized to zero computes the identity, and argue why that helps training a deep network.

Answer

With zero weights and biases, shift = scale = gate = 0, so each residual branch is multiplied by gate 0: x+0⋅attn(…)+0⋅mlp(…)=xx + 0 \cdot \mathrm{attn}(\ldots) + 0 \cdot \mathrm{mlp}(\ldots) = x. The network starts as the identity map from input to the final layer (itself zero-initialized: the output starts at 0), gradients reach every block unattenuated, and each block learns to add a correction — the same reason ResNets with zero-initialized last layers and ControlNet’s zero convolutions train stably.

Exercise 3 (SDEdit’s trade-off). For SDEdit with a perfect model of p(x∣c)p(x \mid c), what distribution does the output follow as t0→1t_0 \to 1, and as t0→0t_0 \to 0? Interpret script 02’s “kept” column.

Answer

t0→1t_0 \to 1: xt0x_{t_0} carries no information about the input, so the output is a fresh sample of p(x∣c)p(x \mid c): maximal editability, no faithfulness. t0→0t_0 \to 0: the output is drawn from p(x0∣xt0,c)p(x_0 \mid x_{t_0}, c) with xt0≈x0x_{t_0} \approx x_0, i.e. the image of class cc closest in pixels to the input (the likelihood dominates). “Kept” measures whether that closest image has the same size and position — it often does not, because shapes of different kinds have different footprints. Faithfulness in pixels is not faithfulness in attributes.

Exercise 4 (why replacement inpainting is biased). In replacement inpainting, the unknown part at step tt is denoised conditioned on a freshly noised copy of the known part. Explain why the final unknown part does not follow p(xunknown∣xknown)p(x_{\text{unknown}} \mid x_{\text{known}}), using ShapeWorld’s copy rule (script 02: 0.32 instead of 0.56).

Answer

The model’s prediction at step tt uses the current xtx_t, whose known part was replaced by a noised version of the true known pixels drawn independently of the unknown part’s current state. Early (large tt), the known part’s noisy copy carries little information about the left shape, and the unknown part commits to a right shape before the evidence is strong; later steps cannot undo that commitment because the reverse process only makes small changes. The right shape is therefore under-influenced by the left one (a copy rate closer to the unconditional 0.13 than to 0.56). Resampling gives the unknown part more steps at each noise level to react to the known part, moving the rate towards the truth (0.41 with 5 resamples).

Exercise 5 (SDS — derivation). Let L(θ)=Et,ϵ[w(t)∥ϵ^(xt,t,y)−ϵ∥2]\mathcal{L}(\theta) = E_{t, \epsilon}[w(t)\lVert\hat\epsilon(x_t, t, y) - \epsilon\rVert^2] with xt=αtg(θ)+σtϵx_t = \alpha_t g(\theta) + \sigma_t\epsilon. Compute ∇θL\nabla_\theta\mathcal{L} and show that dropping the U-Net Jacobian gives the SDS gradient (up to a constant factor).

Answer

∇θL=E[2w(t)(ϵ^−ϵ)⊤∂ϵ^∂xt∂xt∂θ]\nabla_\theta\mathcal{L} = E[2w(t)(\hat\epsilon - \epsilon)^\top \frac{\partial\hat\epsilon}{\partial x_t}\frac{\partial x_t}{\partial\theta}] with ∂xt∂θ=αt∂g∂θ\frac{\partial x_t}{\partial\theta} = \alpha_t\frac{\partial g}{\partial\theta}. Replacing the U-Net Jacobian ∂ϵ^/∂xt\partial\hat\epsilon/\partial x_t by the identity (DreamFusion’s choice) leaves E[2αtw(t)(ϵ^−ϵ) ∂g/∂θ]E[2\alpha_t w(t)(\hat\epsilon - \epsilon)\,\partial g/\partial\theta] — the SDS gradient with weight 2αtw(t)2\alpha_t w(t). Intuition: ϵ^−ϵ≈−σt∇log⁡pt(xt)−ϵ\hat\epsilon - \epsilon \approx -\sigma_t\nabla\log p_t(x_t) - \epsilon points from the current render towards more probable images.

Exercise 6 (the distillation target — derivation). In progressive distillation the teacher’s two DDIM steps take xtx_t to x′′x''. Show that the x^0\hat x_0 for which one student DDIM step from tt to t′′t'' lands on x′′x'' is x^0=(x′′−(σt′′/σt)xt)/(αt′′−σt′′αt/σt)\hat x_0 = (x'' - (\sigma_{t''}/\sigma_t)x_t)/(\alpha_{t''} - \sigma_{t''}\alpha_t/\sigma_t).

Answer

One DDIM step: x′′=αt′′x^0+σt′′ϵ^x'' = \alpha_{t''}\hat x_0 + \sigma_{t''}\hat\epsilon with ϵ^=(xt−αtx^0)/σt\hat\epsilon = (x_t - \alpha_t\hat x_0)/\sigma_t. Substitute: x′′=x^0(αt′′−σt′′αt/σt)+(σt′′/σt)xtx'' = \hat x_0(\alpha_{t''} - \sigma_{t''}\alpha_t/\sigma_t) + (\sigma_{t''}/\sigma_t)x_t; solve for x^0\hat x_0. (latent.progressive_distill converts it into a vv-target.)

Exercise 7 (diffusion classifiers — derivation). Using the ELBO of Lecture 11 (§3.3), argue that arg⁡min⁡yEt,ϵ[w(t)∥ϵ−ϵ^(xt,t,y)∥2]\arg\min_y E_{t,\epsilon}[w(t)\lVert\epsilon - \hat\epsilon(x_t, t, y)\rVert^2] approximates arg⁡max⁡yp(y∣x)\arg\max_y p(y \mid x) for a uniform class prior. Why is w(t)≡1w(t) \equiv 1 (the simple loss) only an approximation?

Answer

−log⁡p(x∣y)≈−ELBO(x,y)=∑tλtEϵ∥ϵ−ϵ^(xt,t,y)∥2+C-\log p(x \mid y) \approx -\mathrm{ELBO}(x, y) = \sum_t \lambda_t E_\epsilon\lVert\epsilon - \hat\epsilon(x_t, t, y)\rVert^2 + C, with CC independent of yy; Bayes with a uniform prior gives arg⁡max⁡yp(y∣x)=arg⁡min⁡y−log⁡p(x∣y)\arg\max_y p(y \mid x) = \arg\min_y -\log p(x \mid y). The true ELBO weights λt\lambda_t are not uniform (they emphasize low noise); with the simple loss’s uniform weights the score is a re-weighted bound, which still ranks classes well when every noise level discriminates similarly — script 04 shows which levels carry the class.

Exercise 8 (latent vs pixel cost). A pixel U-Net costs cpc_p per step on a 288-pixel image; a DiT on 18 latent tokens costs cℓc_\ell; the decoder costs cdc_d once. For NN sampling steps, when is latent diffusion cheaper? Use script 01’s timings.

Answer

Latent is cheaper when Ncℓ+cd<NcpN c_\ell + c_d < N c_p, i.e. N>cd/(cp−cℓ)N > c_d/(c_p - c_\ell). With cp≈0.73c_p \approx 0.73 s and cℓ≈0.14c_\ell \approx 0.14 s per 1,000 samples per step (script 01) and a decoder cost of a fraction of one U-Net pass, latent diffusion wins from the first step; at 50 steps it is ~5× faster despite having 8× more parameters — the attention runs over 18 tokens instead of convolutions over 288 pixels at every layer.

Exercise 9 (coding). In script 02, train the ControlNet with the left shape kind drawn as a coarse sketch (e.g. the shape’s outline at half resolution) instead of a box. Does it control the kind as well as the position?

Answer

(Run it.) A sketch carries the kind, so the controlled samples should follow kinds more often than with boxes; how often depends on how much of the outline survives the downsampling — the same compression question as the latent space of script 01.


13. Further reading

From the slides

  • A. Nichol et al. GLIDE, ICML 2022; A. Ramesh et al. Zero-Shot Text-to-Image Generation (DALL·E), ICML 2021; Hierarchical Text-Conditional Image Generation with CLIP Latents (DALL·E 2), 2022; J. Betker et al. Improving Image Generation with Better Captions (DALL·E 3), 2023; C. Saharia et al. Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding (Imagen), NeurIPS 2022.
  • R. Rombach et al. High-Resolution Image Synthesis with Latent Diffusion Models, CVPR 2022; A. Blattmann et al. Stable Video Diffusion, 2023.
  • J. Ho et al. Cascaded Diffusion Models, JMLR 2022; Imagen Video, 2022.
  • W. Peebles, S. Xie. Scalable Diffusion Models with Transformers (DiT), ICCV 2023; A. Gupta et al. Photorealistic Video Generation with Diffusion Models (WALT), 2023; T. Brooks et al. Video Generation Models as World Simulators (Sora), 2024; P. Esser et al. Scaling Rectified Flow Transformers (Stable Diffusion 3), 2024.
  • C. Meng et al. SDEdit, ICLR 2022; A. Hertz et al. Prompt-to-Prompt, ICLR 2023; N. Ruiz et al. DreamBooth, CVPR 2023; L. Zhang, A. Rao, M. Agrawala. Adding Conditional Control to Text-to-Image Diffusion Models (ControlNet), ICCV 2023; J. Z. Wu et al. Tune-a-Video, ICCV 2023; E. Molad et al. Dreamix, 2023.
  • B. Poole et al. DreamFusion, ICLR 2023; A. Jain, A. Xie, P. Abbeel. VectorFusion, CVPR 2023; M. Yang et al. Probabilistic Adaptation of Text-to-Video Models (VideoAdapter), 2023.
  • T. Salimans, J. Ho. Progressive Distillation, ICLR 2022; Z. Xiao, K. Kreis, A. Vahdat. Denoising Diffusion GANs, ICLR 2022; Y. Zhao et al. MobileDiffusion, 2023; K. Crowson et al. Hourglass Diffusion Transformers, 2024; S. Lin et al. SDXL-Lightning, 2024.
  • L. Tang et al. Emergent Correspondence from Image Diffusion, NeurIPS 2023; A. C. Li et al. Your Diffusion Model is Secretly a Zero-Shot Classifier, ICCV 2023; K. Namekata et al. EmerDiff, ICLR 2024.
  • M. Yang et al. Scalable Diffusion for Materials Generation (UniMat), 2023; M. Janner et al. Planning with Diffusion for Flexible Behavior Synthesis (Diffuser), ICML 2022; C. Chi et al. Diffusion Policy, RSS 2023.

Added by these notes

  • A. Lugmayr et al. RePaint: Inpainting using Denoising Diffusion Probabilistic Models, CVPR 2022.
  • K. Clark, P. Jaini. Text-to-Image Diffusion Models are Zero-Shot Classifiers, NeurIPS 2023.
  • Y. Lipman et al. Flow Matching for Generative Modeling, ICLR 2023 — the objective behind Stable Diffusion 3.

14. Next lecture

Lectures 2–12 asked how to model p(x)p(x). Unit V asks a different question: which puzzles on unlabelled data teach useful representations, without generating anything? Lecture 13 starts with the oldest family — reconstruct what is missing: denoising autoencoders, context encoders, colorization, masked autoencoders (MAE and its cousins) and pretext puzzles such as rotation and jigsaw — and measures, with ShapeWorld’s known factors, what each puzzle’s representation actually contains (linear probes, as in Lecture 10’s BiGAN experiment).

← 返回课程目录