Year: 2021

Abstract:
Straight-forward conformation generation models, which generate 3-D structures directly from input molecular graphs, play an important role in various molecular tasks with machine learning, such as 3D-QSAR and virtual screening in drug design. However, existing loss functions in these models either cost overmuch time or fail to guarantee the equivalence during optimization, which means treating different items unfairly, resulting in poor local geometry in generated conformation. So, we propose Equivalent Distance Geometry Error (EDGE) to calculate the differential discrepancy between conformations where the essential factors of three kinds in conformation geometry (i.e. bond lengths, bond angles and dihedral angles) are equivalently optimized with certain weights. And in the improved version of our method, the optimization features minimizing linear transformations of atom-pair distances within 3-hop. Extensive experiments show that, compared with existing loss functions, EDGE performs effectively and efficiently in two tasks under the same backbones.

heading: 1 INTRODUCTION
text: Small organic molecules, conventionally a chemical or biomedical topic, are now being widely studied by artificial intelligence researchers. Based on prior natural science knowledge, machine learning models aid in multiple tasks on molecules including 3-D Quantitative Structure-Activity Relationship (QSAR) analysis, virtual screening for drug discovery, and protein-ligand binding analysis. Before any real industrial applications, molecular conformation generation draws particular concern. The task is also challenging as (1) conformation contains the 3-D geometry which can be translated or rotated, making it complicated to compare the generated one with ground-truth; (2) the number of molecules found in nature presents combination explosive growth, so the procedure of generating conformations is supposed to be fast enough for applicability.
In the past few years, different machine learning models have been proposed to handle the molecular conformation generation task. Generally, the molecules are featurized into token sequences (e.g. SMILES (Weininger, 1988)) or 2-D molecular graphs 1 (Gilmer et al., 2017) to feed the neural networks, while the way to obtain conformations is optional: (1) Straight-forward methods directly generate the 3-D coordinates of atoms from the inputs; (2) Step-wise methods first predict distances between atom pairs and then rebuild the conformations from the distances either via discrete algorithms (e.g. EDG (Havel, 1998)) or bi-level (Xu et al., 2021). As the expense of avoiding the troublesome comparison between conformations, step-wise methods usually adopt more complex architectures and endure relatively expensive time and space costs. Therefore, based on its innate advantage of high efficiency, Straight-forward methods require powerful assistance to perform equally great as step-wise ones. And a well-designed loss function can be helpful.
In recent studies, the simplest way to compare the conformations is to represent the conformations with atom position matrices R(G) ∈ Rn×3 and calculate their Root-Mean-Squared Deviations (RMSD). Since conformation is invariant to spatial permutations (e.g. translation and rotation), a universal approach is to first find an optimal alignment. As an instance, Kabsch algorithm (Kabsch, 1976) provides a differentiable method to align two given conformations. We referred to the socalculated RMSD as Kabsch-RMSD. However, using Kabsch-RMSD as the loss of neural networks
1The atoms and bonds inside the molecule form the vertexes and edges respectively.
is neither efficient nor effective: it needs to calculate the rotation matrix for every single conformation, which stifles batch processing and increases time cost; meanwhile, the rotation matrix is vulnerable to misplaced atoms and poorly-predicted regions (Mariani et al., 2013), so the RMSD between aligned and reference conformation cannot correctly reflect molecular similarity when input conformations are less likely.
To further improve the applicability of loss function on molecular conformation comparing, Distance Geometry (DG) is proposed to encode a conformation into a vector of distances among the atoms, where the comparison is applied. The main idea of DG is to indirectly optimize bond lengths D, bond angles Φ and dihedral angles2 Ψ by optimizing the distances among 1-hop, 2-hop and more distant neighbors respectively in the molecular graph. However, when balancing time and effects, traditional distance geometry methods are faced with a dilemma: (1) If too many distant neighbors in the graph are considered, the loss calculation will be time-consuming. (2) If only close atompairs (e.g. 3-hop at most) are considered, the factors in the geometry will be treated unfairly. Based on the theoretical and experimental demonstration in Appendix B.1, the gradient allocated on bond angles Φ and dihedral angles Ψ will become much smaller than that on bond lengths D when optimizing atom-pair distances, resulting in contorted angles and poor local geometry. Therefore, the equivalence in optimizing different factors should be stressed in the comparison.
To push the boundary of efficient and effective loss function for molecular conformation generation, we propose Equivalent Distance Geometry Error (EDGE). Firstly, EDGE exploits the essential factors inside the conformation geometry, including a series of bond lengths D, bond angles Φ and dihedral angles Ψ. Then the factors are jointly optimized with certain weights to guarantee that they are fairly treated. To avoid the high complexity of directly calculating the angles, we introduce Taylor Expansion to our method to approximate the angles with linear transformations of atom-pair distances within 3-hop. Extensive experiments prove that the improved version of EDGE performs as fast as optimizing 1/2/3-hop atom-pair distances and achieves better performance than existing popular loss functions on conformation comparison when applied to straight-forward backbones.
To conclude, our main contributions are threefold:
• We propose a novel loss function, EDGE, for straight-forward models on molecular conformation generation, which optimizes the essential factors in the conformation geometry equivalently, realizing high consistency of generation.
• To avoid the high complexity and gradient explosion caused by direct calculation of angles, we introduce Taylor Expansion and Multiplier Truncation which achieves efficient model optimization with improved EDGE and guarantees its applicability.
• We conduct comprehensive experiments on several recently proposed benchmarks, including QM9(Wu et al., 2018), GEOM-QM9 and GEOM-Drugs(Axelrod & GómezBombarelli, 2020). The outstanding performance on different metrics shows that EDGE is powerful on both definite conformation prediction and multiple conformation generation tasks, compared with existing loss functions. Besides, EDGE’s efficiency is guaranteed via theoretical analysis and empirical test.

