In the world of generative modeling, Generative Adversarial Networks (GANs) have long been the "wild child." While likelihood-based models like VAEs and Diffusion models have mathematically rigorous objectives (like minimizing KL divergence), GANs rely on a high-stakes minimax game between a generator and a discriminator. We hope that as the discriminator gets better at telling real from fake, it provides gradients that push the generator toward the true data distribution. But does it actually?
A new paper from ICLR 2024, "SAN: Inducing Metrizability of GAN with Discriminative Normalized Linear Layer," tackles this fundamental question. The authors provide a theoretical framework to ensure that a discriminator acts as a true distance metric—a property they call metrizability—and introduce a simple architectural tweak to make it happen in practice.
The Core Problem: Do Discriminators Actually Measure Distance?
The central challenge in GAN training is stability and convergence. Theoretically, if a discriminator is "optimal," the generator should be minimizing a specific divergence (like Jensen-Shannon). However, in the real world, discriminators are never truly optimal.
If the discriminator doesn't behave like a proper distance metric, the gradients it provides might not actually be making the generator's distribution "closer" to the real one. This disconnect leads to common failure modes like mode collapse (where the generator only produces a few types of images) or severe training instability. The authors set out to find the exact conditions under which a trained discriminator provides meaningful, distance-reducing gradients.
Methods: Bridging GANs and Sliced Optimal Transport
The researchers connected the GAN framework with the concept of Sliced Optimal Transport. They treat the discriminator as a two-part system: a feature extractor ($h$) that maps data to a high-dimensional space, and a linear projection ($\omega$) that "slices" these features down to a 1D value.
To ensure this system acts as a valid distance metric, they derived three Metrizable Conditions:
- Direction Optimality: The projection direction $\omega$ must be the one that most distinguishes the real and fake distributions.
- Separability: The cumulative density functions (CDFs) of the projected real and fake features should not cross.
- Injectivity: The feature extractor must not "lose" information about the input data.
The SAN Solution
To enforce these conditions, they proposed the Slicing Adversarial Network (SAN). It requires two simple, drop-in changes to existing GAN architectures:
- Normalized Linear Layer: The last layer of the discriminator is constrained to a hypersphere (a unit vector $\omega$).
- New Maximization Objective: They add a "slicing" loss term that explicitly optimizes $\omega$ to satisfy direction optimality, using stop-gradient operators to keep the training stable.
Key Insights and Discoveries
- The "Aha" Moment on Loss Functions: The authors discovered that most common GAN losses (Hinge, Saturating, Non-saturating) actually fail to satisfy direction optimality by default. Only Wasserstein GAN (WGAN) naturally satisfies it, but WGAN often fails the "separability" condition, explaining its own set of instabilities.
- A Grounded Objective: By viewing the discriminator as a "slicer," they turned GAN training into a form of "Max-Sliced" Wasserstein distance minimization, which is much more theoretically grounded.
- Simplicity is Strength: Unlike many GAN improvements that require complex auxiliary networks or heavy regularization, SAN is a simple modification. You can take a BigGAN or StyleGAN-XL and convert it to a SAN with just a few lines of code.
Key Results
The authors validated SAN across a wide range of complexities, from 2D synthetic "Mixture of Gaussians" to high-resolution image datasets like CelebA ($128 \times 128$), ImageNet ($256 \times 256$), and FFHQ ($1024 \times 1024$).
The results were particularly impressive for class-conditional generation:
- State-of-the-Art (SOTA): StyleSAN-XL (the SAN version of StyleGAN-XL) achieved a record-breaking FID of 1.36 on CIFAR10 and 2.14 on ImageNet $256 \times 256$.
- Better Mode Coverage: In synthetic tests, standard GANs often suffered from mode collapse, while SAN consistently covered all target distributions.
- Consistent Improvement: Across DCGAN and BigGAN architectures, SAN consistently improved both FID (image quality) and Inception Score (diversity) compared to the base models.
Limitations and Future Work
While SAN represents a significant step forward, the authors note a few areas for future exploration:
- Separability Analysis: While the authors proved that separability is necessary, they mostly verified it empirically. A formal mathematical method to guarantee separability during training remains an open research path.
- Architecture Specifics: SAN isn't a "silver bullet" for every single GAN variant. For example, Least-Squares GAN (LSGAN) doesn't fit the required monotonic properties of their theorem.
- Injectivity: Ensuring the feature extractor is perfectly injective is difficult in deep networks. While they used Leaky ReLUs and Gradient Penalties to help, more rigorous ways to enforce injectivity could further improve results.
Check out the project page and code here: https://ytakida.github.io/san/
Summary updated