A machine-learned expression for the excess Gibbs energy

Marco Hoffmann, Thomas Specht, Quirin Göttl, Jakob Burger, Stephan Mandt, Hans Hasse, Fabian JirasekarXiv 2025 · OpenReview

TL;DR

This paper introduces HANNA, a novel machine learning model that accurately predicts the excess Gibbs energy of liquid mixtures, crucial for chemical engineering. By embedding physical laws as hard constraints and training on a vast dataset, HANNA achieves superior accuracy and broader applicability than existing methods, even for complex multi-component systems.

What Problem Does This Paper Address?

Accurately predicting the thermodynamic properties of liquid mixtures is essential for designing and optimizing chemical processes. The excess Gibbs energy ($g^E$) is a key property that underpins many others, including phase equilibria like vapor-liquid (VLE) and liquid-liquid (LLE). However, predicting $g^E$ for multi-component mixtures solely from molecular structures has been a significant challenge. Traditional models like UNIFAC, while useful, have limitations: they struggle with simultaneous VLE and LLE predictions, require extensive parameter fitting for each system, and cannot predict properties for entirely new components or systems. Quantum-chemical methods like COSMO-RS can be applied more broadly but are computationally expensive and can be sensitive to parameter choices. This paper aims to bridge this gap by developing a flexible, thermodynamically consistent machine learning model that can predict $g^E$ for any mixture given only the molecular structures of its components.

Methods

The core of this work is the development of HANNA (Thermodynamically consistent machine learning model for excess Gibbs energy). HANNA is a neural network architecture that integrates physical laws as "hard constraints," ensuring that its predictions are always thermodynamically consistent.

Key methodological aspects include:

  • Molecular Embeddings: HANNA uses the ChemBERTa-2 transformer model to convert molecular structures (provided as SMILES strings) into numerical embeddings.
  • Hard Constraints: The neural network is designed to inherently obey thermodynamic consistency criteria, such as the Gibbs-Duhem equation and permutation invariance (the order of components shouldn't affect the result).
  • Geometric Projection: To extend predictions from binary mixtures to multi-component mixtures, a geometric projection method (specifically, the Muggianu projection) is employed. This allows predictions for complex mixtures without needing additional parameters.
  • End-to-End Training: HANNA is trained directly on experimental data. A novel aspect is the development of a surrogate solver that enables end-to-end training on liquid-liquid equilibrium (LLE) data. This solver mimics the convex envelope method (CEM) to predict LLE phase compositions, circumventing the need for iterative solvers during training.
  • Lipschitz Regularization: To ensure smooth and robust predictions, a Lipschitz regularization technique is applied.

Datasets

The study utilizes a comprehensive dataset from the Dortmund Data Bank (DDB) [39], a major repository for thermodynamic properties. The training and evaluation data include:

  • Vapor-Liquid Equilibrium (VLE) Data: Both TPXY (temperature, pressure, liquid, and vapor composition) and TPX (temperature, pressure, liquid composition) data were used.
  • Activity Coefficients at Infinite Dilution (ACI) Data: For binary and ternary mixtures.
  • Liquid-Liquid Equilibrium (LLE) Data: For binary, ternary, and quaternary systems.
  • Excess Enthalpy (HE) Data: For binary and ternary mixtures.

The authors performed a rigorous data splitting strategy, ensuring that test sets were entirely unseen during training to provide a fair evaluation.

Key Insights and Ideas

  • Thermodynamic Consistency as a Hard Constraint: Embedding physical laws directly into the neural network architecture, rather than relying on soft constraints or post-processing, is a powerful way to ensure reliable predictions. This is a key differentiator from many other machine learning approaches.
  • Surrogate Solver for LLE Training: The development of a differentiable surrogate solver for LLE is a significant contribution. It unlocks the ability to train machine learning models directly on LLE data, which was previously challenging due to the iterative nature of solving LLE problems.
  • Geometric Projection for Extrapolation: The Muggianu projection allows HANNA to generalize from binary to multi-component systems without introducing new parameters, simplifying the model and its applicability.
  • Broad Applicability Beyond Traditional Models: HANNA's ability to predict properties for systems and components not seen during training, and its simultaneous handling of VLE and LLE, significantly expands its scope compared to models like UNIFAC.

Key Results

  • Superior Accuracy: HANNA consistently outperformed modified UNIFAC (mod. UNIFAC), a leading benchmark, across VLE, ACI, and LLE data for binary and ternary mixtures. For ACI data, the median system-wise mean absolute error (MAE) was reduced from 0.18 (mod. UNIFAC) to 0.11 (HANNA).
  • Improved LLE Prediction: HANNA correctly identified miscibility gaps in LLE systems more accurately than mod. UNIFAC (89% vs. 74% for binary systems on the mod. UNIFAC horizon).
  • Broad Applicability: HANNA can predict properties for any mixture where molecular structures are known, including those with ionic liquids, a significant advantage over UNIFAC which is limited by its group contribution framework.
  • Robust Extrapolation: The geometric projection method proved effective for extrapolating to multi-component mixtures, showing comparable or better performance than physics-based extrapolation methods.
  • Comparison to Other ML Models: HANNA also demonstrated superior performance compared to other graph neural network (GNN) based models, particularly in terms of accuracy and broader applicability.

Limitations and Future Work

  • Ionic Species: HANNA does not explicitly model ions, meaning the effects of dissociation are implicitly learned from binary data. Extending this to explicit ionic species is a future direction.
  • Polymers and Strong Electrolytes: The model was not trained on data for polymers or strong electrolytes (except ionic liquids), so its predictions for these systems are not reliable.
  • Pressure Dependence: Like most $g^E$ models, HANNA neglects the pressure dependence of activity coefficients, which might be a limitation at very high pressures.
  • Minor Anomalies: A small fraction of binary LLE systems showed unusual predictions of two separate LLE regions, potentially linked to the ChemBERTa-2 tokenization for small molecules like methanol and water.
  • Future Work: The authors plan to:
  • Include solid-liquid equilibrium (SLE) data in future training.
  • Explore new projection strategies for multi-component mixtures and potentially include ternary data in training.
  • Investigate fine-tuning the ChemBERTa-2 model or exploring alternative molecular representation learning methods (e.g., SELFormer, graph neural networks) to address minor deficiencies.

Summary updated

Abstract

The excess Gibbs energy plays a central role in chemical engineering and chemistry, providing a basis for modeling the thermodynamic properties of liquid mixtures. Predicting the excess Gibbs energy of multi-component mixtures solely from the molecular structures of their components is a long-standing challenge. In this work, we address this challenge by integrating physical laws as hard constraints within a flexible neural network. The resulting model, HANNA, was trained end-to-end on an extensive experimental dataset for binary mixtures from the Dortmund Data Bank, guaranteeing thermodynamically consistent predictions. A novel surrogate solver developed in this work enabled the inclusion of liquid-liquid equilibrium data in the training process. Furthermore, a geometric projection method was applied to enable robust extrapolations to multi-component mixtures, without requiring additional parameters. We demonstrate that HANNA delivers excellent predictions, clearly outperforming state-of-the-art benchmark methods in accuracy and scope. The trained model and corresponding code are openly available, and an interactive interface is provided on our website, MLPROP.
BibTeX
@misc{hoffmann2025machine,
  author = {Marco Hoffmann and Thomas Specht and Quirin Göttl and Jakob Burger and Stephan Mandt and Hans Hasse and Fabian Jirasek},
  title = {{A machine-learned expression for the excess Gibbs energy}},
  year = {2025},
  eprint = {2509.06484},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.06484},
}
Figure