heading: 2 PROPOSED METHOD

heading: 2.1 PRELIMINARIES
text: Notations In the statements and equations below, we use italic letters for scalars and indices, bold lower-case letters for (column) vectors, bold upper-case letters for matrices, calligraphic letters for sets, and normal letters for annotations. Given a certain molecule, M = (V, E , n,m,Xv, Xe) is the corresponding molecular graph. Here, V is the set of all n atoms, E ⊂ V × V is the set of all m chemical bonds, Xv = (xv1, ..., x v n) > ∈ Rn×dv is the matrix of atomic features, and Xe = (xe1, ..., x e m) > ∈ Rm×de that of bond features. G is the geometry of its conformation and R(G) is the matrix of atom positions. d(u, v;M) is the graph distance between atom u, v inM and d(u, v;G) is their Euclidean distance in G. A conformation geometry G has three types of factors D(G),Φ(G),Ψ(G), which refer to the set of bond length d, bond angle φ and dihedral angle ψ
2Dihedral angle is referred as torsion angle in some works.
respectively. For operators, ⊕ is the operator of concatenations and ‖ · ‖ denotes the l2 norm of the input vector.
Problem Definition We consider following straight-forward molecular conformation generation process: the models input a molecular graphM and output a molecular conformation R(G). Our task is to find an efficient and effective loss function to calculate the differential discrepancy between generated and reference conformation G, Ĝ, which can be utilized to optimize the models backwardly.

heading: 2.2 EQUIVALENCE IN MOLECULAR GEOMETRY
text: When applied to straight-forward backbones on molecular conformation generation, existing DGbased loss functions such as Conn-k (Yang et al., 2021) can’t fairly distribute the gradient to different factors D(G), Φ(G) and Ψ(G) in the conformation during optimization, resulting in contorted geometry. Simply calculating the average error between the generated D(G),Φ(G),Ψ(G) and the reference ones has the same deficiency, because the three types of factors are in different dimensions and equivalence can hardly be guaranteed while training the model. To fairly treat all the factors, it is necessary to jointly optimize them with certain weights which are determined by their corresponding degrees of freedom and value distributions in the dataset.
Degree of Freedom Consider a 3-D molecular geometry G of a molecule with n atoms, it has fG = 3n−6 degree of freedom due to the existence of rotation and translation (Simm & HernandezLobato, 2020). It means that a geometry can be just recovered from a certain combination of bond lengths, bond angles and dihedral angles with a total number 3n−6. Note that three types of factors occupy fD, fΦ, fΨ degrees of freedom out of fG respectively, and we have3:
fG = fD + fΦ + fΨ = 3n− 6 (1)
To completely perceive the local structure of molecular geometries, the number of bond lengths, bond angles and dihedral angles sampled in the geometry (i.e. f̂D, f̂Φ, f̂Ψ) may exceed their exact degrees of freedom fD, fΦ, fΨ during optimization. So we need to balance them through a simple proportion (e.g. fD/f̂D for bond lengths D).
Value Distribution When jointly optimizing bond lengths D, bond angles Φ and torsion angles Ψ, which are in different dimensions, it can hardly achieve equivalence to manually give hyperparameters to balance the gradients. Therefore, we rescale D,Φ,Ψ with the reciprocals of their deviations σD, σΦ, σΨ respectively to uniformly approximate a Gaussian distribution with σ = 1.
3The calculation of degrees of freedom for each kind of factors can be found in Appendix C.1.

