Enhancing the Expressivity of Temporal Graph Networks through Source-Target Identification

Benedict Aaron Tjandra, Federico Barbero, Michael Bronstein

TL;DR

Temporal Graph Networks (TGNs) struggle with predicting the intensity of future node interactions, often losing to simple heuristics like moving averages. This paper proves that TGNs are theoretically incapable of tracking past message histories due to their permutation-invariant design. By introducing TGNv2, which adds source-target node identification to interaction messages, the authors break this limitation and achieve state-of-the-art performance across all major benchmarks.

What Problem Does This Paper Address?

In temporal graph learning, dynamic node affinity prediction asks: how much will node $x$ interact with node $y$ over a future time interval? This is crucial for real-world applications like forecasting trade volumes between nations or predicting a user's future listening habits in recommender systems.

Surprisingly, advanced Temporal Graph (TG) models consistently perform poorly on this task. They are routinely outperformed by dead-simple baselines like persistent forecasting (predicting that the future will look exactly like the most recent interaction) or moving averages over past data. This paper investigates the fundamental architectural flaw causing deep learning models to fail at a task that simple heuristics easily solve.

Methods

The authors provide a mathematical proof showing that standard TGNs cannot represent a moving average or an autoregressive model of any order. This failure stems from TGN's permutation invariance: the model cannot distinguish between the senders and receivers of messages when updating node memories.

To fix this, the authors propose TGNv2. The core modification is straightforward but mathematically powerful: they inject explicit source and target node identifications ($\phi_n(i)$ and $\phi_n(j)$) directly into the message construction function:

$$\mathbf{m}_i(t) = \text{msg}_s(\mathbf{s}_i(t^-), \mathbf{s}_j(t^-), \phi_t(\Delta t), e_{ij}(t), \phi_n(i), \phi_n(j))$$

This simple addition breaks the permutation invariance trap. It allows the network's memory updater to "index" specific pairwise interaction histories, enabling the model to theoretically and practically simulate autoregressive and moving average functions.

Graphs G and G' demonstrate how standard TGNs cannot distinguish between different sequences of messages due to permutation invariance.

Datasets

The models were evaluated using the Temporal Graph Benchmark (TGB), specifically focusing on four dynamic node affinity prediction datasets:

  • tgbn-trade: Tracks the global exchange of goods between nations.
  • tgbn-genre: Models music users and their listening history across genres.
  • tgbn-reddit: Details user interactions and postings within various subreddits.
  • tgbn-token: Observes crypto token transactions.

Key Insights and Ideas

  • The Permutation Invariance Blindspot: While permutation invariance is highly desirable for static Graph Neural Networks (GNNs) to generalize across structures, it acts as a straightjacket for temporal networks trying to track specific historical trends between pairs of nodes.
  • Heuristics as a Design Guide: Instead of trying to invent a completely detached deep learning architecture, the authors used the success of simple heuristics (like moving averages) to pinpoint exactly what mathematical operations the neural network was failing to compute.

Key Results

TGNv2 completely revitalizes TGN performance, outperforming all existing temporal graph models (including JODIE, TGAT, CAWN, GraphMixer, and DyGFormer) by a wide margin.

As shown in the results table below, on the tgbn-trade dataset, TGNv2 nearly doubles the performance of standard TGN, jumping from a test NDCG@10 of 0.374 to 0.735. It also performs comparably to or better than the competitive "Moving Average over Messages" heuristic across all benchmarks.

Table 1: Main results. † are results obtained from Huang et al. (2023), while ‡ are obtained from Yu (2023). TGNv2 outperforms all current TG models by a large margin.

Limitations and Future Work

While TGNv2 dramatically closes the gap and beats all deep learning baselines, it still slightly lags behind the absolute best heuristic ("Moving Average over ground-truth Labels") on certain datasets like tgbn-trade.

The authors note this is likely because their current message aggregator is restricted to outputting only the last message in a batch to maintain a fair, controlled comparison with original TGN setups. Future work will focus on exploring more expressive message aggregation functions and evaluating TGNv2 on other temporal graph tasks, such as dynamic link prediction.

Summary updated

Abstract

Despite the successful application of Temporal Graph Networks (TGNs) for tasks such as dynamic node classification and link prediction, they still perform poorly on the task of dynamic node affinity prediction -- where the goal is to predict 'how much' two nodes will interact in the future. In fact, simple heuristic approaches such as persistent forecasts and moving averages over ground-truth labels significantly and consistently outperform TGNs. Building on this observation, we find that computing heuristics over messages is an equally competitive approach, outperforming TGN and all current temporal graph (TG) models on dynamic node affinity prediction. In this paper, we prove that no formulation of TGN can represent persistent forecasting or moving averages over messages, and propose to enhance the expressivity of TGNs by adding source-target identification to each interaction event message. We show that this modification is required to represent persistent forecasting, moving averages, and the broader class of autoregressive models over messages. Our proposed method, TGNv2, significantly outperforms TGN and all current TG models on all Temporal Graph Benchmark (TGB) dynamic node affinity prediction datasets.
BibTeX
@inproceedings{tjandra2024enhancing,
  author = {Benedict Aaron Tjandra and Federico Barbero and Michael Bronstein},
  title = {{Enhancing the Expressivity of Temporal Graph Networks through Source-Target Identification}},
  booktitle = {NeurReps @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=ytwpZDDOkb},
}
Figure