Boltzmann Tuning of Generative Models

Victor Berger, Michèle SebagarXiv 2021 · arXiv

Abstract

Deep generative models typically excel at capturing the central tendencies of a dataset, yet many critical applications—from power grid stress-testing to rare disease modeling—require sampling from the "tails" or extreme regions of a distribution. Traditionally, this is achieved via inefficient rejection sampling. This paper introduces Boltzmann Tuning of Generative Models (BTGM), a framework that treats model steering as a constrained optimization problem. By leveraging the Boltzmann distribution and variational inference, BTGM allows researchers to "nudge" pre-trained models toward specific differentiable criteria without retraining the underlying architecture.

Introduction

Variational Auto-Encoders (VAEs) and Generative Adversarial Networks (GANs) are powerful tools for learning complex data manifolds. However, they are fundamentally biased toward the "average" behavior of their training data. In engineering contexts, the average case is often less important than the extreme case. For instance, an architect designing a power grid must account for peak consumption scenarios—rare events that a standard generative model might never produce.

To find these rare samples, researchers often resort to rejection sampling: generating thousands of candidates and discarding those that fail to meet a specific threshold. This process is computationally wasteful and "blind" to the underlying geometry of the model. BTGM offers a more efficient alternative by performing a posteriori tuning, warping the generative process to favor samples that maximize a desired criterion while remaining faithful to the original data distribution.

Methodology

The Boltzmann Solution

The authors formalize the tuning process as a constrained optimization problem. The goal is to find a new distribution $q$ that maximizes the expected value of a differentiable criterion $f(x)$, while ensuring that $q$ remains close to the original distribution $p$. This closeness is enforced using the Kullback-Leibler (KL) divergence.

The mathematical solution to this trade-off is the Boltzmann distribution: $$q_\beta(x) \propto p(x)e^{\beta f(x)}$$ Here, $\beta$ acts as a "temperature" parameter that controls the strength of the bias. A low $\beta$ keeps the distribution close to the original, while a high $\beta$ pushes the model toward the extremes of $f(x)$.

Variational Inference and Latent Space Operation

Directly sampling from a Boltzmann distribution is computationally difficult. To overcome this, BTGM uses Variational Inference (VI). Specifically, the authors employ Normalizing Flows to learn a transformation $g$ that warps samples from the original model into the tuned distribution.

Crucially, this operation can take place entirely within the latent space of a frozen VAE or GAN. By shifting the latent vectors before they pass through the decoder, BTGM ensures that the resulting samples remain "plausible" and stay on the learned data manifold, even as their specific characteristics are shifted toward the goal.

Optimizing the Landscape

A significant contribution of the paper is the analysis of the optimization landscape. The authors demonstrate that the choice of the criterion formulation (e.g., $f(x)$ vs. $\log f(x)$) drastically affects performance. By analyzing the distribution of gradient norms, they show that log-transforms often provide a "smoother" landscape, preventing the optimization from stalling on plateaus or failing at sharp "gradient cliffs."

Experimental Results

Energy Consumption and Safety Policy

The framework was tested on a real-world dataset of 8 million weekly energy consumption curves. The goal was to sample the top 1% of peak consumption scenarios to estimate "diversity factors" for power grid safety. BTGM successfully generated these extreme scenarios far more efficiently than traditional Monte Carlo methods, providing a robust tool for infrastructure stress-testing.

Post-Hoc Conditional Generation

Using the MNIST dataset, the authors demonstrated that BTGM can turn an unconditional model into a conditional one after training. By using a pre-trained digit classifier as the criterion $f$, they steered a standard GAN to produce specific digits (e.g., only "4"s) or specific styles (e.g., thicker strokes). This proves that models can be repurposed for specific tasks without the need for labeled training from scratch.

Model Refining

BTGM can also be used to improve the quality of the generative model itself. By using a discriminator as the criterion, the authors were able to "deblur" VAE outputs, pulling the VAE’s distribution closer to the true data distribution and improving visual fidelity.

Discussion and Limitations

While BTGM is highly effective, it faces the challenge of "mode dropping." If the tuning pressure ($\beta$) is set too high, the model may lose diversity, collapsing to a single "optimal" sample. Furthermore, the success of the method depends on the differentiability and smoothness of the criterion $f$. Highly non-linear criteria with sharp boundaries can still pose challenges for the optimization process.

Conclusion

Boltzmann Tuning of Generative Models provides a mathematically rigorous bridge between data-driven modeling and analytical goals. By transforming the latent space of pre-trained models, BTGM enables the efficient exploration of rare events and the post-hoc refinement of generative outputs. Future work will look toward multi-criteria optimization and integrating BTGM into Bayesian Optimization loops to incorporate human expert preferences directly into the generative process.

Summary updated

BibTeX
@misc{berger2021boltzmann,
  author = {Victor Berger and Michèle Sebag},
  title = {{Boltzmann Tuning of Generative Models}},
  year = {2021},
  eprint = {2104.05252},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.05252},
}
Figure