Differentiable Thermodynamic Phase-Equilibria for Machine Learning
Authors: Karim K. Ben Hicham, Moreno Ascani, Jan G. Rittig, Alexander Mitsos
Organizations: RWTH Aachen University, Process Systems Engineering (AVT.SVT), 52074 Aachen, Germany · Forschungszentrum Jülich GmbH, Institute of Climate and Energy Systems ICE-1: Energy Systems Engineering, 52425 Jülich, Germany · JARA-ENERGY, 52056 Aachen, Germany
Accurate prediction of phase equilibria remains a central challenge in chemical engineering. Physics-consistent machine learning methods that incorporate thermodynamic structure into neural networks have recently shown strong performance for activity-coefficient modeling. However, extending such approaches to equilibrium data arising from an extremum principle, such as liquid-liquid equilibria, remains difficult. Here we present DISCOMAX, a differentiable algorithm for phase-equilibrium calculation that guarantees thermodynamic consistency at both training and inference, only subject to a user-specified discretization. The method combines discrete enumeration of feasible phase states with masked softmax aggregation in the backward pass, with the propagation of the true equilibrium state in the forward pass, using a straight-through gradient estimator to enable physics-consistent end-to-end learning of neural \gls{gE}-models. We show that this approach bears analogy to statistical thermodynamics, and we evaluate it on binary liquid-liquid equilibrium data where it outperforms existing surrogate-based methods, while offering a general framework for learning from different kinds of equilibrium data.
Figures & tables
xaug=(x(i))i=1N′=(x,z),N′=N+1.
Algorithm 1 DISCOMAX: Differentiable Binary Equilibrium Solver with DISCRETE enumeration (fp) and masked SOFTMAX aggregation over feasible states (bp).
Model
MAE (mean ± std)
RMSE
R2
DISCOMAX H+G
0.016 ± 0.017
0.018
0.998
DISCOMAX H
0.017 ± 0.018
0.019
0.998
DISCOMAX
0.019 ± 0.036
0.030
0.996
DISCOMAX G
0.031 ± 0.057
0.046
0.990
Surrogate H
0.109 ± 0.064
0.102
0.952
Surrogate H+G
0.109 ± 0.071
0.108
0.946
Table 1: Metrics of fitting 50 systems with different gap widths one by one (batch size = 1). H stands for the auxiliary Hessian loss, and G stands for the auxiliary Gibbs loss.
Model
Split
MAE
RMSE
R2
DISCOMAX
Test
0.075 ± 0.003
0.098 ± 0.005
0.965 ± 0.003
Validation
0.075 ± 0.003
0.098 ± 0.004
0.965 ± 0.003
Train
0.035 ±< 0.001
0.040 ±< 0.001
0.993 ±< 0.001
DISCOMAX G
Test
0.070 ± 0.002
0.091 ± 0.005
0.969 ± 0.003
Validation
0.070 ± 0.003
0.091 ± 0.005
0.969 ± 0.003
Train
0.024 ±< 0.001
0.032 ± 0.001
0.995 ±< 0.001
Table 2: Full cross-validation results for the phase-composition predictions in the generalization study, aggregated over ten folds. Metrics are shown as mean ± standard deviation.
Figure 5: Test-set parity plots of phase compositions for representative model variants: a. DISCOMAX H, b. Surrogate G, and c. DISCOMAX. Full cross-validation results for all other variants are reported in Table 2 .
Figure 6: Test-set gap-width parity plots for DISCOMAX H and Surrogate G on a representative fold.
Figure 7: Training-set gap-width parity plots for DISCOMAX H and Surrogate G on the same fold as Figure 6 .
Test MAE
Test RMSE
Test R2
Model
DISCOMAX H
0.046 ± 0.003
0.047 ± 0.003
0.986 ± 0.002
DISCOMAX
0.045 ± 0.003
0.047 ± 0.003
0.986 ± 0.002
Table S1: Full cross-validation results for the test, validation, and train set aggregated over ten folds for the best performing models on the COSMO-RS dataset DISCOMAX batch-size 128 and DISCOMAX H batch-size 128. Metrics are shown as mean ± standard deviation.
Machine learning (ML) approaches have shown promising results for predicting molecular properties relevant for chemical process design. However, they are often limited by scarce experimental property data and lack thermodynamic consistency. As such, thermodynamics-informed ML, i.e., incorporating thermodynamic relations into the loss function as regularization term for training, has been proposed. We herein transfer the concept of thermodynamics-informed graph neural networks (GNNs) from the Gibbs-Duhem to the Clapeyron equation, predicting several pure component properties in a multi-task manner, namely: vapor pressure, liquid molar volume, vapor molar volume and enthalpy of vaporization. We find improved prediction accuracy of the Clapeyron-GNN compared to the single-task learning setting, and improved approximation of the Clapeyron equation compared to the purely data-driven multi-task learning setting. In fact, we observe the largest improvement in prediction accuracy for the properties with the lowest availability of data, making our model promising for practical application in data scarce scenarios of chemical engineering practice.
Jan Pavšek, Alexander Mitsos, Elvis J. Sim +1
Process Systems Engineering (AVT.SVT), RWTH Aachen University · JARA Center for Simulation and Data Science (CSD) · Institute of Climate and Energy Systems ICE-1: Energy Systems Engineering, Forschungszentrum Jülich GmbH
Accurate phase equilibria are foundational to alloy design because they encode the underlying thermodynamics governing stability, transformations, and processing windows. However, while the CALculation of Phase Diagrams (CALPHAD) provides a rigorous thermodynamic framework, exploring multicomponent composition-temperature space remains computationally expensive and is typically limited to sparse section. To enable rapid phase mapping and alloy screening, we propose a physics-informed graph attention network (GAT) that learns element-aware representations and couples them with thermodynamic constraints for multi-label phase-set prediction in the Ag-Bi-Cu-Sn alloy system. Using about 25,000 equilibrium states generated with pycalphad, each composition-temperature point is represented as a four-node element graph with atomic fractions and elemental descriptors as node features. The model combines graph attention, global pooling, and a multilayer perceptron to predict nine relevant phases. To improve physical consistency, we incorporate thermodynamic constraints, applied as training penalties or as an inference-time projection. Across six binary and three ternary subsystems, the baseline model achieves a macro-F1 score of 0.951 and 93.98% exact-set match, while physics-informed decoding improves robustness and raises exact-set accuracy to about 96% on dense in-domain grids. The surrogate also generalizes to an unseen ternary section with 99.32% exact-set accuracy and to a quaternary section at 700 °C with 91.78% accuracy. These results demonstrate that attention-based graph learning coupled with thermodynamic constraint enforcement provides an effective and physically consistent surrogate for high-resolution phase mapping and extrapolative alloy screening.
Eunjeong Park, Amrita Basak
Department of Mechanical Engineering, Pennsylvania State University, University Park, PA, 16802, USA
Predicting the thermodynamic properties of an alloy requires sampling its configurations across many chemical conditions and recovering free energies on a common absolute scale. Markov chain Monte Carlo (MCMC) is the standard tool, but it requires separate simulations at different conditions, and auxiliary free-energy methods such as thermodynamic integration are used to place results on a common absolute scale. Modern discrete neural samplers typically use reverse KL divergence as the objective and can be mode-seeking or biased. We present Free energy Offering Generative Sampler (FrOGS), a hybrid discrete neural sampler that couples an autoregressive model to a continuous-time Markov chain (CTMC) to be trained jointly under a single shared loss. FrOGS draws i.i.d. configurations, returns an unbiased estimate of the partition function, and gives consistent estimates of thermodynamic observables. We train a single model across a wide range of chemical conditions to produce estimates on a common absolute free-energy scale. FrOGS matches exact finite-size results on the 2D Ising model and reference phase diagrams for AgPd and CuAu, without mode collapse. We additionally compare to SEGAL, a published autoregressive baseline, and find that only FrOGS recovers the stability range of the CuAu3 phase.
Kyucheol Min, Elyssa Hofgard, Tess Smidt
Massachusetts Institute of Technology Cambridge, MA 02139