GenTKG: Generative Forecasting on Temporal Knowledge Graph with Large Language Models

Ruotong Liao, Xu Jia, Yangzhe Li, Yunpu Ma, Volker Tresp

Introduction

Temporal Knowledge Graphs (tKGs) serve as dynamic repositories of facts, structured as quadruples: (subject, relation, object, timestamp). Predicting future events within these graphs—such as forecasting a diplomatic visit or a policy change—is a critical challenge. Traditional approaches have largely relied on embedding-based models, which act as "black boxes" losing semantic richness, or rule-based models, which struggle with scalability and flexibility.

A significant limitation of these methods is their data-centric nature; they typically require retraining from scratch for every new dataset and fail to generalize across different data distributions. GenTKG addresses this by leveraging the pre-trained reasoning capabilities of Large Language Models (LLMs) to create a more robust foundation for temporal forecasting.

The GenTKG Framework

GenTKG introduces a two-stage "Retrieve-then-Generate" framework designed to bridge the modality and computation gaps between graph structures and LLMs.

The GenTKG framework overview, illustrating the Temporal Logical Rule-based Retrieval (TLR) and Few-shot Instruction Tuning (FIT) stages.

1. Temporal Logical Rule-based Retrieval (TLR)

To overcome the context window limitations of LLMs, TLR identifies the most relevant historical facts for a given query. Instead of simple recency-based retrieval, it utilizes mined temporal logic rules to find supportive historical context. These facts are then serialized into a chronological natural language prompt, providing the LLM with the "structural DNA" of the graph.

2. Few-shot Instruction Tuning (FIT)

Rather than heavy fine-tuning, GenTKG employs Low-Rank Adaptation (LoRA) to align a pre-trained LLM (e.g., LLaMA2-7B) with the forecasting task. This task-centric alignment focuses on teaching the model the format and logic of forecasting rather than memorizing specific graph instances. This allows the model to achieve high performance with remarkably small training sets—sometimes as few as 16 samples.

Key Insights and Results

GenTKG demonstrates that LLMs, equipped with prior world knowledge, only need minimal task-specific examples to excel at temporal reasoning.

  • State-of-the-Art Performance: GenTKG consistently outperforms leading embedding-based (e.g., xERTE) and rule-based (e.g., TLogic) models across standard benchmarks like ICEWS and GDELT. On the noisy GDELT dataset, it achieved a 58% improvement in Hits@1 over the best conventional baseline.
  • Extreme Efficiency: The "16-shot miracle" highlights that tuning on just 0.0042% of the data can yield performance comparable to fully trained traditional models.
  • Cross-Domain Generalizability: A standout feature of GenTKG is its "train-once, apply-anywhere" capability. A model trained on one dataset (e.g., ICEWS) can be effectively applied to others (e.g., GDELT or YAGO) with minimal performance degradation.
Cross-checking evaluation results demonstrating the generalizability of GenTKG across different datasets. The heatmaps show the performance difference when training on one dataset and evaluating on another.
  • Relational vs. Semantic Learning: Interestingly, using numerical indices for entities often outperformed natural language names. This indicates that the model learns to prioritize structural relational patterns over simple semantic memorization.

Limitations and Future Outlook

While GenTKG sets a new bar for tKG forecasting, it faces challenges related to the finite context window of LLMs, which can limit historical depth and impact recall metrics like Hits@10. Future work may involve utilizing models with expanded context windows (e.g., LongLoRA) and exploring zero-shot capabilities to further reduce the need for fine-tuning.

Summary updated

BibTeX
@inproceedings{liao2024gentkg,
  author = {Ruotong Liao and Xu Jia and Yangzhe Li and Yunpu Ma and Volker Tresp},
  title = {{GenTKG: Generative Forecasting on Temporal Knowledge Graph with Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-naacl.268},
}
Figure