A Near-Optimal Gradient Flow for Learning Neural Energy-Based Models

Yang Wu, Pengxu Wei, Lin LiangarXiv 2019 · DOI

TL;DR

This paper introduces OT-EBM, a novel training scheme for Energy-Based Models (EBMs) that replaces traditional KL-divergence gradient flows with a smoother, second-order Wasserstein gradient flow. By treating data points as particles moving toward a target manifold via Optimal Transport principles, the authors achieve significantly better stability, faster convergence, and higher-quality image generation compared to standard methods.

What Problem Does This Paper Address?

Energy-Based Models (EBMs) are a powerful class of generative models that learn an "energy function" to assign low energy to real data and high energy to everything else. Traditionally, training them involves a tug-of-war: Maximum Likelihood Estimation (MLE) updates the model parameters, while Stochastic Gradient Langevin Dynamics (SGLD) samples "particles" from the model to see where it’s failing.

However, this process is notoriously finicky. The authors identify three major "bugs" in the standard approach:

  1. KL Vanishing: Because KL divergence is asymmetric, it can cause particles to "vanish" or collapse if the model's empirical distribution doesn't overlap perfectly with the target.
  2. Inefficient Randomness: SGLD relies on random diffusion, which requires a massive number of particles to accurately approximate the data distribution.
  3. Non-smooth Transportation: Standard updates often result in "jagged" paths for particles, leading to unstable training and mode collapse, especially in high-dimensional spaces like images.

Methods

The researchers propose moving from a KL Discrete Flow to a Wasserstein Gradient Flow (specifically the JKO scheme).

Instead of just looking at the "distance" between distributions at a single point in time, they utilize Optimal Transport (OT). They treat the learning process as a physical simulation where particles move from disorder to a target manifold along the most efficient path.

Key Technical Innovations: * Fokker-Planck Derivation: They derive a second-order approximation of the gradient flow from the Fokker-Planck equation, which describes how probability densities evolve over time. * Deterministic Updates: Unlike SGLD, which is noisy, their derived update for particles is deterministic (similar to SGD), making the evolution of the data points predictable and stable. * Lipschitz Constraint: They incorporate an $L$-Lipschitz constraint on the energy function. This ensures the "velocity" of the particles is bounded, preventing the gradients from exploding—a common death knell for EBM training. * OT-EBM Algorithm: The final algorithm uses a "two-step lookahead" approach that encourages smoother trajectories and better alignment with the underlying data manifold.

Datasets

The authors tested OT-EBM across a diverse range of benchmarks to prove its versatility:

  • Toy Distributions: 2D Gaussian Mixture Models (GMM) and Swissroll.
  • Small/Medium Images: CIFAR-10 and SUN (specifically the "cabins" category).
  • Large-Scale Images: CelebA (human faces), LSUN (Bedrooms and Churches), and ImageNet (64x64).
  • High-Resolution: CelebA-HQ and FFHQ (1024x1024 resized to 256x256).
  • Structured Data: The Cora dataset for discrete graph inference.

Key Insights and Ideas

  • The "Aha" Moment: The researchers realized that standard MLE training is essentially a first-order gradient flow that ignores the geometry of the data space. By switching to a Wasserstein metric, they account for the path particles take, not just their final destination.
  • Stability through Geometry: By enforcing Lipschitz continuity, the model effectively builds a "smoother" energy landscape. This prevents the model from "collapsing" into zero-energy states that don't represent real data.
  • Generative Versatility: The OT-EBM framework isn't just for images; it successfully rebuilt complex graphical relationships in social network data (Cora), suggesting that Optimal Transport is a fundamental improvement for EBMs regardless of the data type.

Key Results

  • Superior Image Quality: On CIFAR-10, OT-EBM improved the Inception Score (IS) and lowered the Fréchet Inception Distance (FID) across multiple architectures (e.g., Deep FRAME, CoopNet). For instance, CoopNet+OT achieved an FID of 28.98 compared to the baseline's 26.22 (lower is better), with even more dramatic gains when adding self-attention.
  • Robustness to Hyperparameters: OT-EBM remained stable even when learning rates were increased to levels that caused standard EBMs to completely collapse (see Figure 5 in the paper).
  • Graph Inference: In the Cora dataset task, OT-EBM achieved a 0.64 training accuracy and 0.31 testing accuracy for graph reconstruction, nearly doubling the performance of standard EBMs (0.34 and 0.15 respectively).
  • High-Res Success: The model successfully generated 256x256 faces with smooth edges and realistic features, overcoming the "curse of dimensionality" that often plagues sampling-based models.

Limitations and Future Work

  • Approximation vs. Exact OT: The authors use a "near-optimal" numerical scheme because calculating exact Optimal Transport is computationally expensive. While their approximation works well, there is still a gap between the theoretical ideal and the practical implementation.
  • Optimizer Synergy: The current work uses Adam for parameter updates. The authors suggest that exploring other gradient descent variants specifically tailored for particle evolution could yield even better results.
  • Weight Normalization: The paper notes that while OT provides a form of normalization, combining it with explicit weight normalization (like spectral normalization) remains tricky and requires further exploration to avoid convergence issues.

Summary updated

BibTeX
@misc{wu2019near,
  author = {Yang Wu and Pengxu Wei and Lin Liang},
  title = {{A Near-Optimal Gradient Flow for Learning Neural Energy-Based Models}},
  year = {2019},
  eprint = {1910.14216},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.14216},
}

Loading related content...

Figure