heading: 2.3 OUR METHOD: EQUIVALENT DISTANCE GEOMETRY ERROR
text: We propose Equivalent Distance Geometry Error (EDGE) as a loss function for straight-forward methods of molecular conformation generation. As illustrated in Fig.1, EDGE calculates the discrepancy between generated conformation G and reference conformation Ĝ following4:
L(G, Ĝ) = λ2D ∑ d∈D(G) d̂∈D(Ĝ) (d− d̂)2 + λ2Φ ∑ φ∈Φ(G) φ̂∈Φ(Ĝ) (φ− φ̂)2 + λ2Ψ ∑ ψ∈Ψ(G) ψ̂∈Ψ(Ĝ) (ψ − ψ̂)2
where λD = fD
f̂D
1
σD λΦ =
fΦ
f̂Φ
1
σΦ λΨ =
fΨ
f̂Ψ
1
σΨ
(2)
To be more efficient, we can encode a molecular conformation into a vector z:
zD = [λDd|d ∈ D(G)] zΦ = [λΦφ|φ ∈ Φ(G)] zΨ = [λΨψ|ψ ∈ Ψ(G)] z = zD ⊕ zΦ ⊕ zΨ
(3)
Then Eq.2 can be represented as the discrepancy between two encodings of conformation, which achieves fast comparison among multiple conformations:
L(G, Ĝ) = ‖z − ẑ‖2 (4)
(a)
Calculation of D For a conformation G, we first calculate the distance matrix D: Di,j = ‖R(G)i −R(G)j‖2 (5) where R(G)i ∈ R3 is the 3-D position of i-th atom in G. Then the value of sampled bond lengths D can be found in D.
Calculation of Φ For a certain bond angle φ determined by three atoms in G, a, b are the lengths of its two sides and c is the length of the side opposite it, which is shown in Fig.2(a). As a, b, c can be found in D, the value of φ can be calculated through the cosine theorem as
φ = arccos a2 + b2 − c2
2ab (6)
Calculation of Ψ For a certain dihedral angle ψ determined by four sequentially-connected atoms in G, a, b, c are the lengths of the sides in the atom chain and d, e, f are 2/3-hop distances among the atoms, which is shown in Fig.2(b). Following Euler’s formula in the tetrahedron, we have5:
ψ = arcsin
√ 4a2b2e2 − b2t22 − a2r22 − e2t21 + r2t1t2
4a2b2c2 − a2r21 (7)

heading: 2.4 IMPROVEMENT

heading: 2.4.1 DEFICIENCY OF ORIGINAL EDGE
text: High Complexity Although obtaining the exact value of d, d̂ in D(G),D(Ĝ) is straightforward, calculating and optimizing the factors Φ(G) and Ψ(G) will bring high computational complexity due to the existence of complicated operations like inverse trigonometric functions.
Gradient Explosion When φ → π or ψ → 0, π/2, the derivative of inverse trigonometric functions in Eq.6,7 reaches∞. Even if we introduce Taylor Expansion to the calculation of each factor’s error, which will be shown in 2.4.2, the same situation occurs when calculating the partial derivatives. So, gradient explosion is also a considerable problem during the optimization with EDGE.
4The calculation of the weights for different datasets can be found in Appendix C. 5In Eq. 7, r1 = b2 + c2 − e2, r2 = b2 − c2 + e2, t1 = a2 + b2 − d2, t2 = a2 + e2 − f2. And details of
the calculation of ψ are available in Appendix A.1.

heading: 2.4.2 TAYLOR EXPANSION
text: To solve the problem of high computational complexity and make calculation in Eq.2 efficient, we utilize Taylor Expansion to approximate the errors of bond angles Φ and dihedral angles Ψ with a linear transformation of atom-pair distances in D from Eq.5.
For each factor-pair φ and φ̂ in Φ(G) and Φ(Ĝ), considering the bond lengths â, b̂, ĉ in Ĝ which generate φ̂ in the way mentioned above, they have the corresponding bond lengths a, b, c in G. We can compose the vectors û = (â, b̂, ĉ)> and u = (a, b, c)> with them respectively. Like Eq. 6, φ can be taken as a function w.r.t u. So, we can apply multivariate Taylor expansion to φ− φ̂:
φ− φ̂ = ( ∂φ ∂u |u=û)>(u− û)
where u− û→0 and ∂φ ∂u = ( ∂φ ∂a , ∂φ ∂b , ∂φ ∂c )>
(8)
Similarly, for each factor-pair ψ and ψ̂ in Ψ(G) and Ψ(Ĝ), we can get the vectors v̂ = (â, b̂, ĉ, d̂, ê, f̂)> and v = (a, b, c, d, e, f)>. Like Eq. 7, ψ can be taken as a function w.r.t v. So we can apply multivariate Taylor expansion to ψ − ψ̂:
ψ − ψ̂ = (∂ψ ∂v |v=v̂)>(v − v̂)
where v − v̂ → 0 and ∂ψ ∂v = ( ∂ψ ∂a , ∂ψ ∂b , ∂ψ ∂c , ∂ψ ∂d , ∂ψ ∂e , ∂ψ ∂f )>
(9)
As the generated conformation G is changeable while reference conformation Ĝ is fixed during training, the partial derivatives ∂φ∂u |u=û, ∂ψ ∂v |v=v̂ , which is invariant to Ĝ, can be obtained in data processing6. Therefore, the discrepancy of bond angles and dihedral angles in Eq.2 can be replaced with Eq.8,9, which are simply linear transformations of atom-pair distances. Besides, the atom-pairs considered here is at most 3-hop connected, so the number of variables in linear transformation (i.e. atom-pair distances) is in the same order of magnitude with atom count n (see Appendix B.2). So, the problem of high complexity of EDGE is resolved by Taylor Expansion.

