E2Former: An Efficient and Equivariant Transformer with Linear-Scaling Tensor Products

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

TL;DR

E2Former introduces a novel "Wigner $6j$ convolution" that drastically cuts the computational cost of equivariant transformers. By shifting heavy tensor product operations from edges to nodes, this mathematical reframing enables $SO(3)$-equivariant modeling of large-scale molecular systems with a 7x–30x speedup, all while maintaining state-of-the-art accuracy.

The Problem: The Cost of Equivariance

In molecular modeling, "equivariance" is the gold standard. An equivariant model inherently understands that if you rotate a molecule in 3D space, its physical properties (like force vectors) should rotate accordingly. Spherical Equivariant Graph Neural Networks (EGNNs) achieve this by utilizing complex mathematics known as spherical tensor products.

However, there is a catch: these tensor products are computationally expensive and are typically calculated for every single edge (the connection between atoms) in a molecular graph. As systems grow—such as in large proteins or complex materials—the number of edges explodes quadratically with local density. This makes high-accuracy equivariant models painfully slow or even impossible to run on large systems, forcing researchers into a difficult compromise between computational speed and physical accuracy.

Methods: The E2Former Architecture

To break this bottleneck, the authors propose E2Former, a transformer architecture built around a groundbreaking operation: the Wigner $6j$ Convolution.

Overview of the E2Former framework

The technical breakthrough relies on two key mathematical maneuvers:

  1. Binomial Local Expansion: The authors prove that edge-based directions can be mathematically decomposed into node-based positions. Essentially, they use a "binomial theorem for tensors" to break down the interaction between two atoms into terms that belong to each atom individually.
  2. Wigner $6j$ Recoupling: In quantum mechanics, Wigner $6j$ symbols describe how to reorder the coupling of three angular momenta. E2Former uses this principle to rearrange the order of tensor operations. Instead of multiplying features on every edge, the model aggregates neighbor information first and then performs the expensive tensor products at the node level.

By shifting the complexity from $O(|\mathcal{E}|)$ (edges) to $O(|\mathcal{V}|)$ (nodes), the model scales linearly with the number of atoms rather than quadratically with the local density of connections.

Key Insights

  • The Edge-to-Node Shift: The most significant breakthrough is realizing that tensor products do not need to be performed on edges to maintain $SO(3)$ equivariance. Mathematical factorization allows the network to achieve the exact same result by working on nodes.
  • Recoupling as an Efficiency Tool: Wigner $6j$ symbols, often seen merely as abstract physics constants, are repurposed here as a practical engineering tool to "rearrange" the neural network's internal logic for vastly better performance.
  • No Accuracy-Efficiency Trade-off: Unlike "scalarization" methods that simplify the math to gain speed but lose descriptive power, E2Former maintains the full expressive power of spherical tensor products. It is effectively a "free lunch" in terms of complexity reduction.
  • Unprecedented Scalability: The paper demonstrates that E2Former is uniquely capable of handling massive systems (up to 6,400 atoms) on standard hardware, whereas previous models crash due to memory or time constraints.

Key Results

E2Former was rigorously tested across industry-standard benchmarks, including OC20 (1.2 million catalyst-adsorbate relaxations), OC22, and SPICE.

Performance and training efficiency comparison
  • Massive Speedups: The Wigner $6j$ convolution achieves a 7x to 30x speedup compared to standard $SO(3)$ convolutions.
  • Competitive Accuracy: On the OC20 dataset, the 67M-parameter E2Former matched the accuracy of state-of-the-art models like EquiformerV2 while operating significantly faster.
  • Training Efficiency: On the OC22 dataset, E2Former converged in just 1,500 GPU hours—roughly one-third of the time required by previous top-tier models.
  • Molecular Dynamics (MD) Performance: In MD simulations, E2Former proved to be 1,000x faster than traditional Quantum Mechanics (DFT) and 2x faster than high-end empirical methods (GFN2-xTB), all while tracking the "ground truth" power spectrum with high precision.

Limitations and Future Work

While E2Former represents a major leap forward, the authors note a few areas for future refinement. For very small molecular graphs where the number of edges isn't significantly larger than the number of nodes, the mathematical overhead of the Wigner $6j$ operations might diminish the speed benefits. Additionally, while the current implementation is highly efficient, further kernel-level optimization for specific GPUs could unlock even greater speeds.

Looking ahead, combining Wigner $6j$ Convolutions with other recent optimizations could pave the way for a highly potent "foundational model" for chemistry, capable of tackling massive, all-atom protein systems in complex biological environments.

Summary updated

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