JEM++: Improved Techniques for Training JEM

Xiulong Yang, Shihao Ji · DOI

Introduction

Energy-Based Models (EBMs) represent a powerful class of probabilistic models capable of simultaneous classification and image generation within a single neural network architecture. Despite their potential, training these models—specifically the Joint Energy-based Model (JEM) framework—has historically been plagued by significant challenges. The original JEM relies on Stochastic Gradient Langevin Dynamics (SGLD) for sampling, a process that is both computationally intensive and prone to numerical instability or "divergence." Furthermore, JEM has struggled to integrate standard architectural components like Batch Normalization (BN), as the distribution gap between initial noise and real data often corrupts BN statistics.

JEM++ addresses these limitations through a suite of technical enhancements designed to stabilize training, accelerate sampling, and enable the use of modern network features.

Methodology

The JEM++ framework introduces four primary improvements to the standard JEM training pipeline:

1. Proximal SGLD and PYLD

To mitigate the instability caused by extreme pixel values during sampling, JEM++ employs Proximal SGLD. This method constrains updates by projecting samples into an $L_\infty$-norm ball relative to the previous step, ensuring the sampling process remains within a stable neighborhood.

To address the computational bottleneck of SGLD, the authors propose PYLD (Proximal-YOPO-SGLD). Inspired by the "You Only Propagate Once" (YOPO) framework, PYLD decouples the updates of the network's first layer from the subsequent layers. This allows for multiple "cheap" inner sampling steps for every full backpropagation, significantly reducing the overall training time.

Comparison of SGLD and PYLD sampling frameworks. PYLD utilizes inner loops to speed up the sampling process.

2. Informative Initialization and Batch Normalization

A key insight of JEM++ is that the failure of Batch Normalization in previous EBMs was due to a "Batch Norm Gap"—a massive statistical discrepancy between random noise and real data. JEM++ resolves this by using Informative Initialization, where the SGLD chain starts from a Gaussian Mixture Model (GMM) estimated from the training data rather than pure noise. This initialization places starting points closer to the real data manifold, providing consistent statistics for BN layers and allowing JEM++ to leverage larger learning rates and modern CNN architectures.

Experimental Results

JEM++ was evaluated on standard benchmarks including CIFAR10, CIFAR100, and SVHN.

Performance and Efficiency

On the CIFAR10 dataset, JEM++ achieved a classification accuracy of 94.1%, a notable improvement over the original JEM's 92.9%. In terms of efficiency, the PYLD framework delivered a 1.5x to 2.4x speedup per epoch. Crucially, while the original JEM often diverged early in training, JEM++ remained stable for over 150 epochs.

Generative Quality and Calibration

JEM++ maintains high generative quality alongside its discriminative performance. The model also exhibits superior calibration; on CIFAR10, it achieved an Expected Calibration Error (ECE) of 2.35%, significantly lower than the 5.5% typically seen in standard Softmax classifiers.

JEM++ generated CIFAR10 samples, showing both unconditional and class-conditional generation capabilities.

Discussion and Conclusion

JEM++ represents a significant advancement in making hybrid energy-based models practical and robust. By addressing the core issues of sampling stability and architectural compatibility, it narrows the gap between specialized generative/discriminative models and unified hybrid frameworks.

While JEM++ is substantially faster than its predecessor, it still requires more compute than a pure classifier. Additionally, the authors noted a slight tension between classification accuracy and image quality in the final stages of training, suggesting that balancing these two objectives remains a fertile ground for future research.

Summary updated

BibTeX
@inproceedings{yang2021jem,
  author = {Xiulong Yang and Shihao Ji},
  title = {{JEM++: Improved Techniques for Training JEM}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.00643},
}
Figure