NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bidirectional Generative Modeling Using Adversarial Gradient Estimation

Xinwei Shen, Tong Zhang, Kani Chen

TL;DR

This paper introduces Adversarial Gradient EStimation (AGES), a unified optimization framework for bidirectional generative modeling across a broad class of $f$-divergences. By replacing the unstable minimax objectives typical of GANs with a direct gradient estimator trained via non-linear logistic regression, AGES unifies Variational Autoencoders (VAEs) and Bidirectional GANs (BiGANs) while significantly improving training stability and mode coverage.

What Problem Does This Paper Address?

Generative modeling usually operates in one direction: mapping a simple latent distribution ($Z$) to complex real-world data ($X$). However, bidirectional generative modeling adds an encoder to map data back to the latent space ($X \to Z$), which is essential for downstream tasks like representation learning.

Existing bidirectional frameworks suffer from a fragmented landscape:

  1. Variational Autoencoders (VAEs) optimize the Kullback-Leibler (KL) divergence but rely on restrictive, explicit distribution assumptions (like factorized Gaussians) that lead to blurry images.
  2. Bidirectional GANs (BiGANs) handle implicit distributions well but are traditionally tied to the Jensen-Shannon (JS) divergence and suffer from notorious training instabilities and mode collapse.
  3. $f$-GANs extend GANs to general $f$-divergences but rely on a minimax formulation where the discriminator's loss often suffers from poor statistical efficiency and high variance.

The authors set out to design a mathematically principled, unified optimization framework that works for any choice of $f$-divergence without being bottlenecked by the pitfalls of minimax optimization.

Methods

The authors formulate bidirectional generation as matching the joint distributions of the encoder pair $(X, E(X))$ and the generator pair $(G(Z), Z)$ by minimizing a general $f$-divergence.

1. Direct Gradient Evaluation (Theorem 1)

Instead of optimizing the divergence objective indirectly via a minimax game, the authors derive an exact formula to compute the gradients of the divergence directly with respect to the generator ($\theta$) and encoder ($\phi$) parameters. Crucially, they discover that different $f$-divergences yield the exact same gradient structure, differing only by a scalar weighting factor ($s_\theta, s_\phi$) determined by the density ratio $r(x,z) = p_e(x,z)/p_g(x,z)$.

A summary of these standard $f$-divergences and their corresponding scaling properties can be seen below:

Table 1: List of f-divergences: KL, reverse KL divergence, Jensen-Shannon divergence×2, and squared Hellinger distance. When the divergence is symmetric, f = ˜f, e.g., JS and H2.

2. Adversarial Gradient Estimation (AGES)

Since the true density ratio $r(x,z)$ is unknown, AGES trains a discriminator $D(x,z)$ using standard nonlinear logistic regression to distinguish between encoder and generator pairs. Because logistic regression acts as a highly efficient density ratio estimator, the optimal discriminator directly approximates the log-density ratio ($\log r(x,z) \approx D(x,z)$). This value is plugged directly into the analytical gradient formulas to update the encoder and generator.

Compared to $f$-GAN, AGES alters the discriminator's objective to maximize statistical efficiency:

Table 2: Training objectives of f-GAN and AGES for KL.

3. Scaling Clipping & AGES-ALL

To prevent exploding or vanishing gradients caused by unbounded scaling factors in certain divergences (like KL or Reverse KL), the authors introduce Scaling Clipping (SC), which bounds the density ratio into a safe positive range around its optimal value of 1. Taking this to the extreme, they introduce AGES-ALL by setting $s_\theta = s_\phi = 1$, creating a highly stable algorithm that locally minimizes multiple $f$-divergences simultaneously.

Datasets

The authors evaluated their approach on both synthetic and real-world image benchmarks:

  • Synthetic Mixture of Gaussians (MoG): A 2D grid layout with 9 components (imbalanced probabilities) and an expanded 25-component version (12 minority classes) specifically designed to trigger and test mode collapse.
  • Stacked MNIST: A dataset containing 1,000 distinct modes formed by stacking three random MNIST digits, used to evaluate mode coverage and reconstruction accuracy.
  • CelebA & ImageNet: Real-world face and natural image datasets, downsampled to $64 \times 64$ pixels to evaluate high-fidelity image generation and semantic representation learning.

Key Insights and Ideas

  • Unification of VAEs and GANs: The paper beautifully demonstrates that VAEs (with implicit encoders like AVB) and BiGANs are simply special cases of the same bidirectional $f$-divergence framework, corresponding to KL and JS divergences respectively.
  • Moving Beyond Minimax: By reframing the discriminator's role purely as a density ratio estimator via logistic regression rather than an adversarial opponent in a zero-sum game, AGES achieves superior statistical efficiency and avoids the training oscillations common to GANs.
  • The Power of the Forward KL: The authors provide empirical proof that minimizing the forward KL divergence heavily penalizes the model for dropping modes ($p_g(x) \approx 0$ when $p_r(x) > 0$). AGES successfully stabilizes KL minimization, allowing models to overcome mode collapse where JS or Hinge losses fail.

Key Results

Optimization Efficiency

On the synthetic 9-Gaussian dataset, AGES-KL achieved optimization performance nearly identical to a standard VAE (which uses an exact, closed-form analytic objective), whereas $f$-GAN-KL performed significantly worse and exhibited massive variance across trials.

Table 3: Metrics for the objective value, cycle consistency and unidirectional generation (the smaller the better). All results are averaged over 10 trials shown with the standard error.

Mitigating Mode Collapse

On the challenging 25-mode imbalanced MoG dataset, AGES-KL successfully captured almost all modes ($24.9 \pm 0.36$), drastically outperforming standard GANs, Hinge loss, and Reverse-KL variants.

Table 4: Two measures of mode collapse on the imbalanced MoG dataset. All results are averaged over 10 trials shown with the standard error.

Real-World Image Generation

When scaled to real datasets using the AGES-ALL variant, the model achieved superior Fréchet Inception Distances (FIDs) on Stacked MNIST (4.40) and CelebA (8.51) compared to state-of-the-art bidirectional baselines like BigBiGAN and logD-GAN, proving that the framework scales effectively to complex visual data.

Limitations and Future Work

While AGES demonstrates excellent stability and semantic representation capabilities, the authors note a few limitations:

  • Pixel-Level Precision: Although the encoder-generator cycle consistency captures high-level semantic attributes (e.g., matching facial expressions, hair color, or object categories), the reconstructions are not always perfectly aligned at the exact pixel level.
  • Scale of Evaluation: Due to computational constraints, the empirical experiments on CelebA and ImageNet were restricted to a relatively low resolution ($64 \times 64$) and smaller network architectures.

Future work includes scaling AGES to high-resolution image synthesis and exploring its utility in downstream tasks like causal representation learning, image-to-image translation, and unsupervised feature disentanglement.

Summary updated

BibTeX
@misc{shen2020bidirectional,
  author = {Xinwei Shen and Tong Zhang and Kani Chen},
  title = {{Bidirectional Generative Modeling Using Adversarial Gradient Estimation}},
  year = {2020},
  eprint = {2002.09161},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.09161},
}
Figure