heading: 2.4.3 MULTIPLIER TRUNCATION
text: Taylor Expansion solves the problem of high computational complexity, but gradient explosion still exists. Here, we apply Multiplier Truncation strategy to truncate the partial derivatives to finite values. Instead of limiting the final values, the problematic multipliers hidden in the formulas are found and then truncated to prevent gradient explosion, while the useful parts in the values are mostly preserved.
For φ w.r.t. u, we have: ∂φ
∂u =
∂φ
∂ cosφ
∂ cosφ ∂u = − 1 sinφ ∂ cosφ ∂u (10)
When φ→ π, 1sinφ →∞. As stable values can always be acquired by multiplier ∂ cosφ ∂u , 1 sinφ is the cause of gradient explosion in Eq.10. Here, we truncate − 1sinφ to [−10,−1] from (−∞,−1].
Similarly, for ψ w.r.t. v, we have:
∂ψ ∂v = ∂ψ ∂ sin2 ψ
∂ sin2 ψ
∂v =
1
2 sinψ cosψ
∂ sin2 ψ
∂v (11)
When ψ → 0 or π/2, 12 sinψ cosψ →∞, so we truncate 1 2 sinψ cosψ to [1, 10] from [1,∞). Moreover, inside the multiplier ∂ sin
2 ψ ∂v , the value of a denominator 4b
2c2− (b2 + c2− e2)2 will tend to 0 when e = b+ c (i.e. the bond angle between b, c is π), resulting in that the elements in the vector reaches ∞ and triggers explosion. To avoid this, we truncate 4b2c2−(b2 +c2−e2)2 to [10,∞) from [0,∞).
6Detailed formulas of the partial derivatives in Eq.8,9 are available in Appendix A.2.
The improved version of EDGE with Taylor Expansion and Multiplier Truncation resolves the previous deficiency and achieves time-friendly model training with equally powerful performance in the experiment.

heading: 3 EXPERIMENT

heading: 3.1 EXPERIMENT SETUP

