WorksPhysics and Astronomy
Differentiable Electronic Grand Canonical Learning for Electrochemistry
Abstract
Electronic grand-canonical density functional theory captures how structure and electronic charge respond to electrode potential and, together with statistical mechanics, how these responses give rise to emergent phenomena. However, its computational cost limits the system sizes and sampling times accessible to first- principles simulations. Here, we introduce a differentiable architecture that represents the grand potential and obtains forces and electronic charge as its derivatives, exactly satisfying the mixed-derivative constraints required for thermodynamic consistency, and implement it within the equivariant MACE framework as GC- MACE. We demonstrate more accurate joint learning across multiple electrochemical interfaces and improved transferability to thicker water films relative to previous models, while enabling constant-potential simulations at substantially larger length and time scales than accessible to ab initio molecular dynamics. With broad training data, the framework offers a route to thermodynamically consistent foundation interatomic potentials for the electronic grand canonical ensemble
Introduction
Simulating electrode-electrolyte interfaces under operating electrochemical conditions reveals the microscopic processes underlying electrocatalysis and battery operation.[1, 2, 3, 4, 5, 6] Experiments show that solvation,[7] pH,[8] and electrode polarization[9] strongly affect structure and reactivity at the interface, motivating simulations that capture these effects while allowing exchange of electrons at a prescribed electrode potential. This electrical boundary condition is naturally described within the electronic grand canonical ensemble,[10] e.g., using grand-canonical density functional theory (GC-DFT) with a continuum electrolyte[11, 12, 13] or a solvated-jellium treatment of the compensating charge.[14] However, the computational cost of GC-DFT limits accessible system sizes and sampling times,[15, 16, 17] whereas solvent and ion reorganization,[18] interfacial reactions,[19] and surface reconstruction[20] require large systems and extensive sampling.
Machine learning interatomic potentials (MLIPs) have extended conventional DFT to substantially larger length and time scales by learning potential energy surfaces from first-principles data.[21] Modern MLIPs increasingly build physical structure directly into the model, enforcing symmetries such as rotational equivariance and deriving forces from a scalar energy so that they are conservative, while retaining scalability to large datasets and systems.[22] Extending MLIPs to the electronic grand canonical ensemble requires describing the coupled dependence of energy and electronic charge on atomic configuration and electrode potential.
In the electronic grand canonical ensemble (at zero electronic temperature), the thermodynamic potential is the grand potential,
where is the electronic potential energy, is the excess number of electrons compared to an unbiased system, and is the chemical potential, which is fixed by the electrode potential , i.e., and is the elementary charge. Several previous works have developed MLIPs to study systems described by the electrode potential-dependent grand potential. For example, Ref. 23 uses separate MLIPs at selected electrode potentials, enabling nanosecond simulations of explicitly solvated interfaces but without a continuous potential dependence within a single model. Ref. 24 predicts atomic charges and electronegativities through a dual-learning scheme and combines them to construct the grand potential. Ref. 25 uses the electron number as an input and predicts the Fermi level, with a potentiostat adjusting the electron number to regulate the electrode potential. Finally, Refs. 26,27 use the electrode potential as an explicit input to predict potential-dependent energies and derive atomic forces, making their potential-conditioning strategy most similar to that adopted here.
We introduce a differentiable architecture implemented with the equivariant MACE framework,[28] GC-MACE, that learns a single scalar grand potential as a continuous function of atomic positions and electrode potential . Forces and excess electron numbers are obtained as and . Our architecture improves upon earlier models for the electronic grand canonical ensemble by deriving forces and excess electron numbers from a single grand potential, preserving conservative forces while exactly satisfying the mixed-derivative relationship,
which is required for thermodynamic consistency.^{10} We validate the framework by training a single model across Au, Ag, and Cu interfaces and evaluating its predictions of grand potentials, forces, and excess electron numbers, together with transferability across water-layer thicknesses. Finally, we revisit the acidified water on Au(111) system, previously studied in ab initio studies, by training a single model transferable across five electrode potentials to achieve converged sampling of water layering and potential-induced reorientation in a system containing substantially more explicit water and over much longer timescales.
Results
A differentiable framework for constant-potential learning
The differentiable architecture takes atomic positions , atomic species, and electrode potential as inputs; here, the potential is referenced to the electrostatic potential deep in the solvent. In our GC-MACE implementation (Figure 1), a continuous embedding of is projected to match the initial scalar atomic features and added before the equivariant MACE interactions, with scalar atomic readouts summed to obtain the learned grand potential . Here, denotes the learned parameters, and hats distinguish model predictions from the corresponding unhatted physical quantities. Conditioning scalar atomic features on the spatial scalar preserves the spatial transformation properties of the underlying representation while allowing the learned interactions to depend on the electrode potential. The predicted forces and excess electron numbers follow by automatic differentiation,

