MemExplainer is a novel framework designed to peek inside the "black box" of Temporal Graph Networks (TGNs). Unlike previous methods that only look at immediate neighbors, MemExplainer uses a "backtracking" approach to trace how historical events shaped a node's internal memory, providing a mathematically grounded and more faithful explanation of model predictions.
The Challenge: Explaining Temporal Graphs
Temporal Graph Networks (TGNs) are the gold standard for modeling data that evolves over time, such as social network interactions, financial transactions, and human movement. Their secret sauce is a memory module: every time a node interacts, it updates an internal "memory vector" that stores its history.
However, TGNs are notoriously difficult to explain. Existing explainability tools (like GNNExplainer) were built for static graphs. When applied to temporal graphs, they usually treat a node's memory as a fixed, static input. This is a major oversight. It’s like trying to explain why a person is angry today by only looking at who they are talking to right now, while completely ignoring the series of frustrating events that happened to them earlier in the week. To truly explain a TGN, one must account for how past events built the current memory state.
The MemExplainer Framework
To address this gap, the authors introduce MemExplainer, which decomposes a TGN prediction into two distinct explanatory "trees":
- Topology Attribution Tree (Spatial): This component handles the spatial aspect of the graph. It uses Layer-wise Relevance Propagation (LRP) to attribute the model's prediction to the target node’s immediate neighbors and their current memory states.
- Memory Backtracking Tree (Temporal): This component handles the temporal aspect. It recursively "backtracks" through time, applying LRP to the memory update functions (such as GRUs or RNNs). This quantifies exactly how much a specific event from several steps ago contributed to the node's memory today.
Key Innovations
- Conservation Property: By utilizing LRP, the authors ensure that the "relevance scores" assigned to historical events sum up exactly to the model's total output (the logits). This provides a mathematical guarantee of consistency that heuristic-based methods lack.
- Faithful Event Selection: Most explainers simply pick the "top-k" highest-scoring events. MemExplainer instead formulates an optimization problem using KL Divergence. It identifies a subset of events that, when kept, minimize the difference between the original prediction and the "explained" prediction, properly accounting for the non-linear nature of neural networks.
Experimental Insights and Results
The researchers evaluated MemExplainer on nine diverse temporal graph datasets across three different tasks: Link Prediction (e.g., Wikipedia, Reddit), Node Property Prediction (e.g., TGBN-trade), and Graph Classification (e.g., HMDB51 human pose classification).
Key Findings: * Memory is the Hidden Driver: The paper proves that ignoring the memory module leads to unfaithful explanations. In many cases, a prediction is driven more by a node's internal state—built over time—than by its current neighbors. * Superior Fidelity: MemExplainer consistently outperformed state-of-the-art baselines (such as TGNNExplainer, TempME, and PGExplainer) across all datasets. It achieved significantly lower Fidelity-KL scores, meaning its explanations were much more representative of the model's actual logic. A t-test showed that MemExplainer’s improvements were statistically significant in 77% of cases for Fidelity-KL. * Action-Specific Chains: In human pose tasks, MemExplainer was the only method that consistently highlighted the relevant "kinematic chains" for an action—for example, focusing on the legs for a "running" label rather than highlighting the entire skeleton. * Efficiency: Despite the complexity of backtracking, the method remains highly practical. Even with a backtracking depth of 10, the total running time was at most 6 seconds per explanation.
Limitations and Future Work
The primary limitation of MemExplainer is computational scalability. On massive temporal graphs with extremely long histories, the backtracking tree can become very deep and wide, leading to high memory usage.
To mitigate this, the authors suggest implementing tree pruning in future iterations—cutting off branches with very low relevance scores early in the process to keep the explanation focused and computationally light. Additionally, while the current framework is optimized for discrete events, it could be further adapted to handle continuous-time dynamics.
Summary updated