heading: 3.1.1 TASKS
text: We evaluate our loss function on two molecular conformation tasks: definite conformation prediction and multiple conformation generation.
Definite conformation prediction aims to predict the optimal conformation for each molecule. Here, we use a popular dataset QM9 (Wu et al., 2018), which contains the conformations of about 133k molecules. These reference conformations are generated through Density Functional Theory (DFT), making sure that they are in a relatively stable status. The backbone model where we apply the loss functions is PhysNet (Yang et al., 2021), a learnable force field designed to optimize the molecular conformations. To show the performance of the loss functions on various aspects, they are evaluated on following metrics:
• D RMSE, Φ RMSE and Ψ RMSE: the root-mean-squared error on the bond lengths, bond angles and dihedral angles sampled from molecular graphs, respectively.
• A-RMSD (Mansimov et al., 2019): the root-mean-squared derivation between reference conformation Ĝ and generated conformation G after applying alignment function A7, i.e.
A-RMSD(G, Ĝ) = RMSD(A(R(G),R(Ĝ)),R(Ĝ)) (12) where A is the alignment function.
• lDDT-Score (Mariani et al., 2013): Compute over all pairs of atoms in the reference structure at a distance closer than 15Å, and the distances in generated conformations are considered preserved if they are within a tolerance threshold compared to reference ones. lDDTScore is the average fraction of preserved distances over thresholds 0.5Å, 1Å, 2Å and 4Å, i.e.
lDDT-Score(G, Ĝ) = 1 4 ∑ r∈{0.5,1,2,4} average u,v∈V∧d(u,v;Ĝ)<15 1(|d(u, v;G)− d(u, v; Ĝ)| < r)
(13)
Multiple conformation generation aims to generate realistic and diverse conformations for a molecule. Here, we use the recent proposed GEOM-QM9 and GEOM-Drugs (Axelrod & GómezBombarelli, 2020), both of which contain multiple conformations for each molecule. Following the settings from Xu et al. (2021), we sampled 50,000 molecule-conformation pairs as training set and another 17813 pairs covering 150 molecules as test set from GEOM-QM9. As for GEOM-Drugs, we sampled 50,000 molecule-conformation pairs as training set and another 9161 pairs covering 100 molecules as test set. The backbone models selected to handle conformation generation are PhysNet and CVGAE (Mansimov et al., 2019), an auto-encoder designed for generating molecular conformations. Following metrics are used to evaluate the performance of loss functions:
• COV-δ (Xu et al., 2021): the fraction of conformations in reference set Sr covered by at least one conformation in generated set Sg within a RMSD threshold δ after alignment, i.e.
COV(Sg,Sr) = 1 |Sr| ∣∣{Ĝ ∈ Sr|A-RMSD(G, Ĝ) < δ, ∃G ∈ Sg}∣∣ (14)
• MAT (Xu et al., 2021): the average RMSD over conformations in reference set Sr, each of which is compared with the most similar conformation in generated set Sg after alignment, i.e.
MAT(Sg,Sr) = 1 |Sr| ∑ Ĝ∈Sr min G∈Sg A-RMSD(G, Ĝ) (15)
7The alignment function is AlignMol from RDKit package v1.6.1.
• Multi-lDDT-Score (Mariani et al., 2013): the average lDDT-Score between each conformation in reference set Sr and the conformation in generated set Sg with highest lDDTScore compared to the former, i.e.
Multi-lDDT-Score(Sg,Sr) = 1 |Sr| ∑ Ĝ∈Sr max G∈Sg lDDT-Score(G, Ĝ) (16)

heading: 3.1.2 BASELINES
text: We compare EDGE with its variants and multiple loss functions for molecular conformation comparison as listed below:
• Naive RMSD: root-mean-squared error of the atom positions, i.e. RMSD(R(G),R(Ĝ)) • Kabsch RMSD (Li et al., 2021): root-mean-squared error of the atom positions after align-
ing the conformations using Kabsch algorithm, i.e. RMSD(Kabsch(R(G),R(Ĝ)),R(Ĝ)) • lDDT-γ (Mariani et al., 2013): root-mean-squared error of atom-pair distances whose val-
ues are less than γ in reference conformation, i.e. RMSE u,v∈V∧d(u,v;Ĝ)<γ (d(u, v;G), d(u, v; Ĝ))
• Conn-k (Yang et al., 2021): root-mean-squared error of distances of k-hop connected atompairs, i.e. RMSE
u,v∈V∧d(u,v;M̂)<k (d(u, v;G), d(u, v; Ĝ))
• EDGE-w/o f : an invariant of EDGE, where degree of freedom is not considered when calculating hyper-parameters λD, λΦ, λΨ.
• EDGE-w/o σ: an invariant of EDGE, where value distribution is not considered when calculating hyper-parameters λD, λΦ, λΨ.
• EDGE: our loss function.
To further reflect how the loss function improves the performance, we also consider following baselines which are simply conformation generation strategies rather than learning models:
• RDKit: directly using the conformation generated by RDKit without further training.
• Random Guess: sampling the atom positions from the standard Gaussian distribution and constructing a conformation.

heading: 3.1.3 DETAILS OF IMPLEMENTATION
text: For PhysNet(RDKit initialized), we use RDKit (package version 1.6.1) to generate an initial conformation and then refine it with a PhysNet Block. The number and duration of time-step are 5 and 0.2 respectively. The hyper-parameter setup inside PhysNet follows Yang et al. (2021).
For CVGAE, we follow the settings of a UFF-free version from Mansimov et al. (2019), to show that EDGE can also perform better on generative backbones where derivative fine-tuning with force field is not considered.
The value of hyper-parameters λD, λφ, λψ is calculated through sampling the degrees of freedom and standard deviation of D,φ, ψ from the train set of datasets QM9, GEOM-QM9 and GEOMDrugs. The explicit process and the results of calculation can be found in Appendix C.2.
When optimizing the backbones, we set learning rate to 2e-6 for PhysNet and 5e-5 for CVGAE, and learning rate decay is 0.95. We train all the models for 100 epochs on the train set.

