What is a generative adversarial network (GAN)?
Also called: Generative adversarial nets
In one minute
A generative adversarial network (GAN) is one way for AI to make realistic data such as photos: an AI that makes fakes and an AI that tries to spot them are pitted against each other, and both get better.
It was introduced in a 2014 paper. The maker AI takes random numbers and computes a picture from them; different numbers give different pictures. The spotter AI looks at real photos and made pictures and judges whether each one is real. The two take turns learning, each trying not to lose to the other. The maker never uses real photos directly; it improves using the spotter’s verdicts as clues. Round after round, its pictures get closer to the real thing.
In a 2022 experiment, people told GAN-made face photos from real ones no better than by guessing. Its weak points are that training easily becomes unstable and that it can end up making the same kind of thing over and over (mode collapse). In the two years or so from around 2021, most picture-making AIs moved to a different method, the diffusion model.
A common mix-up
“A GAN makes fake photos by cutting and pasting real photos.”
Only partly right. A GAN learns from lots of real photos, so its pictures come to resemble the ones it learned from. But the maker AI never uses real photos directly. Only the spotter AI looks at them. The maker turns a list of random numbers into a picture and improves only through clues coming back from the spotter’s verdicts: how to change the picture so it looks more real. When making a picture, too, it just passes random numbers through the maker once; there is no step that looks up photos and pastes them together. The 2014 paper also placed, next to pictures it made, the most similar photo from the training data, to show they weren’t simply copies. Still, a GAN can sometimes turn out a near-copy of a photo it learned from. A 2023 study found pictures nearly identical to training photos among those made by GANs too. That said, the same study found more such pictures from the diffusion models it compared.
Explained in pictures
You’re free to use these figures in lessons, slides and posts if you credit Naru News (naru.news). CC BY 4.0.
Think of it like this
Counterfeiters and the police (the paper’s own comparison)
The 2014 paper compared a GAN to counterfeiting. The maker AI is a team of counterfeiters, trying to produce fake money and use it without being caught. The spotter AI is the police, trying to detect the fake money. When the police catch them, the counterfeiters improve their methods, and then the police look more closely too. Through this competition both get better, until the fakes can’t be told from the real thing.
As the word “adversarial” suggests, the two AIs compete, each trying to beat the other. But the goal isn’t for either one to win. In the end, only the maker AI is used to make pictures. The spotter AI is a sparring partner for training the maker.
But the comparison has limits. Real counterfeiters can hold real banknotes and compare them closely. A GAN’s maker AI never looks at real photos directly; it improves only from clues coming back from the verdicts of the spotter AI, the police in the story. And real police aim to catch every fake, but a GAN that succeeds ends with the spotter AI unable to say anything about any picture except “half real, half fake” (the ideal case the paper showed mathematically).
Key points
Why is it called a “generative adversarial network”?
The name is made of three words. The 2014 paper was titled “Generative Adversarial Nets,” where nets is short for networks. Taking the first letters gives GAN.
Adversarial means competing against an opponent. The paper describes the generating AI as pitted against an adversary: the AI that judges. The maker tries not to be caught and the spotter tries to catch it, each trying to beat the other.
Generative means producing data. The maker AI produces new data resembling the photos or other data it learned from. It is the same “generative” as in “generative AI” (more on the “Generative AI” page).
Network means a neural network (a computing system made of small parts that take in numbers, calculate and pass the result on, stacked and connected in many stages). In the paper, both the maker and the spotter were neural networks. The maker is also called the generator, and the spotter the discriminator.
How does it learn?
The maker AI takes a list of randomly chosen numbers, computes with them, and turns them into data such as a picture. Inside a computer, a picture is also a list of numbers, one for the color of each dot, so computing one list of numbers into another can produce a picture. Different numbers go in each time, so a different picture comes out each time. The spotter AI takes a picture and answers with a number between 0 and 1: how likely it is to be a real photo. A 1 means it sees the picture as surely real, and a 0 as surely fake.
In training, the two are trained in turns. First the spotter is shown real photos and pictures the maker made, and adjusted to tell them apart correctly. Then the maker is adjusted in the direction that makes the spotter more likely to mistake its pictures for real. In the 2014 paper’s experiments, they alternated one step for the spotter and one step for the maker.
The maker never looks at a real photo directly, not even once. It can still improve because the spotter’s verdict is made by calculation. Change the color of a dot in the made picture a little, and the verdict’s number changes a little too. So by tracing the spotter’s calculation backward, you can find which parts of the picture to change, and which way, to bring the verdict closer to 1, “real.” The maker uses only this direction to adjust how it makes pictures, little by little. Since the spotter was trained by looking at real photos, the maker is in effect learning from real photos indirectly, through the spotter. As a comparison, it is like a blindfolded player of fukuwarai (a Japanese game of placing the parts of a face on a blank face) finishing the face only by following the voices of people who can see it: “a bit to the right,” “a bit higher.”
Keeping the two in balance matters too. The paper warns that if the maker is trained too much without training the spotter, it ends up making the same picture from too many different numbers, without enough variety.
The paper examined, mathematically, an ideal case on paper: both AIs are large enough and training goes as well as it can. Then the maker becomes able to make data just like the data it learned from, and the spotter can only answer “the chance it’s real is one half” for anything it sees. In other words, real and made become impossible to tell apart.
The paper tried this method on data of handwritten digits, face photos, and small photos of things such as vehicles and animals. It said it made no claim that its pictures were better than those of earlier methods, but believed they were at least competitive with the better ones and showed the promise of the adversarial approach.
How realistic did it get?
GANs improved a lot in later research. GANs were known to be unstable to train and to often make nonsensical pictures, and a 2015 study changed how the AI is put together so that they could train stably in most settings. Trained on photos of bedrooms, it made bedroom-like pictures.
StyleGAN, released in 2018, is a GAN that makes face photos and other pictures. Trained on 70,000 detailed face photos, it beat earlier methods on the commonly used yardsticks of picture quality.
So can people tell them apart? In an experiment published in 2022, face photos made by a GAN were mixed with real face photos, shown one at a time, and people were asked whether each was real or made. On average they got 48.2% right, about the same as the 50% you would get by choosing at random. Another group, first told about the odd spots that fakes tend to have and given the answer after each photo, got 59.0%, only a little better than guessing. However, made faces with obvious flaws had been removed beforehand, which made telling them apart that much harder.
Being able to make realistic faces also feeds worries about deepfakes (fake videos, photos or voices made with AI to look real).
What are its weak points?
The first is that training easily becomes unstable. Because each AI keeps shifting in response to the other, the two have trouble settling where they are exactly balanced. A 2016 overview of GANs says the two AIs often seem to go back and forth, undoing each other’s progress. The 2021 paper that reported diffusion models beating GANs on picture quality also says GANs often collapse in training unless their settings are chosen carefully.
The second is mode collapse: the maker starts making the same kind of picture even when given different random numbers. A “mode” is a spot in the data where many similar examples gather. In dog photos, for instance, each kind of dog that shows up often has many similar photos gathered together; each of those is a mode. The name comes from the maker producing only some of them. One likely cause is the maker crowding toward whichever picture the spotter currently finds most real.
It is rare for everything to become the same picture, but partial collapse is common: for example, pictures that all share the same colors or patterns, or pictures of the same dog from different angles. Each picture may look fine on its own, but there aren’t enough kinds. The same 2021 paper also says GANs cover a narrower range of variety than some other methods.
How is it different from a diffusion model?
They make pictures differently. A GAN finishes a picture by passing random numbers through the maker AI just once. A diffusion model (an AI method that starts from a picture of pure noise and removes the noise a little at a time) repeats that removal over many steps. So it is slower than a GAN at making pictures.
They learn differently too. In a GAN, the opponent the maker is trying to beat (the spotter) keeps getting stronger during training, so the training goal keeps moving. A diffusion model deliberately mixes noise into pictures and practices guessing what noise was mixed in. Since it mixed in the noise itself, the right answer is always fixed.
A 2021 paper titled “Diffusion Models Beat GANs on Image Synthesis” reported that diffusion models had overtaken GANs, which until then led in picture quality. As strengths of diffusion models, it lists that the training goal doesn’t move, that the models are easy to make bigger, and that they can make a wide range of the kinds of pictures they learned from; as a weak point, it says they are slower than GANs at making pictures. A 2023 paper says that over the previous two years, diffusion models largely replaced GANs and became the basis of well-known picture-making AIs such as Stable Diffusion (more on the “Diffusion model” page).
Check yourself
Q1In a GAN, introduced in a 2014 paper, an AI that makes pictures and an AI that judges whether a picture is a real photo or a made one are trained in turns. What does the maker AI use as its clue to improve how it makes pictures?
Answer and explanation
Answer: A From the spotter AI: changes that make its verdict more real
The maker AI never uses real photos directly. The spotter’s verdict is made by calculation, so by tracing that calculation backward you can find which parts of the made picture to change, and which way, to bring the verdict closer to “real.” That direction is all the maker uses to adjust. It is never handed pieces cut out of real photos, nor told dot-by-dot differences from a real photo. Only the spotter looks at real photos.
Q2When a GAN is trained to make dog photos, a failure called “mode collapse” can happen. What does the maker AI do after mode collapse?
Answer and explanation
Answer: B It makes similar dogs from any numbers
In mode collapse, the maker AI makes the same kind of picture even when given different random numbers. It may produce only pictures of the same dog from different angles. Each picture may look fine and isn’t broken; what runs short is the variety of things it makes. And since the maker never uses real photos directly, it isn’t copying photos either.
Q3A 2021 paper reported that diffusion models (one AI method for making pictures) had overtaken GANs in picture quality. What weak point of diffusion models, compared with GANs, did this paper point out?
Answer and explanation
Answer: C Making a picture takes more time
Diffusion models repeat the removal of noise over many steps, so the paper says they are slower than GANs at making pictures. A GAN makes a picture by passing random numbers through the maker AI just once. On the contrary, being easy to make bigger and being able to make a wide range of the kinds of pictures they learned from are strengths of diffusion models listed in the same paper. Tending to make similar pictures is a weak point of GANs.
More on this → Key points: How is it different from a diffusion model?
Related terms
- Generative AI
- Diffusion model
- Deepfake
- Latent space
- Neural network
- Deep learning
- Machine learning
- Parameter
- Overfitting
- Mode collapse
- Variational autoencoder (VAE)
Sources and how we checked
- Goodfellow et al., “Generative Adversarial Nets” (Université de Montréal; arXiv, June 10, 2014; published in Advances in Neural Information Processing Systems 27, NIPS 2014; read the abstract, Section 1 (the counterfeiters and police comparison), Sections 3 and 4 (the ideal-case solution and alternating training), Section 5 (datasets and Figure 2), Section 6 (advantages and disadvantages) and Section 7 in the ar5iv HTML version; read November 14, 2026)
- Goodfellow, “NIPS 2016 Tutorial: Generative Adversarial Networks” (OpenAI; arXiv, December 31, 2016, version 4 April 2017, versions 2–4 being typo fixes only; read Sections 2.5, 3.1, 3.2.6 and 5.1 (non-convergence and mode collapse) in the ar5iv HTML version; read November 14, 2026)
- Radford, Metz and Chintala, “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks” (DCGAN; indico Research and Facebook AI Research; arXiv, November 2015, version 2 January 2016, submitted to ICLR 2016; read Sections 1, 3, 4.1 (bedroom photos) and 7 in the ar5iv HTML version; read November 14, 2026)
- Karras, Laine and Aila, “A Style-Based Generator Architecture for Generative Adversarial Networks” (StyleGAN; NVIDIA; arXiv, December 12, 2018, version 3 March 2019, the CVPR 2019 final version; read the abstract, Sections 1 and 2, Appendix A (the FFHQ face dataset) and Appendix C in the ar5iv HTML version; read November 14, 2026)
- Nightingale and Farid, “AI-synthesized faces are indistinguishable from real faces and more trustworthy” (PNAS, vol. 119, no. 8, e2120481119, February 2022; read how the faces were made and chosen, the description of GANs and Experiments 1–3 in the PubMed Central version; read November 14, 2026)
- Dhariwal and Nichol, “Diffusion Models Beat GANs on Image Synthesis” (OpenAI; arXiv, May 2021, version 4 June 2021; read the abstract, Section 1, Table 5 and Section 7 (limitations) in the ar5iv HTML version; read November 14, 2026)
- Carlini et al., “Extracting Training Data from Diffusion Models” (Google, DeepMind, ETH Zurich, Princeton University and UC Berkeley; arXiv, January 30, 2023; read Sections 1, 2 and 6 in the ar5iv HTML version; read November 14, 2026)
- Google Cloud, Japanese page “What are generative adversarial networks (GANs)?” (for the Japanese name “tekitai-teki seisei nettowāku”; read November 14, 2026)
- NTT, Japanese news release on learning depth and bokeh from ordinary photos (June 25, 2021; for the Japanese names “seiseiki” (generator) and “shikibetsuki” (discriminator) in its explanation of GANs; read November 14, 2026)
AI wrote this page from the sources above, and a different AI checked it against the text of those sources (November 14, 2026). A person with a master’s degree in science and a Japanese high-school science teaching license also read and checked it before publishing. Numbers are as of that date. If anything was hard to follow, you spot a mistake, or there’s a term you’d like explained, please write to [email protected].
AI terms
- AI agent
- AI alignment
- Alignment faking
- Artificial general intelligence (AGI)
- Artificial intelligence (AI)
- Autoformalization
- Backdoor
- Benchmark
- Chain of thought (CoT)
- Context window
- Data poisoning
- Deep learning
- Deepfake
- Diffusion model
- Embedding
- Emergent misalignment
- Evaluation awareness
- Fine-tuning
- Formal verification
- Generalization
- You are hereGenerative adversarial network (GAN)
- Generative AI
- Gradual disempowerment
- Hallucination
- Hyperparameter
- Intelligence explosion
- Interpretability
- Jailbreaking
- Large language model (LLM)
- Latent space
- Lean
- Machine learning
- Mixture of experts (MoE)
- Neural network
- Neuralese
- Overfitting
- Parameter
- Persona vectors
- Pre-training
- Prompt
- Prompt injection
- Reasoning model
- Recursive language model (RLM)
- Recursive self-improvement (RSI)
- Red teaming
- Reinforcement learning (RL)
- Retrieval-augmented generation (RAG)
- Reward hacking
- Shutdown resistance
- Sleeper agent
- Subliminal learning
- Superintelligence (ASI)
- System prompt
- Technological singularity
- Time horizon
- Token
- Transfer learning
- Transformer