Triplet Interaction Improves Graph Transformers: Accurate Molecular Graph Learning with Triplet Graph Transformers

Md Shamim Hussain, Mohammed J Zaki, Dharmashankar Subramanian

Introduction

In the field of molecular machine learning, the ability to capture the intricate relationship between a molecule's 2D topological structure and its 3D geometric properties is paramount. While standard Graph Transformers (GTs) have demonstrated success in modeling long-range dependencies, they often suffer from a "geometric blind spot." Most existing architectures, such as the Edge-augmented Graph Transformer (EGT), primarily model second-order interactions—relationships between pairs of nodes.

However, chemical properties are fundamentally dictated by 3D spatial arrangements, including bond angles and dihedral angles. These are inherently third-order interactions involving triplets of atoms. While some models circumvent this by using ground-truth 3D coordinates, obtaining such data via Density Functional Theory (DFT) is computationally expensive and impractical for large-scale molecular screening. The Triplet Graph Transformer (TGT) addresses this challenge by introducing a mechanism to model third-order interactions directly from 2D graph data, effectively imbuing the model with "geometric common sense."

Methodology

The core innovation of TGT lies in its ability to facilitate communication between triplets of nodes, allowing the model to reason about the relative positioning of atoms without explicit 3D input at inference time.

Triplet Interaction Modules

The authors propose two variants of the triplet interaction mechanism:

  1. Triplet Attention (TGT-At): This high-expressivity module allows the interaction between two node pairs $(i, j)$ and $(j, k)$ to be mediated by the third pair $(i, k)$. While powerful, this approach carries an $O(N^3)$ computational complexity.
  2. Triplet Aggregation (TGT-Ag): To address scalability, this variant utilizes tensor multiplication to aggregate vector representations, achieving a sub-cubic complexity (approximately $O(N^{2.37})$) while maintaining significant representational power.

Three-Stage Training Pipeline

To bridge the gap between 2D graphs and 3D properties, TGT employs a sophisticated three-stage training strategy:

  • Stage 1: Distance Prediction. The model is first trained as a Distance Predictor to estimate 3D interatomic distances from 2D topological graphs. By predicting a full distance matrix rather than absolute coordinates, the model maintains SE(3) invariance.
  • Stage 2: Task Pretraining. A Task Predictor is pretrained using noisy ground-truth 3D structures to establish a baseline understanding of the relationship between geometry and chemical properties.
  • Stage 3: Fine-tuning. The Task Predictor is fine-tuned using the distances generated by the Stage 1 model, allowing it to operate effectively on 2D inputs during inference.

Robustness and Inference

TGT introduces Source Dropout, a regularization technique that drops entire columns of the attention matrix to improve robustness against variations in node degrees. Furthermore, the model utilizes Stochastic Inference, generating multiple distance samples via active dropout during testing. Aggregating these samples acts as test-time data augmentation and provides a built-in measure of uncertainty quantification.

Experimental Evaluation

The TGT framework was evaluated across several high-profile benchmarks, demonstrating its versatility and state-of-the-art (SOTA) performance.

  • PCQM4Mv2: On this massive dataset of 4 million molecules, TGT-At achieved a Validation Mean Absolute Error (MAE) of 67.1 meV, setting a new SOTA and significantly outperforming previous leaders like UniMol+.
  • OC20 (IS2RE): In the Open Catalyst 2020 challenge, TGT-At achieved an MAE of 403.0 meV on the Initial Structure to Relaxed Energy task, the highest performance recorded for "direct" methods that avoid iterative relaxation.
  • General Graph Tasks: To demonstrate that triplet interactions benefit general graph reasoning, the model was tested on the Traveling Salesman Problem (TSP). TGT variants outperformed GatedGCN and EGT, proving the model's ability to understand the relative spatial positioning of nodes in a 2D plane.

Discussion and Limitations

TGT demonstrates that a neural approach can learn the underlying physics of atomic distances directly from data, often outperforming classical geometry estimates. However, certain challenges remain. The $O(N^3)$ complexity of the attention mechanism remains a hurdle for modeling very large structures like proteins. Additionally, because the model relies on distance matrices, it currently cannot distinguish between enantiomers (chiral molecules that are mirror images of each other), as their internal distance profiles are identical.

Future work aims to explore sparse or low-rank triplet interactions to reduce computational overhead and extend the TGT framework to tasks such as molecular conformation generation and larger biological systems.

Summary updated

BibTeX
@inproceedings{hussain2024triplet,
  author = {Md Shamim Hussain and Mohammed J Zaki and Dharmashankar Subramanian},
  title = {{Triplet Interaction Improves Graph Transformers: Accurate Molecular Graph Learning with Triplet Graph Transformers}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=iPFuWc1TV2},
}
Figure