EGNN: E(n)-Equivariant Graph Neural Networks
Published:

The EGNN Approach
Intuition First: EGNN is like a choreography that works in any room orientation. Each dancer (atom) tracks two things: their personal identity (invariant features h_i โ atomic number, charge) and their position on stage (equivariant coordinates r_i). When two dancers communicate, they whisper only about the distance between them (invariant), then each adjusts their stage position by moving slightly toward or away from the other. Because they only use relative positions โ never absolute coordinates โ the whole dance looks the same whether the room is rotated 30ยฐ or 300ยฐ.
EGNN maintains two quantities per node:
- h_i โ โ^d: invariant features
- r_i โ โ^n: equivariant coordinates (n=3 for 3D)
These are updated jointly across layers, always maintaining E(n) equivariance.
The EGNN Update Rule
Edge messages (invariant quantities only):
| The message uses the squared distance | ย | r_i - r_j | ย | ยฒ โ an E(n)-invariant scalar. Optional edge attribute a_{ij} is also invariant. |
Coordinate update (equivariant):
Relative positions (r_i - r_j) are translation-invariant and rotation-equivariant. A weighted sum of equivariant vectors is equivariant: rotating all coordinates by R gives R applied to the entire sum. So this update is automatically E(n)-equivariant.
Feature update (invariant):
Features are updated only using invariant messages, so h_i remains invariant.
Comparison to TFN / SE(3)-Transformers
| Property | EGNN | TFN / SE(3)-Trans |
|---|---|---|
| Symmetry group | E(n) | SE(3) |
| Geometric features | Distances + relative positions | Spherical harmonics (irreps) |
| Computational cost | O(N E d) | O(N E d Lยฒ) where L = max degree |
| Output types | Scalars + vectors (l=0,1) | Arbitrary tensors (l=0,1,โฆ,L) |
| Complexity | Simple MLPs | Clebsch-Gordan tensor products |
| Practical speed | Fast | Slow for high L |
EGNN gives up expressive power beyond l=1 features (it has no l=2 or higher tensor outputs) in exchange for dramatically simpler and faster computation.
Applications
Molecular dynamics: predict energies and forces. Forces are the negative gradient of energy, so if energy is invariant, forces are automatically equivariant. EGNN can directly output equivariant force predictions.
N-body simulation: predict trajectories of charged particles. EGNN models the interaction forces and propagates positions forward.
Protein structure: predict residue positions given contact maps. Equivariance ensures predictions rotate consistently with the input.
Point cloud processing: EGNN applied to LiDAR point clouds maintains rotational equivariance for 3D object detection.
Worked Example: One EGNN Layer on 3 Atoms
Setup: 3 atoms โ H at rโ=(0,0,0), O at rโ=(1,0,0), H at rโ=(1,1,0). Features hโ=hโ=1 (hydrogen), hโ=2 (oxygen). ฯ_e and ฯ_x are simple identity functions for illustration.
Step 1 โ Edge messages (squared distances):
- mโโ = ฯ_e(hโ, hโ, โrโโrโโยฒ) = ฯ_e(1, 2, 1.0) โ scalar sโโ
- mโโ = ฯ_e(hโ, hโ, โrโโrโโยฒ) = ฯ_e(2, 1, 1.0) โ scalar sโโ
- mโโ = ฯ_e(hโ, hโ, โrโโrโโยฒ) = ฯ_e(1, 1, 2.0) โ scalar sโโ (longer bond)
Step 2 โ Coordinate update for O (atom 2), C=1:
- rโ โ rโ + (rโโrโ)ยทฯ_x(sโโ) + (rโโrโ)ยทฯ_x(sโโ)
- (rโโrโ) = (1,0,0), (rโโrโ) = (0,โ1,0)
- If ฯ_x(s) = 0.1: rโ โ (1,0,0) + 0.1ยท(1,0,0) + 0.1ยท(0,โ1,0) = (1.1, โ0.1, 0)
Equivariance check: rotate everything 90ยฐ around z-axis: rโ=(0,0,0)โ(0,0,0), rโ=(1,0,0)โ(0,1,0), rโ=(1,1,0)โ(โ1,1,0).
- (rโโโrโโ) = (0,1,0), (rโโโrโโ) = (1,0,0)
- rโโ โ (0,1,0) + 0.1ยท(0,1,0) + 0.1ยท(1,0,0) = (0.1, 1.1, 0) โ exactly the 90ยฐ rotation of (1.1,โ0.1,0) โ
EGNN vs SchNet
| SchNet (Schรผtt et al., 2017) is an earlier distance-based model: messages depend on | ย | r_i - r_j | ย | , so it is rotationally invariant. But SchNet does not update coordinates โ it only updates scalar features. EGNN updates both features and coordinates, enabling it to predict vector quantities (forces, displacements) directly. |
Training EGNN
For energy prediction:
- Target: energy E (scalar) โ use invariant readout: E = ฮฃ_i ฯ_out(h_i)
- Loss: MSE(E_pred, E_true)
For force prediction:
- Forces: F_i = -โE/โr_i (autograd through the EGNN coordinate update)
- Or: directly predict F_i using equivariant output head
Simultaneous energy and force training (combined loss) improves generalisation โ forces carry information about the energy surface curvature.
Summary
| Component | Equivariance | How |
|---|---|---|
| m_{ij} (messages) | Invariant | Uses only distances |
| r_i update | Equivariant | Weighted sum of (r_i - r_j) |
| h_i update | Invariant | Uses only invariant messages |
| Graph readout | Invariant | Sum of invariant node features |
EGNN is the practical choice when E(n) equivariance is needed and the task requires only scalar (energy) or vector (force) outputs. For higher-order outputs (tensors, multipoles), TFN or MACE are needed.
References
- Satorras, V. G., Hoogeboom, E., & Welling, M. (2021). E(n) Equivariant Graph Neural Networks. ICML 2021 (EGNN: E(n)-equivariant message passing using only interatomic distances โ no spherical harmonics required).
- Schรผtt, K. T., Kindermans, P.-J., Sauceda Felix, H. E., Chmiela, S., Tkatchenko, A., & Mรผller, K.-R. (2017). SchNet: A Continuous-Filter Convolutional Neural Network for Modeling Quantum Interactions. NeurIPS 2017 (SchNet: the simpler predecessor using only distances, motivating EGNNโs invariant message design).
- Hoogeboom, E., Satorras, V. G., Vignac, C., & Welling, M. (2022). Equivariant Diffusion for Molecule Generation in 3D. ICML 2022 (EDM: applying EGNN equivariance to 3D molecule generation via diffusion models).
