An Empirical Study of Graphormer on Large-Scale Molecular Modeling Datasets

Di HearXiv 2022 · DOI

TL;DR

This paper presents "Graphormer-V2," an improved version of the Graphormer model that achieves state-of-the-art results on large-scale molecular modeling tasks. By introducing architectural modifications like a post-layer normalization strategy and enhanced 3D structural encodings, Graphormer-V2 demonstrates superior performance and generalization capabilities, particularly in quantum chemistry and catalyst design.

What Problem Does This Paper Address?

Graph neural networks (GNNs) are powerful tools for modeling molecular structures, but conventional message-passing GNNs (MPGNNs) face limitations in expressiveness and can suffer from over-smoothing. The original Graphormer, built on the Transformer architecture, addressed some of these issues by incorporating structural encodings. However, there was a need to further enhance its performance and adaptability for complex, large-scale molecular modeling tasks, especially those involving 3D spatial information and demanding high accuracy in predictions like quantum chemical properties and catalytic reactions.

Methods

The authors introduce "Graphormer-V2," an evolution of the original Graphormer. Key modifications include:

  • Post-Layer Normalization (Post-LN): Instead of the Pre-LN variant common in Transformers, they found that placing layer normalization after the residual blocks (Post-LN) leads to better generalization performance on large-scale molecular property prediction tasks, despite potentially slower initial convergence.
  • 3D Molecular Graph Modeling: Graphormer-V2 is extended to handle 3D molecular structures. This involves:
  • Spatial Encoding: Using Gaussian basis functions to encode Euclidean distances between atoms, capturing spatial relationships.
  • Centrality Encoding: Summing spatial encodings to represent atom importance within the 3D graph.
  • 3D Attention Sub-layer: A novel attention mechanism that decomposes attention into three directions based on relative position offsets, potentially maintaining rotational equivariance.
  • Periodic Boundary Condition (PBC) Handling: For crystal systems, they propose duplicating atoms within a cutoff distance across repeated cells rather than constructing multigraphs, which is more compatible with attention mechanisms.
  • Global Receptive Field: The paper theoretically analyzes Graphormer's global receptive field, contrasting it with the local nature of MPGNNs. This global view is shown to provide greater expressiveness, akin to the "congested clique" model in distributed computing theory, enabling it to solve problems that local MPGNNs cannot.

Datasets

The paper evaluates Graphormer-V2 on the following datasets:

  • PCQM4M (V1 and V2): A large-scale quantum chemistry dataset for predicting molecular properties based on Density Functional Theory (DFT). V2 includes 3D molecular structures.
  • OGBG-MolHIV: A dataset for predicting the ability of compounds to inhibit HIV replication, used to test fine-tuning on data-inadequate downstream tasks.
  • OC20 (Open Catalyst 2020): A large dataset for modeling catalyst-adsorbate reaction systems, used to evaluate 3D molecular modeling capabilities for predicting relaxed energies.

Key Insights and Ideas

  • Post-LN for Better Generalization: Counterintuitively, the simpler Post-LN architecture, often associated with slower convergence, yields superior generalization on large molecular datasets compared to the more common Pre-LN. This highlights the importance of architectural choices for specific downstream tasks.
  • 3D Information is Crucial: The explicit incorporation of 3D spatial information through novel encoding schemes significantly enhances Graphormer's ability to model complex molecular interactions, leading to better performance on tasks like energy prediction in catalytic systems.
  • Global Receptive Field as a Key Advantage: The theoretical analysis reveals that Graphormer's ability to consider all nodes simultaneously (global receptive field) fundamentally increases its expressive power compared to MPGNNs, which are limited by local message passing. This is a significant theoretical contribution to understanding GNN expressiveness.
  • Fine-tuning for Data Scarcity: Graphormer-V2, when pre-trained on large datasets, can be effectively fine-tuned on smaller, data-scarce tasks (like OGBG-MolHIV) to achieve strong performance, demonstrating its robust feature learning capabilities.

Key Results

  • PCQM4M: Graphormer-V2 achieves significantly lower Mean Absolute Error (MAE) than the vanilla Graphormer on the PCQM4M dataset, outperforming the first-place winner of the KDD Cup 2021. For instance, V2 Base achieved an MAE of 0.0348 on PCQv2 train, compared to 0.0416 for V1 Base.
  • OGBG-MolHIV: Graphormer-V2 demonstrates strong performance on this dataset, indicating its effectiveness for data-inadequate downstream tasks after fine-tuning.
  • OC20: Graphormer-V2 significantly outperforms competitors in the NeurIPS 2021 workshop's Open Catalyst Challenge, showcasing its advanced capabilities in modeling catalyst-adsorbate reaction systems. For the IS2RE task, V2Base (ensemble) achieved an MAE of 0.4722.

Limitations and Future Work

  • Generalization of Deep Models: The paper notes that while Graphormer-V2 shows improvements, there's still potential to develop deeper Graphormer models with even better generalization capabilities, as indicated by the observation that Graphormer Large had worse generalization on one dataset despite lower optimization error.
  • Theoretical Understanding: While a theoretical framework is developed to understand Graphormer's expressiveness via distributed computing theory, further exploration of its capabilities and limitations, especially concerning adaptive aggregation strategies, could be beneficial.
  • Rotational Equivariance: The paper suggests that sharing parameters in the 3D attention layer's linear projections could maintain rotational equivariance of the model's final estimation layer, hinting at potential avenues for further architectural refinement.

Summary updated

BibTeX
@misc{he2022empirical,
  author = {Di He},
  title = {{An Empirical Study of Graphormer on Large-Scale Molecular Modeling Datasets}},
  year = {2022},
  eprint = {2203.06123},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.06123},
}
Figure