heading: 3.2 RESULT
text: The result on three datasets and two backbones is listed in Tab.1, 2 and 3. More tables are presented in Appendix C.3.
As for efficiency, EDGE can optimize the molecular conformations as efficiently as Naive RMSD and Conn-3, and it’s much faster than distance geometry methods considering distant atom-pairs
(Conn-∞ and lDDT-5) and traditional RMSD with a time-consuming alignment algorithm (Kabsch RMSD). This is proved empirically in all three groups of experiments in the tables.
For Definite Conformation Prediction on QM9 (Tab.1), EDGE has the best performance on ARMSD and lDDT-Score, two universal metrics to compare the conformations from a global view. To further demonstrate that EDGE outperforms the baselines through equivalently optimizing the bond lengths D, bond angles Φ and dihedral angles Ψ, we evaluate their RMSE on the three factors. Compared to traditional DG-based methods (Conn-k and lDDT-γ), EDGE better retains the dihedral angles, which is significant in preserving complicated local structures like atom chains (see Sec.3.3). Moreover, EDGE’s variants (w/o f and w/o σ) break the balance on degrees of freedom or
value distribution and lose the equivalence on D,Φ,Ψ, so they obtain much worse results. In summary, EDGE treats D,Φ,Ψ equivalently, so it can avoid contorted local geometries and optimize the conformation more effectively.
The result of Multiple Conformation Generation shows that EDGE can also assist optimization in the generative conformation task and still has better performance compared to traditional Kabsch RMSD and DG-based Conn-3. Moreover, EDGE is adaptive to multiple types of backbones, no matter it’s generative (CVGAE) or derivative (PhysNet).
In Tab.1,2 where the conformations are fine-tuned from RDKit-initialized ones, Kabsch RMSD and traditional DG-based methods may end up with results worse than RDKit in optimization. The main cause is that they can’t measure the accurate discrepancy among the conformations, and the backbone falls into a solution which is optimal for the given loss function but suboptimal for universal metrics e.g. A-RMSD. Contrastively, EDGE finds out the essential factors in the conformation geometry and treats them equivalently when calculating the discrepancy, achieving a better performance.

heading: 3.3 VISUALIZATION
text: We visualize the conformations generated by PhysNet under multiple loss functions on dataset QM9 and compare them with RDKit-initialized conformations and reference ones, as it shows in Fig.3. Kabsch RMSD and Conn-3 retain appropriate bond lengths and bond angles while the atom chains inside are severely contorted because dihedral angles are significant in preserving local geometries, especially the atom chains in molecules (Winter et al., 2021). Contrastively, EDGE equivalently optimizes the essential factors in conformation geometry and focuses more on the angles. Therefore, PhysNet leveraged by EDGE produces conformations with better-structured atom chains as well as fine atom rings and achieves better performance.

heading: 4 CONCLUSION AND FUTURE WORK
text: We analyze the shortcomings of existing methods on measuring conformation discrepancy e.g. comparing the atom positions or atom-pair distances. Then we propose EDGE, which can find the essential factors in conformation geometry (i.e. bond lengths, bond angles and dihedral angles) and treat them equivalently by balancing the degrees of freedom as well as standard deviations. Theoretical analysis and extensive experiments demonstrate EDGE’s efficiency and effectiveness when being applied to diverse backbone models. For future work, with the assistance of EDGE, the end-to-end conformation generation models are prevented from being misled by time-consuming or ineffective optimization strategies, and thus more well-designed models can be proposed and improved to handle various tasks on molecular conformation.

