TL;DR
Goodfellow et al. (2014) train two networks against each other. A generator turns random noise into samples, and a discriminator tries to tell those samples from real training data. is trained to fool and is trained to catch . At the optimum, reproduces the data distribution and outputs everywhere. The whole system is trained with backpropagation, with no Markov chains and no explicit likelihood.
Where you'll see it: the adversarial loss behind most image synthesis and restoration work since 2014, and the starting point for conditional GANs, Wasserstein GANs and StyleGAN.
The problem
Before 2014, deep generative models were hard to train. Undirected models such as restricted Boltzmann machines and deep Boltzmann machines have a partition function whose gradient is intractable, so training leans on Markov chain Monte Carlo, which mixes slowly. Directed latent-variable models need approximate inference during training. Score matching and noise-contrastive estimation need the density to be analytically defined up to a normalising constant, which many multi-layer models do not offer. Generative stochastic networks avoid the density but still need a Markov chain at sampling time.
The paper's goal is a model where sampling takes one forward pass, training uses only backpropagation, and no inference network or chain is needed. Piecewise linear units such as ReLU and maxout train well under backprop, but they misbehave inside feedback loops, so the method should avoid loops entirely.
Key idea
Think of counterfeiters and police. The counterfeiter (the generator) makes fake banknotes. The police (the discriminator) inspect notes and decide real or fake. Each side improves in response to the other. The paper's observation is that the police's job is an ordinary binary classification problem, so the whole game can be trained with the same gradient tools used for classifiers.
flowchart LR Z[noise z] --> G[generator G] G --> F[fake sample] R[real sample x] --> D[discriminator D] F --> D D --> P[probability the input is real]
is pushed up on real samples and down on fakes. is pushed in the opposite direction on its fakes. Neither network ever sees the other's parameters, only the signal that flows through .
The method
Let be the data distribution and a simple prior over noise, such as a uniform or Gaussian distribution. The generator is a multi-layer perceptron that maps noise to data space. It defines a model distribution as the distribution of when . The discriminator is a second perceptron that outputs a single number in , read as the probability that came from the data.
The two players share one value function:
maximises and minimises it, which gives the minimax game . The first term rewards for calling real data real. The second rewards for calling fakes fake, and it is the term attacks.
The optimal discriminator
Proposition 1. For a fixed , the best possible discriminator is
The proof rewrites as an integral over of . Each point contributes with and . Setting the derivative to zero gives , which is the formula above.
The global optimum
Substitute back into to get a criterion that depends only on :
Here is the Jensen–Shannon Divergence, built from two KL divergences to the average of the two distributions. The Jensen–Shannon divergence is never negative and is zero only when its inputs are equal. So reaches its smallest value, , exactly when . At that point everywhere, and .
This is the paper's main theoretical claim: in the non-parametric limit, where and can represent any function, the game has one solution and it is the data distribution.
Convergence of the training loop
Training cannot run to its optimum at every step, since that is too expensive and overfits a finite dataset. The paper's Proposition 2 says that if is allowed to reach its optimum at each step and is updated to improve , then converges to . The argument: for a fixed , the value is linear in , and a supremum of linear functions is convex. A convex objective with a unique minimum, updated in small steps, converges to that minimum.
The catch, which the paper states, is that in practice is not optimised directly. Only the parameters are, and a multi-layer perceptron creates many critical points in parameter space. The argument therefore does not carry over to deep networks. The authors' answer is that the method works well empirically despite this.
The training algorithm
Algorithm 1 alternates between steps of ascending 's stochastic gradient on a minibatch and one step of descending 's. Each step uses real examples and fresh noise samples. Each step uses new noise samples. The paper uses in its experiments, the cheapest option, and applies momentum as the gradient rule.
Larger would keep closer to its optimum for the current , which matters for the synchronisation problem discussed later.
The non-saturating generator loss
The generator minimises in Algorithm 1. Early in training produces obvious fakes, rejects them confidently, and this term saturates, so its gradient is tiny. The paper proposes that instead maximise . This has the same fixed point but gives much stronger gradients at the start.
Let , where is the discriminator's pre-sigmoid score for one fake and .
- Saturating loss: . At , the gradient is .
- Non-saturating loss: . At , the gradient is .
- The ratio is . Early in training the non-saturating loss gives about 99 times the gradient signal to the generator.
Interpretation: when the discriminator is confident the fake is fake, the original loss gives the generator almost nothing to learn from. Switching to fixes that without changing where training ends.
Results
The paper trains on MNIST, the Toronto Face Database (TFD) and CIFAR-10. The generator is a mix of ReLU and sigmoid units, and the discriminator uses maxout units with dropout. Noise enters only at the bottom layer of the generator.
The paper has no standard metric for generative models, so it estimates the test-set log-likelihood under . It draws samples from , fits a Gaussian Parzen window (a kernel density estimate with one Gaussian per sample) around them, and reports the log-likelihood of held-out test points under that window. The Gaussian width is chosen by cross-validation on a validation set. The authors say this estimator has high variance and does poorly in high dimensions. They call it the best available option.
| Model | MNIST | TFD |
|---|---|---|
| DBN | ||
| Stacked CAE | ||
| Deep GSN | ||
| Adversarial nets |
Adversarial nets score highest on MNIST. On TFD the paper's table and the numbers differ in how they read. The table bolds both stacked CAE () and adversarial nets (), but the numbers put the adversarial nets second, below the stacked CAE and above the DBN () and deep GSN (). The paper does not say why both are bold. The gap is about the size of the quoted standard errors ( and ), so a tie is a reasonable reading, but that is our inference, not the paper's statement. Note also that the standard errors mean different things in the two columns: across test examples on MNIST, across dataset folds on TFD. The authors do not claim their samples are better than those of other models. They say the samples are "at least competitive" and that the figures show the framework's potential. The figures include random draws, not cherry-picked ones, and nearest-neighbour training images to show the model has not memorised data. The paper also shows digits from linear interpolation in space, which suggests the generator learns a smooth latent space.
Why it mattered
The paper turned a set of theoretical ideas into a method anyone could run with a few lines of backpropagation code. Its key properties were no Markov chains, exact sampling by a single forward pass, and no need to write down a density. Each of these was a known pain point for the models of its day.
It also left clear problems open. The paper names two. The first is that has no explicit form, so the model cannot score a given example. The second is training instability: must stay synchronised with . If trains too far ahead of , it can collapse many values of onto one output, which the paper calls the "Helvetica scenario".
Later work took the paper in several directions. Conditional GANs add a label to both networks, which is extension 1 in the paper's conclusion. Deep convolutional GANs (2015) made training stable enough for natural images. Wasserstein GANs (2017) changed the distance being minimised to address the instability. StyleGAN (2018 to 2019) pushed image quality far beyond the paper's samples. Most of today's adversarial losses trace back to this paper's two-player setup.
Reading guide
Read the paper in this order. Each part needs the listed prerequisites.
- Introduction and Section 2 (related work). Needs Generative Model and Latent Variable Model to follow why the older approaches are hard to train.
- Section 3 (adversarial nets) and Figure 1. Needs Minimax Game, Feedforward Neural Network and Backpropagation for the value function and the two networks. The non-saturating loss paragraph uses Cross-Entropy Loss intuition: 's objective is a binary log-likelihood.
- Algorithm 1. Needs Stochastic Gradient Descent and Momentum for the minibatch updates.
- Section 4.1 (Proposition 1 and Theorem 1). Needs Probability Density Function for the densities, Kullback–Leibler Divergence and Jensen–Shannon Divergence for the final identity. This is the mathematical core, so read it slowly.
- Section 4.2 (Proposition 2). Needs the idea of convexity. Treat it as motivation: the convergence result does not hold for deep networks, as the paper says.
- Section 5 (experiments). The Parzen estimate needs Probability Density Function and the Gaussian kernel. Table 2 is a useful summary of how each model family handles training, inference and sampling.
- Section 6 and 7. Advantages, disadvantages and extensions. Read these last, since they assume the rest of the paper.
Check yourself
QuestionWrite down the value function V(G, D) and say which player maximises it.Show answer
. The discriminator maximises it, since it wants to label real data as real and fakes as fake. The generator minimises it.
QuestionAt a point x, p_data(x) = 0.8 and p_g(x) = 0.5. What is the optimal discriminator D*(x)?Show answer
. The discriminator should lean towards real here, because the data is more likely to produce this point than the generator is.
QuestionWhy does the optimal value of the game equal minus log 4?Show answer
At the global optimum , so everywhere. Each expectation then contributes , and the sum is . The theorem shows this is the minimum of , because and the divergence is never negative.
QuestionWhy does the paper switch the generator's loss from minimising log(1 - D(G(z))) to maximising log D(G(z))?Show answer
When confidently rejects early fakes, is near zero. The original loss then has a gradient near zero, so learns very slowly. The alternative loss has the same fixed point but a gradient larger by a factor of at that point. The worked example in this lesson gives a factor of 99 at .
QuestionA generator trained on digits produces only sevens. Which failure does the paper describe, and what does it recommend to limit it?Show answer
This is the Helvetica scenario, where the generator collapses many noise values to the same output. The paper's advice is that must not be trained too much without updating , so the two stay synchronised. The inner discriminator steps of Algorithm 1 are the natural knob for this, though the paper itself used . It does not claim any setting fully prevents collapse; it lists synchronisation as a disadvantage of the framework.
Sources
- Goodfellow, I. J. et al. (2014). Generative Adversarial Nets. NIPS 2014. https://arxiv.org/abs/1406.2661
- Goodfellow, I. (2016). NIPS 2016 Tutorial: Generative Adversarial Networks. https://arxiv.org/abs/1701.00160
- Wikipedia. Generative adversarial network. https://en.wikipedia.org/wiki/Generative_adversarial_network