Figure 1. GC-MACE implementation of the differentiable grand-potential architecture. The species embedding , where denotes the atomic number, and the final potential embedding have the same number of even-scalar (0e) channels. The same potential embedding is broadcast to every atom in the configuration and added before the first interaction layer. Interatomic displacement vectors include the appropriate periodic images. Geometry-dependent equivariant interactions produce invariant atomic contributions , summed over atoms and the interaction layers to obtain the learned scalar . This output represents either the total grand potential or its residual relative to a fixed, potential-independent baseline . Forces and the excess electron number follow by differentiating the reconstructed grand potential, including the baseline forces in delta learning. The mixed-derivative relation shown below the outputs holds by construction.
Grand potentials, forces, and excess electron numbers jointly constrain the model through the loss
where is the number of atoms, the unhatted targets are supplied by GC-DFT, and , , and weigh the three contributions. All three quantities are jointly fit through a common thermodynamic surface.
For a twice differentiable learned grand potential , equality of mixed derivatives guarantees that Eq. (2) is satisfied. The electronic response to atomic displacements is therefore consistent with the force response to changes in electrode potential. Deriving forces from the learned grand potential makes them conservative at fixed potential, while the MACE representation used in GC-MACE preserves translation, rotation, and permutation symmetries. These properties enable thermodynamically consistent constant-potential dynamics without separately predicting or adjusting the electron number.
We train the model either directly on GC-DFT grand potentials or on their residuals relative to a pretrained model at the potential of zero charge. The residual formulation preserves the same derivative relations.
Au, Ag, and Cu surface chemistry
We first assess the differentiable architecture through its GC-MACE implementation on the dataset of Chen et al.,[24] which comprises two subsets with grand potentials, forces, and excess electron numbers computed using GC-DFT with the solvated jellium method (SJM)[14] implemented in GPAW.[29] The first subset contains 5293 configurations of Au(111), Ag(111), and Cu(111) electrochemical interfaces, obtained from nudged elastic band calculations of (1) the Volmer and Heyrovsky steps of the hydrogen evolution reaction on Au and Ag surfaces at electrode potentials spanning 4.0–4.85 V, and (2) CO chemisorption on Cu at electrode potentials spanning 3.79–4.61 V. Over this potential range, the excess electron number per atom ranges from approximately −40 × to 20 × . We divide these configurations into training, validation, and test sets containing 4235, 529, and 529 configurations, respectively. The second subset contains 3015 Au(111) configurations with water films ranging from one to five layers and four water molecules per layer, with 250–896 configurations at each thickness. For the surface-chemistry benchmark, we train a single GC-MACE model directly on the combined Au, Ag, and Cu training configurations.
Figure 3. Extrapolation across water layers using the dataset of Chen et al.,[24] with GC-MACE trained on total grand potentials. Models trained on configurations with up to 1–4 water layers (line shading) are evaluated on configurations with 1–5 layers: (a) grand potential, (b) force, and (c) excess-electron root mean square errors (RMSEs) versus the number of water layers in the test configurations.
Figure 2 compares GC-MACE predictions of grand potentials, forces, and excess electron numbers with GC-DFT reference values on the test set. For Au, Ag, and Cu, respectively, we obtain grand-potential root mean square errors (RMSEs) of 0.161 ± 0.003, 0.069 ± 0.003, and 0.781 ± 0.002 meV/atom, force RMSEs of 25.7 ± 0.4, 20.5 ± 0.3, and 36.4 ± 0.7 meV/Å, and excess-electron RMSEs of (0.038, 0.037, 0.088) × /atom, each with a standard error of 0.001 × /atom. Quoted uncertainties are standard errors of the mean over four training runs differing only in random seed; Figure 2 shows one run. By comparison, Ref. [24] trains separate models for each metal and learns grand potential and excess charge through distinct regressions, without force training in this benchmark. For Au(111), Ag(111), and Cu(111), those models yield grand-potential RMSEs of 0.15, 0.21, and 0.24 meV/atom and excess-electron RMSEs of (0.058, 0.050, 0.101) × /atom, respectively.[24] Comparing the two models, we find both models achieve sub-meV energy errors but neither outperforms the other across all elements: GC-MACE is 3× more accurate on Ag, 7% less accurate on Au, and 3× less accurate on Cu. GC-MACE has lower reported excess-electron RMSEs on all three metals and simultaneously fits forces, which were not included in training the reference models for this benchmark. It also guarantees the derivative relations between atomic and electronic responses.
Figure 2. Parity between grand-canonical density functional theory (DFT) reference values and predictions from a single GC-MACE machine learning interatomic potential (MLIP), trained directly on total grand potentials using the dataset of Chen et al..24 The test set contains 233, 101, and 195 configurations of Au(111), Ag(111), and Cu(111) interfaces, respectively. (a–c) Grand potential per atom, shown separately for Au, Ag, and Cu systems, owing to their different energy scales. (d) Force components and (e) excess electrons per atom for all slabs. The diagonal lines indicate exact agreement. Root mean square errors (RMSEs) are reported separately for each metal system in the legends. The figure shows predictions from one training run; the main text reports averages over four runs.
Figure 3 assesses transferability with solvent thickness by training GC-MACE on interfaces containing up to one, two, three, or four water layers and evaluating on systems containing as many as five layers, following Ref. [24]. Both approaches obtain large errors when training on one layer and testing on the five-layer system. GC-MACE has grand-potential, force, and excess-electron RMSEs of 1551 meV/atom, 305 meV/Å, and 21 × /atom, respectively. Including two layers in training reduces the GC-MACE grand-potential and excess-electron RMSEs to 7.1 meV/atom and 4.2 × /atom, respectively, whereas Ref. [24] reports energy errors of order 100–1000 meV/atom and charge errors of order – /atom for thicker interfaces. With three- and four-layer training, the GC-MACE five-layer errors decrease further to 1.2 and 0.69 meV/atom in the grand potential and to 2.4 and 1.7 × /atom in excess electron number. For test configurations containing one to four water layers, the model trained on configurations with up to four layers has grand-potential RMSEs of 0.135–0.278 meV/atom. By comparison, the model of Ref. [24] reaches its low-error five-layer regime only when films of comparable thickness are represented in training. These results indicate that GC-MACE exhibits improved transferability to thicker solvent films, most clearly in the grand potential, while also evaluating force transferability with forces and electronic response derived from the same thermodynamic surface.
Acidified water on Au(111)
We now turn to our main system of interest, acidified water on Au(111). As discussed in more detail in Sec. IV D, we generated a GC-DFT dataset of 127-atom configurations comprising a three-layer 3 × 2 Au(111) slab (18 atoms), 36 water molecules arranged in six layers, and one excess proton. The electrode potentials span 3.5–5.5 V. The training, validation, and test sets contain 2870, 163, and 125 configurations, respectively. For this system, we compare two models: one that directly learns the total grand potential and one that uses delta learning relative to a potential-independent foundation-model baseline (Sec. IV B); we will refer to these as the “direct” and “delta” learned models, respectively.
Figure 4. Parity for the differentiable architecture on our grand-canonical reference dataset from density functional theory (DFT) calculations for acidified water on Au(111) (six water layers), evaluated on the held-out test split (125 configurations, 3.5–5.5 V). Predictions from machine learning interatomic potentials (MLIPs) trained on delta residuals (orange) and total grand potentials (blue) are compared on shared axes showing total quantities. Molecular dynamics uses the delta model. The columns show the grand potential per atom, the force components, and the excess electrons per atom; root mean square errors (RMSEs) are annotated in each panel. Delta predictions are converted to total grand potentials and forces by adding back the same per-frame baseline used to construct the residual targets, so the total-quantity errors equal the residual errors.
Figure 4 compares GC-MACE predictions with GC-DFT reference values on the test set. The delta model gives grand-potential, force, and excess-electron RMSEs of 1.37 meV/atom, 31.1 meV/Å, and 0.29 × /atom, respectively, compared with the direct model, which gives RMSEs of 1.70 meV/atom, 48.7 meV/Å, and 0.41 × /atom. Thus the delta model outperforms its direct counterpart on all three quantities.
Figure 5 tests extrapolation in electrode potential by comparing the models trained over 3.5–5.5 V with GC-DFT reference data spanning 1.2–8.4 V. For the delta model, predicting outside the training window raises the grand-potential RMSE from 0.79 meV/atom inside to 1.20 below the window and 1.12 above. Likewise the force RMSE increases from 27.6 meV/Å inside the window to 40.9 meV/Å below and 33.7 meV/Å above. The excess electron predictions degrade by a factor of four to five, from 0.29 × /atom inside the window to 1.25 × /atom below and 1.45 × above. The differential capacitance , which should be roughly independent of near the potential of zero charge, does not extrapolate well to potentials outside of the training data. Inside the window, the model reproduces to 0.005 /V against a reference value of 0.041 /V, but outside the window the reference rises roughly fivefold, to 0.227 /V below and 0.215 /V above, while the model captures almost none of the increase, resulting in errors of 0.20 and 0.19 /V, approximately the same magnitude as the reference signal. The same ordering holds for the direct model trained on total grand potentials. Thus the degradation reflects the limits of the training window and the nonlinear electronic response at large applied potentials rather than the choice of learning target. These results show that the electronic response, and especially its derivative, is far more sensitive to potential extrapolation than the grand potential or the forces, so small grand-potential errors alone do not establish the accuracy of the predicted charge response.
Having evaluated the generalization performance of our model, we now assess its molecular dynamics (MD) capabilities, a more demanding test with greater practical relevance. A similar system was previously studied using potential-dependent ab initio MD (AIMD) simulations,[30] although our study differs in interfacial geometry, electrolyte composition, and electrochemical boundary conditions. Our SJM reference calculations impose the electrode potential at fixed ionic composition, allowing the electron number to adjust, with the countercharge represented by a jellium region screened by a dielectric continuum.[14]
Our 508-atom system represents a single half-cell comprising a three-layer 6 × 4 Au(111) slab, 144 water molecules arranged in six layers, and four excess protons. We run trajectories at 330 K at five potentials ranging from −0.59 to 0.95 V vs the standard hydrogen electrode (SHE) using the same GC-MACE model throughout (we reference our absolute electrode potentials to the SHE by subtracting 4.44 V). Each trajectory provides 350 ps of sampling, a duration significantly longer than that accessible in standard AIMD.[30] The simulations use TORCH-SIM[31] with a BAOAB Langevin integrator at a friction of (a thermostat time constant of 1.018 ps) and a 0.25 fs timestep, with further MD settings given in Sec. IV.
Figure 5. Extrapolation in the electrode potential. Both models were trained only on configurations with 3.5 < < 5.5 V (shaded) and are evaluated against grand-canonical density functional theory reference values for 281 further configurations of the same system spanning 1.2–8.4 V, none of which appear in the training, validation, or test splits (83 below the window, 102 inside, 96 above). Every panel reports an error, averaged within potential bins: (a) grand-potential root mean square error (RMSE); (b) force RMSE; (c) mean absolute error in the excess electron number per atom; and (d) mean absolute error in the differential capacitance . The capacitance is taken within a configuration, from 122 pairs that share a geometry and differ only in potential (37 geometries, gaps 0.1–2.0 V), so that model and reference are differenced over identical pairs and the comparison is free of geometry-to-geometry variation. Note the logarithmic scales on (c) and (d): the four quantities leave the training window at very different rates.
Figure 6 compares the oxygen and hydrogen density profiles and orientation distributions of interfacial water. Water-density profiles and orientation distributions obtained using the potential-independent mace-mh-1.model baseline with D3(BJ) dispersion are shown in Sec. S3 (Figure S2) of the Supplementary Information. We observe pronounced water layering near the electrode, but with a relatively weak potential dependence. The hydrogen-density peak closest to the Au surface is slightly reduced at the most positive potentials. In contrast, we observe a relatively strong dependence of the water orientation at the surface: the mean angle between the water bisector and the surface normal decreases monotonically with increasing potential, consistent with an increased attraction between the negatively charged oxygen and the positively charged surface. The same qualitative behavior was observed in Ref. 30. The potentials shown are referenced to the standard hydrogen electrode.
Figure 6. Structure of interfacial water at constant electrode potential: GC-MACE molecular dynamics (350 ps at each of five electrode potentials, 330 K, delta model with D3 dispersion, each trajectory started by relaxing the same initial structure at its own potential): Left and middle columns: density profiles calculated from oxygen and hydrogen positions, respectively, versus height above the outermost Au layer, assigning one water-molecule mass to each oxygen and half a water-molecule mass to each hydrogen. Right column: the orientation distribution of the water bisector relative to the surface normal for surface water ( Å), showing the potential-induced reorientation. The inset defines as the angle between the outward surface normal and the water bisector, which points from the oxygen towards the two hydrogens (i.e. along the molecular dipole): has both O–H bonds directed away from the electrode.
Figure S2. Interfacial water obtained using the foundation MLIP mace-mh-1.model (head oc20_usemppbe) with D3(BJ) dispersion using Becke–Johnson damping. (a) Oxygen and (b) hydrogen mass-density profiles versus height above the outermost Au layer, and (c) the orientation distribution of the water bisector for surface water ( Å), defined as in the main text.
Conclusions
We have introduced a differentiable architecture that learns the grand potential of electrochemical interfaces as a continuous function of atomic configuration and electrode potential, obtaining forces and excess electron numbers by differentiation, and demonstrated it through the equivariant GC-MACE implementation. This construction ensures conservative forces and exactly satisfies the mixed-derivative relations between force responses to electrode potential and charge responses to atomic displacements, establishing thermodynamic consistency between atomic and electronic responses. Differential capacitance follows from the curvature of the same grand-potential surface.
When benchmarked on the GC-DFT data of Ref. [24], a single GC-MACE model accurately reproduces grand potentials, forces, and excess electron numbers across electrochemical Au, Ag, and Cu interfaces. These results demonstrate that the differentiable formulation can describe multiple electrode materials within a common, thermodynamically consistent model.
For acidified water on Au(111), we showed that model predictions worsen at electrode potentials outside the training range, possibly because of breakdowns in the linear response relationship between excess charge and electrode potential. We used a single GC-MACE model to perform 350 ps trajectories at each of five electrode potentials in a 508-atom half-cell. The simulations resolve interfacial water layering and potential-induced reorientation over sampling times substantially longer than those of a previous AIMD study.[30] Future work will explore the performance of our model with an explicit electrolyte, whose precise behavior may not be captured by the dielectric continuum treatment used here.
By deriving atomic and electronic responses from a single learned grand-potential surface, the differentiable formulation enforces consistency between them. In its current GC-MACE implementation, this construction is combined with equivariant atomic representations and multielement modelling. The formulation could also be incorporated into other differentiable architectures used to build foundation MLIPs.[21, 32, 33] With sufficiently broad GC-DFT training sets for solvated and electrified catalytic interfaces, analogous in scope to the Open Catalyst 2020,[34] Open Catalyst 2022,[35] and Open Catalyst 2025[36] datasets for conventional DFT, this approach could support foundation MLIPs transferable across electrode potentials, electrodes, adsorbates, and electrolytes.
Methods
GC-MACE implementation details
For the GC-MACE implementation presented here, we use equivariant MACE interactions,[28] built on the Atomic Cluster Expansion.[37] Interatomic displacements within a 6.0 Å cutoff are expanded using eight Bessel radial functions with a polynomial cutoff of order and spherical harmonics up to . The model uses two residual interaction layers with body order three and hidden features (128 channels, ). The radial multilayer perceptron has three hidden layers of 64 units each. The electrode potential is embedded using two linear layers with 1024, separated by a sigmoid linear unit (SiLU) activation, followed by a linear projection to 128 channels and a second SiLU activation. The resulting embedding is shared by all atoms in a configuration and added to their initial 128-channel scalar species features. Energy predictions are obtained using a linear readout at intermediate layers and a gated multilayer perceptron with 16 × 0e hidden features at the final layer. Atomic reference energies are averages over the training set, and the model output scaling is set using the root mean square training forces. These settings yield a model with approximately parameters.
GC-MACE training for direct and delta learning
Using the architecture described in Sec. IV A, we optimize the joint loss in Eq. (4) using Adam with AMSGrad, , weight decay , and gradient clipping at 10. The architecture and optimization settings are shared by every model reported here, with the Chen et al. benchmark using the different batch size and loss weights specified below. Training proceeds for 500 epochs, with a second stage beginning at epoch 250. The initial learning rate is and is reduced on plateau by a factor of 0.8 with a patience of 50 epochs; it is set to at the start of the second stage. For acidified water, the loss weights are in the first stage and in the second, with a batch size of 11. At the start of the second stage, the force and excess-electron weights are raised tenfold relative to the grand-potential weight, which is held fixed. For the Chen et al. benchmark, the weights remain throughout training, with a batch size of 16. These weights are chosen so that each of the three terms contributes comparably to the total loss. Training uses float64 precision, and reported predictions use exponentially averaged model weights with a decay of 0.99.
In direct learning, the learned scalar represents the total grand potential . Its derivatives give the predicted forces and excess electron numbers through Eq. (3), and all three quantities are jointly fit to their GC-DFT reference values using Eq. (4). This formulation is used for the Chen et al. benchmark in Sec. II B and for acidified water in Sec. II C.
In delta learning, the learned scalar instead represents the grand-potential residual relative to a fixed, potential-independent baseline,
The same derivative construction and joint loss are used, with the grand-potential and force targets replaced by and , where . The excess-electron targets remain unchanged because the baseline is independent of electrode potential. The total predictions are reconstructed as
This formulation is used for the acidified-water MD presented in Sec. II C. The baseline used for delta learning is the pretrained mh-1 foundation MLIP (mace_mp, checkpoint mace-mh-1.model, head oc20_use mppbe). The mh-1 baseline is evaluated without dispersion corrections when constructing the residual grand-potential and force targets. For MD we add the D3 dispersion energy and its corresponding forces to the reconstructed grand potential and forces.
Physical symmetries and derivative relations
Translation invariance of the learned grand potential is inherited by its first and mixed derivatives. This guarantees the translation invariance of the predicted charge and two sum rules:
At fixed electrode potential, classical Hamiltonian dynamics on this surface conserves , where is the classical nuclear kinetic energy. Finally, at fixed atomic positions, the electronic differential capacitance is
where is the excess electronic charge. The model prediction follows by replacing with .
GC-DFT reference data
Electronic structure
Dataset compositions, electrode-potential ranges, and training, validation, and test splits are described in Secs. II B and II C. Reference-data distributions for both datasets are shown in Sec. S1 (Figure S1) of the Supplementary Information. Our GC-DFT calculations use the PBE functional and the SJM[14] implemented in GPAW[29] and driven through ASE[38]. The metal slab, adsorbates, and any explicit solvent molecules are surrounded above by a dielectric continuum, with a faraway helium slab carrying any necessary compensating charge. We apply a dipole correction in the surface plane, and the electrode potential is referenced to the electrostatic potential deep in the dielectric continuum.
Figure S1. Distributions of the grand-canonical density functional theory (GC-DFT) reference data. (a–c) dataset of Chen et al. 24 (Au, Ag, Cu slabs): (a) electrode potential, (b) grand energy versus potential with the per-slab mean removed (the slabs’ absolute energy scales differ), and (c) excess electrons versus potential. (d–f) Our GC-DFT dataset of acidified water on Au(111) (six water layers): (d) electrode potential, and joint distributions of (e) grand energy and (f) excess electrons versus potential.
The following settings are used for every GC-DFT reference label. The calculations use GPAW in finite-difference mode. The grid is set from a target spacing of 0.1 Å, with the number of grid points rounded up to a multiple of 16 in each direction. For the acidified-water system, the resulting coarse and fine grids contain and points, respectively. Brillouin-zone sampling uses a Monkhorst–Pack mesh. Fermi–Dirac occupations have a width of 0.1 eV, and the force convergence tolerance is eV/Å. The implicit solvent uses the smooth-cavity model of Held and Walter[39]. The cavity uses a Power12 effective potential with eV. The dielectric is linear, with , and the surface tension is 18.4 mN/m. The cavity construction includes ghost atoms below each oxygen atom at a spacing of Å. The compensating jellium region extends from above the water film to the cell boundary.
Dataset sampling
Configurations for the initial acidified-water dataset were selected from MD driven by the potential-independent foundation MLIP. These initial configurations were drawn at random from the trajectory rather than at fixed intervals, and no two selected configurations are structurally close. Target electrode potentials in the range 3.5–5.5 V were randomly assigned to each configuration after selection. The electrode potentials used in the dataset are those achieved by the converged SJM calculation, which may differ from the target potential up to a tolerance of 0.01 V. The initial GC-DFT dataset comprised 834 geometries. However, this dataset required expansion because MD with MLIPs trained on it exhibited short-range O–H instabilities and spontaneous formation of hydronium–hydroxide pairs at a much higher frequency than physically expected. These problems were addressed through short-range data augmentation and active-learning procedures, as detailed in § 1.8 of the Supplementary Information. The final GC-DFT reference dataset contained 904 geometries and 3158 labelled rows, an increase of 70 geometries.
For the dataset of Chen et al. [24], we use the same 80/10/10 training, validation, and test split as the original study, obtained by randomly shuffling configurations using a fixed seed. The acidified-water dataset was instead split by geometry using a fixed random seed, with all entries sharing the same atomic geometry assigned to the same training, validation, or test set.
Constant-potential molecular dynamics and analysis
MD uses an in-house implementation built upon TORCH-SIM[31] and TORCH-D3[40], with the reconstructed forces given in Eq. (6). The simulations use the NVT ensemble with a BAOAB Langevin thermostat[41] and a conservative 0.25 fs timestep. The friction is in the integrator’s internal units, corresponding to fs and a damping time of 1.018 ps. The potentials, trajectory duration, temperature, integration parameters, and equilibration period are given in Sec. II C. The simulation cell measures Å, with periodic boundaries in the surface plane and open boundaries along the surface normal. The bottom Au layer, containing 24 atoms, is fixed. The initial structure is constructed on a lattice by arranging 36 water molecules in six layers spaced 4 Å apart above the Au(111) slab, adding one excess proton, and tiling the cell in the surface plane, giving 144 water molecules and four excess protons. Each trajectory starts from the same initial atomic structure, relaxed at its assigned electrode potential. Relaxation uses Broyden–Fletcher–Goldfarb–Shanno optimization with a maximum force threshold of 0.01 eV/Å, followed by Maxwell–Boltzmann initial velocities at 330 K. Trajectories of 350 ps are generated at electrode potentials of 3.85, 4.38, 4.79, 4.98, and 5.39 V, using a single thermostat seed per potential. D3 dispersion uses Becke–Johnson damping with PBE parameters and a cutoff of Å. MD is performed in float32 precision, with configurations saved every 0.1 ps.
Oxygen and hydrogen density profiles are obtained by binning atomic heights relative to the outermost Au layer and averaging over the retained trajectory. The outermost Au plane is recomputed each frame, and heights are binned at 0.15 Å. Mass densities are normalised by the lateral cell area and bin width. Both profiles are reported as equivalent water mass densities, so that oxygen counts carry a full water mass and hydrogen counts half of one; this matches the convention of the reference AIMD profiles and makes and directly comparable. Water orientation is measured by the angle between the outward surface normal and the water bisector, directed from oxygen towards the two hydrogen atoms. Orientation distributions include molecules whose oxygen atoms lie within 4 Å of the outermost Au layer. Orientations are histogrammed in 5° bins.
Molecules are identified per frame rather than by a fixed assignment. Each hydrogen is attached to its nearest oxygen under the minimum-image convention in the two periodic directions, and counted as bonded if the separation is below 1.30 Å; a water molecule is an oxygen carrying exactly two such hydrogens. An oxygen carrying three hydrogens (hydronium) or one hydrogen (hydroxide) has no well-defined bisector and is omitted from the orientation histogram for that frame alone, while still contributing to the density profiles.
Acknowledgements
We thank Xi Chen and Andrew Peterson for helpful discussions and for sharing the data of Ref. [24]. We thank Stefano Falletta and William Baldwin for insightful discussions. The Flatiron Institute is a division of the Simons Foundation.
Model and data availability
Models and data will be made available upon publication.
Supplementary Information
Reference-data distributions
Figure S1 shows the distributions of the reference data.
Additional data collection
In the course of our investigation we found that accurate fitting of the training and test data did not always guarantee stable or physical molecular dynamics (MD). Earlier iterations of the model reached grand-potential, force and excess-electron errors comparable to those reported in Sec. II C, yet produced several distinct failures in MD. Two of these were repaired by collecting more data, and are described here: (i) non-physical short-range interactions, in which a short O–H contact led to a divergence in energy; and (ii) spontaneous formation of pairs, which are absent from the training data. The two were addressed differently: the first by short-range data augmentation, the second by collecting additional GC-DFT labels. We describe each in turn.
Short-range Data Augmentation
The short-range failure (i) was addressed by augmenting the dataset with ”compressed” versions of existing GC-DFT labels, where the compression energy is calculated using the foundation machine learning interatomic potential (MLIP) mace-mh-1.model (head oc20_usempbe) with its potential-independent Foundation Embeddings. This baseline does not exhibit short-range failures. Writing for the coordinates of a labelled parent frame and for a compressed copy of it, the grand potential assigned to the copy is
where is the energy predicted using these potential-independent Foundation Embeddings and the grand-canonical reference label. The electrode potential is unchanged by the compression, and depends on coordinates alone, so the difference in Eq. (9) carries no potential dependence and the augmented label only inherits potential dependence from the parent. This removed the failure, and all models reported here are trained on the augmented set.
Active Learning
In total 197 additional GC-DFT labels across 70 geometries were collected, under the same GC-DFT protocol as the base set. With the 834 geometries of the base set these give the 904 geometries and 3158 labelled rows of the final dataset. Frames were selected by criteria fixed in advance of labelling rather than by an acquisition function. Speciation was assigned geometrically, by proton ownership: a proton belongs to its nearest oxygen when that oxygen lies within a cutoff, and counting owners per oxygen identifies and . The first round drew neutral and ion-paired configurations from separate trajectories, since no single trajectory was found to hold both species in equilibrium. The second round selected ion-paired configurations by the – separation.
The ion pairs (ii) were successfully repaired by labelling. The first round, 20 configurations at 4.79 V, showed the excess-electron error to be confined to ion-paired configurations and to grow with the separation of the and rather than saturating. The second followed that trend directly, with 50 configurations at 3.85 V spanning separations from 4.2 to 13.1 Å. After retraining, the excess-electron error on held-out pair-separated configurations fell from 0.130 to 0.055 e, a factor of 2.4, with no increase in error elsewhere in the dataset.
Water structure using the mace-mh-1 foundation MLIP
Figure S2 shows the interfacial water structure obtained using the potential-independent foundation MLIP mace-mh-1.model (head oc20_usemppbe) on the cell used for the production MD, and serves as a baseline for assessing the potential-dependent changes. The first oxygen peak is g cm at Å and the mean orientation is . In-plane oxygen self-diffusion is cm/s, and the interior density (8–16 Å above the outermost Au layer) is g cm. Uncertainties on these quantities are standard deviations across the four replicas. Four trajectories were initialized using the same procedure as the production MD described in the Methods section of the main text. Each trajectory was run for 542 ps, with the first 200 ps discarded before analysis.
References
- [1]J. Tafel, “Über die Polarisation bei kathodischer Wasserstoffentwicklung,” Zeitschrift für Physikalische Chemie 50, 641–712 (1905).DOI
- [2]M. Gouy, “Sur la constitution de la charge électrique à la surface d’un électrolyte,” Journal de Physique Théorique et Appliquée 9, 457–468 (1910).DOI
- [3]D. L. Chapman, “L. A contribution to the theory of electrocapillarity,” The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science 25, 475–481 (1913).DOI
- [4]J. A. V. Butler, “Studies in heterogeneous equilibria. Part II.—The kinetic interpretation of the Nernst theory of electromotive force,” Transactions of the Faraday Society 19, 729–733 (1924).
- [5]O. Stern, “Zur Theorie Der Elektrolytischen Doppelschicht,” Zeitschrift für Elektrochemie und angewandte physikalische Chemie 30, 508–516 (1924).DOI
- [6]M. S. Whittingham, “Electrical Energy Storage and Intercalation Chemistry,” Science 192, 1126–1127 (1976).pubmed.ncbi.nlm.nih.gov/17748676
- [7]M. F. Toney, J. N. Howard, J. R. Riche, G. L. Borges, J. G. Gordon, O. R. Melroy, D. G. Wiesler, D. Yee, and L. B. Sorensen, “Voltage-dependent ordering of water molecules at an electrode–electrolyte interface,” Nature 368, 444–446 (1994).DOI
- [8]A. Damianovic and V. Brusic, “Electrode kinetics of oxygen reduction on oxide-free platinum electrodes,” Electrochimica Acta 12, 615–628 (1967).
- [9]C. G. Gavanes, S. Bebelis, and S. Ladas, “Dependence of catalytic rates on catalyst work function,” Nature 343, 625–627 (1990).
- [10]N. Mermin, “Thermal Properties of the Inhomogeneous Electron Gas,” Physical Review 137, A1441–A1443 (1965).DOI
- [11]K. Letchworth-Weaver and T. A. Arias, “Joint density functional theory of the electrode-electrolyte interface: Application to fixed electrode potentials, interfacial capacitances, and potentials of zero charge,” Physical Review B 86, 075140 (2012).
- [12]R. Sundararaman, W. A. Goddard, and T. A. Arias, “Grand canonical electronic density-functional theory: Algorithms and applications to electrochemistry,” The Journal of Chemical Physics 146, 114104 (2017).DOI
- [13]N. G. Hörmann, O. Andreussi, and N. Marzari, “Grand canonical simulations of electrochemical interfaces in implicit solvation models,” The Journal of Chemical Physics 150, 041730 (2019).DOI
- [14]G. Kastingger, P. Lindgren, and A. A. Peterson, “Controlled-potential simulation of elementary electrochemical reactions: proton discharge on metal surfaces,” The Journal of Physical Chemistry C 122, 12771–12781 (2018).
- [15]R. Sundararaman, D. Vigil-Fowler, and K. Schwarz, “Improving the Accuracy of Atomistic Simulations of the Electrochemical Interface,” Chemical Reviews 122, 10651–10674 (2022).DOI
- [16]M. Todorova, S. Wippermann, and J. Neugebauer, “First-principles approaches and concepts to simulate electrochemical interfaces,” Nature Reviews Chemistry 10, 133–146 (2026).DOI
- [17]K. Reuter, “Embrace the Mess: Theory for Disordered Surfaces of Working Catalysts,” ACS Catalysis 16, 19684–19692 (2026).DOI
- [18]J. Bockris, M. A. V. Devanathan, and K. Müller, “On the structure of charged interfaces,” Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences 274, 55–79 (1963).
- [19]N. M. Marković and P. N. Ross, “Surface science studies of model fuel cell electrocatalysts,” Surface Science Reports 45, 117–229 (2002).
- [20]D. M. Kolb, “Reconstruction phenomena at metal-electrolyte interfaces,” Progress in Surface Science 51, 109–173 (1996).DOI
- [21]R. Jacobs, D. Morgan, S. Attarian, J. Meng, C. Shen, Z. Wu, C. Y. Xie, J. H. Yang, N. Arthrith, B. Blaiszik, G. Ceder, K. Choudhary, G. Csányi, E. D. Cubuk, B. Deng, R. Drautz, X. Fu, J. Godwin, V. Honavar, O. Isayev, A. Johansson, B. Kozinsky, S. Martiniani, S. P. Ong, I. Poltavsky, K. Schmidt, S. Takanoto, A. P. Thompson, J. Westermayr, and B. M. Wood, “A practical guide to machine learning interatomic potentials – Status and future,” Current Opinion in Solid State and Materials Science 35, 101214 (2025).DOI
- [22]N. Batatia, S. Batzner, D. P. Kovács, A. Musaelian, G. N. C. Simm, R. Drautz, C. Ortner, B. Kozinsky, and G. Csányi, “The design space of (3)-equivariant atom-centered interatomic potentials,” Nature Machine Intelligence 7, 56–67 (2025).
- [24]X. Chen, M. El Khatib, P. Lindgren, A. Willard, A. J. Medford, and A. A. Peterson, “Atomistic learning in the electronically grand-canonical ensemble,” npj Computational Materials 9, 73 (2023).DOI
- [28]I. Batatia, D. P. Kovács, G. Simm, C. Ortner, and G. Csányi, “MACE: Higher order equivariant message passing neural networks for fast and accurate force fields,” Advances in Neural Information Processing Systems 35, 11423–11436 (2022).
- [29]J. J. Mortensen, A. H. Larsen, M. Kuisma, A. V. Ivanov, A. Taghizadeh, A. Peterson, A. Haldar, A. O. Dohn, C. Schäfer, E. Ö. Jónsson, et al., “GPAW: An open Python package for electronic structure calculations,” The Journal of Chemical Physics 160, 092503 (2024).
- [30]P. Gunasekaran, X. Du, A. Burley, J. Le, J. Cheng, and A. Cuesta, “Water at electrode–electrolyte interfaces: combining HOD vibrational spectra with ab initio molecular dynamics simulations,” Chemical Science 15, 17469–17480 (2024).
- [31]J. Cohen, J. Riebesell, R. Goodall, A. Kolluru, S. Falletta, J. Krause, J. Colindres, G. Ceder, and A. S. Gangan, “Torch-Sim: An efficient atomistic simulation engine in PyTorch,” AI for Science 1, 025003 (2025).
- [32]E. C.-Y. Yuan, Y. Liu, J. Chen, P. Zhong, S. Raja, T. Kreiman, S. Vargas, W. Xu, M. Head-Gordon, C. Yang, S. M. Blau, B. Cheng, A. Krishnapriyan, and T. Head-Gordon, “Foundation models for atomistic simulation of chemistry and materials,” Nature Reviews Chemistry 10, 212–230 (2026).DOI
- [33]I. Creed, T. Rein, I. Vitenburgs, W. G. Stark, V. Ellingsson, A. Y. Ismail, G. Liu, Y. Lou, B. A. A. Martin, C. Bone, M. A. H. Walker, M. Taj, S. Wang, K. Wong, R. Wu, P. Kayastha, B. Cheng, A. Krishnapriyan, M. Ceriotti, M. F. Langer, J. M. Frost, A. M. Ganose, V. Kapil, and K. T. Butler, “Six Open Questions in Machine-Learned Interatomic Potential Foundation Models,” (2026), arXiv:2606.07327.arxiv.org/abs/2606.07327
- [34]L. Chanssot, A. Das, S. Goyal, T. Lavril, M. Shuaibi, M. Riviere, K. Tran, J. Heras-Domingo, C. Ho, W. Hu, A. Palizhati, A. Sriram, B. Wood, J. Yoon, D. Parikh, C. L. Zitnick, and Z. Ulissi, “Open Catalyst 2020 (OC20) Dataset and Community Challenges,” ACS Catalysis 11, 6059–6072 (2021).
- [35]R. Tran, J. Lan, M. Shuaibi, B. M. Wood, S. Goyal, A. Das, J. Heras-Domingo, A. Kolluru, A. Rizvi, N. Shoghi, A. Sriram, F. Therrien, J. Abed, O. Voznyy, E. H. Sargent, Z. Ulissi, and C. L. Zitnick, “The open catalyst 2022 (OC22) dataset and challenges for oxide electrocatalysts,” ACS Catalysis 13, 3066–3084 (2023).
- [36]S. J. Sahoo, M. Maraschin, D. S. Levine, Z. Ulissi, C. L. Zitnick, J. B. Varley, J. A. Gauthier, N. Govindarajan, and M. Shuaibi, “The open catalyst 2025 (OC25) dataset and models for solid-liquid interfaces,” (2025), arXiv:2509.17862.
- [37]R. Drautz, “Atomic cluster expansion for accurate and transferable interatomic potentials,” Physical Review B 99, 014104 (2019).DOI
- [38]A. H. Larsen, J. J. Mortensen, J. Blomqvist, I. E. Castelli, R. Christensen, M. Dulak, J. Friis, M. N. Groves, B. Hammer, C. Hargus, E. D. Hermes, P. C. Jennings, P. B. Jensen, J. Kermode, J. R. Kitchin, E. L. Kolsbjerg, J. Kubal, K. Kaasbjerg, S. Lysgaard, J. B. Maronsson, T. Maxson, T. Olsen, L. Pastewka, A. Peterson, C. Rostgaard, J. Schiøtz, O. Schütt, M. Strange, K. S. Thygesen, T. Vegge, L. Vilhelmsen, M. Walter, Z. Zeng, and K. W. Jacobsen, “The atomic simulation environment—a Python library for working with atoms,” Journal of Physics: Condensed Matter 29, 273002 (2017).DOI
- [39]A. Held and M. Walter, “Simplified continuum solvent model with a smooth cavity based on volumetric data,” The Journal of Chemical Physics 141, 174108 (2014).DOI
- [40]Y. Takamoto, C. Shinagawa, D. Motoki, K. Nakago, W. Li, I. Kurata, T. Watanabe, Y. Yayama, H. Iriguchi, Y. Asano, T. Ondera, T. Ishii, T. Kudo, H. Ono, R. Sawada, R. Ishitani, M. Ong, T. Yamaguchi, T. Kataoka, A. Hayashi, N. Charoenphakdee, and T. Ibuka, “Towards universal neural network potential for material discovery applicable to arbitrary combination of 45 elements,” Nature Communications 13, 2991 (2022).DOI
- [41]41 B. Leimkuhler and C. Matthews, “Robust and efficient configurational molecular sampling via Langevin dynamics,” The Journal of Chemical Physics 138, 174102 (2013).DOI






