GaAN: Gated Attention Networks for Learning on Large and Spatiotemporal Graphs

Jiani Zhang, Xingjian Shi, Junyuan Xie, Hao Ma, Irwin King, Dit-Yan Yeung

TL;DR

GaAN (Gated Attention Networks) introduces a novel graph aggregator that uses a lightweight convolutional sub-network to dynamically weight the importance of different attention heads. By integrating this gated mechanism into a new Graph Gated Recurrent Unit (GGRU) framework, the authors achieve state-of-the-art results in both static node classification and complex spatiotemporal traffic forecasting.

What Problem Does This Paper Address?

Learning on graph-structured data is challenging because models must effectively capture both node features and the underlying structural relationships. While Graph Convolutional Networks (GCNs) and Graph Attention Networks (GATs) have made strides, they have limitations. Standard multi-head attention (like in GAT) treats all attention heads equally, potentially wasting computation on irrelevant representation subspaces or allowing "noisy" heads to mislead predictions.

Furthermore, applying these models to large-scale graphs or dynamic spatiotemporal data (like traffic flow) introduces significant memory and computational hurdles. The authors aim to create a more flexible, scalable, and powerful architecture that can handle both static and time-varying graph data.

Methods

The core innovation is the GaAN aggregator. Unlike traditional multi-head attention, which simply concatenates the output of all heads, GaAN introduces a gating mechanism.

  1. Gated Attention: A small, light-weighted convolutional sub-network ($\psi_g$) takes the features of a center node and its neighbors to compute a "soft gate" (a value between 0 and 1) for each attention head. This allows the model to dynamically prioritize or ignore specific heads based on the local graph context.
  2. Scalable Sampling: To handle massive graphs, the authors improved upon the GraphSAGE sampling strategy. By merging repeated nodes sampled from different neighborhoods within a mini-batch, they significantly reduced memory consumption and increased training efficiency.
  3. Graph Gated Recurrent Unit (GGRU): The authors proposed a unified framework to extend graph aggregators to spatiotemporal tasks. By replacing the standard linear transformations in a GRU with graph aggregation operations (like GaAN), they created a recurrent unit capable of modeling time-series data defined on graphs.
Figure 1: Illustration of a three-head gated attention ag- gregator with two center nodes in a mini-batch. |N1| = 3 and |N2| = 2 respectively. Different colors indicate dif- ferent attention heads. Gates in darker color stands for larger values. (Best viewed in color)

Datasets

The model was evaluated on three diverse real-world benchmarks:

  • PPI (Protein-Protein Interaction): A multi-label inductive node classification task involving 24 sub-graphs of protein interactions.
  • Reddit: A large-scale multi-class node classification task where nodes are posts and edges represent users commenting on both. This dataset tests the model's ability to scale.
  • METR-LA: A spatiotemporal dataset containing traffic speed information from 207 sensors on Los Angeles highways over four months.

Key Insights and Ideas

  • Attention is not always equal: The primary "aha moment" is that different attention heads capture different types of structural information, and their relevance varies from node to node. Gating provides a "soft" way to select the most useful features for each specific neighborhood.
  • Efficiency through Gating: Because the gating sub-network is very small (using simple max and average pooling), it adds negligible parameter overhead while providing a significant boost in representational power.
  • Recurrence + Graph Structure: The GGRU framework demonstrates that graph aggregators are modular. You can plug a spatial aggregator into a temporal recurrent structure to create a powerful model for dynamic systems like traffic networks.
  • Redundancy in Sampling: The observation that standard neighborhood sampling leads to many redundant node computations led to the "merge" strategy, which is a simple but highly effective trick for scaling to large graphs.
Comparison of different graph aggregators, showing how GaAN (b) differs from standard attention (a), pooling (c), and pairwise sum (d) methods.

Key Results

  • Inductive Node Classification: GaAN achieved a state-of-the-art Micro-F1 score of 98.71 on PPI and 96.36 on Reddit, consistently outperforming GAT, GraphSAGE, and other baseline aggregators.
  • Traffic Forecasting: In the METR-LA task, the GaAN-based GGRU outperformed existing models like DCRNN and GCRNN. Notably, it achieved higher accuracy even without using explicit edge information (like road distance), which DCRNN relies on.
  • Ablation Studies: Visualizing the gate values confirmed that the model indeed learns to assign different importance levels to different heads for different nodes, justifying the gated architecture.

Limitations and Future Work

While highly effective, the authors note a few areas for growth:

  • Edge Features: The current GaAN implementation focuses on node features. While the authors state it's straightforward to incorporate edge features (like distances or relationship types), they haven't explored this extensively in this paper.
  • Extreme Scale: While the merge strategy helps, processing graphs with billions of nodes remains a frontier.
  • Beyond Graphs: The authors suggest that the gated multi-head attention mechanism could be applied to other domains, such as Natural Language Processing (e.g., machine translation), where standard multi-head attention is already a staple.

Summary updated

Abstract

We propose a new network architecture, Gated Attention Networks (GaAN), for learning on graphs. Unlike the traditional multi-head attention mechanism, which equally consumes all attention heads, GaAN uses a convolutional sub-network to control each attention head's importance. We demonstrate the effectiveness of GaAN on the inductive node classification problem. Moreover, with GaAN as a building block, we construct the Graph Gated Recurrent Unit (GGRU) to address the traffic speed forecasting problem. Extensive experiments on three real-world datasets show that our GaAN framework achieves state-of-the-art results on both tasks.
BibTeX
@inproceedings{zhang2018gaan,
  author = {Jiani Zhang and Xingjian Shi and Junyuan Xie and Hao Ma and Irwin King and Dit-Yan Yeung},
  title = {{GaAN: Gated Attention Networks for Learning on Large and Spatiotemporal Graphs}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2018},
  url = {https://openreview.net/forum?id=DswSfmurkf},
}
Figure