- A generative adversarial network (GAN) trains two neural networks against each other: a generator that fabricates data and a discriminator that judges whether a sample is real or fake.
- GANs were introduced by Ian Goodfellow and colleagues in the 2014 paper “Generative Adversarial Nets”; the design frames generation as a two-player minimax game.
- Training is notoriously unstable — mode collapse, vanishing gradients, and non-convergence are common failure modes that the field spent years taming.
- Landmark variants include DCGAN (2015), which stabilised training with convolutions, and NVIDIA’s StyleGAN (2018), which produced photorealistic faces.
- Since roughly 2021, diffusion models have overtaken GANs for most high-end image generation, though GANs remain valued for fast, single-pass inference.
What is a GAN?
A generative adversarial network is a machine learning framework in which two neural networks compete in a zero-sum game so that one learns to produce realistic synthetic data. The generator turns random noise into fake samples; the discriminator tries to tell fakes from real training data. As each improves, the generator is pushed toward outputs indistinguishable from the real thing.
The idea was published by Ian Goodfellow and seven co-authors at the 2014 NeurIPS conference. Goodfellow has recounted that he sketched the core idea after a pub argument and coded a working prototype the same night. The original paper’s abstract describes “a new framework for estimating generative models via an adversarial process, in which we simultaneously train two models.” Yann LeCun, Meta’s chief AI scientist, later called adversarial training “the most interesting idea in the last 10 years in machine learning.” For the broader machinery these networks are built from, see our primer on neural networks.
Generator versus discriminator
The generator and discriminator play opposite roles in a feedback loop. The generator maps a random vector — usually sampled from a Gaussian distribution — into a candidate image, sentence, or signal. The discriminator receives a mix of real and generated samples and outputs a probability that each is real. The two are trained together, each one’s loss defined against the other’s success.
The minimax game
Formally, the original GAN optimises a single value function in which the discriminator maximises its ability to classify real versus fake while the generator minimises the discriminator’s success. At the theoretical optimum, the generator’s output distribution matches the real data distribution exactly, and the discriminator outputs 0.5 everywhere — it can do no better than a coin flip. In practice this equilibrium is hard to reach, because both networks are moving targets that update simultaneously.
The counterfeiter analogy
Goodfellow’s own framing compares the generator to a team of counterfeiters and the discriminator to the police. The counterfeiters get better at forging currency; the police get better at detecting forgeries; the arms race continues until the fakes are indistinguishable from genuine notes. Neither side can win permanently, which is exactly the dynamic that makes GANs both powerful and fragile.
Why GANs are hard to train
GAN training is unstable because two networks are optimised against each other simultaneously, so improvement in one can destabilise the other. Unlike a standard model that descends toward a single loss minimum, a GAN seeks a saddle-point equilibrium that ordinary gradient descent does not reliably find. Researchers spent years developing tricks, architectures, and loss functions to make training converge.
Mode collapse
The most cited GAN pathology is mode collapse, where the generator learns to produce only a few outputs that reliably fool the discriminator, ignoring the diversity of the real data. A face generator might output the same handful of faces regardless of its noise input. Techniques such as minibatch discrimination, the Wasserstein GAN loss (Arjovsky et al., 2017), and spectral normalisation were introduced specifically to mitigate this.
Vanishing gradients and non-convergence
If the discriminator becomes too good too quickly, it classifies every fake with near-certainty, leaving the generator almost no gradient signal to learn from. Conversely, oscillation — where the two networks chase each other without settling — is common. Balancing the relative learning rates and capacities of the two networks remains as much craft as science.
Landmark GAN variants
GANs evolved rapidly through a series of architectural breakthroughs between 2015 and 2020. Each addressed a specific weakness — stability, resolution, or controllability — and together they pushed synthetic image quality from blurry 32-pixel thumbnails to megapixel portraits that fooled human viewers.
DCGAN (2015)
The Deep Convolutional GAN, introduced by Radford, Metz, and Chintala in 2015, replaced the original fully-connected layers with convolutional ones and added architectural guidelines — batch normalisation, strided convolutions, and specific activation functions. DCGAN made training dramatically more stable and became the template that nearly every later image GAN built upon. Because images are the core domain here, the techniques overlap heavily with the field of computer vision.
StyleGAN (2018–2021)
NVIDIA’s StyleGAN, published in 2018 by Karras and colleagues, introduced a style-based generator that controlled image features at different scales — coarse attributes like pose separately from fine details like freckles. It powered the viral site thispersondoesnotexist.com, which displays a fresh, entirely synthetic human face on each refresh. StyleGAN2 (2019) and StyleGAN3 (2021) further reduced artifacts and improved consistency under animation.
Conditional and image-to-image GANs
Conditional GANs let users steer output with a label or input image. Pix2Pix translates sketches into photos; CycleGAN (Zhu et al., 2017) converts horses to zebras or summer scenes to winter without paired training data. These models extended GANs from pure generation into controllable translation, which made them practically useful in design, photography, and film.
Deepfakes and ethical concerns
GANs are the technology behind many early deepfakes — synthetic media that swaps faces or fabricates events convincingly. The same adversarial training that produces realistic art can manufacture non-consensual imagery, fraudulent identities, and political disinformation. According to multiple industry analyses, the volume of detected deepfake content has grown sharply since 2019, prompting regulation and detection research.
Detection is itself an adversarial problem: as detectors improve, generators adapt to evade them, mirroring the GAN dynamic at a societal scale. The EU AI Act, which entered into force in 2024, requires that AI-generated or manipulated media be labelled in many contexts. Researchers caution that watermarking and provenance standards — not just detection — are likely needed, because no classifier reliably catches every synthetic image.
GANs versus diffusion models
GANs and diffusion models are both generative, but they reach realism through opposite strategies. A GAN generates an image in a single forward pass from noise, trained adversarially. A diffusion model learns to reverse a gradual noising process step by step, which is slower at inference but far more stable to train and easier to scale. Since around 2021, diffusion has dominated state-of-the-art image generation.
The 2021 paper “Diffusion Models Beat GANs on Image Synthesis” by Dhariwal and Nichol at OpenAI was a turning point, showing diffusion surpassing GANs on standard image-quality benchmarks. Tools like Stable Diffusion, DALL-E, and Midjourney are diffusion-based. GANs retain advantages in speed — single-pass generation suits real-time applications — and remain useful for super-resolution, face editing, and on-device generation. For the architecture that now leads image synthesis, see our explainer on diffusion models.
Frequently asked questions
Who invented GANs and when?
Generative adversarial networks were introduced in 2014 by Ian Goodfellow and seven co-authors in the paper “Generative Adversarial Nets,” presented at the NeurIPS conference. Goodfellow, then a PhD student, is widely credited as the lead inventor. The idea quickly became one of the most influential concepts in deep learning, spawning thousands of follow-up papers and earning praise from senior researchers as a landmark contribution to unsupervised generative modelling.
What is mode collapse in a GAN?
Mode collapse is a failure mode in which the generator produces only a small set of outputs — sometimes a single image — that reliably fool the discriminator, while ignoring the full diversity of the training data. It happens because the generator finds a narrow shortcut to low loss rather than learning the whole data distribution. Researchers counter it with techniques such as the Wasserstein loss, minibatch discrimination, and careful balancing of the two networks during training.
Are GANs obsolete now that diffusion models exist?
Not obsolete, but no longer dominant for top-tier image generation. Since 2021, diffusion models have produced higher-quality, more diverse images and are easier to train at scale, so they power most modern text-to-image tools. GANs still excel where inference speed matters, because they generate in a single pass rather than dozens of denoising steps. They remain widely used for super-resolution, face editing, style transfer, and lightweight on-device generation.






