Learning-Based Link Anomaly Detection in Continuous-Time Dynamic Graphs

Tim Postuvan, Claas Grohnfeldt, Michele Russo, Giulio Lovisotto

TL;DR

Standard dynamic graph learning treats link prediction as simply asking “will an edge form?”, completely missing whether an edge's timing or content is abnormal. This paper introduces the first formal taxonomy and benchmark for link anomaly detection in Continuous-Time Dynamic Graphs (CTDGs), proposing model-agnostic adaptations—context conditioning and multi-dimensional negative sampling—that enable temporal graph models to reliably catch temporal, structural, and contextual outliers.

What Problem Does This Paper Address?

Continuous-time dynamic graphs (CTDGs) represent systems where interactions occur at irregular, continuous timestamps and carry rich edge attributes (e.g., financial transactions, network packets, or user communications). While anomaly detection is well-studied for static graphs and discrete snapshot graphs, CTDGs present a challenge: “normal” behavior evolves continuously, and anomalies can manifest not just in unexpected connectivity, but in strange timing or bizarre message content.

Prior work routinely repurposes standard link prediction models for anomaly detection. However, standard link prediction is fundamentally misaligned with this goal:

  1. It ignores edge attributes (context) during scoring.
  2. Its training objective relies exclusively on destination perturbation (re-wiring edges to random nodes), blinding models to temporal and contextual anomalies.
  3. The field lacks formal anomaly categorizations and labeled CTDG benchmark datasets.

Methods

The authors tackle these issues through taxonomy, synthetic benchmark design, and model adaptation:

  • Fine-Grained Anomaly Taxonomy: Anomalies are decomposed into three dimensions—Time ($T$), Structure ($S$), and Context ($C$). Because an edge between structurally unexpected nodes lacks a valid historical context distribution, structural anomalies inherently imply contextual anomalies. This yields five realistic categories: $T$, $C$, $T\text{-}C$, $S\text{-}C$, and $T\text{-}S\text{-}C$.
  • Synthetic Graph Generation (TempSynthGraph): A generator that produces dynamic graphs with explicit ground-truth regularities: Stochastic Block Models define structural communities, Poisson/Lognormal intervals enforce temporal regularity, and orthogonal attribute vectors define class-specific contexts.
  • Contextual Conditioning: Rather than predicting edge existence solely from dynamic node embeddings $h_u^t$ and $h_v^t$, the prediction head is conditioned directly on the edge message $m$ via concatenation: $[h_u^t \,||\, h_v^t \,||\, W m]$.
  • Multi-Dimensional Negative Sampling: Training negative edges are sampled by perturbing destinations (structural), timestamps (temporal), or edge features (contextual), rather than solely rewiring target nodes.
Standard Negative Sampling:     (u, v, t, m)  →  (u, z_rand, t, m)
Multi-Dimensional Sampling:     (u, v, t, m)  →  { (u, z_rand, t, m)  [Structural]
                                                 { (u, v, t_rand, m)  [Temporal]
                                                 { (u, v, t, m_rand)  [Contextual]

Datasets

The authors evaluate models on eight CTDG benchmarks:

  • TempSynthGraph: Newly introduced synthetic graph (10,000 nodes, ~1M temporal edges) with controlled temporal, structural, and contextual regularities.
  • Benign Real-World CTDGs (injected with synthetic anomalies): Wikipedia, Reddit, MOOC, Enron, and UCI.
  • Real Cybersecurity CTDGs with Organic Anomalies: LANL (~1M authentication events, red team attacks) and DARPA-Theia (~8.4M Linux provenance system calls, red team exploits).

Key Insights and Ideas

  • Compound anomalies are easiest to spot: Anomalies perturbing multiple axes (e.g., $T\text{-}C$ or $T\text{-}S\text{-}C$) consistently yield higher detection AUCs than single-dimension anomalies ($T$ or $C$).
  • Architectures specialize by dimension:
  • GraphMixer (using fixed trigonometric time encodings) dramatically outperforms competitors on temporal anomalies ($T$, $T\text{-}C$).
  • DyGFormer (using neighbor co-occurrence encoding) and CAWN (using 2-hop causal walks) dominate structural anomalies ($S\text{-}C$, $T\text{-}S\text{-}C$) due to their sensitivity to multi-hop network motifs.
  • Real-world graphs lack uniform regularity: Real-world benchmarks revealed domain-specific messiness: Reddit exhibits poor temporal regularity (users post irregularly), whereas Wikipedia shows weak contextual predictability.
  • Organic attacks mimic structural anomalies: Organic intrusions in LANL and DARPA-Theia behave primarily like structural/contextual anomalies ($S\text{-}C$), explaining why DyGFormer and CAWN transfer best to real-world attack detection.

Key Results

  • Impact of Adaptations: On TempSynthGraph, TGN without context conditioning failed to detect contextual anomalies (52.05% AUC—near random guess). With conditioning and multi-dimensional negative sampling, detection skyrocketed to 97.24% AUC.
  • Synthetic Graph Detection: On TempSynthGraph, GraphMixer achieved the top score for temporal anomalies (96.21% AUC), while DyGFormer led on structural-contextual anomalies (99.15% AUC).
  • Organic Anomaly Detection:
  • DyGFormer and CAWN achieved top detection on real-world attacks: DyGFormer scored 94.07% AUC on LANL and 90.42% AUC on DARPA-Theia; CAWN reached 94.34% on LANL.
  • Memorization heuristics like EdgeBank failed dramatically on organic data (52.72% AUC on DARPA-Theia), demonstrating that memorizing previously seen edges is ineffective when attacks introduce unseen interactions.

Limitations and Future Work

  • Narrow Domain for Organic Anomalies: Ground-truth organic benchmarks in CTDGs remain restricted to cybersecurity (LANL, DARPA); labeled dynamic graphs in finance, social media, and web safety are sorely needed.
  • Neighbor Buffer Poisoning: During online evaluation, unseen anomalous edges are ingested into dynamic node memory and neighbor samplers ($N_u^t$), potentially polluting historical representations for future steps.
  • Granularity Beyond Edges: The taxonomy and methodology focus exclusively on link-level anomalies, leaving sub-graph, path-level, and node-level anomaly detection in CTDGs as open frontiers.

Summary updated

BibTeX
@article{postuvan2024learning,
  author = {Tim Postuvan and Claas Grohnfeldt and Michele Russo and Giulio Lovisotto},
  title = {{Learning-Based Link Anomaly Detection in Continuous-Time Dynamic Graphs}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=8imVCizVEw},
}
Figure