Abstract
Energy-Based Models (EBMs) are a powerful class of generative models, yet they are notoriously difficult to train due to the instability of MCMC-based sampling methods. This paper bridges the gap between Adversarial Training (AT) and EBMs, demonstrating that Binary AT is essentially a stable, approximate method for learning energy functions. By employing Projected Gradient Descent (PGD) as a data sampler, we present a unified framework that achieves competitive image generation and state-of-the-art performance in out-of-distribution (OOD) detection.
Introduction
Energy-Based Models (EBMs) define a probability distribution $p(x) \propto \exp(-E(x))$ through an energy function $E(x)$. Ideally, the model assigns low energy to real data and high energy to other regions. However, standard training relies on Stochastic Gradient Langevin Dynamics (SGLD) to generate negative samples, a process that is computationally expensive and prone to divergence.
Conversely, Adversarial Training (AT) is designed to improve classifier robustness against malicious perturbations. It has been observed that robust models often exhibit generative properties, such as gradients that resemble image features. This work formalizes this connection, showing that AT can be repurposed as a stable alternative for training high-quality EBMs.
Methodology: Adversarial Training as EBM Learning
The core contribution of this work is the interpretation of Binary Adversarial Training as an EBM learning process.
Binary Objective and PGD Sampling
Instead of the standard maximum likelihood objective, we utilize a binary classification objective where the model learns to distinguish between real data and perturbed samples. In this framework, Projected Gradient Descent (PGD) serves as the sampler. Unlike SGLD, PGD uses normalized gradients and lacks a noise term, making it a "non-convergent" but highly stable sampler.
Progressive Training and Stability
To enhance efficiency, we introduce a schedule that gradually increases the number of PGD steps ($K$) during training. This allows the model to capture the broad structure of the data distribution before refining local details. For high-resolution tasks, we employ $R_1$ regularization and pretraining to ensure a smooth energy landscape.
Key Insights and Theoretical Framework
A critical observation is that binary AT learns the support of the data distribution rather than its exact probability density. While this precludes exact likelihood estimation, it makes the model exceptionally robust at identifying samples that fall outside the data manifold.
The Gradient Canceling Effect
The stability of AT compared to standard EBM training is attributed to the logistic (sigmoid) loss. In standard EBMs, gradients can grow indefinitely, leading to numerical overflow. In AT, as the model's confidence increases, the gradient of the sigmoid function naturally approaches zero. This "built-in brake" prevents model divergence and ensures a stable training process.
Experimental Results
The proposed approach was evaluated on standard benchmarks (CIFAR-10) and high-resolution datasets (CelebA-HQ, AFHQ-CAT, LSUN Church).
- Generative Performance: On CIFAR-10, the model achieved an Inception Score of 9.10, outperforming many explicit EBMs. On CelebA-HQ (256x256), it reached an FID of 17.31.
- Out-of-Distribution Detection: The model achieved near-perfect AUROC scores on standard OOD tasks and demonstrated superior robustness against "worst-case" adversarial OOD attacks, where baseline models like JEM or Outlier Exposure often fail.
- Zero-Shot Translation: The smooth energy manifold allows for image-to-image translation (e.g., human to cat) by following the energy gradients of a target model without explicit translation training.
Conclusion and Future Work
This work establishes a strong link between adversarial robustness and generative modeling. By treating AT as a stable EBM training procedure, we achieve high-quality generation and robust OOD detection. Future research will focus on addressing the lack of a true steady-state distribution and exploring ways to enable exact density estimation within this stable framework.
Summary updated