Learning Latent Variable Models via Jarzynski-adjusted Langevin Algorithm

James Cuin, Davide Carbone, O. Deniz Akyildiz

This paper introduces a clever way to train complex statistical models by borrowing a fundamental principle from nonequilibrium thermodynamics. By combining Langevin dynamics with Jarzynski’s equality, the authors develop a scalable algorithm that not only finds the best parameters for a model but also evaluates how well that model fits the data compared to others—a computationally expensive "two-for-one" deal in machine learning.

TL;DR

The authors introduce JALA-EM, a sequential Monte Carlo algorithm that uses a physics-inspired "Jarzynski adjustment" to train latent variable models. Unlike traditional methods, JALA-EM provides a recursive estimate of the marginal likelihood during training, making it exceptionally powerful for real-time model selection and parameter estimation in high-dimensional spaces.

The Challenge: Marginal Likelihood in Latent Variable Models

In many real-world scenarios—from analyzing gene sequences to processing natural language—we use Latent Variable Models (LVMs). These models assume there are hidden ("latent") structures influencing the data we observe. To train these models, practitioners typically aim for Maximum Marginal Likelihood Estimation (MMLE): finding the parameters that make the observed data most probable.

The catch is that calculating the marginal likelihood requires solving a massive, often intractable integral over all possible hidden states. The gold standard, the Expectation-Maximization (EM) algorithm, struggles when this integral is complex. Modern "particle-based" alternatives are faster but often fail to provide an easy way to calculate the marginal likelihood itself. This metric is crucial for model selection—deciding if Model A is actually better than Model B.

The JALA-EM Approach

The researchers bridge this gap using the Jarzynski-adjusted Langevin Algorithm (JALA), integrating it into an EM framework.

  1. Langevin Dynamics: The method builds on the Unadjusted Langevin Algorithm (ULA), which moves a "population" of particles toward areas of high probability.
  2. The Physics Twist: When model parameters change during training, the target distribution evolves, introducing bias in standard samplers. The authors apply Jarzynski’s equality—a theorem from statistical mechanics—to calculate "weights" for these particles. These weights act as a mathematically rigorous correction factor for the bias introduced by the moving target.
  3. Sequential Monte Carlo Integration: By integrating JALA into an EM framework, they create a Sequential Monte Carlo (SMC) method. As the algorithm iterates, it updates the model parameters using Stochastic Gradient Descent while simultaneously updating the particle weights.
  4. The "Free" Metric: Because the algorithm tracks these weights, it produces an estimate of the marginal likelihood as a natural byproduct of the training process.

Key Insights

  • Decoupling Time Scales: JALA-EM allows the latent variables and the model parameters to be updated at different step-sizes. Previous state-of-the-art methods (like PGD or IPLA) often require them to move in lockstep, which can lead to instability or agonizingly slow convergence.
  • Physics as a Correction Fluid: Usually, sampling from a changing distribution yields biased samples. Jarzynski’s equality dictates exactly how to re-weight these samples to correct the bias, rather than discarding them.
  • Model Selection on the Fly: Most scalable training methods require a separate, expensive pass to calculate the marginal likelihood for model comparison. JALA-EM provides this metric at the end of training, allowing researchers to compare models instantly.

Experimental Validation and Results

The authors validated JALA-EM across several benchmarks, including the Wisconsin Breast Cancer Dataset (Bayesian logistic regression), MNIST (Bayesian Neural Networks), and synthetic datasets for model order and error model selection.

  • Provable Convergence: The authors provide a nonasymptotic analysis, proving that JALA-EM is guaranteed to converge to the maximum likelihood estimate under standard regularity conditions.
  • Efficiency and Posterior Quality: In benchmark tasks, JALA-EM reached optimal parameter values significantly faster than existing methods like SOUL and PGD. Furthermore, it maintained higher-quality posterior approximations, capturing the true distribution more accurately even when using fewer particles.
Convergence and posterior approximation comparison between JALA-EM, PGD, and SOUL.
  • Robust Model Selection: In experiments designed to "trick" the algorithm with misspecified models, JALA-EM correctly identified the true underlying model class in 99% to 100% of trials.
  • Scalability: The method successfully trained a Bayesian Neural Network with over 400,000 latent variables, demonstrating it can handle the scale of modern machine learning problems.

Limitations and Future Work

While powerful, JALA-EM has some limitations:

  • Weight Degeneracy: Like all SMC methods, particle weights can eventually "collapse" (where one particle hoards all the weight). While resampling mitigates this, it remains a challenge in extremely high dimensions.
  • Theoretical Gap: The current convergence proof does not explicitly account for the resampling step, a common gap in SMC theory that the authors aim to bridge in future work.
  • Hyperparameter Tuning: JALA-EM introduces an additional step-size to tune compared to simpler methods, though the added stability is generally worth the effort.

Future research directions include applying JALA-EM to Energy-Based Models (EBMs) and exploring "tempering" strategies to help particles explore complex, multi-modal probability landscapes.

Summary updated

BibTeX
@inproceedings{cuin2025learning,
  author = {James Cuin and Davide Carbone and O. Deniz Akyildiz},
  title = {{Learning Latent Variable Models via Jarzynski-adjusted Langevin Algorithm}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=LpY1jgtk8I},
}
Figure