Black October, explainedAppsGuidesAI DictionarySmall FixesOn RecordAboutFollow the lab

GAN

Also called generative adversarial network, GANs

A GAN is two AI models trained as rivals: one makes fakes, the other tries to catch them, and both keep getting better.

In plain words

Picture a forger and a detective. The forger paints fake notes. The detective compares them with real ones and says "fake". The forger studies what gave it away and tries again. Over thousands of rounds, the forger gets so good the detective can barely tell.

A generative adversarial network, or GAN, is that contest inside a computer. One neural network, the generator, turns random numbers into a picture. A second, the discriminator, looks at real photos and the generator's fakes and guesses which is which. Each one's mistakes become the other's lesson.

GANs gave us the first startlingly real AI faces around 2018. Today most image tools use diffusion models instead, but GANs are still used where speed matters, such as sharpening blurry photos.

Everyday example

Learning to make perfect rotis

A new cook makes rotis. An aunt who has eaten thousands tastes each one: "too thick", "burnt edge", "almost". The cook adjusts. But the aunt is also learning, spotting smaller flaws as the rotis improve. The cook never sees the recipe, only the verdicts. A GAN's generator learns the same way, from the judge alone.

Where the example breaks: The aunt wants the cook to succeed. In a GAN the two sides really are opponents, and the contest can go wrong: if the judge gets too good too fast, the cook learns nothing, and sometimes the cook finds one roti that passes and makes only that.

Go deeper

How it actually works

A GAN is a training setup, a game between two networks, rather than a single model.

  1. The generator starts from noise

    The generator takes a short list of random numbers, a point in its latent space, and turns it into an image. At first the output is meaningless.

  2. The discriminator judges

    The discriminator is a classifier, often a convolutional network. It is shown a mix of real training images and generated ones and outputs how likely each is to be real.

  3. Both learn from the same verdict

    Using backpropagation, the discriminator is nudged to judge better, and the generator is nudged to produce images the discriminator would call real. The original paper describes this as a two-player minimax game.

  4. Known problems

    GANs are hard to train. They often fail to settle. In mode collapse, the generator finds a few outputs that fool the judge and makes only those. If the judge is too strong, the generator stops getting a useful signal.

First described
June 2014, "Generative Adversarial Networks", Ian Goodfellow and seven co-authors at the Université de Montréal
Famous result
StyleGAN (December 2018) produced highly realistic faces of people who do not exist
Used for
Photo upscaling, style transfer, synthetic training data, and early deepfakes
Largely replaced by
Diffusion models for text-to-image since about 2022

Questions people ask

What does GAN stand for?

Generative adversarial network. Generative because it makes new data, adversarial because two networks compete, and network because both parts are neural networks.

Who invented GANs?

Ian Goodfellow and colleagues at the Université de Montréal, including Yoshua Bengio, described GANs in a paper posted in June 2014.

Are GANs still used?

Yes, but less for headline image generation. Diffusion models took over text-to-image because they train more reliably and follow prompts better. GANs remain useful where speed matters, such as upscaling and real-time effects, and parts of some modern systems borrow the adversarial idea.

What is the difference between a GAN and a diffusion model?

A GAN makes an image in one pass and learns by fooling a judge. A diffusion model starts from noise and removes it over many small steps, learning by undoing added noise. Diffusion is slower to run but steadier to train.

Are GANs used to make deepfakes?

Early face-swap deepfakes used related techniques, and GANs made realistic fake faces widely known. Today's fakes come from many methods. Learning how they are made helps explain why checking the source matters.

Further reading