Dynamic Graph Representation Learning via Self-Attention Networks

Aravind Sankar, Yanhong Wu, Liang Gou, Wei Zhang, Hao YangarXiv 2018

Introduction

Real-world networks, such as social media interactions or financial transactions, are inherently dynamic. Traditional graph representation learning methods like node2vec or Graph Convolutional Networks (GCNs) are primarily designed for static snapshots, failing to capture the temporal evolution of nodes and links. Existing dynamic embedding techniques often rely on temporal smoothness constraints or Recurrent Neural Networks (RNNs). However, smoothness constraints struggle with abrupt behavioral shifts, and RNNs face challenges with long-range dependencies and parallelization.

DySAT (Dynamic Self-Attention Network) addresses these limitations by employing a "two-dimensional" self-attention mechanism that captures both structural neighborhoods and temporal dynamics efficiently.

Methodology: Two-Dimensional Attention

DySAT processes a sequence of graph snapshots through a stacked architecture of structural and temporal attention layers. This design allows the model to learn node representations that are sensitive to both the immediate local graph structure and the long-term evolution of the network.

The DySAT architecture: Structural self-attention captures local topology at each time step, followed by temporal self-attention to model evolution across snapshots.

Structural Self-Attention

For each time step $t$, the model employs a structural self-attention mechanism. In this phase, a node "attends" to its immediate neighbors. Similar to Graph Attention Networks (GAT), the model learns to assign different weights to different neighbors, effectively identifying which connections are most relevant to a node's current context. This is crucial for capturing the local topology of the graph at any specific point in time.

Temporal Self-Attention

Once the structural features are extracted, DySAT applies temporal self-attention across the sequence of snapshots. For a single node, the model attends to its own previous representations. Inspired by the Transformer architecture, this mechanism allows the model to capture long-range dependencies and identify specific historical events that are predictive of future states, regardless of how far back they occurred in the timeline. This avoids the "vanishing gradient" issues common in RNN-based models.

Training and Loss

The model incorporates position-aware encodings to maintain a sense of temporal order, ensuring the model knows which snapshot came first. It is trained in an unsupervised manner using a binary cross-entropy loss function. This objective encourages nodes that frequently co-occur in random walks at a specific time step to have similar embeddings, while pushing apart the embeddings of nodes that do not.

Experimental Evaluation

The authors evaluated DySAT on four diverse datasets representing two distinct types of networks: communication networks (Enron, UCI) and bipartite rating networks (Yelp, ML-10M).

Key Results

DySAT consistently outperformed all baselines, including static methods like node2vec and GraphSAGE, as well as dynamic models like DynamicTriad and DynAERNN.

Performance comparison of DySAT against baselines across four datasets. DySAT (bottom row) achieves the highest Micro-AUC and Macro-AUC scores, significantly outperforming competitors.

Key findings from the experiments include:

  • Superior Predictive Accuracy: DySAT achieved an average gain of 3.6% in macro-AUC over the previous state-of-the-art. It showed particular strength in the ML-10M dataset, reaching a Macro-AUC of 93.68.
  • Efficiency and Scalability: By utilizing parallelizable self-attention instead of sequential RNNs, DySAT is significantly faster. The authors report it is roughly 10x faster than DynAERNN on GPUs. On the large ML-10M dataset, DySAT took only 0.72 seconds per mini-batch.
  • Stability and Robustness: Unlike static methods that often show erratic performance as graph structures shift, DySAT maintains high predictive accuracy across all time steps. It also performs well on nodes that appear for the first time in later snapshots, as the structural attention provides a strong initial context.

Discussion and Future Work

While DySAT represents a significant advancement, several areas for future exploration remain. Managing large adjacency matrices in memory is a challenge; future iterations could benefit from mini-batch sampling techniques. Additionally, extending the framework from discrete snapshots to continuous-time event streams would broaden its applicability. Preliminary work on IncSAT also suggests that the model can be adapted for streaming data environments where memory efficiency is paramount.

Summary updated

BibTeX
@misc{sankar2018dynamic,
  author = {Aravind Sankar and Yanhong Wu and Liang Gou and Wei Zhang and Hao Yang},
  title = {{Dynamic Graph Representation Learning via Self-Attention Networks}},
  year = {2018},
  eprint = {1812.09430},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.09430},
}
Figure