Flash Invariant Point Attention
Andrew Liu, Axel Elaldi, Nicholas T Franklin, Nathan Russell, Gurinder S Atwal, Yih-En A Ban, Olivia Viessmann
TL;DR
Invariant Point Attention (IPA) enables geometry-aware modeling of proteins and RNAs but suffers from quadratic $O(L^2)$ scaling that limits input length. FlashIPA provides a factorized reformulation that leverages FlashAttention to achieve linear memory and wall-clock scaling with sequence length, while preserving SE(3) invariance and, in many cases, improving performance over standard IPA. Key innovations include a factorized pair representation $z_{ij}=z_i^{1 op} z_j^2$, a local nearest-neighbor distogram bias, and lifting IPA components into regular attention to enable efficient computation. Empirically, FlashIPA matches or exceeds IPA in validation and enables training and generation for much longer biomolecular structures (thousands of residues and RNAs up to thousands of nucleotides) with substantial reductions in compute cost, making long-context, geometry-aware modeling more accessible and scalable. The work provides an open-source implementation at https://github.com/flagshippioneering/flash_ipa and demonstrates practical impact on backbone generative models like FoldFlow and RNA-FrameFlow.
Abstract
Invariant Point Attention (IPA) is a key algorithm for geometry-aware modeling in structural biology, central to many protein and RNA models. However, its quadratic complexity limits the input sequence length. We introduce FlashIPA, a factorized reformulation of IPA that leverages hardware-efficient FlashAttention to achieve linear scaling in GPU memory and wall-clock time with sequence length. FlashIPA matches or exceeds standard IPA performance while substantially reducing computational costs. FlashIPA extends training to previously unattainable lengths, and we demonstrate this by re-training generative models without length restrictions and generating structures of thousands of residues. FlashIPA is available at https://github.com/flagshippioneering/flash_ipa.
