Integrate Temporal Graph Learning into LLM-based Temporal Knowledge Graph Model

He Chang, Jie Wu, Zhulin Tao, Yunshan Ma, Xianglin Huang, Tat-Seng ChuaarXiv 2025

TL;DR

Temporal Knowledge Graph Forecasting (TKGF) predicts future events based on historical graph data, but current LLM-based methods struggle to capture temporal dynamics and align graph structures with natural language. This paper introduces TGL-LLM, a novel framework that integrates temporal graph neural networks with LLMs using hybrid graph tokenization and a two-stage training paradigm. By effectively bridging the gap between temporal graph embeddings and language tokens, TGL-LLM achieves state-of-the-art accuracy on real-world forecasting tasks.

Problem Statement: The Challenge of Temporal Knowledge Graph Forecasting

Temporal Knowledge Graphs (TKGs) store facts that evolve over time, such as (Country A, negotiate with, Country B, timestamp). The goal of TKGF is to predict missing future facts. Traditionally, Graph Neural Networks (GNNs) have been used for this, but they struggle with "long-tail" entities—those with very few historical connections—and lack open-world knowledge.

Recently, researchers have turned to Large Language Models (LLMs). However, existing approaches face significant hurdles:

  1. Loss of Temporal Context: Many methods use static graph representations, failing to capture the chronological evolution of events.
  2. Poor Cross-Modal Alignment: TKGs are inherently noisy. Forcing an LLM to align its language space with suboptimal graph embeddings often degrades performance.
  3. Context Window Limits: Flattening graph data into text prompts quickly exceeds the maximum length limits of LLMs.
Comparison of text-based vs. embedding-based approaches for Temporal Knowledge Graphs.

Methodology: The TGL-LLM Framework

To address these limitations, the authors propose TGL-LLM, which integrates temporal graph learning with LLMs through two primary innovations:

1. Hybrid Graph Tokenization

Instead of static snapshots, TGL-LLM utilizes a Relational Graph Convolutional Network (RGCN) combined with a Gated Recurrent Unit (GRU) to generate temporal graph embeddings. These embeddings are passed through a trainable Multi-Layer Perceptron (MLP) adapter to project them into the LLM’s token space. The LLM is then prompted with a hybrid sequence of natural language instructions and chronologically ordered graph tokens.

2. Two-Stage Training Paradigm

To resolve the noisy alignment problem, the framework employs a data pruning strategy:

  • Stage 1 (Quality): Influence functions are used to identify and prune noisy data, fine-tuning the LLM (via LoRA) on a high-quality subset to ensure precise alignment.
  • Stage 2 (Diversity): A second round of fine-tuning on a randomly sampled "diversity subset" exposes the model to a wider variety of relational patterns, maintaining its general reasoning capabilities.
The TGL-LLM architecture, illustrating temporal graph learning, hybrid tokenization, and the two-stage training paradigm.

Datasets and Evaluation

To avoid data leakage from Llama-2’s pre-training data, the authors created three new datasets from the POLECAT database, focusing on events after July 2023:

  • POLECAT-IR (Iran)
  • POLECAT-IS (Israel)
  • POLECAT-EG (Egypt)

The forecasting task is framed as a Multiple-Choice Question (MCQ) to ensure stability in the LLM's generative output.

Key Insights and Results

  • Temporal Importance: Ablation studies show that replacing the temporal GRU embeddings with static ones leads to a significant performance drop, proving that LLMs require explicit chronological input to reason over time effectively.
  • Solving the Long-Tail Problem: TGL-LLM excels with "sparse" entities (fewer than 100 training appearances), outperforming traditional GNNs by leveraging the LLM's pre-trained open-world knowledge.
  • Superior Performance: On the POLECAT-IR dataset, TGL-LLM achieved an Acc@4 of 85.14%, vastly outperforming LLM baselines like KoPA (60.83%) and traditional models like HisMatch (52.91%).
  • Efficiency: By compressing structural information into embeddings rather than raw text, TGL-LLM requires shorter context windows and significantly less training time (~11.2 hours on an RTX A40) compared to text-heavy baselines.

Limitations and Future Work

While TGL-LLM sets a new standard, the authors identify areas for growth, including the development of more sophisticated graph adapters beyond simple MLPs and the incorporation of fine-grained local subgraph representations. Future research will also explore moving beyond the MCQ format toward true generative forecasting and predicting time intervals or relations.

Summary updated

BibTeX
@misc{chang2025integrate,
  author = {He Chang and Jie Wu and Zhulin Tao and Yunshan Ma and Xianglin Huang and Tat-Seng Chua},
  title = {{Integrate Temporal Graph Learning into LLM-based Temporal Knowledge Graph Model}},
  year = {2025},
  eprint = {2501.11911},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.11911},
}
Figure