TL;DR
AlphaFold-style protein models rely on "triangle" math to ensure 3D geometry makes physical sense, but that math scales cubically ($O(L^3)$)—making large molecular complexes brutally slow to compute. The authors introduce TriHyena, an operator that swaps heavy attention mechanisms for Fast Fourier Transform (FFT) convolutions, breaking the cubic barrier down to $O(L^2 \log L)$. You get up to $7\times$ faster training speeds while keeping structural accuracy intact.
What Problem Does This Paper Address?
If you want a neural network to fold a protein of length $L$, it has to predict how every amino acid interacts with every other amino acid—an $L \times L$ grid of pairs. To ensure these pairwise distances obey 3D geometry (think of the triangle inequality: if residue $i$ is close to $k$, and $k$ is close to $j$, then $i$ and $j$ can't be miles apart), models like AlphaFold2/3 and RoseTTAFold3 update pair $(i, j)$ by aggregating information across all possible third points $k$.
This relies on two core operations: Triangle Attention (TriAttn) and Triangle Multiplication (TriMul). Because you do $O(L)$ work for each of the $L^2$ pairs, compute time explodes at $O(L^3)$. Previously, researchers had an unappealing choice: optimize CUDA kernels to shave off constants (still cubic), or rip out the triangles entirely for speed and watch accuracy suffer. Preserving explicit 3D triangle reasoning at subcubic speed has been an open bottleneck.
Methods
Enter TriHyena, a drop-in replacement for TriAttn and TriMul that adapts 1D subquadratic sequence mixers (specifically, Hyena operators) to 2D pair grids.
Instead of computing expensive all-to-all attention weights or dense matrix contractions over index $k$, TriHyena treats $k$ as a 1D sequence axis and sweeps across it with a Fast Fourier Transform (FFT):
- Reciprocal Gating: To update pair $(i, j)$, TriHyena pulls features from row $(i, k)$ and its reciprocal column $(k, i)$, multiplying them elementwise.
- FFT Convolution: Rather than explicitly reading features from the third edge $(j, k)$, it transports information from $k$ to $j$ using a learned filter based purely on their sequence offset $(j - k)$—generated on the fly by a tiny sinusoidal network (SIREN). Doing this via FFT drops compute from $O(L^3)$ to $O(L^2 \log L)$ while keeping $O(L^2)$ memory.
- Target Gating: Finally, the result is modulated by a gate from the target pair $(i, j)$ itself.
Hardware Trickery: Asymptotic math doesn't always pay the bills at shorter protein lengths ($L \le 2048$), where memory traffic dominates. So, alongside custom fused cuFFTDx kernels, the authors built an explicit $O(L^2)$ convolution path for NVIDIA Blackwell (B200/B300) GPUs that exploits Tensor Cores to bypass FFT overhead at shorter lengths.
Datasets
No new datasets were introduced; the authors evaluated TriHyena using established benchmarks and protocols:
- Speed Benchmarks: Synthetic tensors across sequence lengths $L = 128$ to $2048$.
- Structure Prediction (Reduced-scale RF3): Trained from scratch on ~2.55M examples (cropped to 256 tokens) and evaluated on a held-out test set of 1,206 PDB entries (32–1,100 tokens) covering monomers, protein–protein interfaces, and protein–ligand interfaces.
- Protein Generation (Genie2): Trained following the standard Genie2 protocol, evaluating unconditional backbone generation across 1,035 structures per checkpoint (5 samples at every length from 50 to 256 residues).
Key Insights and Ideas
- You don't need explicit features on all three triangle edges: TriAttn and TriMul read features from both $(i, k)$ and $(j, k)$. TriHyena ignores $(j, k)$ features completely, relying on reciprocal $(i, k) \odot (k, i)$ features and the relative sequence distance $j - k$. Surprisingly, this still captures enough triangular geometry to fold proteins accurately.
- Wider representations favor TriHyena: Modern folding models are scaling up pair channel widths (from 128 in AF2 to 256 or 384 in newer models). Because TriHyena's filters operate depthwise (independently per channel), its speed and memory lead over standard operators widens dramatically as models get fatter.
- Not an approximation, a new operator: TriHyena isn't a mathematical approximation of attention—you can't load AlphaFold weights into it. It is a distinct operator family that must be trained from scratch.
Key Results
- Speedups: Against heavily optimized
cuEquivariancebaselines at $L=2048$, TriHyena trains $3.2\text{--}7.0\times$ faster than TriAttn and $1.5\text{--}1.7\times$ faster than TriMul across A100, H100, H200, B200, and B300 GPUs. At wide pair dimensions ($d_{\text{pair}}=768, L=2048$),cuEq-TriAttncrashes out-of-memory while TriHyena breezes through.
- Structure Prediction (RF3 Ablations): Measured by lDDT (a 0-to-1 score of local atomic accuracy), swapping TriAttn for TriHyena matches the baseline across the board (0.644 vs. 0.641 monomer BO1; 0.288 vs. 0.290 protein–protein interface). Replacing both TriAttn and TriMul (an all-TriHyena model) holds monomer accuracy steady (0.629) with only a slight 0.04 dip on interfaces (0.251).
- Generative Design (Genie2): Replacing all five TriMul layers with TriHyena yields virtually identical F1 trade-offs between designability and structural diversity ($0.84 \pm 0.05$ vs. $0.85 \pm 0.06$).
Limitations and Future Work
- Memory Overhead at Standard Widths: While asymptotically $O(L^2)$, TriHyena uses a median of 21% more peak training memory than
cuEq-TriAttnand 42% more thancuEq-TriMulat default widths ($d_{\text{pair}}=256$), though it wins out at wider dimensions. - Token Order Sensitivity & Extrapolation: Because the convolutional filter depends on sequence offset $(j - k)$, multi-chain complexes are sensitive to the arbitrary order in which chains or ligands are fed into the model. Furthermore, the 0.04 interface lDDT drop in the all-TriHyena model could stem either from losing conventional triangle operators or from length extrapolation (training on 256-token crops, testing up to 1,100).
- Future Directions: Testing chain-reordering sensitivity, training on longer sequence crops, and adding learnable decay windows to help the SIREN filter extrapolate gracefully to massive biomolecular assemblies.
Summary updated