Continuous Temporal Graph Networks for Event-Based Graph Data

Jin Guo, Zhen Han, su zhou, Jiliang Li, Volker Tresp, Yuyi Wang

Abstract

There has been an increasing interest in modeling continuous-time dynamics of temporal graph data. Previous methods encode time-evolving relational information into a low-dimensional representation by specifying discrete layers of neural networks, while real-world dynamic graphs often vary continuously over time. Hence, we propose Continuous Temporal Graph Networks (CTGNs) to capture continuous dynamics of temporal graph data. We use both the link starting timestamps and link duration as evolving information to model continuous dynamics of nodes. The key idea is to use neural ordinary differential equations (ODE) to characterize the continuous dynamics of node representations over dynamic graphs. We parameterize ordinary differential equations using a novel graph neural network. The existing dynamic graph networks can be considered as a specific discretization of CTGNs. Experiment results on both transductive and inductive tasks demonstrate the effectiveness of our proposed approach over competitive baselines.

Introduction

Most real-world networks are inherently dynamic, characterized by users interacting with items, researchers citing papers, or social connections evolving over time. Traditionally, these systems are modeled either as a series of static "snapshots" (Discrete-Time Dynamic Graphs) or as a sequence of instantaneous events (Continuous-Time Dynamic Graphs).

However, existing models often overlook a critical feature: link duration. In event-based graphs, the length of an interaction frequently signals the strength or nature of a relationship. For instance, a user clicking a movie and watching for only 10 seconds likely indicates a lack of interest, whereas a two-hour viewing session suggests high engagement. Standard models typically treat these as identical "events," losing valuable context. Furthermore, stacking discrete neural layers to capture complex dynamics often leads to "over-smoothing," where node representations become indistinguishable.

Illustration of how interaction duration (e.g., watch time) signals user preference in dynamic graphs.

Methodology: Continuous Temporal Graph Networks (CTGN)

The proposed CTGN framework treats node representations as continuous functions of time, moving beyond discrete snapshots. The architecture follows an Encoder-ODE-Decoder flow designed to capture the continuous evolution of graph states.

The CTGN architecture featuring a Neural ODE module to evolve node representations continuously.

1. Memory and Message Passing

The model maintains a "memory" for each node using a Gated Recurrent Unit (GRU). This memory stores a compressed summary of the node's historical interactions, providing a temporal context for future predictions.

2. Temporal Encoder

A graph attention layer projects nodes into a latent space. This projection is based on the node's own features and the recent history of its neighbors, allowing the model to capture local structural dynamics.

3. Neural ODE Module

The core innovation of CTGN is the Neural ODE module. Instead of passing the latent state through fixed, discrete layers, CTGN defines the derivative of the node state using a neural network. An ODE solver then integrates this state over the actual link duration. This allows the node's representation to "evolve" specifically based on how long an interaction lasted, effectively using duration as an integration variable.

4. Regularization and Decoding

To ensure stability, a Time Smoothness Regularization loss term is introduced, penalizing large Euclidean distances between adjacent states to prevent erratic jumps. Finally, a task-specific decoder—such as an LSTM for link prediction or an MLP for node classification—utilizes these continuous embeddings.

Experimental Evaluation

The model was evaluated on five real-world datasets, including event-based data with explicit durations (Netflix, Mooc, Lastfm) and contact sequences where duration was proxied by the time between events (Wikipedia, Reddit).

Key Results

CTGN consistently outperformed competitive baselines like TGN, TGAT, and DyRep across both transductive and inductive tasks:

  • Superior Accuracy: On the Lastfm dataset (inductive task), CTGN achieved an Average Precision (AP) of 74.05%, outperforming TGN's 72.89%.
  • Consistency: On the Mooc dataset, it reached 97.97% precision in transductive link prediction.
  • Robustness: CTGN proved more stable across different training batch sizes compared to TGN, and remained superior even on datasets without explicit duration, suggesting that continuous modeling is inherently better at capturing temporal patterns.

Conclusion

CTGN introduces a novel approach to temporal graph modeling by leveraging Neural ODEs to incorporate interaction duration. By treating node evolution as a continuous process, the model avoids over-smoothing and captures deeper relational nuances. Future work may explore more efficient ODE solvers to reduce computational overhead on massive-scale graphs and investigate more sophisticated proxies for interaction strength in datasets lacking explicit duration features.

Summary updated

BibTeX
@inproceedings{guo2022continuous,
  author = {Jin Guo and Zhen Han and su zhou and Jiliang Li and Volker Tresp and Yuyi Wang},
  title = {{Continuous Temporal Graph Networks for Event-Based Graph Data}},
  booktitle = {DLG4NLP @ NAACL},
  year = {2022},
  url = {https://openreview.net/forum?id=ASBJkCusMC},
}
Figure