HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

How Attentive are Graph Attention Networks?

Shaked Brody; Uri Alon; Eran Yahav

How Attentive are Graph Attention Networks?

Abstract

Graph Attention Networks (GATs) are one of the most popular GNN architectures and are considered as the state-of-the-art architecture for representation learning with graphs. In GAT, every node attends to its neighbors given its own representation as the query. However, in this paper we show that GAT computes a very limited kind of attention: the ranking of the attention scores is unconditioned on the query node. We formally define this restricted kind of attention as static attention and distinguish it from a strictly more expressive dynamic attention. Because GATs use a static attention mechanism, there are simple graph problems that GAT cannot express: in a controlled problem, we show that static attention hinders GAT from even fitting the training data. To remove this limitation, we introduce a simple fix by modifying the order of operations and propose GATv2: a dynamic graph attention variant that is strictly more expressive than GAT. We perform an extensive evaluation and show that GATv2 outperforms GAT across 11 OGB and other benchmarks while we match their parametric costs. Our code is available at https://github.com/tech-srl/how_attentive_are_gats . GATv2 is available as part of the PyTorch Geometric library, the Deep Graph Library, and the TensorFlow GNN library.

Benchmarks

BenchmarkMethodologyMetrics
graph-classification-on-ddGATv2
Accuracy: 75.966±2.191
graph-classification-on-enzymesGATv2
Accuracy: 77.987±2.112
graph-classification-on-imdb-bGATv2
Accuracy: 80.000±2.739
graph-classification-on-nci1GATv2
Accuracy: 82.384±1.700
graph-classification-on-nci109GATv2
Accuracy: 83.092±0.764
graph-classification-on-proteinsGATv2
Accuracy: 77.679±2.187
graph-regression-on-esr2GATv2
R2: 0.655±0.000
RMSE: 0.518±0.655
graph-regression-on-f2GATv2
R2: 0.885±0.000
RMSE: 0.344±0.885
graph-regression-on-kitGATv2
R2: 0.826±0.000
RMSE: 0.453±0.826
graph-regression-on-lipophilicityGATv2
R2: 0.821±0.009
RMSE: 0.534±0.014
graph-regression-on-parp1GATv2
R2: 0.919±0.000
RMSE: 0.356±0.919
graph-regression-on-pgrGATv2
R2: 0.666±0.000
RMSE: 0.558±0.666
graph-regression-on-zinc-fullGATv2
Test MAE: 0.079±0.004
molecular-property-prediction-on-esolGATv2
R2: 0.928±0.005
RMSE: 0.549±0.020
molecular-property-prediction-on-freesolvGATv2
R2: 0.970±0.007
RMSE: 0.676±0.081

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp