Online Detection of Anomalies in Temporal Knowledge Graphs with Interpretability

Jiasheng Zhang, Jie Shao, Rex Ying

Abstract

Temporal knowledge graphs (TKGs) are valuable resources for capturing evolving relationships among entities, yet they are often plagued by noise, necessitating robust anomaly detection mechanisms. Existing dynamic graph anomaly detection approaches struggle to capture the rich semantics introduced by node and edge categories within TKGs, while TKG embedding methods lack interpretability, undermining the credibility of anomaly detection. Moreover, these methods falter in adapting to pattern changes and semantic drifts resulting from knowledge updates. To tackle these challenges, we introduce AnoT, an efficient TKG summarization method tailored for interpretable online anomaly detection in TKGs. AnoT begins by summarizing a TKG into a novel rule graph, enabling flexible inference of complex patterns in TKGs. When new knowledge emerges, AnoT maps it onto a node in the rule graph and traverses the rule graph recursively to derive the anomaly score of the knowledge. The traversal yields reachable nodes that furnish interpretable evidence for the validity or the anomalous of the new knowledge. Overall, AnoT embodies a detector-updater-monitor architecture, encompassing a detector for offline TKG summarization and online scoring, an updater for real-time rule graph updates based on emerging knowledge, and a monitor for estimating the approximation error of the rule graph. Experimental results on four real-world datasets demonstrate that AnoT surpasses existing methods significantly in terms of accuracy and interoperability.

Introduction: The Challenge of Noise in Evolving Knowledge

Temporal Knowledge Graphs (TKGs) represent facts as quadruplets: (Subject, Relation, Object, Timestamp). These structures are vital for tracking real-world dynamics, such as geopolitical shifts or sports transfers. However, TKGs are frequently compromised by noise and errors.

Existing anomaly detection methods face three primary hurdles. First is semantic blindness: many models treat different relationship types generically, failing to distinguish between a "diplomatic visit" and a "military strike." Second is the "Black Box" problem: high-performing embedding-based models often cannot explain why a specific fact is flagged, which is unacceptable in sensitive domains. Finally, semantic drift poses a challenge; as the world changes, what was once a standard pattern may become an anomaly, and vice versa.

Figure 1: Illustration of Conceptual, Missing, and Time errors in TKGs and how they conflict with preserved knowledge.

As shown in Figure 1, AnoT specifically targets three error categories:

  1. Conceptual Errors: Facts that violate entity categories (e.g., a person "winning" a country).
  2. Time Errors: Facts that violate temporal logic (e.g., a person serving as president after leaving office).
  3. Missing Errors: Valid facts that are absent from the graph but predicted by established patterns.

The AnoT Framework: Summarization as Detection

The core philosophy of AnoT is that a high-quality summary of a graph is inherently a powerful anomaly detector. If a graph can be compressed into a small set of logical rules, any fact that cannot be efficiently compressed is likely an anomaly.

The Rule Graph and MDL Principle

AnoT utilizes the Minimum Description Length (MDL) principle to distill the TKG into a "Rule Graph." This graph consists of "atomic rules" (e.g., (Person, PlaysFor, Team)) and "rule edges" that represent temporal dependencies (e.g., a TransferTo event typically precedes a PlaysFor event). By mapping new knowledge onto this rule graph, the system can derive an anomaly score based on how well the new fact fits existing static categories and temporal sequences.

Detector-Updater-Monitor Architecture

To handle the online nature of TKGs, AnoT employs a tripartite architecture:

  • Detector: Performs initial offline summarization and provides real-time scoring for incoming facts.
  • Updater: Modifies the rule graph in real-time as new, valid knowledge is confirmed, allowing the model to adapt to semantic drift without full retraining.
  • Monitor: Tracks the "approximation error" of the current rule graph. If the error exceeds a threshold—indicating the graph has become obsolete—it triggers a refresh.
Figure 2: The detector-updater-monitor architecture of AnoT, showing the flow from raw TKG to the Rule Graph and anomaly detection.

Experimental Evaluation

The authors evaluated AnoT against state-of-the-art baselines (including RE-GCN and various TKG embedding models) across five diverse datasets: ICEWS 14, ICEWS 05-15, YAGO 11k, GDELT, and Wikidata. To simulate real-world noise, 15% of the facts were synthetically perturbed.

Key Results

  • Accuracy: AnoT outperformed existing methods by an average of 11.5% in AUC and 13.6% in precision.
  • Interpretability: Unlike black-box models, AnoT provides "correcting prompts." By traversing the rule graph, it can show the specific logical path or "precursor nodes" used to validate or reject a fact.
  • Efficiency and Stability: The system processes thousands of samples per second. Notably, even when trained on only 20% of available data, AnoT maintained high accuracy, whereas baseline models suffered significant performance degradation.

Conclusion

AnoT demonstrates that interpretability does not have to come at the cost of performance. By treating anomaly detection as a graph summarization problem, the framework provides a robust, online solution for maintaining the integrity of Temporal Knowledge Graphs. Future work may involve expanding the rule graph to capture more complex multi-node motifs and integrating these logical rules as constraints within deep learning architectures to further enhance accuracy.

Summary updated

BibTeX
@article{zhang2024online,
  author = {Jiasheng Zhang and Jie Shao and Rex Ying},
  title = {{Online Detection of Anomalies in Temporal Knowledge Graphs with Interpretability}},
  journal = {Proc. ACM Manag. Data},
  year = {2024},
  doi = {10.1145/3698823},
}
Figure