Boundary Seeking GANs

R Devon Hjelm, Athul Paul Jacob, Adam Trischler, Gerry Che, Kyunghyun Cho, Yoshua BengioICLR 2018

TL;DR

Boundary-Seeking GANs (BGANs) introduce a principled method for training Generative Adversarial Networks on discrete data, such as text or quantized images. By using the discriminator’s output to compute importance weights for a policy gradient, BGANs bypass the non-differentiability of discrete samples. Furthermore, the authors demonstrate that a "boundary-seeking" objective—minimizing the distance to the discriminator's decision boundary—significantly enhances training stability for high-dimensional continuous images.

The Problem: GANs and Discrete Data

Standard GANs rely heavily on the "reparameterization trick," which requires the entire pipeline—both generator and discriminator—to be fully differentiable. While this works beautifully for continuous data like standard images, it breaks down for discrete data like text or categorical variables. In these scenarios, the generator typically employs a "step" or "argmax" function. Because these functions have a derivative of zero almost everywhere, they provide no useful gradient for backpropagation.

Previous attempts to bridge this gap have utilized reinforcement learning (REINFORCE) or continuous relaxations (like Gumbel-Softmax). However, these approaches often suffer from high variance or fail to directly optimize the original GAN objective. The authors of BGAN sought a method that accommodates discrete data while preserving the theoretical foundations of $f$-divergence minimization.

Methods: The Boundary-Seeking Objective

The core innovation of this paper is the Boundary-Seeking objective, which adapts GAN training for both discrete and continuous domains.

  1. Importance Weights for Discrete Data: Leveraging the theory of $f$-divergences, the authors show that an optimal discriminator can estimate the target data distribution. They derive "importance weights" directly from the discriminator's output. Instead of attempting to backpropagate through discrete samples, they use these weights to provide a reward signal within a policy gradient framework.
  2. Lower-Variance Gradient: To make this training practical, they introduce a conditional KL-divergence objective. This reduces the high variance typically associated with importance sampling, yielding a much cleaner learning signal for the generator.
  3. Continuous BGAN: For continuous data, standard GAN losses can be unstable and prone to "mode collapse." BGAN proposes a new objective: minimizing the squared output of the discriminator’s "statistic network" (the layer immediately preceding the sigmoid activation). This effectively pushes the generator to produce samples that sit exactly on the discriminator's decision boundary—the point of maximum uncertainty.

Key Insights and Ideas

A major breakthrough in the paper is the mathematical simplification of the importance weights.

Importance weights for various f-divergences

As shown above, the authors discovered that for many common $f$-divergences (including KL, Reverse KL, and Jensen-Shannon), the importance weights simplify to the exact same functional form: $e^{F_\phi(x)}$, where $F_\phi$ is the pre-activation output of the discriminator. This reveals a universal method to weight samples based on how "real" the discriminator perceives them to be.

Additionally, standard GAN generator objectives can be viewed as concave optimization problems, which are notoriously difficult to converge. By squaring the statistic network output in the continuous case, the authors transform the generator's task into a convex optimization problem, drastically improving stability. Rather than just trying to "fool" the discriminator, BGAN targets the boundary. A sample on the boundary perfectly confuses the discriminator, representing an ideal GAN equilibrium.

Datasets Evaluated

The authors rigorously evaluated BGAN across several diverse benchmarks:

  • Adversarial Classification: CIFAR-10.
  • Discrete/Quantized Images: Binary MNIST and a newly introduced Quantized CelebA (downsampled to 32x32 and reduced to a 16-color palette).
  • Natural Language: The 1-billion word dataset, modeled at the character level.
  • Continuous Images: CelebA (64x64), LSUN bedrooms, and the full 1000-label ImageNet (trained without conditioning).

Key Results

BGAN demonstrated strong performance across both discrete and continuous domains.

Error rates on discrete classification tasks
  • Discrete Superiority: In discrete classification tasks on CIFAR-10, BGAN (using Jensen-Shannon divergence) achieved a 26.0% error rate. This significantly outperformed WGAN-clipping (72.3%) and matched the performance of a standard supervised baseline (26.6%).
  • Text from Scratch: BGAN successfully trained a character-level language model from scratch without any pre-training or auxiliary losses—a feat previously considered very difficult for GANs. While the generated text isn't perfect, it successfully captures English-like patterns and structure.
  • Stability in High Dimensions: The continuous BGAN produced high-quality, realistic samples for complex datasets like ImageNet and LSUN. Crucially, it remained stable even when the generator was "over-optimized" (updated 5 times for every 1 discriminator update), a scenario where standard GANs typically collapse.

Limitations and Future Work

While BGAN represents a significant step forward, the authors note a few limitations:

  • Text Quality: Although BGAN is a breakthrough for discrete GAN training, the resulting text quality still lags behind state-of-the-art Recurrent Neural Networks (RNNs) trained with maximum likelihood.
  • Bias: The importance weight estimator can be biased if the discriminator is sub-optimal. The tighter the variational lower bound of the discriminator, the lower this bias becomes.
  • Credit Assignment: BGAN provides a strong global signal, but combining it with better "credit assignment" techniques (e.g., determining which specific character in a generated sentence made it look fake) could further improve results in natural language processing tasks.

Summary updated

BibTeX
@inproceedings{hjelm2018boundary,
  author = {R Devon Hjelm and Athul Paul Jacob and Adam Trischler and Gerry Che and Kyunghyun Cho and Yoshua Bengio},
  title = {{Boundary Seeking GANs}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=rkTS8lZAb},
}
Figure