heading: A DETAILS OF EDGE
text: A.1 THE FORMULA OF ψ
For a certain dihedral angle ψ determined by four sequentially-connected atoms in G which is shown in Fig.2(b), we want to calculate the value of it using a, b, c, d, e, f , which are sides’ lengths of the tetrahedron generated by the four atoms. Supposing that α is the angle between b and c, the volume of the tetrahedron V can be calculated following
V = 1
3 Sh =
1 3 · 1 2 bc sinα · a sinψ = abc sinα sinψ 6 (17)
Using Euler’s formula in the tetrahedron, V can also be calculated following
V = 1
6 ∣∣∣∣∣∣∣ b2 b 2+e2−c2 2 a2+b2−d2 2 b2+e2−c2 2 e 2 a 2+e2−f2 2 a2+b2−d2
2 a2+e2−f2 2 a 2
∣∣∣∣∣∣∣ 1 2
(18)
Note that
sinα = √ 1− cos2 α = √ 1− (b 2 + c2 − e2
2bc )2 (19)
Combining Eq.17,18 and 19, we can get the formula of ψ:
ψ = arcsin
√ 4a2b2e2 − b2t22 − a2r22 − e2t21 + r2t1t2
4a2b2c2 − a2r21 (20)
where
r1 = b 2 + c2 − e2 r2 = b2 − c2 + e2
t1 = a 2 + b2 − d2 t2 = a2 + e2 − f2
(21)
A.2 PARTIAL DERIVATIVES IN TAYLOR EXPANSION
A.2.1 φ
For each φ in Φ(G), considering the bond lengths a, b, c in G which generate φ following 2(a), we can compose the vectors u = (a, b, c)> with them. Note that φ can be taken as a function w.r.t u:
φ = φ(u) = arccos a2 + b2 − c2
2ab (22)
To implement Taylor Expansion, we need to calculate
∂φ ∂u = ( ∂φ ∂a , ∂φ ∂b , ∂φ ∂c )> (23)
Following Eq.22, we can get the elements in Eq.23, which are the partial derivatives w.r.t. each variable:
∂φ ∂a = −a2 + b2 − c2 2a2b sinφ
∂φ ∂b = a2 − b2 − c2 2ab2 sinφ
∂φ ∂c =
c
ab sinφ
(24)
A.2.2 ψ
For each ψ in Ψ(G), considering the bond lengths a, b, c, d, e, f in G which generate φ following 2(b), we can compose the vectors v = (a, b, c, d, e, f)> with them. Note that ψ can be also taken as a function ψ(v) following Eq.20. To implement Taylor Expansion, we need to calculate
∂ψ ∂v = ( ∂ψ ∂a , ∂ψ ∂b , ∂ψ ∂c , ∂ψ ∂d , ∂ψ ∂e , ∂ψ ∂f )> (25)
Following ψ(v), we can get the elements in Eq.25, which are the partial derivatives w.r.t. each variable:
∂ψ ∂a = a((4b2c2 − r21) sin2 ψ − s1e2 − s2b2 − s3c2 + 2a2c2) M
∂ψ ∂b = b(2r3a 2 sin2 ψ − s1f2 − s2a2 − s3e2 + 2b2f2) M
∂ψ ∂c = c(2r2a 2 sin2 ψ − 2r2a2 + t1t2) M
∂ψ ∂d = d(−2t1e2 + r2t2) M
∂ψ ∂e = e(2r1a 2 sin2 ψ − s1a2 − s2d2 − s3b2 + 2d2e2) M
∂ψ ∂f = f(−2t2b2 + r2t1) M
(26)
where r1 = b 2 + c2 − e2
r2 = b 2 − c2 + e2
r3 = −b2 + c2 + e2
s1 = c 2 + d2 − f2
s2 = c 2 − d2 + f2
s3 = −c2 + d2 + f2
t1 = a 2 + b2 − d2
t2 = a 2 + e2 − f2
M = a2(r21 − 4b2c2) sinψ cosψ
(27)

