Neural Thermodynamic Integration: Free Energies from Energy-based Diffusion Models

Bálint Máté, François Fleuret, Tristan Bereau · DOI

TL;DR

This paper introduces "Neural TI," a novel method that uses energy-based diffusion models to estimate free energy differences in molecular systems. By learning an alchemical pathway with a neural network, Neural TI significantly reduces the computational cost of traditional thermodynamic integration, enabling accurate free energy calculations for complex systems like Lennard-Jones fluids.

What Problem Does This Paper Address?

Estimating free energy differences is crucial for understanding molecular interactions, reaction mechanisms, and phase transitions. Thermodynamic Integration (TI) is a rigorous method for this, but it's computationally expensive. This is because TI requires sampling many intermediate molecular configurations (ensembles) that bridge the initial and final states. When these ensembles don't overlap well, many intermediate simulations are needed, making the process prohibitively slow, especially for systems with many degrees of freedom. This paper aims to overcome this computational bottleneck by using a machine learning approach to learn the interpolation between states, thus avoiding the need for numerous intermediate simulations.

Methods

The core innovation is "Neural TI," which leverages denoising diffusion models (DDMs). Instead of simulating many intermediate states, Neural TI trains a DDM to learn a time-dependent Hamiltonian that interpolates between the non-interacting (ideal gas) and fully interacting (target) systems. Specifically, the DDM learns to predict the "score" (gradient of the log probability density) of this interpolated system. This score is then related to the gradient of a time-dependent potential, allowing for thermodynamic integration along the diffusion process's time variable. The key advantage is that the DDM can generate samples from all intermediate ensembles, enabling TI from a single reference calculation. The authors also adapt DDMs for systems with periodic boundary conditions (toroidal DDMs) to handle the topological constraints of molecular simulations.

Datasets

The method is demonstrated on simulations of Lennard-Jones (LJ) fluids. Training data for the diffusion models was generated using canonical Monte Carlo simulations for various particle numbers (N) and densities (ρ). Specifically, for the 3D LJ fluid, training was performed on N ∈ {40, 80, 120, 160, 200} particles (densities ρ ∈ {0.19, 0.37, 0.56, 0.74, 0.93}). For a 1D LJ system, training used N ∈ {50, 70, 90} (densities ρ ∈ {0.5, 0.7, 0.9}). The paper does not introduce new benchmark datasets but uses standard LJ fluid systems for evaluation.

Key Insights and Ideas

  • DDMs as Alchemical Pathways: The paper demonstrates that DDMs can effectively learn the complex interpolation between different molecular states, acting as a learned "alchemical pathway" for free energy calculations.
  • Score Matching for TI: By relating the DDM's score function to the gradient of a time-dependent potential, the method directly enables thermodynamic integration without explicit simulations of intermediate Hamiltonians.
  • Transferability Across Densities: The trained diffusion models show remarkable transferability, accurately reconstructing molecular properties (like radial distribution functions) and estimating free energies across a wide range of densities, including the gas-liquid phase transition.
  • Handling Periodic Boundary Conditions: The adaptation of diffusion models to toroidal spaces is crucial for applying them to molecular systems with periodic boundary conditions, a common requirement in simulations.
  • Large Free Energy Differences: Neural TI can accurately estimate very large free energy differences (up to 200 kBT), which are challenging for traditional TI methods.

Key Results

  • Neural TI accurately estimates the excess chemical potential of Lennard-Jones fluids across various densities, showing excellent agreement with reference grand-canonical Monte Carlo (GCMC) simulations.
  • The method demonstrates transferability, allowing accurate free energy estimations for particle numbers not included in the training set.
  • The radial distribution functions (RDFs) predicted by the trained diffusion models closely match those from Monte Carlo simulations, indicating good generative performance.
  • The paper reports accurate free energy differences for coupling all LJ interactions from an ideal gas state, achieving this with a single reference simulation.

Limitations and Future Work

  • Computational Cost Trade-off: While Neural TI bypasses intermediate simulations, training the diffusion model itself can be computationally intensive. The authors note that the computational tradeoff is between training time and the cost of intermediate simulations in standard TI.
  • Expressivity of ML Force Field: The accuracy of Neural TI can be limited by the expressivity of the underlying neural network architecture used for the potential. For high-density LJ fluids, slight discrepancies were observed compared to standard TI with many simulations, potentially due to convergence issues in the reference simulations or model limitations.
  • Generalization to Other Interactions: The current work focuses on Lennard-Jones interactions. Future work could explore extending the method to other types of interactions, such as Coulomb electrostatics, which would require adapting the energy function.
  • Analysis of Computational Aspects: A detailed analysis of the computational aspects and scaling properties of Neural TI compared to standard TI is left for future work.

Summary updated

BibTeX
@misc{mate2024neural,
  author = {Bálint Máté and François Fleuret and Tristan Bereau},
  title = {{Neural Thermodynamic Integration: Free Energies from Energy-based Diffusion Models}},
  year = {2024},
  eprint = {2406.02313},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.02313},
}
Figure