Abstract
Maximum likelihood estimation of energy-based models is a challenging problem due to the intractability of the log-likelihood gradient. In this work, we propose learning both the energy function and an amortized approximate sampling mechanism using a neural generator network, which provides an efficient approximation of the log-likelihood gradient. The resulting objective requires maximizing entropy of the generated samples, which we perform using recently proposed nonparametric mutual information estimators. Finally, to stabilize the resulting adversarial game, we use a zero-centered gradient penalty derived as a necessary condition from the score matching literature. The proposed technique can generate sharp images with Inception and FID scores competitive with recent GAN techniques, does not suffer from mode collapse, and is competitive with state-of-the-art anomaly detection techniques.
Introduction
Energy-Based Models (EBMs) offer a mathematically elegant framework for density estimation by learning a scalar energy function that assigns low values to observed data and high values elsewhere. Despite their theoretical appeal, EBMs are notoriously difficult to train. The primary bottleneck lies in the "negative phase" of maximum likelihood estimation, which requires sampling from the model's current distribution. Traditionally, this is achieved via Markov Chain Monte Carlo (MCMC) methods. However, MCMC is computationally expensive and prone to getting trapped in local modes, leading to poor exploration of the data distribution.
Generative Adversarial Networks (GANs) bypassed these issues by using a generator network for efficient sampling, but they often suffer from "mode collapse," where the generator ignores large portions of the data distribution. This research introduces Maximum Entropy Generators (MEG), a framework that combines the density scoring capabilities of EBMs with the efficient sampling of generator networks, while explicitly addressing mode collapse through entropy maximization.
Methodology: Amortized Sampling with Maximum Entropy
The core of the MEG framework is the simultaneous training of two neural networks: an energy function $E_\theta$ and a generator $G_\omega$. Unlike traditional EBMs that rely on pixel-space MCMC, MEG uses the generator to provide an amortized approximation of the model's distribution.
To ensure the generator captures the full diversity of the data, the authors incorporate an Entropy Maximization term into the objective. By maximizing the entropy of the generator's output, the model is forced to cover all modes of the energy landscape. This is implemented using nonparametric mutual information estimators, specifically a Jensen-Shannon Divergence-based estimator.
Furthermore, the training is stabilized using two key refinements:
- Zero-centered Gradient Penalty: Derived from score matching theory, this penalty prevents energy values from exploding and ensures a smooth energy landscape.
- Latent Space MCMC: To further refine samples, the model performs MCMC "walks" in the low-dimensional latent space of the generator. This is more efficient than pixel-space MCMC because the data manifold is typically "flatter" and more continuous in latent space, allowing for better semantic transitions.
Experimental Results
The MEG framework was evaluated across a variety of tasks, ranging from toy 2D distributions to complex natural image datasets and anomaly detection benchmarks.
Mode Capture and Energy Landscapes
On synthetic 2D datasets, MEG demonstrates an exceptional ability to learn complex, multi-modal energy landscapes without missing modes.
To test mode collapse more rigorously, the authors used 4-StackedMNIST, a dataset with 10,000 distinct modes. MEG successfully captured all 10,000 modes, significantly outperforming WGAN-GP, which missed hundreds of modes and exhibited higher KL divergence.
Image Generation and Anomaly Detection
On natural image datasets like CIFAR-10, MEG achieved competitive results with an Inception Score of 7.31 and an FID of 33.18. While these scores are on par with standard GANs, MEG retains the advantage of providing an explicit energy function.
This energy function proves highly effective for anomaly detection. On the KDD99 network intrusion dataset, MEG achieved an F1 score of 0.944, outperforming specialized models like DAGMM. The ability to assign meaningful energy values allows the model to identify out-of-distribution samples more reliably than the binary discriminators used in GANs.
Discussion and Conclusion
The Maximum Entropy Generator framework successfully addresses the long-standing challenges of training EBMs. By replacing slow pixel-space MCMC with an entropy-regularized generator and latent-space refinement, MEG achieves a balance between efficient sampling and robust density estimation.
While the approach introduces some computational overhead due to the entropy estimators and requires careful adversarial balancing, the benefits are clear: perfect mode capture on challenging benchmarks and state-of-the-art performance in anomaly detection. Future work may focus on developing even more efficient entropy estimation techniques to further scale the framework to higher-resolution datasets.
Summary updated