heading: B PROVES
text: B.1 PROVE OF INEQUITABLE GRADIENTS OVER D,Φ,Ψ IN DISTANCE GEOMETRY
We first analyze the gradients allocated on bond lengths D and bond angles Φ when optimizing 2- hop atom-pair distances. Suppose two bonds a, b with a bond angle φ, note that the third side of the triangle is c, a 2-hop distance (see Fig.2(a)). We have:
c2 = a2 + b2 − 2ab cosφ (28)
The partial derivatives of c on variables a, b ∈ D and φ ∈ Φ are: ∂c
∂a = a− b cosφ c
∂c ∂b = b− a cosφ c
∂c ∂φ = ab sinφ c (29)
To further quantify the derivatives in Eq.29, we sample the distributions of D,Φ from QM9 dataset (see more details in Appendix C.2). We found that bond lengths has a mean value of µD ≈ 1.452 and standard deviation σD ≈ 0.103, and bond angles has µΦ ≈ 108◦ and σΦ ≈ 22◦. As σD is relatively small compared to µD, we suppose that a = b = µD. Then the values of the derivatives are only variant to the temporary φ, and we get:
∂c ∂a = ∂c ∂b = cos π − φ 2
∂c ∂φ = µD sin π − φ 2
(30)
Eq.30 is visualized in Fig.4. When optimizing the 2-hop distances, a large portion of gradient is allocated to fine-tuning the bond lengths D rather than the bond angles Φ, especially for bigger bond angles. Therefore, traditional loss functions based on distance geometry, where the bond angles are expected to be optimized by preserving 2-hop distances, didn’t treat D,Φ equivalently and would cause contorted local geometries.
When optimizing 3-hop atom-pair distances, the inequity of leveraging D,Φ,Ψ is proved empirically from the result in Tab.1, as the DG-based loss functions (Conn-k and lDDT-γ) focus more on bond lengths and less on dihedral angles.
B.2 PROVE OF LIMITED ATOM-PAIR NUMBER
For an atom in a common molecule, the number of neighbors is at most 6 (e.g. sulfur atom). Therefore, an atom has at most 30 2-hop neighbors and 150 3-hop neighbors, which means that at most 186 atoms are 3-hop connected to it. For a molecule with n atoms, the number of 3-hop connected atom-pairs will not exceed 12 × 186n = 93n. Note that the number of 3-hop connected atom-pairs is γ times of atom number n. For molecules in train set of GEOM-Drugs where the average atom number is around 44.2 (Xu et al., 2021), the estimated value of γ is 4.6. This empirical result shows that optimizing the 1/2/3-hop atom-pair distances is constant times more expensive compared to directly optimizing atom positions, and it can be n times faster than considering all atom-pairs, as the constant γ = 4.6 is much smaller than atom number n = 44.2.
C IMPLEMENTATION DETAILS
C.1 CALCULATION OF DEGREE OF FREEDOM
Consider a 3-D conformation geometry G and the corresponding molecular graphM (with n atoms), the degrees of freedom is fG = 3n − 6 due to translation and rotation. We can figure out the exact number of degrees on three types of factors by:
• Generate a spanning tree T for the molecular graphM, and fD = n− 1 is the number of edges in T .
• For every atom v in T , if the number of its neighbors N (v) are more than 1, it provides 2|N (v)| − 3 degrees of freedom for fΦ8. In brief, we have fΦ =∑ v∈V(T )∧|N (v)|>1 2|N (v)| − 3
• Obviously, fΨ = fG − fD − fΦ
8For an atom v whose distances to its neighborsN (v) are given, it needs 2|N (v)| − 3 exact values of bond angles (v serves as the axis) to determine their relative position in 3-D space, if |N (v)| > 1 (Havel, 1998).
Because there might be more than one possible spanning trees in a molecular graph, the output fD, fΦ, fΨ is diverse. However, no matter how fD, fΦ, fΨ compose the total degrees of freedom fG , it always embodies a set of 3n−6 factors (including bond lengths, bond angles and dihedral angles) which can determine the conformation geometry G. Therefore, the correctness of output fD, fΦ, fΨ is insensitive to process of generating T .
C.2 CALCULATION OF HYPER-PARAMETERS λ
To capture the complete local geometry, we consider all possible bond length, bond angles and dihedral angles when sampling them from conformation G, and their numbers f̂D, f̂Φ, f̂Ψ may exceed the actual degrees of freedom fD, fΦ, fΨ. So we balance them with weights fDf̂D , fΦ f̂Φ , fΨ f̂Ψ
. The weights are calculated through sampling from a certain dataset, whose exact values are listed in Tab.4.
We also sampled the standard deviation of D,Φ,Ψ for all three datasets, as it shows in Tab.5.
Then we calculate the hyper-parameters via Eq.2, and the result is listed in Tab.6.
C.3 MORE RESULTS ON MULTIPLE CONFORMATION GENERATION
See tables 7 and 8.

Review summaries:
The authors proposed a new method for molecular conformation generation. The authors choose to use bond lengths $d$, bond angles $\phi$ and dihedral angles $\psi$ for molecular conformation generation. The authors use Taylor expansion and multiplier truncation to improve models.  The authors conduct experiments on QM9 to verify the algorithm.  

This paper proposes a new loss function for conformer generation tasks. These tasks essentially generated 3D point clouds from molecular graphs, and require a geometric similarity metric between generated samples and training data to drive the learning. The traditional metric of distance is RMSD based on aligned poses, but the authors suggest this is too time-consuming and instead propose a heuristic-weighted combination of bond distance between first other neighbors, and a Taylor-expansion of angles between second-order neighbors and dihedrals between 3rd order neighbors.   The metric is empirically found to perform well, based on both statistical metrics used in conformer generation tasks, by visual inspection of pathological cases, and because the timings are excellent

The work  introduces a custom loss function for the molecular conformation similarity. The authors combine this loss function with the PhysNet and GraphDG models to either predict a single conformation or to generate an ensemble of conformations. Other loss functions, including Naive RMSD, Kabsch algorithm, Conn-k and lDDT-k are compared under the same settings.  The main contributions of the paper are as follow: authors proposed a novel loss function for conformation generation, that can be used in *straight-forward* models, also provide Taylor Expansion and Multiplier Truncation techniques to speed up this metric.

The papers proposed a new objective function for comparing two 3D structures, in the molecular conformation context. Specifically, they proposed to compare the bond lengths, angles, and torsions, and design reweights to balance the three components. Furthermore, they improved the efficiency by approximating the comparison of angles and torsions with Taylor expansion. Experiments demonstrate that compared with directly comparing the aligned RMSD and other metrics, the proposed method is both more efficient and effective.