E2Former: A Linear-time Efficient and Equivariant Transformer for Scalable Molecular Modeling

Yunyang Li, Lin Huang, Zhihao Ding, Chu Wang, Xinran Wei, Han Yang, Zun Wang, Chang Liu, Yu Shi, Peiran Jin, Jia Zhang, Mark Gerstein, Tao Qin · DOI

Abstract

Equivariant Graph Neural Networks (EGNNs) are essential for accurate 3D molecular modeling but suffer from high computational costs due to edge-dependent spherical tensor products. We present E2Former, a transformer architecture that utilizes Wigner $6j$ recoupling to shift computational complexity from edges ($O(|\mathcal{E}|)$) to nodes ($O(|\mathcal{V}|)$). This mathematical reformulation achieves a 7x–30x speedup over traditional SO(3) convolutions, enabling the simulation of systems with over 6,000 atoms while maintaining state-of-the-art accuracy across major benchmarks like OC20 and SPICE.

Introduction

Simulating molecular systems accurately requires models to respect 3D geometric symmetries, a property known as equivariance. Spherical EGNNs achieve high precision by using spherical tensor products to pass messages between atoms. However, these operations are typically computed over every edge in the molecular graph. As system sizes grow or neighborhood radii increase, the number of edges $|\mathcal{E}|$ scales rapidly, making these models computationally prohibitive for large proteins or complex materials. E2Former addresses this bottleneck by factorizing edge-dependent operations into node-dependent ones, achieving linear scaling with respect to the number of atoms.

Methodology

The core innovation of E2Former is the Wigner $6j$ Convolution, which reduces complexity from $O(|\mathcal{E}|)$ to $O(|\mathcal{V}|)$. This is achieved through two primary techniques:

  1. Binomial Local Expansion: Instead of treating an edge as a single vector between two atoms, this technique mathematically decomposes the edge into the absolute positions of the source and target atoms.
  2. Wigner $6j$ Recoupling: Borrowed from the quantum theory of angular momentum, the Wigner $6j$ symbol allows for the reordering of tensor product multiplications. This allows the model to factorize edge-dependent operations into node-dependent ones.

By combining these techniques, the network computes heavy tensor products once per atom rather than once per connection. This efficient convolution is integrated into the E2Former transformer architecture, which uses the saved computational budget to incorporate deeper layers, wider hidden dimensions, and multi-head attention.

Overview of the E2Former framework showing the transition from edge-level to node-level complexity via Wigner 6j recoupling.

Experimental Results

E2Former was evaluated on several standard benchmarks, including the massive OC20 and OC22 datasets, as well as SPICE and QM9.

Computational Efficiency and Scaling

Profiling standard SO(3) convolutions revealed that message construction via tensor products is the primary bottleneck, while attention calculation takes relatively little time. The Wigner $6j$ convolution addresses this directly, demonstrating a 7x to 30x speedup over conventional methods. Crucially, E2Former's memory footprint grows linearly, allowing it to process a 6,400-atom system. In contrast, competing state-of-the-art models like MACE-Large and EquiformerV2 failed at this scale due to out-of-memory errors. At a scale of 3,200 atoms, E2Former remains nearly 3x faster than MACE-Large.

Computational time comparisons between standard SO(3) convolutions and the proposed Wigner-6j convolution across different system sizes and complexities.

Accuracy and Molecular Dynamics

On the OC20 dataset, E2Former (67M parameters) matched or exceeded the performance of much heavier models, achieving an Energy MAE of 270 meV and a Force MAE of 20.50 meV/Å. In 10,000-step molecular dynamics (MD) simulations of an amino acid in water, E2Former was approximately 1,000x faster than traditional Density Functional Theory (DFT) methods and ~2x faster than empirical methods like GFN2-xTB. Crucially, E2Former accurately captured high-frequency bond vibrations that empirical methods often miss.

Conclusion and Future Work

E2Former proves that mathematical optimization can overcome the brute-force computational limits of equivariant models. By targeting the message construction bottleneck, it unlocks the ability to simulate massive molecular systems with high fidelity. Future work includes optimizing the architecture for specific hardware accelerators and scaling the model to all-atom protein systems. While highly efficient for large graphs, the overhead of spherical harmonics may make it less optimal for very small systems where edge-level operations are not the primary constraint.

Summary updated

BibTeX
@inproceedings{li2025e,
  author = {Yunyang Li and Lin Huang and Zhihao Ding and Chu Wang and Xinran Wei and Han Yang and Zun Wang and Chang Liu and Yu Shi and Peiran Jin and Jia Zhang and Mark Gerstein and Tao Qin},
  title = {{E2Former: A Linear-time Efficient and Equivariant Transformer for Scalable Molecular Modeling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=ls5L4IMEwt},
}
Figure