4.5.7 · D5Generative Models

Question bank — Generator and discriminator dynamics

1,401 words6 min readBack to topic

True or false — justify

The optimal discriminator everywhere only when the generator has perfectly matched the data.
True. equals precisely when at every ; anywhere the two densities differ, tilts away from .
If the discriminator loss stops decreasing, the GAN has converged.
False. GAN training is a two-player game, not one loss to minimise; a flat D-loss can mean D is momentarily beaten, or that both players are stuck oscillating around a saddle — not a stable Nash equilibrium.
At the ideal equilibrium the generator's loss goes to zero.
False. When , the non-saturating loss is , not zero. A "flatlining near 0.69" for both players is the healthy sign, not a zero loss.
The generator can see real data directly during training.
False. G only ever receives gradient signal through D; it never touches samples. All its information about "what real looks like" is second-hand, filtered by the discriminator.
Maximising over is the same task as ordinary supervised binary classification.
True. Maximising is exactly minimising binary cross-entropy with label 1 on real and 0 on fake — the sign flip is the only difference.
The first term matters when computing G's gradient.
False. That term has no dependence on G's parameters , so its gradient w.r.t. G is zero; G effectively only sees the fake-sample term.
The non-saturating loss changes where the Nash equilibrium sits.
False. It changes the gradient landscape (stronger signal when G is failing), but the fixed point is still , . It's a re-parameterisation for optimisation, not a new game.

Spot the error

"Since G minimises , we should also let G push the term down."
Error: G has no control over — that term depends only on real samples and D. Trying to "push it down" is meaningless; it's a constant from G's viewpoint.
"D should be trained to output exactly 1 for real and 0 for fake, so we always want maximally confident D."
Error: an over-confident D saturates (), killing G's gradient in the original loss. We want D good but not saturated, which is why we alternate updates instead of training D to convergence each round.
"The minimax objective always trains stably because it has a unique global optimum."
Error: existence of an optimum doesn't guarantee gradient descent-ascent reaches it. The dynamics can cycle around the saddle indefinitely; convergence to the equilibrium is not guaranteed by having one.
"If , the original loss gives a big gradient because D is very wrong about... no, right about the fake."
Error: at D is correctly confident it's fake, and with a tiny slope — the vanishing gradient case. The original loss gives a small gradient exactly here, which is why the non-saturating form exists.
"Mode collapse means the discriminator collapsed and outputs a constant."
Error: mode collapse is a generator failure — G maps many noise vectors to one (or few) outputs, ignoring the diversity of real data. See 4.5.08-Mode-collapse-in-GANs; it is not D outputting a constant.
"We ascend the gradient for both D and G because both are being maximised."
Error: D ascends (maximiser), but G descends (minimiser). Only in the non-saturating reformulation do we phrase G's step as maximising — and even then it's a different objective, not the same one.
"Because is a probability, it must lie strictly between 0 and 1."
Error: at the boundary where but , exactly; where but , . The optimum does hit the endpoints in degenerate regions.

Why questions

Why do we use inside the objective rather than raw probabilities?
Log turns the product of per-sample likelihoods into a sum (stable, differentiable), and it is the natural object from maximum-likelihood / cross-entropy — matching D's task of classifying real vs fake.
Why does the original generator loss vanish early in training?
Early on G is bad, so D confidently outputs ; then and its slope is nearly flat, so G receives almost no gradient exactly when it needs to learn most.
Why does the non-saturating loss fix this?
Its gradient scales like , which blows up when is tiny — giving G a strong learning signal precisely when it is failing, instead of a vanishing one.
Why do we typically take steps on D per single step on G?
To keep D close to its optimum for the current G, so that G's gradient points in a meaningful direction; if D lags too far behind, G's signal becomes misleading.
Why is called Bayes-optimal?
It's the posterior probability that a sample came from the real class assuming equal priors on real/fake — the best possible classifier given the two densities, so no discriminator can do better against that fixed G.
Why can't the discriminator "win" permanently even if it's much stronger than G?
Because if D wins hard, G's gradient vanishes (original loss) or D provides an easy target to climb (non-saturating loss); the game structure forces D to keep re-adjusting as G shifts , so no permanent win exists at equilibrium.
Why does Wasserstein GAN change the loss instead of just tuning learning rates?
The JS-divergence implicit in the original objective saturates (flat gradients) when and barely overlap; WGAN replaces it with a distance whose gradient stays informative even for disjoint supports — a structural fix, not a hyperparameter one.

Edge cases

What is at a point where ?
Exactly — D is genuinely undecided there because a sample is equally likely to come from either source. This is the local signature of a matched region.
What happens to where the real density is zero but G still generates samples ()?
; D can be perfectly certain such outputs are fake, which is why "hallucinated" off-manifold generator samples are so easy to catch.
What is G's ideal , and why is everywhere at that point?
Ideal is at every ; then the ratio uniformly, meaning D has literally no information to separate the two distributions.
In the numerical case , what does the non-saturating generator loss evaluate to, and is that good?
; this is the healthy equilibrium value — G isn't "losing", it has driven D to maximal uncertainty, which is the goal.
If G suffers mode collapse but still fools D on its single mode, has it reached the true equilibrium?
No. Fooling D on one mode gives low loss on expectation over that mode, but globally, so it is a degenerate fixed point of the alternating updates, not the true Nash equilibrium.
What happens to the gradient descent-ascent dynamics if D and G have exactly matched, opposing gradients each step?
They can enter a stable cycle (limit-cycling) around the equilibrium rather than converging — a hallmark of the non-convex, non-concave nature of the min-max game and a known source of training instability.
Recall Fastest self-check

Optimal discriminator formula ::: Value of at perfect equilibrium ::: everywhere, because . Why non-saturating loss exists ::: Original has vanishing gradient when D is confident; gives a strong gradient there. Whose failure is mode collapse ::: The generator's — it ignores diversity and maps to few outputs.