Quant Memo
Advanced

Spectral Normalization for GAN Stability

GANs are notoriously unstable to train because the discriminator can become too powerful too fast; spectral normalization fixes this by rescaling every weight matrix so the discriminator can never change its output faster than a fixed rate.

A GAN's discriminator is trained to tell real data from the generator's fakes, and the generator improves by using the discriminator's gradient as a training signal. If the discriminator gets too sharp — its output swings wildly for tiny changes in input — that gradient becomes useless or explosive, and training collapses. The technical way to say "not too sharp" is that the discriminator's Lipschitz constant should be bounded: its output shouldn't change faster than some fixed rate relative to how much its input changed.

Spectral normalization enforces this directly on every weight matrix in the discriminator, layer by layer. Each weight matrix WW is divided by its spectral norm — its largest singular value, σ(W)\sigma(W) — so the rescaled matrix W/σ(W)W / \sigma(W) has spectral norm exactly 11, meaning it can stretch any input vector by at most a factor of 11. Since a network's overall Lipschitz constant is bounded by the product of its layers' individual Lipschitz constants, normalizing every layer this way caps the whole discriminator's sensitivity in one mechanical step, with no extra loss terms or hyperparameters to tune.

Computing the exact largest singular value every training step would be expensive, so in practice it's approximated cheaply with one or two iterations of the power method, updated alongside the weights each step — accurate enough to keep training stable at negligible extra cost. This became one of the standard, close-to-default stabilization tricks for GAN discriminators after 2018, often paired with architectural choices like those in DCGAN.

Spectral normalization divides every discriminator weight matrix by its largest singular value, capping how sharply the discriminator's output can change and preventing the runaway discriminator dominance that destabilizes GAN training.

Related concepts

Practice in interviews

Further reading

  • Miyato et al., Spectral Normalization for Generative Adversarial Networks (2018)
ShareTwitterLinkedIn