✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: July 13, 2026
  • 7 min read

Towards the Explainability of Temporal Graph Networks via Memory Backtracking and Topological Attribution

Direct Answer

The paper introduces MemExplainer, a novel framework that makes Temporal Graph Networks (TGNs) transparent by tracing how past events are stored in node memories and how those memories influence current predictions. By constructing a topology attribution tree and a memory backtracking tree, the method quantifies the exact contribution of each historical interaction, delivering faithful explanations that can be trusted in high‑stakes applications.

Background: Why This Problem Is Hard

Temporal graphs model dynamic relationships—think of financial transaction streams, communication networks, or user‑item interactions in recommendation engines. TGNs excel at these tasks because they maintain a mutable memory vector for each node, continuously updated as new edges arrive. However, that very strength creates an opacity problem: the memory aggregates countless events, and standard explainability tools (e.g., gradient‑based saliency or attention visualizations) ignore the internal state updates. Consequently, practitioners cannot answer critical questions such as “Which past transaction caused the model to flag this account as risky?” or “Which earlier friendship link drove the recommendation of a new connection?” Existing post‑hoc methods either treat the TGN as a black box or attribute importance only to immediate neighbors, leaving the historical dimension unexamined.

From an engineering standpoint, the difficulty compounds because TGNs process streams in an online fashion. The memory of a node at time t is a function of a variable‑length sequence of events, each potentially influencing the next through non‑linear transformations. Traditional graph explainers assume a static adjacency matrix and static node features, assumptions that break down in the temporal setting. Without a principled way to backtrack through the memory updates, any explanation risks being misleading, which undermines trust in safety‑critical domains such as fraud detection, autonomous traffic management, or medical monitoring.

What the Researchers Propose

MemExplainer tackles the gap by decomposing a TGN’s prediction into two complementary trees:

  • Topology Attribution Tree (TAT): Captures how the current neighborhood—both direct and multi‑hop—contributes to the output, taking into account each neighbor’s stored memory vector.
  • Memory Backtracking Tree (MBT): Traverses the chronological chain of events that built each neighbor’s memory, quantifying the influence of individual past interactions.

Both trees are built using Layer‑wise Relevance Propagation (LRP), a technique originally designed for feed‑forward networks that guarantees relevance conservation: the sum of relevance scores assigned to leaf nodes equals the model’s raw logit for the target class. By extending LRP to the recurrent memory update mechanism of TGNs, the authors ensure that every historical event receives a mathematically sound contribution value.

To bridge the gap between relevance scores (which live in logit space) and user‑friendly importance rankings, MemExplainer formulates an optimization problem that selects a set of “top‑k” events whose combined relevance best matches the original probability distribution. This step avoids the common pitfall where the highest‑scoring events in logit space do not correspond to the most impactful events after the softmax transformation.

How It Works in Practice

The workflow can be visualized as a three‑stage pipeline:

  1. Forward Pass: The TGN processes a temporal graph stream, updating each node’s memory vector mv(t) whenever a new edge (u, v, t, e) arrives. The final prediction for a target node (or edge) is produced from the current memories and the latest structural context.
  2. Relevance Backpropagation: Starting from the output logit, LRP propagates relevance backward through the prediction head, the aggregation function, and finally into the memory update equations. This yields two trees:
    • The Topology Attribution Tree branches out to neighbor nodes and their memory vectors.
    • The Memory Backtracking Tree expands each memory vector into the sequence of events that contributed to it.
  3. Event Selection Optimization: An integer‑programming‑style objective selects a compact subset of leaf events that maximally preserves the original probability distribution. The result is a concise, faithful explanation that can be presented to end‑users or auditors.

The key differentiator is the explicit treatment of the memory module. While prior explainers stop at the graph topology, MemExplainer drills into the temporal dimension, revealing “when” and “how” each event shaped the model’s internal state.

Illustration of the Topology Attribution Tree and Memory Backtracking Tree

Figure: Conceptual diagram of the topology attribution tree (left) and memory backtracking tree (right) used by MemExplainer.

Evaluation & Results

The authors benchmarked MemExplainer on nine publicly available temporal graph datasets covering three downstream tasks:

  • Node property prediction (e.g., user churn, fraud label).
  • Link prediction (future interaction forecasting).
  • Graph‑level classification (temporal pattern detection).

Two complementary evaluation protocols were employed:

  1. Faithfulness Test: They measured the drop in model performance after removing the top‑k events identified by the explainer. A faithful explainer should cause a steep performance decline when its most important events are masked.
  2. Human‑Centric Study: Domain experts were asked to rank explanations generated by MemExplainer against three state‑of‑the‑art baselines (Grad‑CAM for graphs, attention‑based explainer, and a temporal SHAP variant). Experts consistently rated MemExplainer’s outputs as more intuitive and aligned with their domain knowledge.

Across all datasets, MemExplainer achieved a 15‑30% higher faithfulness score compared to the strongest baseline, and the human study showed a 22% increase in perceived usefulness. Importantly, the method added only a modest 12% overhead to inference time, demonstrating that the extra backtracking computation is practical for real‑time systems.

Why This Matters for AI Systems and Agents

Explainability is no longer a nice‑to‑have feature; it is a regulatory and operational requirement for many AI‑driven agents. MemExplainer equips engineers with a tool that can:

  • Audit Decision Paths: Pinpoint the exact historical interactions that led an autonomous trading bot to execute a high‑risk order, satisfying compliance checks.
  • Debug Model Drift: Detect whether a sudden performance drop is caused by a shift in the temporal pattern of incoming events rather than a flaw in the model architecture.
  • Enhance Human‑In‑The‑Loop Workflows: Provide concise, trustworthy explanations to operators of UBOS platform overview who need to intervene in real time.
  • Facilitate Trust in Autonomous Agents: When an AI marketing agent (AI marketing agents) recommends a new campaign, the explainer can surface the past customer interactions that justified the suggestion, making the recommendation auditable.

In practice, integrating MemExplainer into a production pipeline means that every prediction can be accompanied by a “trace report”—a lightweight JSON payload listing the top contributing events, timestamps, and neighbor identifiers. This report can be fed directly into monitoring dashboards, alerting systems, or compliance logs without requiring a separate post‑processing step.

What Comes Next

While MemExplainer marks a significant advance, several open challenges remain:

  • Scalability to Billion‑Edge Streams: The current backtracking algorithm, though efficient, still incurs linear cost in the length of a node’s event history. Future work could explore hierarchical summarization or sketch‑based memory compression.
  • Cross‑Model Generalization: Extending the relevance propagation to hybrid architectures that combine TGNs with transformer‑style temporal encoders is an open research direction.
  • User‑Centric Visualization: Translating the two‑tree output into interactive visual tools (e.g., timeline heatmaps) would lower the barrier for non‑technical stakeholders.
  • Integration with Existing UBOS Tools: Embedding MemExplainer into the Workflow automation studio could enable automated remediation actions—such as flagging suspicious events for manual review—based on the explainer’s output.

Addressing these points will push explainable temporal graph analytics from research prototypes to enterprise‑grade services, where transparency, speed, and scalability are all non‑negotiable.

For readers who wish to explore the technical details, the full manuscript is available on original arXiv paper. The authors have also open‑sourced their implementation at GitHub, making it straightforward to experiment with MemExplainer on custom temporal datasets.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.