Modeling Dynamic Heterogeneous Network for Link Prediction Using Hierarchical Attention with Temporal RNN

Hansheng Xue, Luwei Yang, Wen Jiang, Yi Wei, Yi Hu, Yu Lin

Abstract

Real-world networks are characterized by both heterogeneity—diverse node and edge types—and dynamics—evolution over time. Traditional network embedding methods often focus on one dimension while neglecting the other. This paper introduces DyHATR, a novel framework that integrates hierarchical attention with temporal Recurrent Neural Networks (RNNs) to capture complex structural and temporal dependencies. By combining node-level and edge-level attention with a temporal self-attention mechanism, DyHATR achieves state-of-the-art performance in dynamic link prediction across multiple real-world datasets.

Introduction

Most early network embedding techniques, such as DeepWalk or Node2vec, operate under the assumption of a static, homogeneous environment where all nodes and edges are of a single type and connections remain fixed. However, real-world systems like e-commerce platforms or social networks are inherently complex. For instance, an e-commerce network involves different node types (users, items) and interaction types (clicks, purchases), where a "purchase" carries more weight than a "click." Furthermore, user interests are dynamic and shift over time.

As shown in the taxonomy below, existing methods typically fall into categories that address either heterogeneity (SHENE) or dynamics (DHONE), but rarely both (DHENE) effectively. DyHATR bridges this gap by learning embeddings that reflect both the "what" (interaction type) and the "when" (evolutionary patterns).

Taxonomy of network embedding methods across homogeneity, heterogeneity, and dynamics.

Methodology

The DyHATR architecture is composed of two primary modules designed to handle the dual challenges of heterogeneity and dynamics.

Hierarchical Attention (HAT)

To manage heterogeneity, the model employs a two-level attention mechanism:

  • Node-level Attention: Similar to Graph Attention Networks (GAT), this learns the relative importance of neighbors within a specific edge type. This allows the model to discern which specific interactions (e.g., which specific "clicked" items) are most representative of a node's current state.
  • Edge-level Attention: This layer aggregates information across different edge types. It learns to assign higher weights to more significant interactions, such as prioritizing "purchase" edges over "view" edges when generating the final node representation.

Temporal Attentive RNN

To capture network dynamics, DyHATR treats the network as a sequence of snapshots ($G^1, G^2, ... G^T$):

  • RNN Layer: Node embeddings generated by the HAT layer are processed through an RNN (LSTM or GRU) to capture sequential evolution.
  • Temporal Self-Attention: To overcome the limitations of standard RNNs in long sequences, a self-attention layer is applied over the hidden states of all time steps. This allows the model to identify and focus on the most relevant historical snapshots for future link prediction, effectively handling periodic or bursty behaviors.
The complete DyHATR architecture, featuring Hierarchical Attention (HAT) for spatial heterogeneity and a Temporal Attentive RNN for temporal dynamics.

Experimental Evaluation

The authors evaluated DyHATR on four diverse real-world datasets:

  • Twitter (Higgs): 100k nodes with retweet, reply, and mention edges.
  • Math-Overflow: 24k nodes capturing various interaction types over 11 snapshots.
  • EComm & Alibaba.com: Transactional and behavioral logs featuring multiple interaction types (click, buy, cart, etc.).

Key Results

DyHATR consistently outperformed both static (GAT, metapath2vec) and dynamic (DySAT, EvolveGCN) baselines. On the EComm dataset, DyHATR achieved an AUROC of 0.696, surpassing the best baseline, metapath2vec-GRU (0.668). Ablation studies confirmed that both Hierarchical Attention and Temporal Self-Attention are critical; removing either component led to a significant performance decline. Additionally, the model's ability to incorporate raw node attributes (e.g., user demographics) further improved results, raising the EComm AUROC to 0.704.

Conclusion

DyHATR demonstrates that capturing the "evolutionary pulse" of a network requires high-frequency observation and a sophisticated attention hierarchy. While the model introduces higher computational complexity due to its dual-attention layers, its superior performance in link prediction highlights the necessity of modeling both heterogeneity and dynamics in unison. Future research may explore continuous-time embeddings to move beyond discrete snapshots and extend the framework to tasks like community detection.

Summary updated

BibTeX
@inproceedings{xue2020modeling,
  author = {Hansheng Xue and Luwei Yang and Wen Jiang and Yi Wei and Yi Hu and Yu Lin},
  title = {{Modeling Dynamic Heterogeneous Network for Link Prediction Using Hierarchical Attention with Temporal RNN}},
  booktitle = {ECML/PKDD},
  year = {2020},
  url = {https://openreview.net/forum?id=mZJRsTwEFk},
}
Figure