Introduction
In the rapidly evolving field of graph representation learning, temporal graphs—where nodes and edges are associated with specific timestamps—have become essential for modeling real-world systems like social networks, financial transactions, and recommendation engines. To predict future interactions, researchers rely on Temporal Graph Neural Networks (TGNNs). However, a critical yet overlooked aspect of this research is how these models are evaluated.
Traditionally, TGNNs are evaluated using a "batch-based" approach, where time-stamped edges are grouped into fixed-size batches (e.g., 200 edges) to optimize computational efficiency. This paper argues that this standard practice is fundamentally flawed, leading to significant information loss, data leakage, and misleading performance metrics.
The Pitfalls of Batch-Based Evaluation
The authors identify four primary issues inherent in the batch-oriented paradigm:
- Information Loss in Continuous-Time: By treating all edges within a batch as if they occurred simultaneously, models lose the high-resolution temporal ordering crucial for understanding sequential dependencies.
- Information Leakage in Discrete-Time: In datasets with snapshots (e.g., yearly votes), thousands of edges may share the same timestamp. Splitting these into sequential batches allows memory-based models to update their internal state on "early" batches and use that "future" information to predict "later" edges from the same snapshot.
- Inconsistent Task Difficulty: Real-world network activity is often "bursty." A fixed-size batch might cover five minutes during a peak period or two months during a lull. This inconsistency makes it difficult to assess model reliability over time.
- Tunable Batch Sizes: Since the batch size effectively determines the prediction horizon, it acts as a hidden hyperparameter. Comparing models evaluated with different batch sizes is an "apples-to-oranges" comparison.
As shown in the figure above, datasets like Enron and MOOC exhibit highly irregular activity patterns. In a batch-based setup, the evaluation heavily over-weights these high-activity bursts simply because they generate more batches, masking poor performance during quieter periods.
Dynamic Link Forecasting: A New Paradigm
To address these flaws, the authors propose Dynamic Link Forecasting. This new evaluation framework shifts the focus from predicting the next $b$ edges (a batch) to forecasting all edges that will occur within a fixed time window $h$ (a horizon). This approach aligns temporal graph learning with established practices in time-series forecasting.
By grouping edges by time windows rather than fixed counts, the evaluation becomes "leak-free" and provides a more realistic assessment of how models would perform in a real-time deployment scenario. To facilitate this shift, the authors introduced a SnapshotLoader for PyTorch Geometric and extended the DyGLib library.
Experimental Insights and Performance Shifts
The researchers evaluated 9 state-of-the-art TGNNs (including TGN, JODIE, and DyGFormer) across 14 diverse datasets. The results were striking:
- The "Cheating" Effect: On discrete-time datasets, memory-based models (TGN, JODIE, DyRep) saw massive performance drops when moved to the leak-free forecasting evaluation. For instance, TGN’s AUC-ROC plummeted by 31.2% on the US Legislators dataset. This confirms that these models were exploiting intra-snapshot leakage rather than learning true temporal dynamics.
- Baselines vs. Complexity: Under the fairer window-based evaluation, simple baselines like EdgeBank—which predicts an edge if it has appeared before—often outperformed complex TGNNs on repetitive datasets like UN Trade.
- Computational Efficiency: Importantly, the transition to window-based evaluation does not come with a significant runtime penalty, making it a practical replacement for the status quo.
Conclusion and Future Directions
This work highlights a critical methodological blind spot in temporal graph research. By moving from batch-based link prediction to window-based link forecasting, the community can ensure that model improvements reflect genuine progress in temporal reasoning rather than the exploitation of evaluation artifacts.
Future research should explore combining this window-based approach with ranking-based metrics (like Hits@K) and applying window-based logic to the training phase itself. This could help memory-based models learn to generalize across time rather than relying on short-term batch dependencies.
Summary updated