NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DyG2Vec: Efficient Representation Learning for Dynamic Graphs

Mohammad Ali Alomrani, Mahdi Biparva, Yingxue Zhang, Mark Coates

Abstract

Dynamic graphs, characterized by evolving nodes and edges, present significant modeling challenges. Existing methods often rely on sequential memory updates or expensive random walks, limiting scalability and parallelization. We introduce DyG2Vec, an efficient framework for dynamic graph representation learning. By employing window-based subgraph sampling and a non-contrastive self-supervised learning (SSL) objective, DyG2Vec achieves state-of-the-art accuracy on link prediction and node classification tasks while delivering a 5-10x speedup over previous top-tier models.

Introduction

Representing dynamic graphs—such as social networks, financial transaction logs, or user-item interaction streams—is critical for various downstream tasks. However, current state-of-the-art models face a trade-off between accuracy and efficiency. Memory-based models (e.g., TGN) suffer from sequential processing bottlenecks, while random walk-based models (e.g., CaW) are computationally intensive and difficult to parallelize on GPUs. Furthermore, many existing methods are task-specific, hindering their utility for general-purpose pre-training.

DyG2Vec addresses these limitations by providing a task-agnostic encoder designed for efficiency and scalability. It moves away from global history and sequential updates, favoring a localized, parallelizable approach that supports self-supervised learning on unlabeled data.

Methodology

The DyG2Vec architecture is built upon several key innovations designed to maximize both representational power and computational throughput.

The DyG2Vec pipeline for self-supervised representation learning on dynamic graphs.

Window-based Subgraph Sampling

Instead of maintaining a global state or sampling long temporal paths, DyG2Vec operates on a fixed-size window of recent interactions. This window-based approach serves as a natural regularizer, focusing the model on the most relevant recent temporal patterns while ensuring constant memory and computational complexity regardless of the total graph history.

Temporal Edge Encoding and Flat Message Passing

To capture structural evolution without recursive overhead, the model incorporates "Temporal Degree Centrality" and "Common Neighbors" directly into edge features. Unlike traditional attention-based models that use causal, recursive message passing, DyG2Vec employs "flat" propagation on the sampled subgraph. This design is highly optimized for GPU parallelism, significantly reducing training and inference times.

Non-Contrastive Self-Supervised Learning

DyG2Vec utilizes a joint-embedding architecture inspired by VICReg for self-supervised pre-training. The model learns to produce similar representations for two different "views" (distorted versions) of the same temporal subgraph. This non-contrastive objective prevents representation collapse without requiring the large batches or negative samples typical of standard contrastive learning.

Experimental Setup

We evaluated DyG2Vec on seven diverse real-world dynamic graph benchmarks, spanning user-interaction datasets (Reddit, Wikipedia, MOOC, LastFM) and communication/social networks (UCI, Enron, SocialEvolution). These datasets range in size from 74 to 11,000 nodes and vary significantly in temporal density, allowing for a robust assessment in both transductive (seen nodes) and inductive (unseen nodes) settings.

Results and Discussion

DyG2Vec consistently outperforms existing baselines in both predictive accuracy and computational efficiency.

Performance comparison of DyG2Vec against state-of-the-art baselines across seven datasets.

Predictive Performance

As shown in the results table, DyG2Vec achieves state-of-the-art performance across all tested datasets. On future link prediction, it outperformed the previous best model (CaW) by an average of 4.23% in transductive settings and 3.30% in inductive settings. Notably, on the MOOC dataset for node classification, DyG2Vec surpassed all baselines by over 10% in AUC.

Efficiency and Scalability

The move away from sequential memory updates allows DyG2Vec to fully leverage GPU acceleration. In practice, this translates to a 5-10x speedup compared to other top-tier models. For instance, on the SocialEvolution dataset, DyG2Vec's inference time is orders of magnitude lower than CaW and significantly faster than memory-based methods like TGN, making it suitable for real-time streaming applications.

Key Insights

  • Recentness Bias: Experiments suggest that a small window of recent history is often sufficient for high performance, indicating that the immediate past is highly predictive in many dynamic graph contexts.
  • SSL Robustness: Self-supervised pre-training proves particularly effective in low-label regimes, where pre-training on unlabeled structure prevents overfitting and boosts downstream accuracy.

Conclusion

DyG2Vec demonstrates that efficient, window-based attention combined with non-contrastive SSL can outperform more complex, sequential, or path-based models. While the window-based approach might face challenges in scenarios with extremely long-range dependencies, its performance on current benchmarks suggests such cases are rare. Future work will explore more complex temporal SSL paradigms and scaling the architecture to billion-scale graphs.

Summary updated

BibTeX
@article{alomrani2024dyg,
  author = {Mohammad Ali Alomrani and Mahdi Biparva and Yingxue Zhang and Mark Coates},
  title = {{DyG2Vec: Efficient Representation Learning for Dynamic Graphs}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=lqPXp4QrDZ},
}
Figure