Training Energy Based Models Without MCMC

38 concepts27 papers1 proposal

Energy-Based Models (EBMs) are beautifully simple. Instead of forcing a neural network to output a normalized probability distribution, an EBM assigns an unnormalized scalar value—an energy $E_\theta(x)$—to every input $x$. The probability density is implicitly defined via the Boltzmann distribution:

$$p_\theta(x) = \frac{e^{-E_\theta(x)}}{Z(\theta)}$$

where $Z(\theta) = \int e^{-E_\theta(x)} dx$ is the normalization constant, known as the partition function.

The catch? Computing $Z(\theta)$ is intractable for high-dimensional data. When we try to maximize the log-likelihood of the observed data, the gradient splits into two opposing forces:

$$\nabla_\theta \log p_\theta(x) = -\nabla_\theta E_\theta(x) + \mathbb{E}_{x' \sim p_\theta(x')}[\nabla_\theta E_\theta(x')]$$

The first term is the positive phase; it pulls down the energy of real data points. The second term is the negative phase; it pushes up the energy of samples drawn from the model itself.

Traditionally, generating these negative samples requires Markov Chain Monte Carlo (MCMC) methods like Langevin dynamics. But MCMC is a notorious bottleneck: it is slow, highly sequential, prone to getting trapped in local modes, and frequently unstable during training.

To unlock the full potential of EBMs, a major research direction has emerged: MCMC-free energy training. Instead of running expensive Markov chains to estimate the negative phase, researchers are developing clever mathematical and architectural frameworks to bypass, amortize, or eliminate MCMC entirely.


Strategy 1: Amortized Sampling and Cooperative Learning

If running an MCMC chain at every training step is too slow, why not train a separate, directed generative model to do the sampling for us? This approach is known as amortized sampling.

Grathwohl et al. introduced VERA, a framework that replaces iterative MCMC with a fast, entropy-regularized generator network. Instead of taking hundreds of sequential Langevin steps, the generator learns to produce approximate samples from the EBM's current distribution in a single parallelizable forward pass. This shifts the sequential sampling bottleneck into a parallelizable inference task, speeding up training by roughly 3x while stabilizing convergence.

Traditional MCMC:  [Initial Noise] -> [Step 1] -> [Step 2] -> ... -> [Step N] -> [Negative Sample]
Amortized Sampler: [Initial Noise] -> [Generator Network] ---------------------> [Negative Sample]

Similarly, Han et al. proposed a "Divergence Triangle" framework that jointly trains a generator, an energy-based model, and an inference model. By acting as mutual proxies, the generator provides samples and the inference model provides latent variables, allowing the EBM to be updated via standard backpropagation without any MCMC sampling. Han et al. extended this concept to jointly train a Variational Auto-Encoder (VAE) and a latent EBM.

Rather than eliminating MCMC completely, related cooperative approaches like the one by Xie et al. use a VAE as an amortized sampler to provide high-quality initializations for short MCMC chains, mitigating the notorious "slow mixing" problem where samplers get stuck in local energy wells.


Strategy 2: Energy Discrepancy and Local Perturbations

What if we could train an EBM without drawing samples from the model's global distribution at all? Instead of trying to explore the entire energy landscape, we can evaluate how the energy changes locally around the true data points.

Schröder et al. introduced Energy Discrepancy (ED), a score-independent loss function that completely bypasses MCMC. Instead of comparing real data to model samples, ED compares real data points $x$ to perturbed versions $x'$ generated by a simple, single-step perturbation kernel. The objective minimizes the energy of real data while maximizing the energy of the perturbed data.

Energy E(x)
   ^
   |       ⚡ Higher Energy for Perturbed Data E(x')
   |        / \
   |       /   \
   |______/     \______  Low Energy for Real Data E(x)
          x ---> x'
        (Real) (Perturbed)

Crucially, because ED relies purely on the difference in energy values ($E_\theta(x) - E_\theta(x')$) rather than the spatial gradients of the energy function, it avoids computing second-order derivatives like the Laplacian. This makes training exceptionally stable and computationally lightweight.

This perturbation-based approach is highly versatile. Schröder et al. adapted Energy Discrepancy to discrete data, replacing slow discrete MCMC samplers with a fixed perturbation process. To handle complex discrete or mixed structures, Schröder et al. later utilized closed-form solutions of heat equations on graphs to define the perturbation kernels, enabling highly parallelizable, MCMC-free training on tabular and discrete image data.


Strategy 3: Importance Sampling and Reference Distributions

Another way to avoid the negative phase MCMC bottleneck is to rewrite the expectation in the gradient. Instead of taking an expectation over the intractable model distribution $p_\theta$, we can take an expectation over a known, tractable reference or proposal distribution $q(x)$ using importance sampling.

Senetaire et al. demonstrated that gradients for the energy-based objective can be estimated using importance sampling from a proposal distribution, yielding unbiased gradient estimates that allow for stable optimization via standard stochastic gradient descent. In autoregressive settings, Che et al. showed that negative samples can be drawn directly from a model's native autoregressive process and subsequently reweighted via importance sampling, bypassing MCMC entirely while mitigating exposure bias.

Taking this a step further, Sander et al. proposed jointly optimizing the energy function and its normalization constant $Z(\theta)$ as separate neural networks. By shifting the training expectations entirely to a simple, fixed reference distribution rather than the model's own evolving distribution, they achieved completely unbiased gradient updates without any MCMC overhead.


Strategy 4: Variational Principles and Potential Flows

Finally, some approaches frame EBM training as a geometric or physical transport problem. Instead of sampling points, they match the entire probability density path (homotopy) from a simple base distribution to the target data distribution.

Loo et al. introduced a framework that trains EBMs by solving a density-weighted Poisson equation through a variational principle (leveraging the Deep Ritz method). By treating training as a functional minimization problem over probability paths, this approach completely eliminates the need for MCMC sampling, avoiding the local mode trapping that plagues high-dimensional Markov chains.

For undirected graphical models like Markov Random Fields, single-author work by Xu developed AdVIL (Adversarial Variational Inference and Learning). By treating the energy function as a black box and using a variational network to approximate the intractable posterior, Xu showed that complex undirected architectures can be trained without model-specific derivations or expensive MCMC sampling.

Key Foundational Work

Divergence Triangle for Joint Training of Generator Model, Energy-Based Model, and Inferential Model (2019) — contributed 2 concept elements to this direction.
Loss Functions for Discriminative Training of Energy-Based Models (2005) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_mcmc_free_energy_training_bb1ca858,
  title = {MCMC-free energy training},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/mcmc-free-energy-training/rdr_bb1ca858b582465b8e1f50437476b955},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-25},
}

This exact version (version 1, frozen text):

@misc{lacuna_mcmc_free_energy_training_bb1ca858_v1,
  title = {MCMC-free energy training},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/mcmc-free-energy-training/rdr_bb1ca858b582465b8e1f50437476b955/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-25},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake