How Attentive are Graph Attention Networks?
Shaked Brody, Uri Alon, Eran Yahav
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 12 OGB and other benchmarks while we match their parametric costs. Our code is available at https://github.com/tech-srl/how_attentive_are_ gats . 1 GATv2 is available as part of the PyTorch Geometric library, 2 the Deep Graph Library, 3 and the TensorFlow GNN library. 4 1 An annotated implementation of GATv2 is available at https://nn.labml.ai/graphs/gatv2/ 2 from torch_geometric.nn.conv.gatv2_conv import GATv2Conv 3 from dgl.nn.pytorch import GATv2Conv 4 from tensorflow_gnn.graph.keras.layers.gat_v2 import GATv2Convolution
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e93e7ea0-4a3c-4562-a3c8-4732d3ba7707Cited by top-tier papers246
- Pure Transformers are Powerful Graph LearnersJinwoo Kim, Dat Nguyen, Seonwoo Min, Sungjun Cho et al.NeurIPS 2022 · 311 citations
- Learning Dynamic Graph Representation of Brain Connectome with Spatio-Temporal AttentionByung-Hoon Kim, Jong Chul Ye, Jae-Jin KimNeurIPS 2021 · 224 citations
- Graph Inductive Biases in Transformers without Message PassingLiheng Ma, Chen Lin, Derek Lim, Adriana Romero-Soriano et al.ICML 2023 · 185 citations
- Periodic Graph Transformers for Crystal Material Property PredictionKeqiang Yan, Yi Liu, Yuchao Lin, Shuiwang JiNeurIPS 2022 · 167 citations
- Causal Attention for Interpretable and Generalizable Graph ClassificationYongduo Sui, Xiang Wang, Jiancan Wu, Min Lin et al.KDD 2022 · 166 citations
Builds on13
- Open Graph Benchmark: Datasets for Machine Learning on GraphsWeihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong et al.NeurIPS 2020 · 3,935 citations
- DropEdge: Towards Deep Graph Convolutional Networks on Node ClassificationYu Rong, Wenbing Huang, Tingyang Xu, Junzhou HuangICLR 2020 · 1,599 citations
- DeepGCNs: Can GCNs Go As Deep As CNNs?Guohao Li, Matthias Müller, Ali K. Thabet, Bernard GhanemICCV 2019 · 1,586 citations
- GraphSAINT: Graph Sampling Based Inductive Learning MethodHanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan et al.ICLR 2020 · 1,155 citations
- Self-Supervised Graph Transformer on Large-Scale Molecular DataYu Rong, Yatao Bian, Tingyang Xu, Weiyang Xie et al.NeurIPS 2020 · 1,113 citations
Related papers
- HONGAT: Graph Attention Networks in the Presence of High-Order NeighborsHeng-Kai Zhang, Yi-Ge Zhang, Zhi Zhou, Yufeng LiAAAI 2024 · 15 citations
- Learnable Graph Convolutional Attention NetworksAdrián Javaloy, Pablo Sánchez-Martín, Amit Levi, Isabel ValeraICLR 2023 · 6 citations
- GATE: How to Keep Out Intrusive NeighborsNimrah Mustafa, Rebekka BurkholzICML 2024 · 3 citations
- A Dynamical Systems-Inspired Pruning Strategy for Addressing Oversmoothing in Graph Attention NetworksBiswadeep Chakraborty, Harshit Kumar, Saibal MukhopadhyayICML 2025
- Graph External Attention Enhanced TransformerJianqing Liang, Min Chen, Jiye LiangICML 2024 · 11 citations
