Visual walkthrough — GAN training instability and mode collapse
This is the picture-story behind the central result of the parent topic. We build everything from zero: what a "distribution" looks like as a picture, what the discriminator is actually deciding, why one specific formula falls out, and — the punchline — why a discriminator that wins too hard silently kills the generator's learning signal.
If you have never seen the GAN setup, read line one and keep going — nothing is assumed.
Step 1 — Two piles of dots on a line
WHAT. Forget networks for a moment. Imagine every possible image squished down to a single number on a horizontal line. A distribution is just "how often each value of shows up", drawn as a curve whose height at tells you how likely that is.
We have two curves:
- — the real data. Where it is tall, real samples cluster.
- — what the generator currently produces.
WHY. GAN training is a fight between these two curves. Everything — instability, mode collapse, the magic — is visible once you can see the two piles overlapping.
PICTURE. Look at the two humps below. The magenta hump is real data; the violet hump is the generator. Where they overlap (the shaded region) is exactly where the discriminator will struggle.

Step 2 — What the discriminator is actually deciding
WHAT. Pick one point on the line. At that spot, two curves have heights and . The discriminator must output a single number :
- → "surely real"
- → "surely fake"
- → "no idea, coin flip"
WHY. The discriminator can only look at the height ratio of the two curves at . If real is much taller there, it should shout "real"; if fake is much taller, "fake". This local view is the seed of the whole derivation.
PICTURE. At one chosen (the dashed vertical line), we mark the two heights. The discriminator's job is to turn those two heights into one belief.

Step 3 — Writing down the score and reading it as a picture
WHAT. The discriminator is scored by
Let's decode every symbol:
- — the expectation: "average this quantity, weighting each by how often real data lands there". It is literally area under (curve × quantity).
- — big (near ) when , and hugely negative when . So the discriminator is rewarded for pushing up on real data.
- — the mirror image: rewarded for pushing down on fakes.
WHY and not just ? Because punishes confidence in the wrong direction infinitely hard. Saying "definitely fake" () about a real image costs . This forces honest probabilities, not reckless guesses. No other simple function has this "infinite penalty at the edge" behaviour.
PICTURE. Two reward curves: climbing toward , and climbing toward . The discriminator wants to sit high on both — impossible where the curves overlap, which is the tension.

Step 4 — Solving one point at a time: the tug-of-war
WHAT. At a single , ignore the averaging and just look at the quantity being summed:
Call the two heights and . We want the that makes largest. Slide from to : near the first term is , near the second term is . So the maximum sits somewhere in the middle, pulled toward whichever height is bigger.
Take the derivative and set it to zero (this is just "find the top of the hill"):
WHY a derivative? Because "find the value that maximises a smooth curve" is exactly the question a derivative answers: the top of a hill is where the slope is flat (). No searching needed.
PICTURE. The little hill over , with its peak marked. Move the peak marker as vs changes.

Step 5 — The three cases, seen as heights
WHAT. Now read across every possible situation:
| Region | heights | meaning | |
|---|---|---|---|
| real-only | "obviously real" | ||
| fake-only | "obviously fake" | ||
| perfect match | "pure coin flip" | ||
| empty region | undefined | see Step 6 |
WHY these cases matter. The whole promise of GANs is: when the generator perfectly copies the data, the game reaches a draw. Case 3 is that draw — if everywhere then everywhere, and the discriminator is reduced to guessing. That is the target we want training to reach.
PICTURE. The two humps again, colour-coded by what does across the line: pure magenta zone , pure violet zone , overlap fading to the grey line.

Step 6 — The degenerate case: where the curves don't touch
WHAT. Early in training the generator's hump sits far away from the real hump — no overlap. In that gap, and , so : undefined. But just left of the fake hump and just right of the real hump, one curve is zero and the other is not, so snaps to exactly or exactly .
WHY this is the danger zone. A discriminator that can output a perfect step — on real, on fake, with a cliff in between — has zero slope everywhere except the cliff. The generator's samples live in the flat plateau, where the surface it's trying to climb is perfectly flat.
PICTURE. Non-overlapping humps and the resulting curve: a flat shelf at , a vertical cliff, a flat shelf at . Mark that the fake samples sit on the flat shelf.

Step 7 — Where the gradient dies (the punchline)
WHAT. The generator improves by nudging its samples "uphill" on the discriminator's surface. Its gradient contains the factor — how steeply rises as you move the sample. On the flat plateau of Step 6:
- — the slope of the discriminator surface at the sample. On a flat shelf this is .
- The prefactor (from at ) is not the problem — it stays a healthy constant.
- Multiply anything by a zero slope → zero learning signal.
WHY this is the real culprit. The generator isn't stuck because "the discriminator is confident" in some vague sense — it's stuck because a saturated discriminator gives a flat surface, and you cannot roll uphill on a flat floor. See why flat regions kill gradient descent.
PICTURE. A ball (a fake sample) sitting on a flat plateau of the surface, with a sad arrow showing "nowhere to roll". Contrast with a tilted surface where the ball rolls toward real data.

Step 8 — The fix, as a re-tilted surface
WHAT. Two rescues, both visible as "give the generator back a slope":
- Non-saturating loss: maximise instead of minimising . Now the prefactor is , which blows up () exactly when the surface is flattest — amplifying the tiny slope back into a usable signal.
- Wasserstein critic: drop the sigmoid entirely. The critic outputs a raw number with a guaranteed non-zero slope (1-Lipschitz), so the surface is never flat — the ball always has somewhere to roll.
WHY it works. Both change the shape of the surface the generator climbs, not the fixed point it's aiming for. Same target (), gentler hills.
PICTURE. Side by side: the dead flat plateau (original loss) vs. the re-tilted, always-sloped surface (fixes), same ball, now rolling.

The one-picture summary
Everything on one canvas: two humps → the height ratio → → three cases → the flat plateau where gradient dies → the re-tilt that saves it.

Recall Feynman retelling — say it back in plain words
Picture two piles of dots on a line: the real pile and the fake pile the generator makes. The discriminator stands at each spot and asks "of the dots here, what fraction are real?" — that fraction is the best it can possibly answer, . When the two piles land perfectly on top of each other, that fraction is everywhere: the discriminator is forced to flip coins. That's the draw we want. But early on the piles are far apart, so the discriminator can draw a perfect cliff — flat over the fakes, flat over the reals. The generator's fakes sit on the flat floor, and to improve it needs the floor to tilt toward the real pile. A flat floor means no direction to walk — that's the dead gradient. The saturated prefactor isn't the villain; the flat floor is. The fixes (non-saturating loss, Wasserstein critic) all do one thing: tilt the floor back so the generator can walk home.
Recall Quick self-test
Why is everywhere the sign of success? ::: It means at every point, so real and fake are indistinguishable — the generator has matched the data. What term actually vanishes in the dead-gradient case, and why? ::: , because a saturated discriminator's output is flat away from the decision cliff. Why does maximising rescue training? ::: Its prefactor grows large exactly when , amplifying the small slope back into a usable signal.
Connections
- Parent: GAN training instability and mode collapse
- Hinglish: 4.5.08 GAN training instability and mode collapse (Hinglish)
- Prereq: 4.5.01-Generative-Adversarial-Networks-fundamentals
- The fix in depth: 4.5.07-Wasserstein-GAN-and-improved-training
- Flat-region intuition: 3.4.05-Optimization-challenges-in-deep-learning
- Related stabilisers: 4.3.06-Batch-normalization-and-alternatives, 4.5.09-StyleGAN-and-progressive-growing, 4.5.10-Conditional-GANs-and-control