Learning Energy-Based Generative Models via Coarse-to-Fine Expanding and Sampling

Yang Zhao, Jianwen Xie, Ping Li

TL;DR

Researchers have unlocked high-fidelity image generation for Energy-Based Models (EBMs) by introducing a coarse-to-fine expanding and sampling strategy. Their approach, CF-EBM, is the first pure EBM to successfully synthesize $512 \times 512$ resolution images and achieves state-of-the-art performance in image-to-image translation with a fraction of the parameters required by GANs.

The Challenge with Energy-Based Models

Energy-Based Models (EBMs) are mathematically elegant: they define a probability distribution through a single scalar energy function $E(x)$, where low energy corresponds to high probability (real data). Unlike Generative Adversarial Networks (GANs), they don't require a separate generator and discriminator, theoretically simplifying the architecture.

However, EBMs are notoriously difficult to train. They rely on Markov chain Monte Carlo (MCMC) sampling—specifically Langevin dynamics—to generate samples during training. At high resolutions, the "energy landscape" becomes incredibly complex and multimodal. MCMC chains often get "stuck" in local minima or fail to converge, leading to unstable training and blurry or non-diverse images. Because of this, EBMs have historically lagged behind GANs and Diffusion models in generating high-resolution, high-fidelity images.

The CF-EBM Approach

To overcome these training hurdles, the authors propose a multi-stage framework called CF-EBM that grows in complexity as training progresses.

Coarse-to-Fine EBM Architecture
  1. Coarse-to-Fine Expanding: The model starts by learning a coarse-level EBM on low-resolution images (e.g., $8 \times 8$). As training continues, new layers are added to the bottom of the network to handle higher resolutions (doubling at each stage). To prevent "shocks" to the system when new layers are added, they use a fading block that smoothly transitions the model's focus from the old coarse layers to the new fine layers.
  2. Smooth MCMC Sampling: Instead of starting MCMC from random noise at high resolutions, the model uses the samples generated by the previous, well-trained coarse stage to initialize the MCMC for the current fine stage. This "top-down" guidance ensures the sampling process stays on track.
  3. Smooth Activation Functions: The authors discovered that standard non-smooth activations like ReLU or LeakyReLU cause gradients to explode or vanish during MCMC. They advocate for smooth activations like Swish, GELU, or CELU, which provide continuous gradients everywhere, significantly stabilizing the Langevin sampling.
  4. One-Sided Image-to-Image Translation: By initializing the MCMC process with an image from a source domain (e.g., a cat) and running it through an EBM trained on a target domain (e.g., dogs), the model performs unsupervised translation without needing the "cycle consistency" loss typical of models like CycleGAN.

Key Insights and Ideas

  • The Manifold Smoothing Hypothesis: The core insight is that the data manifold in a downsampled, low-dimensional space is much smoother than in high-dimensional space. By solving the "easy" low-res problem first, the model creates a reliable map for the "hard" high-res problem.
  • EBMs as Natural Translators: In image-to-image translation, the EBM's energy function acts as a distribution-level constraint. Because the MCMC starts from a real source image, it naturally preserves the "content" (low-frequency structure) while the gradient descent on the energy function modifies the "style" (high-frequency details) to match the target domain.
  • Generative Saliency: Because EBMs are gradient-based, you can visualize exactly which pixels the model is changing during translation. This provides a level of interpretability that "black-box" encoder-decoder GANs lack.
Image-to-Image Translation and Generative Saliency

Key Results

The model was rigorously evaluated across several standard benchmarks, including CIFAR-10, CelebA, and CelebA-HQ, as well as various image-to-image translation datasets.

  • SOTA for EBMs: On CIFAR-10, CF-EBM achieved an FID of 16.71, significantly better than previous EBM attempts (which hovered around 30-40).
  • High-Res Milestone: It is the first EBM to produce high-fidelity $512 \times 512$ faces on CelebA-HQ.
  • Extreme Efficiency: In image-to-image translation, CF-EBM used only 649K parameters and took 0.6 days to train, compared to U-GAT-IT’s 671M parameters and 6 days of training, while often achieving better perceptual scores.
  • Robust OOD Detection: The model outperformed specialized models like JEM and Glow in detecting out-of-distribution data, proving that its learned energy landscape is a faithful representation of the data density.

Limitations and Future Work

While training is efficient, generating images via MCMC is still slower than the single forward pass of a GAN or VAE due to the multiple iterative steps required. Furthermore, the authors used relatively small "channel multipliers" and suggest that scaling up to larger, more complex architectures could further improve image fidelity. Finally, while the empirical success of the coarse-to-fine strategy is clear, further theoretical research is needed to fully understand the intrinsic mathematical mechanisms of these multi-grid energy functions.

Summary updated

BibTeX
@inproceedings{zhao2021learning,
  author = {Yang Zhao and Jianwen Xie and Ping Li},
  title = {{Learning Energy-Based Generative Models via Coarse-to-Fine Expanding and Sampling}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure