betaFeedback

WorksPhysics and Astronomy

GemNet: Universal Directional Graph Neural Networks for Molecules

Abstract

Effectively predicting molecular interactions has the potential to accelerate molecular dynamics by multiple orders of magnitude and thus revolutionize chemical simulations. Graph neural networks (GNNs) have recently shown great successes for this task, overtaking classical methods based on fixed molecular kernels. However, they still appear very limited from a theoretical perspective, since regular GNNs cannot distinguish certain types of graphs. In this work we close this gap between theory and practice. We show that GNNs with spherical representations are indeed universal approximators for predictions that are invariant to translation, and equivariant to permutation and rotation. We then discretize such GNNs via directed edge embeddings and two-hop message passing, and incorporate multiple structural improvements to arrive at the geometric message passing neural network (GemNet). We demonstrate the benefits of the proposed changes in multiple ablation studies. GemNet outperforms previous models on the COLL, MD17, and OC20 datasets by 34%, 41%, and 20%, respectively, and performs especially well on the most challenging molecules. Our implementation is available online.

Introduction

Graph neural networks (GNNs) have shown great promise for predicting the energy and other quantum mechanical properties of molecules. They can predict these properties orders of magnitudes faster than methods from quantum chemistry – at comparable accuracy. GNNs can thus enable the accurate simulation of systems that are orders of magnitude larger. However, they still exhibit severe theoretical and practical limitations. Regular GNNs are only as powerful as the 1-Weisfeiler Lehman test of isomorphism and thus cannot distinguish between certain molecules [45, 60]. Moreover, they require a large number of training samples to achieve good accuracy.

In this work we first resolve the questionable expressiveness of GNNs by proving sufficient conditions for universality in the case of invariance to translations and rotations and equivariance to permutations; and then extending this result to rotationally equivariant predictions. Simply using the full geometric information (e.g. all pairwise atomic distances) in a layer does not ensure universal approximation. For example, if our model uses a rotationally invariant layer we lose the relative information between components. Such a model thus cannot distinguish between features that are rotated differently. This issue is commonly known as the “Picasso problem”: An image model with rotationally invariant layers cannot detect whether a person’s eyes are rotated correctly. Instead, we need a model that preserves relative rotational information and is only invariant to global rotations. To prove universality in the rotationally invariant case we extend a recent universality result based on point cloud models that use representations of the rotation group SO(3)SO(3) [18]. We prove that spherical representations are actually sufficient; full SO(3)SO(3) representations are not necessary. We then generalize this to rotationally equivariant predictions by leveraging a recent result on extending invariant to equivariant predictions [57]. We then discretize spherical representations by selecting points on the sphere based on the directions to neighboring atoms. We can connect this model to GNNs by interpreting these directions as directed edge embeddings. For example, the embedding direction of atom aa would be defined by atom cc, resulting in the edge embedding ecae_{ca}. Updating the spherical representation of atom aa based on atom bb then corresponds to two-hop message passing between the edges ecae_{ca} and edbe_{db} via ebae_{ba}, with atoms cc and dd defining the embedding directions. This message passing formalism naturally allows us to obtain the molecule’s full geometrical information (distances, angles, and dihedral angles), and the direct correspondence shows the model’s expressiveness.

We call this edge-based two-hop message passing scheme geometric message passing, and propose multiple structural enhancements to improve the practical performance of this formalism. Based on these changes we develop the highly accurate and sample-efficient geometric message passing neural network (GemNet). We furthermore show that stabilizing the variance of GemNet’s activations with predetermined scaling factors yields significant improvements over regular normalization layers.

We investigate the proposed improvements in a range of ablation studies, and show that each of them significantly reduces the model error. These changes introduce little to no computational overhead over two-hop message passing. Altogether, GemNet outperforms previous models for force predictions on COLL by 34 %, on MD17 by 41 %, and on OC20 by 20 % on average. We observe the largest improvements for the most challenging molecules, which exhibit dynamic, non-planar geometries. In summary, our contributions are:

  • Showing the universality of spherical representations for rotationally equivariant predictions, and discretizing this theoretical model to two-hop message passing with directed edge embeddings.

  • Geometric message passing: Symmetric message passing enhanced by geometric information.

  • Incorporating all proposed improvements in the Geometric Message Passing Neural Network (GemNet), which significantly outperforms previous methods for molecular dynamics prediction.

Related work

Machine learning potentials. Research on predicting a molecule’s energy and forces (so-called machine learning potentials) started with hand-fitted analytical functions and then gradually moved towards fully learned models. Arguably, classical force fields are their very first instances. They use analytical functions with coefficients that were hand-tuned based on experimental data. A popular example for these is the Merck Molecular Force Field (MMFF94) [31]. The next wave of methods used kernel ridge regression based on fixed, hand-crafted molecular representations [3, 9, 23]. Finally, modern research mostly focusses on fully end-to-end learnable models based on GNNs [30, 53]. These models can also be combined with molecular features from quantum mechanical calculations to improve performance [48]. We consider this combination as orthogonal research.

Directional GNNs. We can also achieve equivariance and invariance to rotations without relying on group representations. Directional GNNs achieve this by representing directional information explicitly [54] or in the form of angles [29] and dihedral angles [25, 39]. Our work is focused on this class of models, showing their expressiveness and proposing an improved variant, GemNet.

Expressiveness of GNNs. A large part of GNN research has been focused on their (limited) expressiveness. Morris et al. [45], Xu et al. [60] first proved that they are only as expressive as the Weisfeiler-Lehman test of isomorphism and Garg et al. [27] showed the limitations of basic directional message passing. Kondor et al. [37], Maron et al. [43], Morris et al. [45, 46] then investigated higher-order representations to circumvent this issue. Finally, Azizian & Lelarge [2], Maron et al. [42] showed that so-called folklore GNNs are the most expressive GNNs for a given tensor order.

Equivariant neural networks. Equivariance and invariance have recently emerged as one of the foundational principles of modern neural networks [13, 15]. This is especially relevant for models in physics, for which we often know the symmetries a priori. Equivariant models for the SO(3) group were first investigated in the context of spherical convolutions by Cohen et al. [14], Esteves et al. [21], Kondor et al. [36]. These methods leverage group representations to achieve full equivariance. They were then transferred to the context of 3D point clouds and molecules by Anderson et al. [1], Thomas et al. [56], Weiler et al. [58], and further developed by Batzner et al. [4], Finzi et al. [24], Fuchs et al. [26]. Importantly, Yarotsky [61] proved the universality of 2D convolutional networks, and Bogatskiy et al. [5] extended this result to general groups. Maron et al. [44] proved universality for models invariant to SnS_n and equivariant to an additional symmetry. Dym & Maron [18] combined these results to prove universality for the joined group of translations, rotations, and permutations. Apart from reflections this is the exact group relevant for general molecules.

Universality of spherical representations

GNNs for molecules typically incorporate directional information in one of two ways: Via SO(3)\mathrm{SO}(3) representations [1, 56] or by using directions in real space [29, 54]. Directions in real space are associated with the three-dimensional S2S^2 sphere, while the SO(3)\mathrm{SO}(3) group is double covered by the four-dimensional S3S^3 sphere. Directional representations thus use one degree of freedom less than SO(3)\mathrm{SO}(3) representations, making them significantly cheaper. And, as we will prove in this section, directional representations actually provide the same expressivity as SO(3)\mathrm{SO}(3) representations for predictions in R3\mathbb{R}^3. We achieve this by showing that the SO(3)\mathrm{SO}(3)-based tensor field network (TFN) [56] variant used by Dym & Maron [18] is equivalent to a similar model based on spherical representations, in the case of rotationally invariant predictions. We then generalize a recent result by Villar et al. [57], which lets us extend our theorem to the rotationally equivariant case. Afterwards, we relate this universality to directional GNNs by interpreting them as a discretization of spherical representations.

Preliminaries. We consider a point cloud with nn points (atoms), each associated with a position and a set of rotationally invariant features (e.g. atom types), defined as X∈R3×nX \in\mathbb{R}^{3 \times n} and Hin∈Rh×nH_{\mathrm{in}} \in\mathbb{R}^{h \times n}. In this section we define model classes by sets of functions F\mathcal{F}. As a first step, we are interested in proving that the set F\mathcal{F} defining our model is equal to the full set of functions G\mathcal{G} that are invariant to the group of translations T3\mathbb{T}^3 and rotations SO(3)\mathrm{SO}(3), and equivariant to the group of permutations SnS_n. We denote the codomain of functions in G\mathcal{G} as WTnW_T^n, where WTW_T is some representation of SO(3)\mathrm{SO}(3). We denote a vector’s norm by x=∥x∥2x = \lVert x \rVert_2, its direction by x^=x/x\hat{x} = x/x, and the relative position by xba=xb−xax_{ba} = x_b - x_a. Proofs are deferred to the appendix. Note that this section is not intended as an introduction to the SO(3)\mathrm{SO}(3) group. For a concise introduction in the context of machine learning see e.g. Weiler et al. [58, Section 3] or Kondor et al. [36].

Tensor field network. In order to show the equivalence of the TFN to spherical representations, we first need to define this model. Following Dym & Maron [18], we split the model into two parts: Embedding functions Ffeat\mathcal{F}_{\mathrm{feat}} that lifts the input into an equivariant representation, and pooling functions Fpool\mathcal{F}_{\mathrm{pool}} that aggregate the results of multiple embedding functions on each point and computes the model output. The overall model is then defined as the set of functions

FK(D),DTFN={f∣f(X,Hin)=∑k=1Kfpool(k)(ffeat(k)(X,Hin)),fpool(k)∈FpoolTFN(D),ffeat(k)∈FfeatTFN(D)},(1)\mathcal{F}^{\mathrm{TFN}}_{K(D),D} = \left\{f \mid f(X,H_{\mathrm{in}}) = \sum_{k=1}^{K} f_{\mathrm{pool}}^{(k)}\left(f_{\mathrm{feat}}^{(k)}(X,H_{\mathrm{in}})\right), f_{\mathrm{pool}}^{(k)} \in\mathcal{F}^{\mathrm{TFN}}_{\mathrm{pool}}(D), f_{\mathrm{feat}}^{(k)} \in\mathcal{F}^{\mathrm{TFN}}_{\mathrm{feat}}(D)\right\}, \tag*{(1)}

where D∈ND \in\mathbb{N} denotes the function’s maximum polynomial degree, K(D)∈NK(D) \in\mathbb{N} is chosen such that Theorem 1 is fulfilled (Dym & Maron [18] only prove the existence of this function), and f∗f^* denotes elementwise application of ff on all points. We then define the set FpoolTFN\mathcal{F}^{\mathrm{TFN}}_{\mathrm{pool}} as all rotationally equivariant linear functions on the SO(3)\mathrm{SO}(3) group, i.e. all SO(3)\mathrm{SO}(3) convolutions [38]. Note that these are more expressive than the self-interaction layers used originally [56]. The embedding functions FfeatTFN(D)={π2∘f(2)∘⋯∘f(1)∣f(i)∈FprodTFN}\mathcal{F}^{\mathrm{TFN}}_{\mathrm{feat}}(D) = \left\{\pi_2 \circ f^{(2)} \circ\cdots\circ f^{(1)} \mid f^{(i)} \in\mathcal{F}^{\mathrm{TFN}}_{\mathrm{prod}}\right\} consist of an auxiliary function π2(X,H)=H\pi_2(X,H) = H and a series of tensor product functions (called convolution by Dym & Maron [18]) FprodTFN={f∣f(X,H)=(X,H~TFN(X,H))}\mathcal{F}^{\mathrm{TFN}}_{\mathrm{prod}} = \left\{f \mid f(X,H) = \left(X,\widetilde{H}^{\mathrm{TFN}}(X,H)\right)\right\}. The intermediate representations are H∈WfeatH \in W_{\mathrm{feat}}, where WfeatW_{\mathrm{feat}} is a representation of SO(3)\mathrm{SO}(3) indexed by the degree ll and the order mm. For HinH_{\mathrm{in}} we have l=m=0l=m=0. The main update is defined by

H~amoTFN(lo)(X,H)=θHamo(lo)+∑lf,mf∑li,miC(lf,mf),(li,mi)(lo,mo)∑b∈NaFTFN,mf(lf)(xb−xa)Hbmi(li),(2)\widetilde{H}^{\mathrm{TFN}(l_o)}_{a m_o}(X,H) = \theta H^{(l_o)}_{a m_o} + \sum_{l_f,m_f} \sum_{l_i,m_i} C^{(l_o,m_o)}_{(l_f,m_f),(l_i,m_i)} \sum_{b \in\mathcal{N}_a} F^{(l_f)}_{\mathrm{TFN},m_f}(x_b-x_a) H^{(l_i)}_{b m_i}, \tag*{(2)}

where θ\theta is a (learned) scalar and Na\mathcal{N}_a are the neighbors of point aa. The Clebsch-Gordan coefficients C(lf,mf),(li,mi)(lo,mo)C^{(l_o,m_o)}_{(l_f,m_f),(l_i,m_i)} arise from decomposing the tensor product of two input SO(3)\mathrm{SO}(3) representations (the filter and input representations) into a sum of output representations. Their exact values are not relevant for this discussion. We index the output with degree lol_o and order mom_o, the learned filter with lfl_f and mfm_f, and the input with lil_i and mim_i. FTFN,m(l)(x)=R(l)(x)Ylm(x^)F^{(l)}_{\mathrm{TFN},m}(x) = R^{(l)}(x)Y_{lm}(\hat{x}) is a rotationally filter, with a (learned) radial part RR, which is any polynomial of degree ≤D\le D, and the real spherical harmonics YlmY_{lm} with degree ll and order mm. The spherical harmonics are the basis for the Fourier transformation of functions on the sphere, analogously to sine waves for functions on R\mathbb{R}. We can prove universality for TFNs by using the universality of polynomial regression and showing that TFNs can fit any polynomial (see Dym & Maron [18] for details), resulting in:

Theorem 1 (Dym & Maron [18]). Consider the set of functions G\mathcal{G} mapping R3×n+h×n→WTn\mathbb{R}^{3 \times n+h \times n} \to\mathcal{W}_{T}^{n} that are equivariant to rotations and permutations and invariant to translations. For all n∈Nn \in\mathbb{N},

  1. For D∈N0D \in\mathbb{N}_{0}, every polynomial p∈Gp \in\mathcal{G} of degree DD is in FK(D),DTFN\mathcal{F}_{K(D),D}^{\mathrm{TFN}}.

  2. Every continuous function f∈Gf \in\mathcal{G} can be approximated uniformly on compact sets by functions in ⋃D∈N0FK(D),DTFN\bigcup_{D \in\mathbb{N}_{0}} \mathcal{F}_{K(D),D}^{\mathrm{TFN}}.

Spherical networks. Instead of intermediate SO(3)\mathrm{SO}(3) representations we now switch to spherical representations, which are functions on the sphere H:S2→RH : S^{2} \to\mathbb{R}. We define the set of functions FK(D),Dsphere\mathcal{F}_{K(D),D}^{\mathrm{sphere}} analogously to FK(D),DTFN\mathcal{F}_{K(D),D}^{\mathrm{TFN}}. However, for Ffeatsphere(D)\mathcal{F}_{\mathrm{feat}}^{\mathrm{sphere}}(D) we use

H~asphere(X,H)(r^)=θHa(r^)+∑b∈NaFsphere(xb−xa,r^)Hb(r^),(3)\widetilde{H}_{a}^{\mathrm{sphere}}(X,H)(\hat{r}) = \theta H_{a}(\hat{r}) + \sum_{b \in\mathcal{N}_{a}} F_{\mathrm{sphere}}(x_{b}-x_{a},\hat{r})H_{b}(\hat{r}), \tag*{(3)}

with the filter function Fsphere(x,r^)=∑l,mR(l)(x)ℜ[Ym(l)∗(x^)Ym(l)(r^)]F_{\mathrm{sphere}}(x,\hat{r}) = \sum_{l,m} R^{(l)}(x)\Re[Y_{m}^{(l)*}(\hat{x})Y_{m}^{(l)}(\hat{r})], using the real part ℜ\Re of the complex spherical harmonics Ym(l)Y_{m}^{(l)}. The set of pooling functions for invariant predictions is

Fpoolsphere={f∣f(H)=θpool∫S2H(r^) dr^},(4)\mathcal{F}_{\mathrm{pool}}^{\mathrm{sphere}} = \{f \mid f(H) = \theta_{\mathrm{pool}} \int_{S^{2}} H(\hat{r})\,\mathrm{d}\hat{r}\}, \tag*{(4)}

with the learnable parameter θpool\theta_{\mathrm{pool}}. We obtain the universality theorem by showing the equivalence between this model and TFN for rotationally invariant functions. The proof is based on the connection between spherical harmonics and the Clebsch-Gordan coefficients [51 3.7.72] (see App. A).

Theorem 2. Consider the set of functions G′\mathcal{G}' mapping R3×n+h×n→WTn\mathbb{R}^{3 \times n+h \times n} \to\mathcal{W}_{T}^{n} that are equivariant to permutations and invariant to translations and rotations. For all n∈Nn \in\mathbb{N},

  1. For D∈N0D \in\mathbb{N}_{0}, every polynomial p∈G′p \in\mathcal{G}' of degree DD is in FK(D),Dsphere\mathcal{F}_{K(D),D}^{\mathrm{sphere}}.

  2. Every continuous function f∈G′f \in\mathcal{G}' can be approximated uniformly on compact sets by functions in ⋃D∈N0FK(D),Dsphere\bigcup_{D \in\mathbb{N}_{0}} \mathcal{F}_{K(D),D}^{\mathrm{sphere}}.

Next, we extend Theorem 2 to rotationally equivariant functions. We do this by generalizing a recent result by Villar et al. [57] to obtain (see App. B):

Theorem 3. Let h:Rd×n+h×n→Rd×nh : \mathbb{R}^{d \times n+h \times n} \to\mathbb{R}^{d \times n} be any function that is equivariant to permutations and rotations and invariant to translations. For all a∈[1,n]a \in[1,n], let the set of relative vectors {xca∣c∈[1,n]}\{x_{ca} \mid c \in[1,n]\} not span a (d−1)(d-1)-dimensional space. Then there are n−1n-1 functions fa(c):Rd×n+h×n→Rnf_{a}^{(c)} : \mathbb{R}^{d \times n+h \times n} \to\mathbb{R}^{n} such that

ha(X,H)=∑c=1c≠anfa(c)(X,H)xca,(5)h_{a}(X,H) = \sum_{\substack{c=1 \\ c \ne a}}^{n} f_{a}^{(c)}(X,H)x_{ca}, \tag*{(5)}

where f(c)f^{(c)} is equivariant to permutations, but invariant to rotations and translations.

This theorem lets us extend a rotationally invariant model to an equivariant one, while providing universality guarantees. Together, Theorem 2 and Theorem 3 (with d=3d=3) thus show that we can approximate any rotationally equivariant function using only representations on the S2S^{2} sphere. We thus do not need SO(3)\mathrm{SO}(3) representations, spin-weighted spherical harmonics [22], triplet embeddings, or complex-valued functions. This result puts theory back in line with practice, where the best results are currently achieved without relying on these more expensive representations [54].

From spherical representations to directional message passing

Directional representations. To use spherical representations in a model we first need to find a tractable description. Instead of using spherical harmonics, we propose to sample the representations in specific directions r^i\hat{r}_i. If we look at recent models, we see that they implicitly use the directions to each atom’s neighbors for this purpose, i.e. they embed the edges in the molecule’s graph. These directions define an equivariant mesh that circumvents the aliasing effects that would arise from fixed grids [36]. Schütt et al. [54] flexibly define the directional mesh in each layer by aggregating directions, while Gasteiger et al. [29] and others use a fixed mesh for each atom. We can refine this mesh of directions e.g. by using more neighbors or by interpolating between directions. The approximation error of this directional mesh is related to the spherical harmonic expansion via the mesh norm and the separating distance between directions [33, 34]. Note that depending on the discretization scheme the resulting mesh might not provide a universal approximation guarantee.

Eq. (3) only defines the relationship for a fixed direction, while models commonly use different directional meshes for the input and output. We model the relationship between different directions using a convolution with a learned filter F2F_2, which can only improve expressiveness. Note that the input function is only defined for specific directions r^i\hat{r}_i. To simplify the resulting equations we express this using Dirac deltas. Since the input and output are spherical functions, the used filter F2F_2 has to be zonal, i.e. it has to be isotropic and depend on only one angle [21]. This can be expressed as [17]

H~adir(X,H)(r^o)=θHa(r^o)+∫SO(3)∑b∈NaFsphere(xba,Rn^)∑i∈RbHbiδ(Rn^−r^i)F2(R−1r^o) dR=θHa(r^o)+∑b∈Na∑i∈RbFsphere(xba,r^i)HbiF2(∠r^or^i),(6)\begin{aligned} \widetilde{H}^{\mathrm{dir}}_a(X,H)(\hat{r}_o) = \theta H_a(\hat{r}_o) + \int_{\mathrm{SO}(3)} \sum_{b \in\mathcal{N}_a} F_{\mathrm{sphere}}(x_{ba},R\hat{n}) \sum_{i \in\mathcal{R}_b} H_{bi}\delta(R\hat{n}-\hat{r}_i)F_2(R^{-1}\hat{r}_o)\,\mathrm{d}R \\ &= \theta H_a(\hat{r}_o) + \sum_{b \in\mathcal{N}_a}\sum_{i \in\mathcal{R}_b} F_{\mathrm{sphere}}(x_{ba},\hat{r}_i)H_{bi}F_2(\angle\hat{r}_o\hat{r}_i), \tag*{(6)} \end{aligned}

where Rb\mathcal{R}_b denotes the directional mesh of atom bb with mesh directions denoted by r^i\hat{r}_i, and r^o\hat{r}_o specifies the output direction. The integral vanishes due to the Dirac delta δ\delta.

General filters. To see the relationship to GNNs we furthermore need to generalize the filter Fsphere(xba,r^i)F_{\mathrm{sphere}}(x_{ba},\hat{r}_i). This filter only depends on the angle ∠r^ix^ba\angle\hat{r}_i\hat{x}_{ba} since it is rotationally invariant:

Lemma 1. Fsphere(Rx,Rr^)=Fsphere(x,r^)F_{\mathrm{sphere}}(Rx,R\hat{r})=F_{\mathrm{sphere}}(x,\hat{r}) for any rotation matrix RR.

We can therefore substitute FsphereF_{\mathrm{sphere}} with a general learnable filter F1F_1 that is parametrized by this relative angle. Since FsphereF_{\mathrm{sphere}} arises as a special case we do not lose expressivity. We thus obtain

H~agem(X,H)(r^o)=θHa(r^o)+∑b∈Na∑i∈RbF1(xba,∠r^ix^ba)F2(∠r^or^i)Hbi.(7)\widetilde{H}^{\mathrm{gem}}_a(X,H)(\hat{r}_o) = \theta H_a(\hat{r}_o) + \sum_{b \in\mathcal{N}_a}\sum_{i \in\mathcal{R}_b} F_1(x_{ba},\angle\hat{r}_i\hat{x}_{ba})F_2(\angle\hat{r}_o\hat{r}_i)H_{bi}. \tag*{(7)}

We have now arrived at a message passing scheme that is directly derived from a theoretical model with universal approximation guarantees but only requires relative directional information. To see the connection to GNNs we interpret these discretized spherical representations as edge embeddings pointing towards r^o\hat{r}_o and r^i\hat{r}_i. Eq. (7) then corresponds to two-hop message passing between the edge embeddings of r^o\hat{r}_o and r^i\hat{r}_i via the edge x^ba\hat{x}_{ba}. Interestingly, the central learnable part of Eq. (7) is the product of the filters F1(xba,∠r^ix^ba)F_1(x_{ba},\angle\hat{r}_i\hat{x}_{ba}) and F2(∠r^or^i)F_2(\angle\hat{r}_o\hat{r}_i) with the input representation, which is strikingly similar to the Hadamard product used in modern GNNs [28, 53] – except that these only use one-hop message passing.

Geometric message passing

Geometric representation. We now develop a specific two-hop message passing scheme based on Eq. (7). We use embeddings based on interatomic directions, and embed all atom pairs with distance xca≤ϵmbx_{ca} \leq\epsilon_{\mathrm{mb}}. r^o\hat{r}_o and r^i\hat{r}_i are thus instantiated as the interatomic directions x^ca\hat{x}_{ca} and x^db\hat{x}_{db}. We denote directional embeddings as mca=Ha(x^ca)m_{ca}=H_a(\hat{x}_{ca}). Message passing is thus based on quadruplets of atoms – two atoms are interacting (aa and bb) and two atoms define the directions (cc and dd). We denote the angle between directions by φabd=∠x^abx^bd\varphi_{abd}=\angle\hat{x}_{ab}\hat{x}_{bd}. To improve empirical performance we additionally use the dihedral angle θcabd=∠x^cax^db⊥x^ba\theta_{cabd}=\angle\hat{x}_{ca}\hat{x}_{db}\perp\hat{x}_{ba} and substitute ∠r^or^i=∠x^cax^db\angle\hat{r}_o\hat{r}_i=\angle\hat{x}_{ca}\hat{x}_{db} with φcab\varphi_{cab}. Figure 1 illustrates the three angles φcab\varphi_{cab}, φabd\varphi_{abd}, and θcabd\theta_{cabd} we use for updating the embedding mcam_{ca}

Angles used in geometric message passing

Figure 1. Angles used in geometric message passing. The dihedral angle θcabd\theta_{cabd} becomes visible when rotating the molecule so that atoms aa and bb lie on top of each other (right).

based on mdb\mathbf{m}_{db}. To ensure that all angles are well-defined we exclude overlapping atom quadruplets, i.e. a≠b≠c≠da \ne b \ne c \ne d. We represent the relative directional information using spherical Fourier-Bessel bases with polynomial radial envelopes to ensure smoothly differentiable predictions, as proposed by Gasteiger et al. [29]. We split the basis into three parts to incorporate all available geometric information. Before the envelope, these are:

e~RBF,n(xdb)=2cembsin⁡(nπcembxdb)xdb,(8)\tilde{e}_{\mathrm{RBF},n}(x_{db}) = \sqrt{\frac{2}{c_{\mathrm{emb}}}} \frac{\sin\left(\frac{n\pi}{c_{\mathrm{emb}}}x_{db}\right)}{x_{db}}, \tag*{(8)}
e~CBF,ln(xba,φabd)=2cint3jl+12(zln)jl(zlncintxba)Yl0(φabd),(9)\tilde{e}_{\mathrm{CBF},ln}(x_{ba},\varphi_{abd}) = \sqrt{\frac{2}{c_{\mathrm{int}}^{3}j_{l+1}^{2}(z_{ln})}}j_l\left(\frac{z_{ln}}{c_{\mathrm{int}}}x_{ba}\right)Y_l^0(\varphi_{abd}), \tag*{(9)}
e~SBF,lmn(xca,φcab,θcabd)=2cemb3jl+12(zln)jl(zlncembxca)Ylm(φcab,θcabd),(10)\tilde{e}_{\mathrm{SBF},lmn}(x_{ca},\varphi_{cab},\theta_{cabd}) = \sqrt{\frac{2}{c_{\mathrm{emb}}^{3}j_{l+1}^{2}(z_{ln})}}j_l\left(\frac{z_{ln}}{c_{\mathrm{emb}}}x_{ca}\right)Y_l^m(\varphi_{cab},\theta_{cabd}), \tag*{(10)}

with the interaction cutoff cintc_{\mathrm{int}}, the spherical Bessel functions jlj_l, and the nn-th root of the ll-order Bessel function zlnz_{ln}. Note that Gasteiger et al. [29] only used the first two parts eRBFe_{\mathrm{RBF}} and eCBFe_{\mathrm{CBF}}. These representations are then transformed using two linear layers to obtain the filter FF. In order to maintain a smoothly differentiable cutoff we cannot use a bias in this transformation. Altogether, the core geometric message passing scheme is

m~ca=∑b∈Naint∖{c},d∈Nbemb∖{a,c}(WSBF1e~SBF(xca,φcab,θcabd))TW((WCBF2WCBF1e~CBF(xba,φabd))⊙(WRBF2WRBF1e~RBF(xdb))⊙mdb),(11)\tilde{\mathbf{m}}_{ca} = \sum_{\substack{b \in\mathcal{N}^{\mathrm{int}}_a \setminus\{c\},\\ d \in\mathcal{N}^{\mathrm{emb}}_b \setminus\{a,c\}}} \left(\mathbf{W}_{\mathrm{SBF}1}\tilde{\mathbf{e}}_{\mathrm{SBF}}(x_{ca},\varphi_{cab},\theta_{cabd})\right)^{\mathsf{T}} \mathbf{W}\left( \left(\mathbf{W}_{\mathrm{CBF}2}\mathbf{W}_{\mathrm{CBF}1}\tilde{\mathbf{e}}_{\mathrm{CBF}}(x_{ba},\varphi_{abd})\right) \odot \left(\mathbf{W}_{\mathrm{RBF}2}\mathbf{W}_{\mathrm{RBF}1}\tilde{\mathbf{e}}_{\mathrm{RBF}}(x_{db})\right) \odot\mathbf{m}_{db} \right), \tag*{(11)}

where WW denotes a weight matrix, W\mathbf{W} denotes a weight tensor. The first weight matrix of each representation part has a small output dimension. This causes a bottleneck that improves generalization.

Symmetric message passing. Whenever we have a directional embedding mca\mathbf{m}_{ca}, we also have the opposing embedding mac\mathbf{m}_{ac}, since both are based on the same cutoff cembc_{\mathrm{emb}}. Whether we associate the embedding mca\mathbf{m}_{ca} or mac\mathbf{m}_{ac} with atom aa is arbitrary. A more principled approach is to jointly interpret both embeddings as a representation of the atom pair aa and cc. In this view, an update to mca\mathbf{m}_{ca} should also influence mac\mathbf{m}_{ac}. This would normally require executing the above message passing scheme twice, once for updating mca\mathbf{m}_{ca} based on mdb\mathbf{m}_{db}, and once for updating mac\mathbf{m}_{ac} based on mdb\mathbf{m}_{db}. We propose to circumvent this double execution by calculating the update (Eq. (11)) only once and then using it for both mca\mathbf{m}_{ca} and mac\mathbf{m}_{ac}. To preserve the distinction between the two directions and ensure that mca≠mac\mathbf{m}_{ca} \ne\mathbf{m}_{ac}, we transform the two updates using two separate learnable weight matrices. One single message passing update thus carries information for both embeddings, which is then dissected by the two weight matrices. In practice, this only requires a simple re-indexing operation that maps the edge caca to acac.

Efficient bilinear layer. The whole message passing scheme, i.e. basis transformation, neighbor aggregation, and bilinear layer, only use linear functions. We can therefore freely optimize the order of summation without changing the result, as proposed by Wu et al. [59] (see App. § 13 for details). Doing so can provide a faster and more memory-efficient model, reducing memory usage by 50% even for Hadamard products. Moreover, since everything is based on efficient matrix products, this allows us to use the bilinear layer at practically no additional cost compared to a Hadamard product. Note that this requires using padded matrices instead of the usual gather-scatter operations to prevent excessively large intermediate results.

GemNet: Geometric message passing neural network

GemNet. The geometric message passing neural network (GemNet) is a significantly refined architecture based on DimeNet++ [28 Hippocratiс license 2.1]. GemNet predicts the molecular energy EE and forces F∈R3×n\mathbf{F} \in\mathbb{R}^{3 \times n} based on the atomic positions X∈R3×n\mathbf{X} \in\mathbb{R}^{3 \times n} and the atomic numbers z∈Nn\mathbf{z} \in\mathbb{N}^{n}. The architecture is illustrated in Figure 2. A comprehensive version with low-level layers and hyperparameters is described in App. § 15. GemNet was developed on the COLL dataset, but generalizes to other datasets such as MD17 without architectural changes. Every change we propose either improves model performance or reduces model complexity. For example, GemNet uses no biases since we found them to be irrelevant or even detrimental to accuracy. We show the impact of the most relevant changes via ablation studies in § 7.

The GemNet architecture

Figure 2. The GemNet architecture (comprehensive version in App. F). □\square denotes the layer’s input, ∥\parallel concatenation, and σ\sigma a non-linearity. Directional embeddings mcam_{ca} are updated using three forms of interaction: Two-hop geometric message passing (Q-MP), one-hop geometric message passing (T-MP), and atom self-interactions. Differences between Q-MP and T-MP are denoted by colors and dashed lines.

Interactions. GemNet incorporates three forms of interactions. The first is geometric message passing, as described in § 5. The second is a one-hop form of geometric message passing. This interaction uses a single cutoff c=cembc = c_{\mathrm{emb}} and passes messages only between directional embeddings pointing towards the same atom, similarly to DimeNet [29]. This provides both angle-based pair interactions and atom self-interactions, thanks to the symmetric message passing scheme described in § 5. The third interaction is a pure atom self-interaction based on atom embeddings. We first aggregate the directional embeddings of one atom to obtain an atom embedding. We then use this atom embedding to update all directional embeddings. We found all three interaction forms to be beneficial, and show this in our ablation studies.

Stabilizing activation variance. The variance of activations in a model is usually stabilized using normalization methods, which has various positive effects on training [16, 41, 52]. However, they also have multiple undesirable side effects, especially in the context of molecular regression. Batch normalization introduces correlations between separate molecules and atoms. Layer normalization forces all activation scales to be constant, while atomic interactions actually cover a large range of scales – directly bonding atoms have a substantially stronger interaction than atoms at a long range. To circumvent these issues, we stabilize GemNet’s variance by introducing constant scaling factors, as suggested by Brock et al. [6]. We found that the activation variance is primarily impacted by four components: Skip connections, non-linearities, message aggregation, and Hadamard/bilinear layers. The two summands in a skip connection y=x+f(x)y = x + f(x) have no covariance at initialization due to random weight matrices. We can thus remove its impact by scaling the output by 1/21/\sqrt{2}. We remove the non-linearity’s impact by scaling its output with a gain of γ=1/0.6\gamma= 1/0.6 for SiLU, similarly to [35]. Note that we do not center SiLU’s output but instead choose a slightly lower γ\gamma to account for mean shift. Additionally, we standardize the weight matrices to have exactly zero mean and 1/fan-in1/\text{fan-in} variance. The sum aggregation and Hadamard/bilinear layers have a more complex impact on the variance, which we cannot determine a priori (see App. § 14 for details). We therefore estimate the variance after these layers based on random batches of data. We then rescale their output accordingly to obtain roughly the variance of the layer input at initialization. These simple empirical scaling factors are sufficient to keep the activation variance roughly constant (see Figure 3). We found that other measures such as adaptive gradient clipping [7], scaled weight standardization [6], or weighting the residual block with zero at initialization [16] are not beneficial for model accuracy.

Figure 3. Layer-wise activation variance. GemNet’s variance varies strongly between layers and increases significantly after each block without scaling factors (top). Introducing scaling factors successfully stabilizes the variance (bottom).

sGDMLNequIPGemNet-QGemNet-T
Aspirin33.014.710.410.3
Benzene1.70.80.70.7
Ethanol15.29.43.13.1
Malonaldehyde16.016.06.05.9
Toluene9.14.42.52.7

Table 2. Force MAE for MD17@CCSD in meV/A˚\mathrm{meV}/\mathrm{\AA}. GemNet outperforms previous methods by 44 % on average.

GemNet-Q and GemNet-T. Geometric message passing is comparatively expensive since it is based on quadruplets of atoms. Its runtime thus scales with O(nkintkemb2)O(nk_{\mathrm{int}}k_{\mathrm{emb}}^{2}), where kintk_{\mathrm{int}} is the number of interacting neighbors, and kembk_{\mathrm{emb}} is the number of embedded directions. For this reason we investigate two message passing models in our experiments – one with two-hop geometric message passing (GemNet-Q) and one using only the two cheaper forms of interaction (GemNet-T). Their complexities are O(nkintkemb2)O(nk_{\mathrm{int}}k_{\mathrm{emb}}^{2}) and O(nkemb2)O(nk_{\mathrm{emb}}^{2}), respectively. Note that GemNet-T is thus a direct ablation of the two-hop message passing scheme implied by our theoretical results.

Direct force predictions. GemNet predicts forces by calculating Fa=−∂E/∂xaF_a=-\partial E/\partial x_a via backpropagation. This form of calculation guarantees a conservative force field, which is important for the stability of simulations. However, by using Eq. (5) we can also directly predict forces and other vector quantities. This essentially means predicting a magnitude for each directional embedding and then summing up over the vectors defined by this magnitude and the embedding’s associated direction, similarly to Park et al. [47]. We denote this variant as GemNet-dQ and GemNet-dT. Interestingly, GemNet is thus able to generate rotationally equivariant predictions despite only using invariant representations. Direct predictions substantially accelerate the model, especially for training. For most datasets, the resulting accuracy is on par with most previous models, but significantly worse than GemNet’s accuracy via backpropagation. However, this is not true for OC20, where we found GemNet-dT to converge faster and perform on par with GemNet-T.

Limitations. GemNet is focused on one specific, important task: Predictions for molecular simulations. We do not make any statements regarding its performance beyond this scope. The GemNet architecture might seem more complex than some previous models, due to its larger variety of interactions and blocks. However, its number of parameters and training or inference time is actually on par with previous models. Two-hop message passing introduces significant computational overhead. We mitigate this effect with a down-projection layer and additionally introduce the ablated GemNet-T model. This model performs surprisingly well on MD17, but not on COLL. This suggests that one-hop message passing is expressive enough for some practical use cases, but two-hop message passing gives an advantage for the more challenging task of fitting multiple molecules at once.

Societal impacts. Accelerating molecular simulations can have positive effects in a wide range of applications in physics and chemistry. At the same time, however, this can be used for malicious purposes such as developing chemical agents or weapons. To the best of our knowledge, this work does not promote these use cases more than regular chemistry research does. To somewhat mitigate negative effects we will publish our source code under the Hippocratic license [19].

Experiments

Experimental setup. We evaluate our model on four molecular dynamics datasets. COLL [28 CC-BY 4.0] consists of configurations taken from molecular collisions of different small organic molecules. MD17 [9] consists of configurations of multiple separate, thermalized molecules, considering only one molecule at a time. MD17@CCSD [10] uses the same setup, but calculates the forces using the more accurate and expensive CCSD or CCSD(T) method. The open catalyst (OC20) dataset

Kernel methodsGNNsGemNet
MoleculesGDMLFCHL19DimeNetSphereNetNequIPPaiNNGemNet-QGemNet-T
Aspirin29.520.721.618.615.114.79.49.5
Benzene[9]--8.17.78.1-6.36.3
Benzene[10]2.6---2.3-1.51.4
Ethanol14.35.910.09.09.09.73.83.7
Malonaldehyde17.810.616.614.714.614.96.96.7
Naphthalene4.86.59.37.74.23.32.22.4
Salicylic acid12.19.616.215.610.38.55.45.5
Toluene6.18.89.46.74.44.12.62.6
Uracil10.44.613.111.67.56.04.54.2

Table 3. Force MAE for MD17 in meV/A˚\mathring{\mathrm{A}}. GemNet outperforms all previous methods by a wide margin, on average by 41 %.

S2EFIS2RSIS2RE
Energy MAEForce MAEForce cosAFbTADwTEnergy MAE
meV ↓\downarrowmeV/A˚\mathring{\mathrm{A}} ↓\downarrow↑\uparrow% ↑\uparrow% ↑\uparrowmeV ↓\downarrow
ForceNet-large-31.20.52012.749.6-
DimeNet++^{++}-large*-31.30.54421.851.7559.1
SpinConv336.329.70.53916.753.6434.3
GemNet-dT292.424.20.61627.658.7399.7

Table 4. Results for the three tasks of the open catalyst dataset (OC20), averaged across its four test sets. GemNet outperforms all previous methods in all measures, on average by 20 %.

*DimeNet++^{++}-large uses separate models for energy and force prediction for IS2RE.

[8 CC-BY 4.0] consists of energy relaxation trajectories of solid catalysts with adsorbate molecules. This dataset is split into three tasks: (1) Structure to energy and forces (S2EF), which is the same task as used by the COLL and MD17 datasets, (2) initial structure to relaxed structure (IS2RS), where an energy optimization is carried out based on the model’s predictions and we measure how close the final structure is to the true relaxed structure (average distance within threshold, ADwT) and whether the final forces are close to zero (average forces below threshold, AFbT), and (3) initial structure to relaxed energy (IS2RE), where we predict the energy of the relaxed structure, based on an energy optimization starting at the initial structure. All presented OC20 models are trained on the S2EF data. Following the setup of Batzner et al. [4], we use 1000 training and validation configurations for MD17, and 950 training and 50 validation configurations for MD17@CCSD. We focus on force predictions and use a high force loss weight since they determine the accuracy of molecular simulations. We measure the mean absolute error (MAE), averaged over all samples, atoms, and components. We compare with the results reported by several state-of-the-art models: sGDML [10], FCHL19 [12], SchNet [53], DimeNet [29], DimeNet++ [28], SphereNet [39], NequIP [4], PaiNN [54], ForceNet [32], and SpinConv [55]. For further details see App. G.

Results. Tables 1 to 4 show that GemNet-T and GemNet-Q consistently perform best on all molecular dynamics datasets investigated – and by a large margin. This is true both in comparison to previous GNNs and for kernel methods – despite the latter typically being more sample efficient. The improvements are largest for chain-like molecules, such as ethanol and malonaldehyde. These molecules are the most challenging since they exhibit a wide range of movement. GemNet even performs better than some previous models that were trained with 50x more training samples. For example, it performs better than SchNet with 50 000 training samples on six out of eight MD17 molecules (see Table 9). Interestingly, the two-hop message passing scheme implied by our theoretical results (GemNet-Q) yields significant improvements on COLL, but performs approximately on par with the ablated GemNet-T on MD17. To investigate this disagreement we trained GemNet on a combined dataset of all MD17 molecules. Table 13 shows that GemNet-Q again performs better than GemNet-T in this setting. These results suggest that regular MD17 is too simple to show the benefits of two-hop message passing. It seems to be particularly important in more difficult settings that cover a large variety of configurations and molecules.

SchNet 50kGemNet-QGemNet-T
Aspirin14.39.49.5
Benzene[9]7.46.36.3
Benzene[10]-1.51.4
Ethanol2.23.83.7
Malonaldehyde3.56.96.7
Naphthalene4.82.22.4
Salicylic acid8.25.45.5
Toluene3.92.62.6
Uracil4.84.54.2

Table 9. Force MAE for MD17 in meV/Å. GemNet using 1000 training samples compared to SchNet using 50 000 samples. GemNet outperforms SchNet on six out of eight molecules – despite using 50x fewer samples.

Table 13: Force MAE of GemNet on the revised MD17 dataset [11] in meV/A˚\AA when using individual models for each molecule (“Individual”) versus a single model for all molecules (“Combined”). The combined setting is harder to learn, leading to a higher error in most cases. GemNet-Q performs better than GemNet-T in this setting.

GemNet-QGemNet-T
IndividualCombinedIndividualCombined
Aspirin9.710.09.59.9
Benzene0.70.50.50.6
Ethanol3.64.43.64.9
Malonaldehyde6.77.76.68.3
Naphthalene1.91.92.12.2
Salicylic acid5.34.65.55.0
Toluene2.32.22.22.5
Uracil4.14.13.84.3

Table 13.

Computational aspects. GemNet-Q is roughly two times slower than GemNet-T (see Table 14). Thanks to the efficient aggregation, GemNet with bilinear layers is as fast as with regular Hadamard products. Efficient aggregation also reduces the memory usage for regular Hadamard products by around 50 % (from 4.1GB to 2.2GB for a batch of 32 Toluene molecules). Note that GemNet has not been optimized for runtime and can likely be accelerated substantially. GemNet-Q uses 2.2M and GemNet-T 1.9M parameters, which is comparable to previous models such as DimeNet++, which uses 1.9M parameters. See App. § 18 for further details.

batch size 32batch size 4
TrainingInferenceTrainingInference
DimeNet++0.3570.0650.2830.031
NequIP (l=1l=1)0.0660.0420.0700.044
NequIP (l=1l=1–3, reflections)0.3360.2060.3270.197
GemNet-Q1.0670.3760.6280.099
GemNet-T0.3970.0880.2990.038
GemNet-dQ0.3690.2640.1060.052
GemNet-dT0.1340.0670.0650.020
Hadamard-Eff1.0770.3920.6320.103
Hadamard-NonEffOOM0.3780.6330.103

Table 14. Runtime per batch of Toluene molecules on an Nvidia GeForce GTX 1080Ti in seconds. GemNet-T is comparably fast to previous methods. Note that NequIP requires roughly 10x10x more training epochs than GemNet for convergence [4]. Using direct force predictions and only one-hop message passing significantly accelerates training and inference (GemNet-dT). Efficient aggregation allows for the usage of a bilinear layer instead of a Hadamard product at no additional cost (GemNet-Q vs. Hadamard-Eff) and enables training with higher batch sizes (Hadamard-Eff vs. Hadamard-NonEff). Note that our implementation does not focus on runtime and can likely be significantly optimized.

Direct force prediction. Directly predicting the forces accelerates training by four times on average and inference by 1.6 times on average in our experiments (see Table 14), while reducing memory consumption by roughly a factor of two. While using direct predictions instead of backpropagation increases the MAE by 44 % on COLL and by 48 % on MD17 (see Table 1 and Table 7), they actually perform better on the S2EF task on OC20. This is likely due to OC20 being orders of magnitude larger than COLL and MD17. Whether to use direct predictions thus depends on the dataset and the application’s computational requirements.

ForcesEnergy
SchNet172198
DimeNet++4047
GemNet-Q26.453
GemNet-T31.660
GemNet-dQ38.160
GemNet-dT43.155

Table 1. MAE on COLL, in meV/A˚\mathrm{meV}/\mathrm{\AA} and meV. GemNet is 34 % more accurate for forces. The higher energy error is due to its lower loss weight.

GemNet-QGemNet-TGemNet-dQGemNet-dT
Aspirin9.49.517.818.0
Benzene[9]6.36.38.58.0
Benzene[10]1.51.42.52.3
Ethanol3.83.76.46.8
Malonaldehyde6.96.711.512.5
Naphthalene2.22.45.25.9
Salicylic acid5.45.512.913.2
Toluene2.62.66.15.7
Uracil4.54.211.710.9

Table 7. MAE for direct force predictions on MD17 in meV/Å. The increased speed of direct force predictions comes at a significant cost of accuracy. Note that the direct models are still more accurate than many previous models.

Ablation studies. We investigate the proposed architectural improvements on COLL in Table 5. The proposed symmetric message passing scheme yields significant accuracy improvements, as does using a bilinear layers instead of a Hadamard product. We also see that removing any of the three interaction forms described in § 6 increases the error, showing that this combination is indeed beneficial. The proposed scaling factors also yield decent improvements, while regular layer normalization actually increases the error. Two-hop message passing yields the largest single improvement. Table 10 shows that our architectural improvements yield similar benefits for DimeNet++. Overall, the error improvements are quite evenly distributed. This suggests that GemNet’s improved performance is not due to one single change, but rather due to the full range of improvements proposed in this work.

ModelForces
without symmetric message passing28.5
Hadamard product instead of bilinear layer29.3
without atom embedding updates28.3
without one-hop message passing31.3
without two-hop message passing32.4
without scaling factors29.1
use layer norm instead (without centering)33.3
with bias27.2
GemNet-Q27.0

Table 5. Ablation studies on COLL. Force MAE in meV/Å after 500 000 training steps. All proposed components yield significant improvements.

ModelForces
DimeNet++^{++}41.1
with symmetric message passing37.5
with bilinear layer38.6
with scaling factors40.0

Table 10. Effect of adding our independent improvements to DimeNet++^{++} on force MAE for COLL in meV/Å. In this experiment we increased the basis embedding size of DimeNet++^{++} from 8 to 16 to eliminate this bottleneck. All improvements have a significant effect.

Conclusion

In this work we proved the universality for GNNs using spherical representations. We proposed geometric message passing based on these insights, and improved this scheme with symmetric message passing and efficient bilinear layers. We incorporated these improvements in the GemNet architecture, which substantially improves the error on various molecular dynamics datasets. We showed that all of the proposed enhancements yield significant performance improvements. Most of our proposed improvements are of independent interest for other molecular GNNs.

Acknowledgments and Disclosure of Funding

We would like to thank Soledad Villar for help with proving Lemma B, as well as Nicholas Gao and Aleksandar Bojchevski for their invaluable feedback and comments.

This research was supported by the Deutsche Forschungsgemeinschaft (DFG) through the Emmy Noether grant GU 1409/2-1 and the TUM International Graduate School of Science and Engineering (IGSSE), GSC 81.

Proof of th:univsphere

We prove the universal approximation theorem by showing the equivalence of TFN and our model. Complex spherical harmonics are related to Clebsch-Gordan coefficients via [51 3.7.72]

Ymi(li)(r^)Ymf(lf)(r^)=∑lo,mo(2li+1)(2lf+1)4π(2lo+1)C(lf,0),(li,0)(lo,0)C(lf,mf),(li,mi)(lo,mo)Ymo(lo)(r^).(12)Y_{m_i}^{(l_i)}(\hat{r})Y_{m_f}^{(l_f)}(\hat{r}) = \sum_{l_o,m_o} \sqrt{\frac{(2l_i+1)(2l_f+1)}{4\pi(2l_o+1)}} C_{(l_f,0),(l_i,0)}^{(l_o,0)} C_{(l_f,m_f),(l_i,m_i)}^{(l_o,m_o)}Y_{m_o}^{(l_o)}(\hat{r}). \tag*{(12)}

We now use the fact that multiplying a learnable function with a unitary matrix or a scalar does not change the resulting function space. We can therefore adapt Eq. (2) by substituting

C(lf,mf),(li,mi)(lo,mo)↦C(lf,mf,li,mi,lo,mo)=(2li+1)(2lf+1)4π(2lo+1)C(lf,0),(li,0)(lo,0)C(lf,mf),(li,mi)(lo,mo)(13)C_{(l_f,m_f),(l_i,m_i)}^{(l_o,m_o)} \mapsto C(l_f,m_f,l_i,m_i,l_o,m_o) = \sqrt{\frac{(2l_i+1)(2l_f+1)}{4\pi(2l_o+1)}} C_{(l_f,0),(l_i,0)}^{(l_o,0)} C_{(l_f,m_f),(l_i,m_i)}^{(l_o,m_o)} \tag*{(13)}

without impacting model expressivity. Since real spherical harmonics and complex (conjugate) spherical harmonics cover the same function space, we can furthermore substitute the filter with Fm′(l)(x)=R(l)(x)Ym(l)∗(x^)F_{m}^{\prime(l)}(x)=R^{(l)}(x)Y_{m}^{(l)*}(\hat{x}). Using the spherical harmonics expansion we therefore obtain

H~a′(X,H′)(r^)=∑lo,moH~amo′(lo)(X,H′)Ymo(lo)(r^)=∑lo,mo(θHamo′(lo)+∑lf,mfli,mi∑b∈NaC(lf,mf,li,mi,lo,mo)Fmf′(lf)(xba)Hbmi′(li))Ymo(lo)(r^)=θHa′(r^)+∑lf,mf,li,mi∑b∈NaFmf′(lf)(xba)Ymf(lf)(r^)Hbmi′(li)Ymi(li)(r^)=θHa′(r^)+∑b∈Na(∑lf,mfFmf′(lf)(xba)Ymf(lf)(r^))(∑li,miHbmi′(li)Ymi(li)(r^))=θHa′(r^)+∑b∈NaF′(xba,r^)Hb′(r^).(14)\begin{aligned} \widetilde{H}^{\prime}_{a}(X,H^{\prime})(\hat{r}) &= \sum_{l_o,m_o}\widetilde{H}^{\prime(l_o)}_{a m_o}(X,H^{\prime})Y_{m_o}^{(l_o)}(\hat{r}) \\ &= \sum_{l_o,m_o}\left(\theta H_{a m_o}^{\prime(l_o)}+\sum_{\substack{l_f,m_f\\l_i,m_i}}\sum_{b\in\mathcal{N}_a}C(l_f,m_f,l_i,m_i,l_o,m_o)F_{m_f}^{\prime(l_f)}(x_{ba})H_{b m_i}^{\prime(l_i)}\right)Y_{m_o}^{(l_o)}(\hat{r}) \\ &= \theta H_a^{\prime}(\hat{r})+\sum_{l_f,m_f,l_i,m_i}\sum_{b\in\mathcal{N}_a}F_{m_f}^{\prime(l_f)}(x_{ba})Y_{m_f}^{(l_f)}(\hat{r})H_{b m_i}^{\prime(l_i)}Y_{m_i}^{(l_i)}(\hat{r}) \\ &= \theta H_a^{\prime}(\hat{r})+\sum_{b\in\mathcal{N}_a}\left(\sum_{l_f,m_f}F_{m_f}^{\prime(l_f)}(x_{ba})Y_{m_f}^{(l_f)}(\hat{r})\right)\left(\sum_{l_i,m_i}H_{b m_i}^{\prime(l_i)}Y_{m_i}^{(l_i)}(\hat{r})\right) \\ &= \theta H_a^{\prime}(\hat{r})+\sum_{b\in\mathcal{N}_a}F^{\prime}(x_{ba},\hat{r})H_b^{\prime}(\hat{r}). \tag*{(14)} \end{aligned}

These functions rely on complex-valued representations, while the output and SO(3) representations are real-valued. However, we can restrict the representations to real values without changing the resulting function space. To see this, we look at the result’s real component

ℜ[H~a′(X,H′)(r^)]=θℜ[Ha′(r^)]+∑b∈Naℜ[F′(xba,r^)Hb′(r^)]=θℜ[Ha′(r^)]+∑b∈Na(ℜ[F′(xba,r^)]ℜ[Hb′(r^)]−ℑ[F′(xba,r^)]ℑ[Hb′(r^)]).(15)\begin{aligned} \Re[\widetilde{H}^{\prime}_{a}(X,H^{\prime})(\hat{r})] &= \theta\Re[H_a^{\prime}(\hat{r})]+\sum_{b\in\mathcal{N}_a}\Re[F^{\prime}(x_{ba},\hat{r})H_b^{\prime}(\hat{r})] \\ &= \theta\Re[H_a^{\prime}(\hat{r})]+\sum_{b\in\mathcal{N}_a}\left(\Re[F^{\prime}(x_{ba},\hat{r})]\Re[H_b^{\prime}(\hat{r})]-\Im[F^{\prime}(x_{ba},\hat{r})]\Im[H_b^{\prime}(\hat{r})]\right). \tag*{(15)} \end{aligned}

The function space covered by ℜ[F′(x,r^)]\Re[F^{\prime}(x,\hat{r})], and thus ℜ[H′(r^)]\Re[H^{\prime}(\hat{r})], is the same as ℑ[F′(x,r^)]\Im[F^{\prime}(x,\hat{r})], and thus ℑ[H′(r^)]\Im[H^{\prime}(\hat{r})]. We can therefore simply remove the imaginary part without changing the resulting function space, obtaining

H~asphere(X,H)(r^)=θHa(r^)+∑b∈Naℜ[F′(xba,r^)]Hb(r^)=θHa(r^)+∑b∈NaFsphere(xba,r^)Hb(r^).(16)\begin{aligned} \widetilde{H}^{\mathrm{sphere}}_a(X,H)(\hat{r}) &= \theta H_a(\hat{r})+\sum_{b\in\mathcal{N}_a}\Re[F^{\prime}(x_{ba},\hat{r})]H_b(\hat{r}) \\ &= \theta H_a(\hat{r})+\sum_{b\in\mathcal{N}_a}F_{\mathrm{sphere}}(x_{ba},\hat{r})H_b(\hat{r}). \tag*{(16)} \end{aligned}

Ffeatsphere(D)\mathcal{F}_{\mathrm{feat}}^{\mathrm{sphere}}(D) thus spans the exact same space of embedding functions as FfeatTFN(D)\mathcal{F}_{\mathrm{feat}}^{\mathrm{TFN}}(D), despite only using real functions on the S2S^2 sphere. However, we cannot span the full space of rotationally equivariant linear pooling functions, since equivariant linear functions on the S2S^2 sphere are limited to convolutions with zonal filters [21]. Fortunately, scalar pooling functions are limited to linear functions of the constant l=0l=0 part. This is equivalent to integrating over the real-space spherical representation, as done in Fpoolsphere\mathcal{F}_{\mathrm{pool}}^{\mathrm{sphere}}.

Proof of th:univvec

To prove this theorem we first introduce a proposition by Villar et al. [57].

Proposition A (Villar et al. [57]). If hh is an SO⁡(d)\operatorname{SO}(d)-equivariant function Rd×n→Rd\mathbb{R}^{d \times n} \to\mathbb{R}^{d} of nn vector inputs x1,x2,…,xnx_1, x_2, \ldots, x_n, then there are nn SO⁡(d)\operatorname{SO}(d)-invariant functions fc:Rd×n→Rf_c : \mathbb{R}^{d \times n} \to\mathbb{R} such that

h(x1,x2,…,xn)=∑c=1nf(c)(x1,x2,…,xn)xc,(17)h(x_1,x_2,\ldots,x_n) = \sum_{c=1}^{n} f^{(c)}(x_1,x_2,\ldots,x_n)x_c, \tag*{(17)}

except when x1,x2,…,xnx_1, x_2, \ldots, x_n span a (d−1)(d-1)-dimensional space. In that case, there exist O⁡(d)\operatorname{O}(d)-invariant functions fc:Rd×n→Rf_c : \mathbb{R}^{d \times n} \to\mathbb{R} such that

h(x1,x2,…,xn)=∑c=1nf(c)(x1,x2,…,xn)xc+∑S∈([n]d−1)f(S)(x1,x2,…,xn)xS,(18)h(x_1,x_2,\ldots,x_n) = \sum_{c=1}^{n} f^{(c)}(x_1,x_2,\ldots,x_n)x_c + \sum_{S \in\binom{[n]}{d-1}} f^{(S)}(x_1,x_2,\ldots,x_n)x_S, \tag*{(18)}

where [n]:={1,…,n}[n] := \{1,\ldots,n\}, ([n]d−1)\binom{[n]}{d-1} is the set of all (d−1)(d-1)-subsets of [n][n], and xSx_S is the generalized cross product of vectors xix_i with i∈Si \in S (taken in ascending order).

To extend Prop. A to our case, we need to restrict the functions to being translation-invariant and permutation-equivariant. We will only concern ourselves with the case where the vectors do not span a (d−1)(d-1)-dimensional space. We start by considering translation-invariant functions, following the proof idea of Villar et al. [57 Lemma 7].

Lemma A. Let hh be a translation-invariant and SO⁡(d)\operatorname{SO}(d)-equivariant function Rd×n→Rd\mathbb{R}^{d \times n} \to\mathbb{R}^{d} of nn vector inputs x1,x2,…,xnx_1, x_2, \ldots, x_n. Let x2−x1,…,xn−x1x_2-x_1,\ldots,x_n-x_1 not span a (d−1)(d-1)-dimensional space. Then there are n−1n-1 translation- and SO⁡(d)\operatorname{SO}(d)-invariant functions fc:Rd×n→Rf_c : \mathbb{R}^{d \times n} \to\mathbb{R} such that

h(x1,x2,…,xn)=∑c=2nf(c)(x1,x2,…,xn)(xc−x1).(19)h(x_1,x_2,\ldots,x_n) = \sum_{c=2}^{n} f^{(c)}(x_1,x_2,\ldots,x_n)(x_c-x_1). \tag*{(19)}

Proof. Consider the SO⁡(d)\operatorname{SO}(d)-equivariant function h~:Rd×(n−1)→Rd\widetilde{h} : \mathbb{R}^{d \times(n-1)} \to\mathbb{R}^{d} with

h(x1,x2,…,xn)=h(0,x2−x1,…,xn−x1)=h~(x2−x1,…,xn−x1).(20)h(x_1,x_2,\ldots,x_n) = h(0,x_2-x_1,\ldots,x_n-x_1) = \widetilde{h}(x_2-x_1,\ldots,x_n-x_1). \tag*{(20)}

Due to Prop. A we have

h~(x2−x1,…,xn−x1)=∑c=2nf~(c)(x2−x1,…,xn−x1)(xc−x1),(21)\widetilde{h}(x_2-x_1,\ldots,x_n-x_1) = \sum_{c=2}^{n} \widetilde{f}^{(c)}(x_2-x_1,\ldots,x_n-x_1)(x_c-x_1), \tag*{(21)}

with the SO⁡(d)\operatorname{SO}(d)-equivariant function f~(c)\widetilde{f}^{(c)}. If we now substitute f~(c)\widetilde{f}^{(c)} with the SO⁡(d)\operatorname{SO}(d)-equivariant and translation-invariant function f(c)f^{(c)}, i.e.

f~(c)(x2−x1,…,xn−x1)=f(c)(0,x2−x1,…,xn−x1)=f(c)(x1,x2,…,xn),(22)\widetilde{f}^{(c)}(x_2-x_1,\ldots,x_n-x_1) = f^{(c)}(0,x_2-x_1,\ldots,x_n-x_1) = f^{(c)}(x_1,x_2,\ldots,x_n), \tag*{(22)}

we obtain

h(x1,x2,…,xn)=∑c=2nf(c)(x1,x2,…,xn)(xc−x1).(23)h(x_1,x_2,\ldots,x_n) = \sum_{c=2}^{n} f^{(c)}(x_1,x_2,\ldots,x_n)(x_c-x_1). \tag*{(23)}

Next, we extend this result to permutation-equivariant functions.

Lemma B. Let hh be a translation-invariant, and permutation and SO⁡(d)\operatorname{SO}(d)-equivariant function Rd×n→Rd×n\mathbb{R}^{d \times n} \to\mathbb{R}^{d \times n} of nn vector inputs x1,x2,…,xnx_1, x_2, \ldots, x_n. Let x2−x1,…,xn−x1x_2-x_1,\ldots,x_n-x_1 not span a (d−1)(d-1)-dimensional space. Then there are n−1n-1 translation- and SO⁡(d)\operatorname{SO}(d)-invariant, and permutation-equivariant functions fc:Rd×n→Rnf_c : \mathbb{R}^{d \times n} \to\mathbb{R}^{n} such that

h(x1,x2,…,xn)=∑c=2nf(c)(x1,x2,…,xn)(xc−x1).(24)h(x_1,x_2,\ldots,x_n) = \sum_{c=2}^{n} f^{(c)}(x_1,x_2,\ldots,x_n)(x_c-x_1). \tag*{(24)}

Proof. Permutation equivariance implies that for all ss and tt (w.l.o.g. s<ts < t)

hs(…,xs,…,xt,…)=ht(…,xt,…,xs,…).(25)h_s(\ldots,x_s,\ldots,x_t,\ldots)=h_t(\ldots,x_t,\ldots,x_s,\ldots). \tag*{(25)}

Due to Lemma A we have

hs(…,xs,…,xt,…)=∑c=2nfs(c)(…,xs,…,xt,…)(xc−x1),(26)h_s(\ldots,x_s,\ldots,x_t,\ldots)=\sum_{c=2}^{n}f_s^{(c)}(\ldots,x_s,\ldots,x_t,\ldots)(x_c-x_1), \tag*{(26)}
=ht(…,xt,…,xs,…)=∑c=2nft(c)(…,xt,…,xs,…)(xc−x1),(27)=h_t(\ldots,x_t,\ldots,x_s,\ldots)=\sum_{c=2}^{n}f_t^{(c)}(\ldots,x_t,\ldots,x_s,\ldots)(x_c-x_1), \tag*{(27)}

with n−1n-1 SO(dd)- and translation-invariant functions f(c):Rd×n→Rnf^{(c)}:\mathbb{R}^{d\times n}\to\mathbb{R}^{n}. We can solve this equation by choosing

fs(c)(…,xs,…,xt,…)=ft(c)(…,xt,…,xs,…),(28)f_s^{(c)}(\ldots,x_s,\ldots,x_t,\ldots)=f_t^{(c)}(\ldots,x_t,\ldots,x_s,\ldots), \tag*{(28)}

i.e. permutation-equivariant functions f(c)f^{(c)}.

Finally, to bring Lemma B to the form presented in the theorem, we first observe that adding scalar inputs HH does not affect the proofs in this section. Second, we observe that subtracting by x1x_1 in Eq. (20) is arbitrary. To bring this more in line with GNNs we can instead subtract the input of each hah_a by xax_a. This yields

ha(X,H)=∑c=1c≠anfa(c)(X,H)(xc−xa).(29)h_a(X,H)=\sum_{\substack{c=1\\c\ne a}}^{n}f_a^{(c)}(X,H)(x_c-x_a). \tag*{(29)}

Proof of Lemma 1

Using the fact that the Wigner-D matrix is unitary, we obtain for any rotation matrix RR:

Fsphere(Rx,Rr^)=∑l,mR(l)(x)ℜ[Ym(l)∗(Rx^)Ym(l)(Rr^)]=∑l,m′,m′′,mR(l)(x)ℜ[Ym′(l)∗(x^)Dm,m′(l)∗(R)Dm,m′′(l)(R)Ym′′(l)(r^)]=∑l,m′,m′′R(l)(x)ℜ[Ym′(l)∗(x^)δm′,m′′Ym′′(l)(r^)]=∑l,m′R(l)(x)ℜ[Ym′(l)∗(x^)Ym′(l)(r^)]=Fsphere(x,r^).(30)\begin{aligned} F_{\mathrm{sphere}}(Rx,R\hat{r})=\sum_{l,m}R^{(l)}(x)\Re\left[Y_m^{(l)*}(R\hat{x})Y_m^{(l)}(R\hat{r})\right] \\ &=\sum_{l,m',m'',m}R^{(l)}(x)\Re\left[Y_{m'}^{(l)*}(\hat{x})D_{m,m'}^{(l)*}(R)D_{m,m''}^{(l)}(R)Y_{m''}^{(l)}(\hat{r})\right] \\ &=\sum_{l,m',m''}R^{(l)}(x)\Re\left[Y_{m'}^{(l)*}(\hat{x})\delta_{m',m''}Y_{m''}^{(l)}(\hat{r})\right] \\ &=\sum_{l,m'}R^{(l)}(x)\Re\left[Y_{m'}^{(l)*}(\hat{x})Y_{m'}^{(l)}(\hat{r})\right]=F_{\mathrm{sphere}}(x,\hat{r}). \tag*{(30)} \end{aligned}

Efficient message passing

For clarity we demonstrate how to optimize the summation order using the simpler one-hop message passing. For a regular Hadamard product we reorder the sums as

m(ca)i=∑b∈Na∖{c}(W(2)W(1)eCBF(xca,ϕbac))iradm(ba)i=∑b∈Na∖{c}(∑j∑l∑nWij(2)Wj(ln)(1)eCBFrad(xca)lneCBFSH(ϕbac)l)m(ba)i=∑jWij(2)∑l(∑nWj(ln)(1)eCBFrad(xca)ln)(∑b∈Na∖{c}eCBFSH(ϕbac)lm(ba)i).(31)\begin{aligned} m_{(ca)i}=\sum_{b\in\mathcal{N}_a\setminus\{c\}}\left(W^{(2)}W^{(1)}e_{\mathrm{CBF}}(x_{ca},\phi_{bac})\right)_i^{\mathrm{rad}}m_{(ba)i} \\ &=\sum_{b\in\mathcal{N}_a\setminus\{c\}}\left(\sum_j\sum_l\sum_n W_{ij}^{(2)}W_{j(ln)}^{(1)}e_{\mathrm{CBF}}^{\mathrm{rad}}(x_{ca})_{ln}e_{\mathrm{CBF}}^{\mathrm{SH}}(\phi_{bac})_l\right)m_{(ba)i} \\ &=\sum_jW_{ij}^{(2)}\sum_l\left(\sum_nW_{j(ln)}^{(1)}e_{\mathrm{CBF}}^{\mathrm{rad}}(x_{ca})_{ln}\right)\left(\sum_{b\in\mathcal{N}_a\setminus\{c\}}e_{\mathrm{CBF}}^{\mathrm{SH}}(\phi_{bac})_lm_{(ba)i}\right). \tag*{(31)} \end{aligned}

For a bilinear layer we use

m(ca)i=∑b∈Na∖{c}((W(1)eCBF(xca,φbac))TW(2)m(ba))i=∑b∈Na∖{c}∑i′∑j(∑l∑nWj(ln)(1)eCBFrad(xca)lneCBFSH(φbac)l)Wiji′(2)m(ba)i′=∑j∑i′Wiji′(2)∑l(∑nWj(ln)(1)eCBFrad(xca)ln)(∑b∈Na∖{c}eCBFSH(φbac)lm(ba)i′).(32)\begin{aligned} m_{(ca)i}=\sum_{b\in\mathcal{N}_a\setminus\{c\}}\left(\left(\mathbf{W}^{(1)}e_{\mathrm{CBF}}(x_{ca},\varphi_{bac})\right)^{T}\mathbf{W}^{(2)}m_{(ba)}\right)_i \\ &=\sum_{b\in\mathcal{N}_a\setminus\{c\}}\sum_{i'}\sum_j\left(\sum_l\sum_n W^{(1)}_{j(ln)}e_{\mathrm{CBF}}^{\mathrm{rad}}(x_{ca})_{ln}e_{\mathrm{CBF}}^{\mathrm{SH}}(\varphi_{bac})_l\right)W^{(2)}_{iji'}m_{(ba)i'} \\ &=\sum_j\sum_{i'}W^{(2)}_{iji'}\sum_l\left(\sum_n W^{(1)}_{j(ln)}e_{\mathrm{CBF}}^{\mathrm{rad}}(x_{ca})_{ln}\right)\left(\sum_{b\in\mathcal{N}_a\setminus\{c\}}e_{\mathrm{CBF}}^{\mathrm{SH}}(\varphi_{bac})_l m_{(ba)i'}\right). \tag*{(32)} \end{aligned}

Note that since W(1)\mathbf{W}^{(1)} is shared across layers we only need to calculate the sum over nn once.

Variance after message passing

The layer-wise variance after sum aggregation is

Var⁡i[∑b∈Nam(ba)i]=∑b∈NaVar⁡i[m(ba)i]+∑b∈Na∑c∈Na∖{b}Cov⁡i[m(ba)i,m(ca)i].(33)\operatorname{Var}_i\left[\sum_{b\in\mathcal{N}_a}m_{(ba)i}\right]=\sum_{b\in\mathcal{N}_a}\operatorname{Var}_i[m_{(ba)i}]+\sum_{b\in\mathcal{N}_a}\sum_{c\in\mathcal{N}_a\setminus\{b\}}\operatorname{Cov}_i[m_{(ba)i},m_{(ca)i}]. \tag*{(33)}

This variance depends on the number of neighbors in Na\mathcal{N}_a. However, we consistently found that rescaling the output depending on Na\mathcal{N}_a has negative effects on the accuracy. The likely reason for this is that atomic interactions scale roughly linearly with neighborhood size. Moreover, the covariance in Eq. (33) is not zero since all messages mbam_{ba} are transformed using the same weight matrices. We therefore best estimate this variance empirically.

For a Hadamard product-based message passing filter (and analogously for a bilinear layer) we have

Var⁡i[Fimi]=Cov⁡i[Fi2,mi2]+(Var⁡i[Fi]+Ei[Fi]2)(Var⁡i[mi]+Ei[mi]2)−(Cov⁡i[Fi,mi]+Ei[Fi]Ei[mi])2.(34)\operatorname{Var}_i[F_i m_i]=\operatorname{Cov}_i[F_i^2,m_i^2]+\left(\operatorname{Var}_i[F_i]+\mathbb{E}_i[F_i]^2\right)\left(\operatorname{Var}_i[m_i]+\mathbb{E}_i[m_i]^2\right)-\left(\operatorname{Cov}_i[F_i,m_i]+\mathbb{E}_i[F_i]\mathbb{E}_i[m_i]\right)^2. \tag*{(34)}

The main problem with this covariance is the non-zero quadratic covariance Cov⁡i[Fi2,mi2]\operatorname{Cov}_i[F_i^2,m_i^2]. We again estimate this variance empirically based on a data sample.

GemNet architecture

We use 4 stacked interaction blocks and an embedding size of 128 throughout the model. For the basis functions we choose NSHBF=NCHBF=7N_{\mathrm{SHBF}} = N_{\mathrm{CHBF}} = 7 and NSRBF=NCRBF=NRBF=6N_{\mathrm{SRBF}} = N_{\mathrm{CRBF}} = N_{\mathrm{RBF}} = 6. For the weight tensor of the bilinear layer in the interaction block we use Nbilinear,SBF=32N_{\mathrm{bilinear,SBF}} = 32 and Nbilinear,CBF=64N_{\mathrm{bilinear,CBF}} = 64. We found that sharing the first weight matrix in Eq. (11), the down projection, resulted in the same validation loss but reduced the training time by up to 15 %. The down projection size was chosen as 16 for the radial and circular basis and 32 for the spherical basis.

The full GemNet architecture

Figure 4. The full GemNet architecture. □ denotes the layer’s input, ∥ concatenation, σ a non-linearity (we use SiLU in this work [20]), and orange a layer with weights shared across interaction blocks. Differences between two-hop message passing (Q-MP) and one-hop message passing (T-MP) are denoted by dashed lines. Numbers next to connecting lines denote embedding sizes.

Training and hyperparameters

We subtract the mean energy from each molecule in MD17 to obtain a training target similar to atomization energy. We train on eV for energies and eV Å−1^{-1} for forces. As a training objective we use the weighted loss function

LMD(X,z)=(1−ρ)∣fθ(X,z)−t^(X,z)∣+ρN∑i=1N∑α=13(−∂fθ(X,z)∂xiα−F^iα(X,z))2(35)\mathcal{L}_{\mathrm{MD}}(X,z)=(1-\rho)\left|f_{\theta}(X,z)-\hat{t}(X,z)\right|+\frac{\rho}{N}\sum_{i=1}^{N}\sqrt{\sum_{\alpha=1}^{3}\left(-\frac{\partial f_{\theta}(X,z)}{\partial x_{i\alpha}}-\hat{F}_{i\alpha}(X,z)\right)^{2}} \tag*{(35)}

with force weighting factor ρ=0.999\rho=0.999. We found the selection of the batch size to be of great influence on the model’s performance for the MD17(@CCSD) dataset. Changing the batch size from 32 to 1 resulted in an approx. 25 % lower validation MAE. The learning rate of 1×10−31 \times10^{-3} and the selection of the embedding cutoff cemb=5c_{\mathrm{emb}} = 5 Å and interaction cutoff cint=10c_{\mathrm{int}} = 10 Å are rather important hyperparameters as well, see Table 8. We optimized the model using AMSGrad [50] with weight decay [40] in combination with a linear learning rate warm-up, exponential decay and decay on plateau. However, we did not apply the weight decay for the initial atom embeddings, biases and frequencies (used in the radial basis). Without weight decay the force MAE was around 3 % higher on COLL (not on OC20). Gradient clipping and early stopping on the validation loss were used as well. In addition, we divided the gradients of weights that are shared across multiple blocks by the number of blocks the weights are shared for, which resulted in a small gain in accuracy. The model weights for validation and test were obtained using an exponential moving average (EMA) with decay rate 0.999. The used hyperparameters can be found in Table 6. The combined model on revised MD17 was trained with a batch size of 10.

Hyperparameters
Interaction cutoff cintc_{\mathrm{int}}10 Å
Embedding cutoff cembc_{\mathrm{emb}}5 Å
Learning rate1×10−31 \times10^{-3}
EMA decay0.999
Weight decay2×10−62 \times10^{-6}
Decay epochs1200
Decay rate0.01
Decay factor on plateau0.5
Gradient clipping threshold10.0
Envelope exponent5
Force weighting factor ρ\rho0.999
MD17
MD17@CCSD(T)
Coll
Train set size1000
950
120 000
Val. set size1000
50
10 000
Max epochs2000
2000
400
Evaluation interval (epochs)10
10
2
Decay on plateau patience (epochs)50
50
10
Decay on plateau cooldown (epochs)50
50
10
Warm-up epochs10
10
1
Batch size1
1
32

Table 6. Model and training hyperparameters.

cembc_{\mathrm{emb}}/Åcintc_{\mathrm{int}}/ÅMAE
51027.0
5528.2
31033.4
3535.3

Table 8. Impact of the cutoff on force MAE on COLL. Results reported in meV/Å after 500 000 training steps. Increasing the interaction cutoff to 10 Å slightly reduces the error. Decreasing the embedding cutoff to 3 Å significantly increases the error.

We used a slightly adapted model for the OC20 dataset. It uses 128 Gaussian radial basis functions instead of spherical Bessel functions, which do not depend on the degree ll of the spherical harmonic. We furthermore used only three interaction blocks, an atom and edge embedding size of 512, an embedding cutoff of 6 Å, a learning rate of 5×10−45 \times10^{-4}, no weight decay, only learning rate decay on plateau with a patience of 15 000 steps and a factor of 0.8 (no warm-up or exponential decay), and a batch size of 2048.

Additional experimental results

Table 11: Force MAE for the revised MD17 dataset [11] in meV/A˚\AA. On average, GemNet outperforms FCHL19 by 52 % and even UNiTE by 5 %, which is a Δ\Delta-ML approach based on quantum mechanical features [49].

FCHL19UNiTEGemNet-QGemNet-T
Aspirin20.97.89.79.5
Benzene2.60.70.70.5
Ethanol6.24.23.63.6
Malonaldehyde10.37.16.76.6
Naphthalene6.52.41.92.1
Salicylic acid9.54.15.35.5
Toluene8.82.92.32.2
Uracil4.23.84.13.8

Table 11.

Table 12: Force MAE of different models (number of parameters in parentheses) for the MD17 dataset in meV/A˚\AA. GemNet performs worse with an embedding size of 64, but still substantially better than previous models with more parameters.

PaiNN (600k)DimeNet (1.9M)GemNet-T 64 (490k)GemNet-T (1.9M)
Aspirin14.721.611.29.5
Benzene[9]-8.1-6.3
Benzene[10]--1.11.4
Ethanol9.710.05.13.7
Malonaldehyde14.916.67.86.7
Naphthalene3.39.33.32.4
Salicylic acid8.516.26.95.5
Toluene4.19.43.32.6
Uracil6.013.15.34.2

Table 12.

Computation time

The models were trained primarily using Nvidia GeForce GTX 1080Ti GPUs. For MD17 and MD17@CCSD training the direct force prediction variants took less than two days, GemNet-Q and GemNet-T took around 6 days per molecule but with very little progress after the 100 hour mark. However, thanks to the memory efficient implementation and the low batch size used, several models were trained in parallel on a single GPU. On the COLL dataset training the direct force prediction variants took around 24 hours each. GemNet-T trained for 60 hours, while GemNet-Q took 6 days. However, after 60 hours GemNet-Q is already within 5 % of its final validation error and outperforms GemNet-T by a large margin. Note that the training time reduces dramatically when using a larger batch size, at the cost of a slightly higher MAE on MD17.

References

  1. [1]Brandon M. Anderson, Truong-Son Hy, and Risi Kondor. Cormorant: Covariant Molecular Neural Networks. In NeurIPS, 2019.arxiv.org/abs/1906.04015
  2. [2]Waiss Azizian and Marc Lelarge. Expressive Power of Invariant and Equivariant Graph Neural Networks. In ICLR, 2020.arxiv.org/abs/2006.15646
  3. [3]Albert P. Bartók, Mike C. Payne, Risi Kondor, and Gábor Csányi. Gaussian Approximation Potentials: The Accuracy of Quantum Mechanics, without the Electrons. Physical Review Letters, 104(13):136403, 2010.pubmed.ncbi.nlm.nih.gov/20481899
  4. [4]Simon Batzner, Tess E. Smidt, Lixin Sun, Jonathan P. Mailoa, Mordechai Kornbluth, Nicola Molinari, and Boris Kozinsky. SE(3)-Equivariant Graph Neural Networks for Data-Efficient and Accurate Interatomic Potentials. arXiv, 2101.03164, 2021.DOI
  5. [5]Alexander Bogatskiy, Brandon Anderson, Jan Offermann, Marwah Roussi, David Miller, and Risi Kondor. Lorentz Group Equivariant Neural Network for Particle Physics. In ICML, 2020.arxiv.org/abs/2006.04780
  6. [6]Andrew Brock, Soham De, and Samuel L. Smith. Characterizing signal propagation to close the performance gap in unnormalized ResNets. In ICLR, 2021.arxiv.org/abs/2101.08692
  7. [7]Andrew Brock, Soham De, Samuel L. Smith, and Karen Simonyan. High-Performance Large-Scale Image Recognition Without Normalization. arXiv, 2102.06171, 2021.arxiv.org/abs/2102.06171
  8. [8]Lowik Chanussot, Abhishek Das, Siddharth Goyal, Thibaut Lavril, Muhammed Shuaibi, Morgane Riviere, Kevin Tran, Javier Heras-Domingo, Caleb Ho, Weihua Hu, Aini Palizhati, Anuroop Sriram, Brandon Wood, Junwoong Yoon, Devi Parikh, C. Lawrence Zitnick, and Zachary Ulissi. Open Catalyst 2020 (OC20) Dataset and Community Challenges. ACS Catalysis, 11(10):6059–6072, 2021.DOI
  9. [9]Stefan Chmiela, Alexandre Tkatchenko, Huziel E. Sauceda, Igor Poltavsky, Kristof T. Schütt, and Klaus-Robert Müller. Machine learning of accurate energy-conserving molecular force fields. Science Advances, 3(5):e1603015, 2017.DOI
  10. [10]Stefan Chmiela, Huziel E. Sauceda, Klaus-Robert Müller, and Alexandre Tkatchenko. Towards exact molecular dynamics simulations with machine-learned force fields. Nature Communications, 9(1):1–10, 2018.
  11. [11]Anders S. Christensen and O. Anatole von Lilienfeld. On the role of gradients for machine learning of molecular energies and forces. Machine Learning: Science and Technology, 1(4):045018, 2020.arxiv.org/abs/2007.09593
  12. [12]Anders S. Christensen, Lars A. Bratholm, Felix A. Faber, and O. Anatole von Lilienfeld. FCHL revisited: Faster and more accurate quantum machine learning. The Journal of Chemical Physics, 152(4):044107, 2020.DOI
  13. [13]Taco Cohen and Max Welling. Group Equivariant Convolutional Networks. In ICML, 2016.arxiv.org/abs/1602.07576
  14. [14]Taco S. Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical CNNs. In ICLR, 2018.arxiv.org/abs/1801.10130
  15. [15]Taco S Cohen, Mario Geiger, and Maurice Weiler. A General Theory of Equivariant CNNs on Homogeneous Spaces. In NeurIPS, 2019.arxiv.org/abs/1811.02017
  16. [16]Soham De and Sam Smith. Batch Normalization Biases Residual Blocks Towards the Identity Function in Deep Networks. In NeurIPS, 2020.arxiv.org/abs/2002.10444
  17. [17]J. R. Driscoll and D. M. Healy. Computing Fourier Transforms and Convolutions on the 2-Sphere. Advances in Applied Mathematics, 15(2):202–250, 1994.
  18. [18]Nadav Dym and Haggai Maron. On the Universality of Rotation Equivariant Point Cloud Networks. In ICLR, 2021.arxiv.org/abs/2010.02449
  19. [19]Coraline Ada Ehmke. The Hippocratic License 2.1: An Ethical License for Open Source., 2020. URL https://firstdonoharm.dev.
  20. [20]Stefan Elfwing, Eiji Uchibe, and Kenji Doya. Sigmoid-weighted linear units for neural network function approximation in reinforcement learning. Neural Networks, 107:3–11, 2018.DOI
  21. [21]Carlos Esteves, Christine Allen-Blanchette, Ameesh Makadia, and Kostas Daniilidis. Learning SO(3) Equivariant Representations with Spherical CNNs. In ECCV, 2018.
  22. [22]Carlos Esteves, Ameesh Makadia, and Kostas Daniilidis. Spin-Weighted Spherical CNNs. In NeurIPS, 2020.arxiv.org/abs/2006.10731
  23. [23]Felix A. Faber, Anders S. Christensen, Bing Huang, and O. Anatole von Lilienfeld. Alchemical and structural distribution based representation for universal quantum machine learning. The Journal of Chemical Physics, 148(24):241717, 2018.DOI
  24. [24]Marc Finzi, Samuel Stanton, Pavel Izmailov, and Andrew Gordon Wilson. Generalizing Convolutional Neural Networks for Equivariance to Lie Groups on Arbitrary Continuous Data. In ICML, 2020.
  25. [25]Daniel Flam-Shepherd, Tony C. Wu, Pascal Friederich, and Alan Aspuru-Guzik. Neural Message Passing on High Order Paths. Machine Learning: Science and Technology, 2021.
  26. [26]Fabian Fuchs, Daniel Worrall, Volker Fischer, and Max Welling. SE(3)-Transformers: 3D Roto-Translation Equivariant Attention Networks. In NeurIPS, 2020.arxiv.org/abs/2006.10503
  27. [27]Vikas Garg, Stefanie Jegelka, and Tommi Jaakkola. Generalization and Representational Limits of Graph Neural Networks. In ICML, 2020.arxiv.org/abs/2002.06157
  28. [28]Johannes Gasteiger, Shankari Giri, Johannes T. Margraf, and Stephan Günnemann. Fast and Uncertainty-Aware Directional Message Passing for Non-Equilibrium Molecules. In Machine Learning for Molecules Workshop, NeurIPS, 2020.arxiv.org/abs/2011.14115
  29. [29]Johannes Gasteiger, Janek Groß, and Stephan Günnemann. Directional Message Passing for Molecular Graphs. In ICLR, 2020.arxiv.org/abs/2003.03123
  30. [30]Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural Message Passing for Quantum Chemistry. In ICML, 2017.arxiv.org/abs/1704.01212
  31. [31]Thomas A. Halgren. Merck molecular force field. I. Basis, form, scope, parameterization, and performance of MMFF94. Journal of Computational Chemistry, 17(5-6):490–519, 1996.doi.org/10.1002/(sici)1096-987x(199604)17:5/6<490::aid-jcc1>3.0.co;2-p
  32. [32]Weihua Hu, Muhammed Shuaibi, Abhishek Das, Siddharth Goyal, Anuroop Sriram, Jure Leskovec, Devi Parikh, and C. Lawrence Zitnick. ForceNet: A Graph Neural Network for Large-Scale Quantum Calculations. arXiv, 2103.01436, 2021.arxiv.org/abs/2103.01436
  33. [33]Kurt Jetter, Joachim Stöckler, and Joseph Ward. Error estimates for scattered data interpolation on spheres. Mathematics of Computation, 68(226):733–747, 1999.DOI
  34. [34]Jens Keiner, Stefan Kunis, and Daniel Potts. Efficient Reconstruction of Functions on the Sphere from Scattered Data. Journal of Fourier Analysis and Applications, 13(4):435–458, 2007.
  35. [35]Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In NeurIPS, 2017.arxiv.org/abs/1706.02515
  36. [36]Risi Kondor, Zhen Lin, and Shubhendu Trivedi. Clebsch-Gordan Nets: a Fully Fourier Space Spherical Convolutional Neural Network. In NeurIPS, 2018.arxiv.org/abs/1806.09231
  37. [37]Risi Kondor, Truong Son Hy, Horace Pan, Brandon M. Anderson, and Shubhendu Trivedi. Covariant Compositional Networks For Learning Graphs. In International Workshop on Mining and Learning with Graphs (MLG), KDD, 2019.arxiv.org/abs/1801.02144
  38. [38]Peter J. Kostelec and Daniel N. Rockmore. FFTs on the Rotation Group. Journal of Fourier Analysis and Applications, 14(2):145–179, 2008.DOI
  39. [39]Yi Liu, Limei Wang, Meng Liu, Xuan Zhang, Bora Oztekin, and Shuiwang Ji. Spherical Message Passing for 3D Graph Networks. arXiv, 2102.05013, 2021.arxiv.org/abs/2102.05013
  40. [40]Ilya Loshchilov and Frank Hutter. Decoupled Weight Decay Regularization. In ICLR, 2018.arxiv.org/abs/1711.05101
  41. [41]Ping Luo, Xinjiang Wang, Wenqi Shao, and Zhanglin Peng. Towards Understanding Regularization in Batch Normalization. In ICLR, 2019.arxiv.org/abs/1809.00846
  42. [42]Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably Powerful Graph Networks. In NeurIPS, 2019.arxiv.org/abs/1905.11136
  43. [43]Haggai Maron, Ethan Fetaya, Nimrod Segol, and Yaron Lipman. On the Universality of Invariant Networks. In ICML, 2019.arxiv.org/abs/1901.09342
  44. [44]Haggai Maron, Or Litany, Gal Chechik, and Ethan Fetaya. On Learning Sets of Symmetric Elements. In ICML, 2020.arxiv.org/abs/2002.08599
  45. [45]Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Ian Eric Lessen, Gaurav Rattan, and Martin Grohe. Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks. In AAAI, 2019.arxiv.org/abs/1810.02244
  46. [46]Christopher Morris, Gaurav Rattan, and Petra Mutzel. Weisfeiler and Leman go sparse: Towards scalable higher-order graph embeddings. In NeurIPS, 2020.arxiv.org/abs/1904.01543
  47. [47]Cheol Woo Park, Mordechai Kornbluth, Jonathan Vandermouse, Chris Wolverton, Boris Kozinsky, and Jonathan P. Mailoa. Accurate and scalable graph neural network force field and molecular dynamics with direct force architecture. npj Computational Materials, 7(1):1–9, 2021.DOI
  48. [48]Zhuoran Qiao, Matthew Welborn, Animashree Anandkumar, Frederick R. Manby, and Thomas F. Miller. OrbNet: Deep learning for quantum chemistry using symmetry-adapted atomic-orbital features. The Journal of Chemical Physics, 153(12):124111, 2020.DOI
  49. [49]Zhuoran Qiao, Anders S. Christensen, Matthew Welborn, Frederick R. Manby, Anima Anandkumar, and Thomas F. Miller III. UNITE: Unitary N-body Tensor Equivariant Network with Applications to Quantum Chemistry. arXiv, 2105.14655, 2021.
  50. [50]Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the Convergence of Adam and Beyond. In ICLR, 2018.arxiv.org/abs/1904.09237
  51. [51]J. J. Sakurai and San Fu Tuan. Modern Quantum Mechanics. Revised, subsequent edition edition, 1993.
  52. [52]Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization? In NeurIPS, 2018.arxiv.org/abs/1805.11604
  53. [53]Kristof Schütt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Stefan Chmiela, Alexandre Tkatchenko, and Klaus-Robert Müller. SchNet: A continuous-filter convolutional neural network for modeling quantum interactions. In NeurIPS, 2017.
  54. [54]Kristof T. Schütt, Oliver T. Unke, and Michael Gastegger. Equivariant message passing for the prediction of tensorial properties and molecular spectra. In ICML, 2021.arxiv.org/abs/2102.03150
  55. [55]Muhammed Shuaibi, Adeesh Kolluru, Abhishek Das, Aditya Grover, Anuroop Sriram, Zachary Ulissi, and C. Lawrence Zitnick. Rotation Invariant Graph Neural Networks using Spin Convolutions. arXiv, 2106.09575, 2021.arxiv.org/abs/2106.09575
  56. [56]Nathaniel Thomas, Tess Smidt, Steven M. Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor Field Networks: Rotation- and Translation-Equivariant Neural Networks for 3D Point Clouds. arXiv, 1802.08219, 2018.arxiv.org/abs/1802.08219
  57. [57]Soledad Villar, David W. Hogg, Kate Storey-Fisher, Weichi Yao, and Ben Blum-Smith. Scalars are universal: Equivariant machine learning, structured like classical physics. In NeurIPS, 2021.arxiv.org/abs/2106.06610
  58. [58]Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco Cohen. 3D Steerable CNNs: Learning Rotationally Equivariant Features in Volumetric Data. In NeurIPS, 2018.arxiv.org/abs/1807.02547
  59. [59]Wenxuan Wu, Zhongang Qi, and Li Fuxin. PointConv: Deep Convolutional Networks on 3D Point Clouds. In CVPR, 2019.arxiv.org/abs/1811.07246
  60. [60]Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In ICLR, 2019.arxiv.org/abs/1810.00826
  61. [61]Dmitry Yarotsky. Universal Approximations of Invariant Maps by Neural Networks. Constructive Approximation, 2021.arxiv.org/abs/1804.10306

Paper details

vlnc:W_jj7u88tg
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents