Energy-Based Modelling for Discrete and Mixed Data via Heat Equations on Structured Spaces

Tobias Schröder, Zijing Ou, Yingzhen Li, Andrew B. Duncan

Overview

Training Energy-Based Models (EBMs) on discrete or mixed data has traditionally been a slow, unstable process reliant on complex Markov Chain Monte Carlo (MCMC) sampling. This paper introduces a novel method to train these models entirely MCMC-free by pairing Energy Discrepancy with perturbations defined by heat equations on graphs. The result is a faster, more robust framework that enables EBMs to excel at tasks ranging from tabular data synthesis to discrete image modeling.

The MCMC Bottleneck in EBMs

Energy-Based Models define a probability distribution through an unnormalized energy function: $p(x) \propto \exp(-U(x))$. Their flexibility makes them incredibly powerful, but they are notoriously difficult to train because calculating the normalization constant (the "partition function") is usually intractable.

The standard workaround is Contrastive Divergence (CD), which uses MCMC to draw samples from the model. However, in discrete spaces (like text, graphs, or categorical table entries), MCMC mixes slowly and is highly sensitive to hyperparameter tuning. Furthermore, handling "mixed" data—where some features are continuous (like salary) and others are categorical (like education level)—remains an open challenge for EBMs. This paper seeks to eliminate the MCMC bottleneck and provide a unified way to handle structured discrete and mixed-type data.

Methods: Energy Discrepancy and Graph-Based Perturbations

The authors build upon a recently proposed loss function called Energy Discrepancy (ED). Unlike standard maximum likelihood estimation, ED does not require sampling from the model itself. Instead, it compares the energy of real data points to "perturbed" versions of those points.

The core innovation lies in how to perturb discrete data in a principled, structured way:

  1. Heat Equations on Graphs: The authors treat the discrete state space as a graph. By simulating a diffusion process (a "heat equation") on this graph, they can generate perturbed samples.
  2. Structured Perturbations: They define specific "rate matrices" tailored to the underlying structure of different data types:
  3. Uniform: Any category can jump to any other (e.g., nominal categories).
  4. Cyclical: For periodic data (e.g., days of the week, months of the year).
  5. Ordinal: For ordered categories (e.g., age groups or star ratings).
Structured Spaces for Mixed Data
  1. Unified Mixed Modeling: For tabular data, the model applies Gaussian noise to numerical features and graph-based noise to categorical features simultaneously. By treating the entire mixed state space as a Cartesian product of these individual structures, they solve the perturbation through a single differential equation.
  2. Scaling Limits: The authors provide a theoretical "Scaling Limit" theorem, proving that as the number of categories grows, these discrete perturbations behave like Gaussian noise. This allows practitioners to set hyperparameters (like the "time" of the perturbation) much more intuitively.

Key Insights and Results

MCMC-Free Efficiency

By using the closed-form solutions of the heat equation on graphs, the authors generate "negative" samples for training almost instantly. This bypasses the most computationally expensive part of traditional EBM training. On MNIST, training with ED was roughly 2x to 4x faster per epoch compared to Contrastive Divergence with 10 MCMC steps, while achieving better or comparable results.

Superior Density Estimation and Synthesis

The paper demonstrates that informing the perturbation with the structure of the data leads to better model performance than treating all categories as unstructured. On synthetic discrete tasks, the proposed ED methods consistently outperformed baselines like PCD and EB-GFN in terms of Negative Log-Likelihood (NLL) and Maximum Mean Discrepancy (MMD).

In generating synthetic tabular data, the model (TabED) performed comparably to state-of-the-art diffusion models (TabDDPM) and GANs (CTGAN), while being significantly more efficient than MCMC-based EBMs.

Better Calibration for Tabular Data

This work establishes what is arguably the first robust training method for EBMs on tabular data. Because EBMs model the joint distribution of features and labels, they naturally provide better calibration (knowing when the model is uncertain) than standard classifiers. On the Adult dataset, the EBM trained via ED showed significantly lower Expected Calibration Error (ECE) than a standard deterministic classifier, meaning its predicted probabilities were much more trustworthy.

Limitations and Future Directions

While the proposed method marks a significant step forward, it does have limitations. The Energy Discrepancy theory assumes the data distribution is positive everywhere. If the data lives on a very low-dimensional "manifold" (common in high-resolution images), the method might struggle. Additionally, while training is MCMC-free, generating new data from the learned model still requires a sampler (like Gibbs or Langevin dynamics).

Looking ahead, the authors suggest extending this framework to even more complex structures, such as language models or large-scale biological networks, where the graph-based perturbation could incorporate deep domain-specific knowledge.

Summary updated

BibTeX
@inproceedings{schroder2024energy,
  author = {Tobias Schröder and Zijing Ou and Yingzhen Li and Andrew B. Duncan},
  title = {{Energy-Based Modelling for Discrete and Mixed Data via Heat Equations on Structured Spaces}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=wAqdvcK1Fv},
}
Figure