Scalable and Efficient Temporal Graph Representation Learning via Forward Recent Sampling

Yuhong Luo, Pan Li

TL;DR

This paper introduces No-Looking-Back (NLB), a novel framework for temporal graph representation learning that significantly speeds up training and inference. By using a GPU-accelerated "forward recent sampling" strategy with hash tables, NLB avoids the computationally expensive backtracking of traditional methods, achieving state-of-the-art accuracy while being dramatically more efficient.

What Problem Does This Paper Address?

Temporal graphs are crucial for modeling dynamic systems like social networks, financial transactions, and communication patterns. Learning representations of nodes in these evolving graphs is key for tasks like predicting future interactions or classifying node properties. However, existing methods for temporal graph representation learning (TGRL) are often computationally intensive. The main bottleneck is the process of "sampling temporal neighbors" – identifying and selecting relevant past interactions for each node. Traditional methods typically involve backtracking through a node's entire interaction history, which is slow and energy-consuming, especially for large-scale, real-time applications. This latency and computational burden hinder the practical deployment of TGRL.

Methods

The core innovation of NLB is its forward recent sampling strategy. Instead of looking backward through a node's history, NLB maintains a GPU-executable, size-constrained hash table for each node. This hash table stores a down-sampled set of the most recent interactions.

Here's how it works:

  • Forward Sampling: When a new interaction (a link) arrives, it's processed forward. The hash table for the involved nodes is updated.
  • Hash Table Maintenance: The hash table has a fixed size. New interactions are inserted using a hashing mechanism. If a collision occurs (meaning the hash table slot is already occupied), the new interaction replaces the old one with a certain probability ($\alpha$). This probabilistic replacement, combined with the fixed size, ensures that the table primarily holds recent interactions. The maintenance of this table is efficient, with $O(1)$ complexity per new link.
  • GPU Acceleration: The entire process is designed to be GPU-compatible, maximizing parallelism and efficiency.
  • Two Variants:
    • NLB-edge: Uses a combination of neighbor ID and timestamp as the hash key, effectively achieving "recent sampling" of links.
  • NLB-node: Uses only the neighbor ID as the hash key, achieving "recent node-wise sampling" (sampling the latest interaction with each unique neighbor).

This approach eliminates the need for expensive backtracking and sampling on the CPU during inference, allowing for rapid retrieval of down-sampled neighbors directly from the GPU.

Datasets

The authors evaluated NLB on six publicly available real-world datasets:

  • Wikipedia
  • Reddit
  • GDELT
  • MAG
  • Ubuntu
  • Wiki-talk

These datasets vary in scale, with some containing billions of temporal links and millions of nodes. The paper also mentions the Temporal Graph Benchmark (TGB) but states they built a separate evaluation pipeline due to the scale of their experiments, though they provide some TGB results in an appendix.

Key Insights and Ideas

  • Backtracking is the Bottleneck: The paper clearly identifies the backward traversal of historical interactions as the primary computational bottleneck in existing TGRL methods.
  • Forward Processing is Key: By shifting to a "forward recent sampling" paradigm, NLB sidesteps this bottleneck entirely.
  • Hash Tables for Efficiency: The use of GPU-accelerated hash tables is a clever way to manage a fixed-size set of recent interactions efficiently and enable $O(1)$ lookups.
  • Recent Sampling Matters: The experiments demonstrate that "recent sampling" (prioritizing newer interactions) is crucial for good performance, and NLB effectively achieves this without the computational cost.
  • Randomness is Beneficial: The probability $\alpha$ for replacing old entries in the hash table is important. Setting $\alpha=1$ (truncation) leads to performance degradation, highlighting the value of probabilistic, random replacement for capturing diverse recent information.

Key Results

NLB demonstrates strong performance across the board:

  • Accuracy: NLB-edge and NLB-node match or surpass state-of-the-art (SOTA) methods in link prediction and node classification accuracy on six real-world datasets.
  • Training Speed: NLB is 1.32-4.40$\times$ faster in training compared to competitive baselines.
  • Energy Efficiency: NLB is 1.2-7.94$\times$ more energy efficient than baselines.
  • Inference Latency: NLB achieves a significant speedup of 1.63-12.95$\times$ in inference latency compared to the fastest baseline.
  • Scalability: The framework is designed for and evaluated on large-scale datasets, handling billions of links.

Limitations and Future Work

  • Single GPU Limitation: For extremely large industry-level graphs, maintaining down-sampled neighbors for all nodes on a single GPU might not be feasible.
  • Future Direction: The authors plan to explore distributed GPUs to partition the hash tables across multiple devices, enabling scalability to even larger graphs while maintaining fast maintenance.

Summary updated

Abstract

Temporal graph representation learning (TGRL) is essential for modeling dynamic systems in real-world networks. However, traditional TGRL methods, despite their effectiveness, often face significant computational challenges and inference delays due to the inefficient sampling of temporal neighbors. Conventional sampling methods typically involve backtracking through the interaction history of each node. In this paper, we propose a novel TGRL framework, No-Looking-Back (NLB), which overcomes these challenges by introducing a forward recent sampling strategy. This strategy eliminates the need to backtrack through historical interactions by utilizing a GPU-executable, size-constrained hash table for each node. The hash table records a down-sampled set of recent interactions, enabling rapid query responses with minimal inference latency. The maintenance of this hash table is highly efficient, operating with $O(1)$ complexity. Fully compatible with GPU processing, NLB maximizes programmability, parallelism, and power efficiency. Empirical evaluations demonstrate that NLB not only matches or surpasses state-of-the-art methods in accuracy for tasks like link prediction and node classification across six real-world datasets but also achieves 1.32-4.40$\times$ faster training, 1.2-7.94$\times$ greater energy efficiency, and 1.63-12.95$\times$ lower inference latency compared to competitive baselines.
BibTeX
@inproceedings{luo2024scalable,
  author = {Yuhong Luo and Pan Li},
  title = {{Scalable and Efficient Temporal Graph Representation Learning via Forward Recent Sampling}},
  booktitle = {LoG},
  year = {2024},
  url = {https://openreview.net/forum?id=wlB56RZ2df},
}
Figure