GANs and VAEs
The older ideas that paved the way.
Before diffusion, two other ideas led the way. Generative adversarial networks, and variational autoencoders. They are still used today, and understanding them deepens your picture of how machines create. In this lesson, you will meet both, without any maths.

- Two older ideas
- Still used today
- Understood without maths
GANs: forger versus detective
A G A N is a game between two networks. The generator is a forger, trying to create fake pictures. The discriminator is a detective, trying to tell real pictures from fakes. At first, the forger is terrible, and the detective wins easily. But each time the detective catches a fake, the forger learns, and improves. After many rounds, the fakes become so good, that even the detective is fooled.
- Forgercreates fake images
- Detectivespots fakes from real
- Feedbackthe forger learns from mistakes
- Better fakesuntil they look real
GANs compared with diffusion
G A Ns can be very fast, producing an image in a single step, and they were behind the first stunning fake faces. But they are tricky to train, they can collapse into producing the same few pictures, and they are harder to steer with text. Diffusion models are slower, but more stable, more varied, and much easier to guide. That is why diffusion took over for general image creation.
GANs
- Very fast, one step
- Tricky, unstable training
- Can repeat the same few pictures
- Hard to steer with text
Diffusion
- Slower, many steps
- Stable training
- Varied results
- Easy to guide with text
VAEs: compress and rebuild
A variational autoencoder learns to squeeze an image into a small code, and then rebuild it. Because the codes are arranged smoothly, you can pick a new code, and decode a brand new image. By itself, the results are a little blurry. But the idea lives on, inside every latent diffusion model, as the compressor, and decompressor, that make it fast.
- Encodersqueezes the image into a small code
- Latent codea compact description of the picture
- Decoderrebuilds an image from the code
Summary
Good. A G A N is a forger versus a detective, fast, but delicate. A V A E compresses and rebuilds, and lives on inside latent diffusion. Diffusion won for its stability, variety, and control. Next, a practical lesson, how to prompt, and control image models, to get exactly what you imagine.
Key takeaways- GAN: forger vs detective
- VAE: compress and rebuild
- Diffusion: stable, varied, steerable