TLogic: Temporal Logical Rules for Explainable Link Forecasting on Temporal Knowledge Graphs

Yushan Liu, Yunpu Ma, Marcel Hildebrandt, Mitchell Joblin, Volker Tresp

Introduction

Knowledge Graphs (KGs) typically represent facts as static triples (subject, relation, object). However, real-world events are inherently temporal. Temporal Knowledge Graphs (tKGs) address this by adding a time dimension, enabling the representation of events like "Angela Merkel visited China on 14/07/04." A critical task in this domain is link forecasting: predicting future interactions $(e_s, r, ?, t)$ based on historical data.

While deep embedding models have achieved high performance in link forecasting, they function as "black boxes," offering little explanation for their predictions. Furthermore, they often struggle with inductive reasoning, where they must generalize to new entities not seen during training. TLogic is a novel framework designed to bridge these gaps using human-readable, symbolic temporal logical rules.

Methodology: Temporal Random Walks and Rule Learning

TLogic moves away from vector embeddings, instead extracting rules from the graph's structure. The framework operates in two primary phases:

1. Rule Learning via Temporal Random Walks

TLogic performs "temporal random walks" on the graph. Unlike standard random walks, these are constrained to be non-increasing in time, effectively walking backward from a target event into the past to find its historical precursors. These walks are then "lifted" into abstract logical rules. For instance, a specific sequence of interactions between politicians can be generalized into a rule: If entity A consults with entity B, and entity B previously visited entity A, then A is likely to consult B again.

Visualization of temporal events and potential walks in a tKG.

2. Rule Application and Scoring

To forecast a link, TLogic identifies all historical paths matching its learned rules. Candidate answers are scored using a noisy-OR aggregation of two metrics:

  • Rule Confidence: The historical reliability of the rule in training data.
  • Temporal Recency: An exponential decay function that prioritizes "body" events occurring closer to the query time $t$.

This approach ensures time consistency, as every prediction is justified by chronologically prior events.

Experimental Evaluation

The authors evaluated TLogic on three subsets of the Integrated Crisis Early Warning System (ICEWS) dataset: ICEWS14, ICEWS18, and ICEWS0515. These benchmarks represent complex international political relations over various time spans.

Key Results

TLogic demonstrates state-of-the-art performance, outperforming both traditional rule-based methods and modern embedding-based models like RE-Net and xERTE.

Performance comparison of TLogic against state-of-the-art models on ICEWS datasets.

On the ICEWS14 dataset, TLogic achieved a Mean Reciprocal Rank (MRR) of 0.4304, a significant improvement over xERTE (0.4079). Beyond accuracy, TLogic is remarkably efficient; rule learning on ICEWS14 takes approximately 180 seconds on a standard 8-CPU machine, compared to the 5,000 seconds required for a single training epoch of xERTE.

Discussion and Insights

  • Explainability: TLogic provides the specific historical walks that trigger a prediction, making the AI's reasoning transparent without sacrificing predictive power.
  • Inductive Capability: Because rules are based on relations rather than specific entities, TLogic excels in inductive settings. It can apply rules learned from one time period to another involving entirely different entities.
  • The Role of Recency: The inclusion of exponential time-decay in the scoring function highlights that recent events are much stronger predictors of future interactions than distant ones.

Conclusion and Future Work

TLogic offers a powerful, explainable, and efficient alternative to black-box models for temporal link forecasting. Future work may involve relaxing the "cyclic" constraint to learn acyclic rules, which could capture even more complex relational patterns. Additionally, more sophisticated sampling strategies for temporal random walks could further enhance the rule discovery process.

Summary updated

BibTeX
@inproceedings{liu2022tlogic,
  author = {Yushan Liu and Yunpu Ma and Marcel Hildebrandt and Mitchell Joblin and Volker Tresp},
  title = {{TLogic: Temporal Logical Rules for Explainable Link Forecasting on Temporal Knowledge Graphs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i4.20330},
}
Figure