EGNN (Satorras, Hoogeboom and Welling, ICML 2021) is a graph neural network for points in space, such as atoms or robot swarms. It respects rotations, reflections and translations without expensive spherical harmonics. Messages depend only on node features and squared distances, so features are invariant. Coordinates are updated along relative position vectors, so they rotate and translate with the input. This page covers E(n) symmetry, the layer equations, invariant and equivariant outputs, and how EGNN compares with other equivariant models. In the exercises you check that distances are invariant and that the coordinate update is equivariant. You then predict a pair energy of 6-atom clusters, training on one pose and testing on randomly rotated clusters. Random-weight EGNN features scored R² 0.958 on both. A raw-coordinate model dropped from 0.70 to 0.58, and rotation augmentation reached only 0.72. The coordinate update was equivariant to about 1e-15.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
Rotate the molecule, get the same energy
A molecule’s energy does not change if you turn it around, and its predicted forces should turn with it. A plain network reading raw x, y, z coordinates has to learn this from data, and often fails for poses it has not seen. EGNN builds it in: it only ever uses distances between points to compute features, and it moves points along the lines joining them. The demo rotates a point cloud: coordinates change, but the distance between two points does not.
Geometric deep learning lab
Distance between the two red points: 0.2419 before and 0.2419 after rotating by 30°. EGNN builds messages from such invariant distances, so its outputs rotate with the input.
Why engineers care
Equivariant networks predict molecular properties and forces, model particle systems, and control swarms of drones or satellites, where the physics does not depend on the coordinate frame.
📝 Quick check (Level 0)
0/3 answered
1. Rotating a molecule changes its energy…
2. EGNN computes features from…
3. Predicted forces should…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.
By hand
Group E(n): rotations, reflections and translations of n-dimensional space. 3-D rotations have 3 degrees of freedom (n(n − 1)/2).
Invariance of h: distances are unchanged by rotation, reflection and translation, so every h stays the same.
Equivariance of x: x_i − x_j rotates with the input and φ_x(m_ij) is invariant, so the update rotates. Translations cancel in the differences.
Counting: 6 atoms have 15 pairwise distances and 3·6 − 6 = 12 internal degrees of freedom.
Cost: about the same as an ordinary message-passing GNN; no spherical harmonics or Clebsch–Gordan products.
📝 Quick check (Level 1)
0/3 answered
1. Pairwise distances among 6 atoms:
2. Internal degrees of freedom of 6 atoms in 3-D:
3. Coordinates move along…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.
EGNN in code
Exercise 1.
Squared distances are rotation-invariant.
The coordinate update rotates and translates with its input.
Practice.
Reference implementations: the authors’ EGNN code and the egnn-pytorch package. PyTorch Geometric’s message passing makes it a few lines.
Normalise the coordinate update (divide by n − 1, or by ‖x_i − x_j‖ + 1) to avoid instability.
Use a cutoff radius for large systems.
For vector outputs (forces), read them from the coordinate updates; for scalars (energy), pool the invariant h.
class EGNNLayer(nn.Module): def forward(self, h, x, edges): i, j = edges; d2 = ((x[i] - x[j]) ** 2).sum(-1, keepdim=True) m = self.phi_e(torch.cat([h[i], h[j], d2], -1)) x = x + scatter_mean((x[i] - x[j]) * self.phi_x(m), i, dim=0) h = self.phi_h(torch.cat([h, scatter_add(m, i, dim=0)], -1)) return h, x
🐍 Exercise 1: invariance and equivariance
Compute squared distances, an EGNN-style coordinate update and a z-axis rotation.
📝 Quick check (Level 2)
0/3 answered
1. Energies are read from…
2. Forces can be read from…
3. Large systems use…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.
Theory
Equivariance proof. Let g act by x ↦ Qx + t with Q orthogonal. Then ‖Qx_i + t − Qx_j − t‖² = ‖x_i − x_j‖², so m_ij and h are invariant. The update gives Q x_i + t + C Σ Q(x_i − x_j) φ_x(m_ij) = Q x_i′ + t. Stacking layers preserves this.
Expressiveness. EGNN passes only scalar messages (distances), plus coordinates as vectors. Higher-order equivariant networks (Tensor Field Networks, SE(3)-Transformers, NequIP, MACE) carry higher-degree spherical tensors, which can represent angular information more directly. Their per-layer cost is higher, but they are often more data-efficient on molecular benchmarks.
Chirality. E(n) includes reflections, so EGNN cannot tell a molecule from its mirror image. SE(3)-equivariant models can.
📝 Quick check (Level 3)
0/3 answered
1. EGNN is equivariant to reflections:
2. So EGNN cannot distinguish…
3. Higher-order models carry…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.
Does built-in invariance beat learning it from data?
History.
V. G. Satorras, E. Hoogeboom and M. Welling, “E(n) equivariant graph neural networks” (ICML 2021).
Strong results on N-body dynamics and the QM9 molecular benchmark.
Exercise 2.
Data: clusters of 6 points in 3-D, elongated along x in their canonical pose.
Target: a Morse-like pair energy Σ (1 − exp(−(d_ij − 1)))², which is rotation-invariant.
Protocol: train on 1500 canonical clusters; test on 500 canonical and 500 randomly rotated clusters.
Features:
a random-feature MLP on raw coordinates (512 features);
the same trained on randomly rotated clusters (augmentation);
two random-weight EGNN layers (64-D), node features summed.
Model: ridge regression.
features
R², canonical test
R², rotated test
raw coordinates
0.704
0.580
raw coordinates, augmented training
0.686
0.717
EGNN
0.958
0.958
Equivariance check: max |EGNN(XR) − EGNN(X)R| = 2.7e-15 (machine precision).
Invariance is exact: EGNN’s R² is identical for rotated clusters, because only distances enter its features.
Raw coordinates fail to generalise across poses: R² drops from 0.70 to 0.58 on rotated clusters.
Augmentation fixes the drop, not the gap: with rotated training data the raw model is pose-independent (0.72) but still far below EGNN. It spends capacity learning a symmetry that EGNN has for free.
Seeds: seeds 1 and 2 gave EGNN 0.985 and 0.962 (both tests); raw rotated 0.549 and 0.662.
Caveat: the target is a pair function, which favours distance-based features.
🐍 Exercise 2 (research): does built-in invariance beat learning it from data?
Predict a pair energy of 6-atom clusters with raw-coordinate random features (with and without rotation augmentation) and random-weight EGNN features; test on rotated clusters and check equivariance.
EGNN in AI, robotics and aerospace
Molecular modelling: property prediction and diffusion-based molecule generation (equivariant diffusion models use EGNN).
Physics simulation: N-body and particle systems.
Swarms: formation control of drones or satellites, where behaviour should not depend on the global frame.
Design lesson: if the task has a symmetry, build it into the architecture rather than hoping data augmentation teaches it.
References
V. G. Satorras, E. Hoogeboom and M. Welling (2021). “E(n) equivariant graph neural networks.” Proc. ICML.
E. Hoogeboom, V. G. Satorras, C. Vignac and M. Welling (2022). “Equivariant diffusion for molecule generation in 3D.” Proc. ICML.
S. Batzner et al. (2022). “E(3)-equivariant graph neural networks for data-efficient and accurate interatomic potentials.” Nature Communications 13.
Rotated test clusters: EGNN R² 0.958 (unchanged); raw coordinates 0.58; augmented 0.72.
Practice
Show:
Level 0
Problem 1Level 0
Pairwise distances among 6 atoms?
15.
Problem 2Level 0
Degrees of freedom of 3-D rotations?
3.
Problem 3Level 0
Year EGNN was published at ICML?
2021.
Level 1
Problem 4Level 1
Internal degrees of freedom of 6 atoms in 3-D (3n − 6)?
12.
Problem 5Level 1
EGNN message input width for 64-D node features (2h + 1)?
129.
Problem 6Level 1
Pairwise distances among 29 atoms?
406.
Problem 7Level 1
Determinant of a rotation matrix?
1.
Level 2
Problem 8Level 2
EGNN R² on rotated test clusters?
0.958.
Problem 9Level 2
Raw-coordinate R² on rotated test clusters?
0.58.
Problem 10Level 2
Raw-coordinate R² on canonical test clusters?
0.704.
Problem 11Level 2
Augmented raw-coordinate R² on rotated clusters?
0.717.
Problem 12Level 2
Atoms per cluster in exercise 2?
6.
Problem 13Level 2
EGNN layers in exercise 2?
2.
Level 3
Problem 14Level 3
Prove that the EGNN coordinate update is translation-equivariant.
Replace every x_i by x_i + t. Differences x_i − x_j and distances are unchanged, so m_ij and φ_x(m_ij) are unchanged. The update becomes x_i + t + C Σ (x_i − x_j) φ_x(m_ij) = x_i′ + t. ∎
Problem 15Level 3
Explain why augmentation did not close the gap to EGNN.
Augmentation makes the training distribution rotation-symmetric, so the raw model becomes roughly pose-independent. But it must now represent the energy as a function over all orientations, using its fixed 512 random features. EGNN removes the 3 rotational degrees of freedom exactly, so all its capacity goes to the 12 internal ones. ∎
Problem 16Level 3
Compare EGNN with SE(3)-Transformers.
EGNN uses scalar distance messages and vector coordinate updates: cheap, simple, E(n)-equivariant (so reflection-blind). SE(3)-Transformers use spherical-harmonic features of several degrees and equivariant attention: richer angular information and chirality awareness, at higher cost and complexity. ∎
Problem 17Level 3
Advise on a controller for a satellite formation.
The desired behaviour should not depend on the inertial frame orientation or origin, so an EGNN over satellites (nodes with relative positions and velocities as equivariant vectors) is a natural policy. Its outputs (thrust vectors) rotate with the formation. Add frame-dependent effects such as Earth’s oblateness explicitly as inputs, since they break the symmetry. ∎
Level 4
Problem 18Level 4
EGNN R², seed 1?
0.985.
Problem 19Level 4
Raw-coordinate R² on rotated clusters, seed 1?
0.549.
Problem 20Level 4
Training clusters in exercise 2?
1500.
Coding practice
🐍 Code 1 (Level 0): pairs
n(n − 1)/2.
🐍 Code 2 (Level 0): rotation freedom
n(n − 1)/2.
🐍 Code 3 (Level 0): message width
2h + 1.
🐍 Code 4 (Level 0): internal freedom
3n − 6.
🐍 Code 5 (Level 0): rotation test
Orthogonal with determinant 1.
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
E(n)-Equivariant GNN (EGNN): topic test
10 questions, drawn at random from a bank of 21. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.