zrLLM: Zero-Shot Relational Learning on Temporal Knowledge Graphs with Large Language Models

Zifeng Ding, Heling Cai, Jingpei Wu, Yunpu Ma, Ruotong Liao, Bo Xiong, Volker Tresp

Introduction

Temporal Knowledge Graphs (TKGs) represent evolving facts as quadruples $(s, r, o, t)$, where a relation $r$ exists between subject $s$ and object $o$ at time $t$. Forecasting future events in these graphs is crucial for applications in diplomacy, finance, and security. However, traditional embedding-based models struggle with "zero-shot" relations—newly introduced relationship types that were absent during the training phase. Without historical occurrences, these models cannot learn meaningful vector representations, leading to a total failure in prediction.

The zrLLM Framework

To overcome this limitation, the authors propose zrLLM, a framework that leverages the semantic power of Large Language Models (LLMs) to bridge the gap between textual descriptions and graph-based forecasting.

The zrLLM framework architecture for training (left) and link prediction (right).

The framework consists of three core innovations:

1. Enriched Relation Descriptions (ERD)

Standard TKG datasets often provide only brief labels for relations (e.g., "Make Statement"). zrLLM uses GPT-3.5 to expand these into detailed semantic explanations. This process ensures that the model understands the nuances of a relation even if it has never seen it in a graph context.

The prompt and output structure used to generate Enriched Relation Descriptions via GPT-3.5.

2. LLM-Powered Representations

The enriched descriptions are processed by a T5-11B encoder to generate high-dimensional embeddings. Unlike traditional look-up tables, these embeddings are grounded in natural language. Consequently, semantically similar relations (e.g., "Praise" and "Endorse") are mapped to nearby points in the embedding space, allowing the model to generalize from known relations to unseen ones.

3. Relation History Learner (RHL)

Beyond semantics, zrLLM introduces the Relation History Learner to capture "temporal logic." By using a History Prediction Network (HPN) and Gated Recurrent Units (GRUs), the RHL learns entity-agnostic patterns—for instance, that a "formal agreement" typically follows a series of "diplomatic consultations." This allows the model to predict the likely historical context of a zero-shot relation.

Addressing Information Leakage

A significant challenge in evaluating LLMs on TKGs is "information leak," where the LLM's training data overlaps with the test set. To ensure a rigorous evaluation, the authors curated three new datasets: ICEWS21-zero, ICEWS22-zero, and ACLED-zero. These datasets contain facts from 2021 to 2023, post-dating the training cutoff for many LLMs, and hold out up to 62% of relations for zero-shot testing.

Key Results and Performance

The integration of zrLLM into existing TKG architectures (such as RE-GCN and CyGNet) yielded substantial performance gains. On the ICEWS21-zero benchmark, baseline models that previously achieved near-zero accuracy on unseen relations saw their Mean Reciprocal Rank (MRR) jump significantly. For example, the TANGO-T model improved from an MRR of 0.067 to 0.216. Furthermore, zrLLM enhanced performance on "seen" relations, suggesting that semantic grounding provides a more robust foundation for TKG reasoning than structural embeddings alone.

Conclusion

zrLLM demonstrates that the semantic knowledge embedded in LLMs can effectively substitute for missing structural history in TKGs. By combining enriched descriptions with a dedicated temporal history learner, the framework enables robust zero-shot relational forecasting. Future work will focus on extending this approach to handle zero-shot entities and improving the computational efficiency of the temporal learning modules.

Summary updated

BibTeX
@inproceedings{ding2024zrllm,
  author = {Zifeng Ding and Heling Cai and Jingpei Wu and Yunpu Ma and Ruotong Liao and Bo Xiong and Volker Tresp},
  title = {{zrLLM: Zero-Shot Relational Learning on Temporal Knowledge Graphs with Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.104},
}
Figure