Abstract
Learning energy-based models (EBMs) typically involves an inner loop of Markov Chain Monte Carlo (MCMC) sampling. However, in high-dimensional spaces, EBMs often suffer from poor mixing due to highly multi-modal energy landscapes. We propose Neural Transport EBM (NT-EBM), which utilizes a flow-based model as a backbone. By defining the EBM as an exponential tilting of this backbone and performing MCMC in the latent space, we enable the sampler to traverse modes effectively. Our approach demonstrates improved stability, better mixing, and enhanced synthesis quality across various benchmarks.
Introduction
Energy-Based Models (EBMs) offer a flexible framework for representing probability distributions via an energy function $E(x)$. Training these models generally relies on "Analysis by Synthesis," where MCMC samples from the model are compared against real data. The primary challenge is the "mixing" problem: in high-dimensional data like images, standard MCMC methods like Langevin dynamics often get trapped in local modes, leading to biased gradients and unstable training.
Methodology: Neural Transport EBM
The core idea of NT-EBM is to leverage the structured latent space of a flow-based model (e.g., Glow) to facilitate sampling.
Exponential Tilting
Instead of learning an EBM from scratch, we define it as a correction to a pre-trained flow model $q_\alpha(x)$. The EBM density is given by: $$p_\theta(x) = \frac{1}{Z(\theta)} \exp(f_\theta(x)) q_\alpha(x)$$ where $f_\theta(x)$ is a neural network that "tilts" the base distribution to better match the target data.
Latent Space MCMC
Because flow models are invertible, we can map any data point $x$ to a latent code $z$. Sampling in $z$-space is significantly more efficient because the distribution is smoother and closer to a simple Gaussian. By performing Hamiltonian Monte Carlo (HMC) in this latent space, a small step can correspond to a large "jump" between distant modes in the original pixel space.
Jacobian-Free Sampling
A key mathematical advantage is that the complex Jacobian term required for flow-based density estimation cancels out during the MCMC transition in latent space. This makes the sampling process computationally efficient and straightforward to implement.
Experiments and Results
We evaluated NT-EBM on datasets including MNIST, SVHN, CIFAR-10, and CelebA.
Mixing and Stability
Using the Gelman-Rubin statistic ($\hat{R}$), which measures if multiple MCMC chains have converged to the same distribution, we quantified mixing performance. NT-EBM achieved $\hat{R} \approx 1.13$, indicating successful convergence, whereas standard pixel-space MCMC failed to mix. Furthermore, NT-EBM remains stable over long-run sampling (up to 10,000 steps), avoiding the "mode collapse" common in traditional EBMs.
Image Synthesis
NT-EBM consistently improves the synthesis quality of its backbone flow models. On CIFAR-10, the base Glow model's FID score improved from 90.08 to 78.12. Visual inspections confirm that the sampler successfully transitions between different object classes and identities, demonstrating true multi-modal capture.
Conclusion
NT-EBM addresses the fundamental mixing problem in EBMs by performing MCMC in a learned latent space. This "correction" approach is not only more stable but also more parameter-efficient than scaling up flow models alone. Future work will explore joint training of the backbone and the EBM, as well as applications in out-of-distribution detection.
Summary updated