Generative Adversarial Networks (GANs)

Gen AI generator discriminator adversarial

A forger versus a detective

A GAN pits two networks against each other. The generator is a forger: it turns random noise into fake data and tries to pass it off as real. The discriminator is a detective: it sees real and fake examples and tries to tell them apart. As the detective gets sharper, the forger is forced to get better — until the fakes are indistinguishable from reality.

Generator noise → fake

Maps a random vector to a sample, trained to fool the discriminator.

Discriminator real or fake?

A binary classifier trained to catch the generator's fakes.

The game minimax

One's gain is the other's loss. They improve together until equilibrium.

Watch the arms race

Early on the fakes are obvious and the detective wins easily. As training proceeds, the fake data distribution slides toward the real one — and the discriminator's accuracy collapses toward a coin flip.

Powerful, but tricky

Strengths
  • Famously sharp, realistic images
  • Fast one-shot generation (no iterative denoising)
  • Great for faces, style transfer, super-resolution
Headaches
  • Unstable training — the two can oscillate
  • Mode collapse: generator outputs the same few samples
  • Hard to know when it has "converged"
GANs vs diffusion

GANs dominated image generation for years. Today diffusion models often beat them on quality and stability — but GANs remain prized when generation speed matters. Both are alternatives to the VAE for generative modelling.