The GAN Minimax Objective
A generative adversarial network trains two networks against each other in a game — a generator trying to fool a discriminator, and a discriminator trying not to be fooled — and the objective that describes this tug-of-war is a single minimax expression.
Prerequisites: Generative vs Discriminative Modeling, Gradient Descent
Most generative models are trained by directly maximizing a likelihood — how probable is the real data under the model. GANs do something structurally different: instead of one network learning a likelihood, two networks compete. A generator tries to produce fake samples realistic enough to pass as real. A discriminator tries to correctly tell real samples from the generator's fakes. Neither network is ever told "here is the correct probability of this data" — they only ever learn from beating, or losing to, each other.
The analogy: a forger and an inspector
Picture an art forger and a museum inspector locked in an ongoing contest. The forger studies rejected pieces and improves their technique to fool the inspector next time. The inspector studies both real paintings and the forger's latest attempts, sharpening their eye to catch subtler and subtler fakes. Neither party is ever handed a rulebook for "what makes a painting authentic" — both only ever react to the other's latest move. If this contest runs long enough with both sides improving, the forger's fakes become indistinguishable from the real thing, and the inspector is reduced to guessing.
The objective, symbol by symbol
The generator maps random noise to a fake sample . The discriminator outputs a probability that a given sample is real. Both are trained on one shared objective, minimized by and maximized by :
In words: wants to output values close to for real data (making the first term large) and close to for fakes (making the second term large too, since is the max of that piece). wants the opposite of the second term — it wants close to , i.e. it wants the discriminator fooled, which minimizes toward . They optimize the same expression in opposite directions, which is what "minimax" means: one player's gain is the other's loss.
Worked example 1: one discriminator update by hand
Suppose on one real sample , , and on one fake sample, (the discriminator is currently mediocre at spotting fakes). The value function for this pair:
The discriminator's gradient step pushes toward and toward to raise . If it succeeds, say and : , a clear improvement (less negative) — the discriminator got better at telling them apart.
Worked example 2: the generator's opposing move
The generator only touches the second term, , and wants to minimize , meaning push up. If it improves its fake so that rises from back to : , versus . 's second term dropped from to — exactly what the generator wants, and exactly what makes the discriminator's job harder next round. This back-and-forth, one step improving 's side and the next improving 's, is why GAN training is a sequence of alternating gradient updates rather than one joint optimization.
Watch the descent path above: GAN training alternates two such descents on the same loss surface, one player stepping downhill while the other tries to reshape the hill under them — which is part of why GAN optimization is notoriously less stable than descending a single fixed loss.
A GAN's minimax objective has the discriminator maximizing its ability to separate real from fake while the generator minimizes that same expression by fooling it — two networks trained on opposite ends of one shared scoreboard, with no direct likelihood ever computed for either.
What this means in practice
The minimax framing is why GANs can produce sharper, more realistic samples than likelihood-based models in many domains — there's no pressure to average over all plausible outputs, only pressure to be indistinguishable from real ones. It's also why GANs are used for synthetic financial time series (see quant-gan-for-financial-time-series): the discriminator can be handed features like autocorrelation or volatility clustering to check for, forcing the generator to reproduce those stylized facts rather than just matching a mean and variance.
The classic confusion is treating a GAN's discriminator loss as a measure of overall generation quality the way a validation loss works elsewhere. It is not: a discriminator loss near per term can mean either "the generator is producing perfect samples the discriminator can't distinguish" or "training has stalled and nothing useful is happening" — the number alone can't tell you which, and practitioners rely on separate quality metrics rather than the adversarial loss curve itself.
Related concepts
Practice in interviews
Further reading
- Goodfellow et al., Generative Adversarial Networks (2014)