Weisfeiler and Leman Follow the Arrow of Time: Expressive Power of Message Passing in Temporal Event Graphs
Authors: Franziska Heeg, Jonas Sauer, Petra Mutzel, Ingo Scholtes
Organizations: Chair of Machine Learning for Complex Networks, Center for AI and Data Science (CAIDAS), University of Würzburg, Würzburg, Germany · Karlsruhe Institute of Technology, University of Karlsruhe, Karlsruhe, Germany · Chair of Computational Analytics, Institute for Computer Science 1, University of Bonn, Bonn, Germany
An important characteristic of temporal graphs is how the directed arrow of time influences their causal topology, i.e., which nodes can possibly influence each other causally via time-respecting paths. The resulting patterns are often neglected by temporal graph neural networks (TGNNs). To formally analyze the expressive power of TGNNs, we lack a generalization of graph isomorphism to temporal graphs that fully captures their causal topology. Addressing this gap, we introduce the notion of consistent event graph isomorphism, which utilizes a time-unfolded representation of time-respecting paths in temporal graphs. We compare this definition with existing notions of temporal graph isomorphisms. We illustrate and highlight the advantages of our approach and develop a temporal generalization of the Weisfeiler-Leman algorithm to heuristically distinguish non-isomorphic temporal graphs. Building on this theoretical foundation, we derive a novel message passing scheme for temporal graph neural networks that operates on the event graph representation of temporal graphs. An experimental evaluation shows that our approach performs well in a temporal graph classification experiment.
Figures & tables
Figure 1: A temporal graph Gτ (left) and the corresponding augmented event graph Gaug (right). In Gaug , gray nodes have label 0 and white nodes have label 1 . Timestamped edges (u,v;t) are represented as nodes uvt .
Figure 2: Example illustrating different temporal graph isomorphism definitions for maximum waiting time δ=2 . Edges are labeled with timestamps. G1 is time-concatenated isomorphic to G2 , consistent event graph isomorphic to G2 and G3 , and time-aggregated isomorphic to G2 , G3 and G4 .
Data
Our Model
GAT
TGAT
TGN
CAW
PINT
ants-1-1
[ 3 ]
1.00 ± 0.00
0.52±0.04
0.54±0.05
0.86±0.03
0.94±0.01
0.86±0.03
ants-1-2
[ 3 ]
1.00 ± 0.00
0.54±0.02
0.54±0.04
0.85±0.03
0.91±0.02
0.83±0.04
sp-workplace
[ 7 ]
1.00 ± 0.00
0.53±0.03
0.55±0.04
0.75±0.04
0.92±0.02
0.83±0.04
sp-hospital
[ 30 ]
1.00 ± 0.00
0.53±0.04
0.55±0.03
0.75±0.04
0.98±0.01
0.95±0.01
eu-email-dept2
[ 20 ]
1.00 ± 0.00
0.54±0.07
0.52±0.03
0.74±0.04
0.76±0.03
0.91±0.02
Table 1: Mean accuracy for binary classification in real-world temporal graphs. For each dataset, we split the timeline into windows of 500 timestamps, generate 400 graphs per window via the shuffling procedures ( Appendix E ), performed 10 runs per window, and report the average over all runs.
Figure 3: Mean classification accuracy for temporal graphs generated with σ1 vs. σ2 (25 runs each).
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: The temporal graph Gτ (left) and corresponding augmented event graph Gaug (center) from Figure 1 , as well as the compressed augmented event graph Gcomp (right). In Gaug and Gcomp , gray nodes have label 0 and white nodes have label 1 . Timestamped edges (u,v;t) are represented as nodes uvt . In Gcomp , edge weights represent the number of connected components of Gaug in which the edge appears.
Figure 5: An example of two temporal graphs G1τ and G2τ which are consistent event graph isomorphic, but there is no node-consistent isomorphism between the compressed event graphs.
Dataset
∣V∣
∣E∣
∣Eτ∣
δ in sec.
ants-1-1
[ 3 ]
89
947
1,911
30
ants-1-2
[ 3 ]
72
862
1,820
30
sp-workplace
[ 7 ]
92
755
9,827
3,600
sp-hospital
[ 30 ]
75
1,139
32,424
3,600
eu-email-dept2
[ 20 ]
162
1,772
46,772
3,600
Appendix
Table 2: Statistics of empirical temporal graphs used in our evaluation. ∣V∣ is the number of nodes, ∣Eτ∣ the number of timestamped edges, and δ the maximum waiting time used to construct the augmented event graph.
Our model
GAT
batch size
200
50
weight_decay
0.0001
0
learning rate
0.001
0.001
DirGNN layers
32 → 16 → 8
–
GatConv layers
–
8 → 64 → 64
dense layers
8 → 4 → 1
64 → 1
Appendix
Table 3: Optimal hyperparameter values and number of tunable model parameters (i.e., model size) for our model and GAT.
ants-1-1
ants-1-2
workplace
hospital
eu-email-dept2
batch size
1
1
1
1
1
weight decay
0
0
0
0
0
learning rate
0.001
0.001
0.01
0.001
0.001
layers
64 → 128 → 1
64 → 128 → 64 → 1
64 → 128 → 1
64 → 128 → 1
64 → 128 → 64 → 1
aggr. node embeddings
mean
-
-
mean
-
pooling
-
-
-
-
max
Appendix
Table 4: Optimal hyperparameter values and number of tunable model parameters for CAW.
ants-1-1
ants-1-2
workplace
hospital
eu-email-dept2
batch size
1
1
1
1
1
weight decay
0
0
0
0
0
learning rate
0.001
0.001
0.01
0.001
0.001
layers
64 → 128 → 1
64 → 128 → 64 → 1
64 → 128 → 1
64 → 128 → 1
64 → 128 → 64 → 1
aggr. node embeddings
mean
-
mean
-
-
pooling
-
-
max
-
-
Appendix
Table 5: Optimal hyperparameter values and number of tunable model parameters for PINT.
ants-1-1
ants-1-2
workplace
hospital
eu-email-dept2
batch size
1
1
1
1
1
weight decay
0
0
0
0
0
learning rate
0.01
0.001
0.001
0.01
0.001
layers
64 → 128 → 1
64 → 128 → 1
64 → 128 → 1
64 → 128 → 1
64 → 128 → 1
aggregation node embeddings
mean
mean
last
mean
mean
pooling
-
max
max
max
max
Appendix
Table 6: Optimal hyperparameter values and number of tunable model parameters for TGAT.
ants-1-1
ants-1-2
workplace
hospital
eu-email-dept2
batch size
1
1
1
1
1
weight decay
0
0
0
0
0
learning rate
0.001
0.001
0.001
0.001
0.001
layers
64 → 128 → 1
64 → 128 → 1
64 → 128 → 1
64 → 128 → 1
64 → 128 → 1
aggregation node embeddings
-
-
-
mean
-
pooling
max
mean
mean
-
max
Appendix
Table 7: Optimal hyperparameter values and number of tunable model parameters for TGN.
Library/Software
Version
CUDA
cu121
torch
2.4.1+cu121
torch_cluster
1.6.3+pt24cu121
torch_scatter
2.1.2+pt24cu121
torch_sparse
0.6.18+pt24cu121
torch_geometric
2.5.1
Appendix
Table 8: Version of key dependencies used in the implementation of our experimental evaluation
Figure 6: Standard deviation of accuracies of our TGNN model for classification of temporal graphs with σ1 vs. σ2 for all pairs of σ1,σ2 (associated with Figure 3 ).
Figure 7: Mean accuracies of a GAT model on the time-concatenated static graph for classification of temporal graphs with σ1 vs. σ2 for all pairs of σ1,σ2 . The mean standard deviation across all runs is 0.048 .
Experiment
Accuracy
Compressed augmented event graph
0.95 ± 0.03
No node labels
0.66 ± 0.20
Message passing only in one direction
0.63 ± 0.18
No edge weights
0.81 ± 0.22
Appendix
Table 9: Results of ablation study for the classification task in the synthetic cluster model, using σ1=0 and σ2=0.9 .
Temporal graph neural networks model how node relationships, graph structure, and features change over time to support prediction on evolving networks.
Real temporal interaction streams carry predictive structure in short-horizon motif patterns -- repetition, reciprocity, star diversity, triadic flow -- that vanilla temporal graph neural networks (TGNNs) often fail to expose to their edge scorers. We show this concretely on MOOC interaction prediction, where a small four-feature family of past-window star counts already delivers most of the lift over a strong static GNN. Across a wide set of real and synthetic temporal datasets we find that motif activity organizes consistently along three scale-stable axes (dyadic recency/reciprocity, star diversity, triadic flow), and we use this empirical structure to design a compact 13-coordinate, leakage-safe, candidate-local motif feature map h(u, v, t) that linearly embeds into any static or temporal encoder without architectural changes. A temporal Weisfeiler-Leman (WL) analysis places the augmentation relative to the first level of an anchored temporal-WL hierarchy and exhibits a candidate-anchored pair on which motif features distinguish. We demonstrate empirically that the same augmentation consistently lifts performance across heterogeneous tasks: TGB link-property prediction across all five baselines, edge classification on Bitcoin Alpha/OTC and MOOC, and graph-level classification of synthetic temporal generators.
Dylan Sandfelder, Mihai Cucuringu, Xiaowen Dong
University of Oxford · University of California, Los Angeles
Temporal graph neural networks (TGNNs) have shown strong performance on dynamic graph learning tasks by continuously updating node memories from evolving interactions (i.e., events) and leveraging these memories for downstream predictions. As graphs grow rapidly in modern applications, training requires processing an increasing number of events; meanwhile, each event can update node memories used by later events, creating dependencies that constrain parallel execution and limit the benefits of additional computing resources. These costs motivate an upstream question: Are all events, and the dependencies they introduce, necessary for learning? We investigate this question through two roles of temporal events: prediction targets and historical events sampled as inputs. We observe that targets involving stable node memories tend to exhibit lower prediction loss, while filtering historical events associated with stable memories can retain similar training-loss trajectories in several evaluated settings. Together, these observations suggest an opportunity to identify input redundancy through changes in node memories. Building on this opportunity, we propose RAFT, a redundancy-aware input-filtering framework for TGNN training. RAFT tracks memory changes during training and uses them to guide two filters: a root-event filter removes selected prediction targets before training, and a support-event filter excludes selected historical context during sampling. Filtering inputs before their downstream preparation and processing reduces the work they trigger. Across three TGNN models and five datasets, RAFT reduces training inputs by 35.23% on average and up to 97.11%, while reducing recorded training time by up to 52.56% with negligible changes to model precisions.
Yue Dai, Sarah Zhou, Youtao Zhang
Department of Computer Science, Illinois Institute of Technology, Chicago, USA · BASIS Independent Silicon Valley, San Jose, CA, USA · Department of Computer Science, University of Pittsburgh, Pittsburgh, USA
Dynamic text-attributed graphs (DTAGs), where nodes, edges, and textual attributes evolve over time, are crucial in applications such as social networks, citation graphs, and knowledge graphs. However, existing approaches struggle to jointly model the temporal evolution of graph structures and the semantic richness of textual attributes. While Temporal Graph Neural Networks (TGNNs) capture evolving node relationships, they often lack contextual text reasoning. Conversely, Large Language Models (LLMs) excel in textual understanding but struggle with structured graph reasoning in temporal settings. To bridge this gap, we propose TemporalGraphLLM, a novel framework that can integrate any temporal GNN with an LLM for enhanced reasoning in DTAGs. Our approach fine-tunes LLMs using graph-time-aware instruction tuning and novel temporal GNNs injection to replace dedicated added tokens with graph embeddings. TemporalGraphLLM effectively leverages pretrained TGNNs within an LLM framework to achieve state-of-the-art performance on edge classification, link prediction, and edge-based text generation tasks. Extensive evaluation on real-world dynamic graph datasets demonstrates state-of-the-art performance. Our findings highlight the synergistic potential of LLMs and TGNNs, opening new directions for learning on evolving graphs.
Moran Beladev, Or Eitan, Gilad Katz +1
Department of Information Systems Engineering Ben-Gurion University of the Negev, Israel