Abstract
Temporal Knowledge Graph Completion (TKGC) is a complex task involving the prediction of missing event links at future timestamps by leveraging established temporal structural knowledge. This paper aims to provide a comprehensive perspective on harnessing the advantages of Large Language Models (LLMs) for reasoning in temporal knowledge graphs, presenting an easily transferable pipeline. In terms of graph modality, we underscore the LLMs' prowess in discerning the structural information of pivotal nodes within the historical chain. As for the generation mode of the LLMs utilized for inference, we conduct an exhaustive exploration into the variances induced by a range of inherent factors in LLMs, with particular attention to the challenges in comprehending reverse logic. We adopt a parameter-efficient fine-tuning strategy to harmonize the LLMs with the task requirements, facilitating the learning of the key knowledge highlighted earlier. Comprehensive experiments are undertaken on several widely recognized datasets, revealing that our framework exceeds or parallels existing methods across numerous popular metrics. Additionally, we execute a substantial range of ablation experiments and draw comparisons with several advanced commercial LLMs, to investigate the crucial factors influencing LLMs' performance in structured temporal knowledge inference tasks.
Introduction
Temporal Knowledge Graphs (TKGs) store facts as quadruples (subject, relation, object, timestamp), capturing the dynamic evolution of real-world events. Predicting future events—a task known as Temporal Knowledge Graph Completion (TKGC)—is vital for applications ranging from social trend forecasting to crisis early warning. Traditional approaches typically rely on Graph Neural Networks (GNNs) or embedding-based methods. While these models excel at capturing structural patterns, they often overlook the rich semantic information embedded in entity and relation names and struggle with data sparsity.
Large Language Models (LLMs) offer a promising alternative due to their advanced reasoning capabilities and extensive semantic knowledge. However, applying LLMs to TKGC presents unique challenges: the "reversal curse" (difficulty in inferring "B is the son of A" from "A is the mother of B") and the difficulty of perceiving complex graph structures when flattened into textual sequences.
The Chain of History Framework
To address these challenges, we propose Chain of History (CoH), a framework that reformulates TKGC as a sequence-to-sequence reasoning task. The CoH pipeline integrates three core components:
- Structure-Augmented History Modeling: To provide the LLM with structural context beyond a simple list of events, we augment the history with local neighborhood information (Entity-augmented) and relation-specific logic (Relation-augmented).
- Mitigating the Reversal Curse: We introduce reciprocal quadruples during training and evaluate various prompting strategies—Ordinary, Text-aware, and Position-aware—to ensure the model can perform both forward and backward inference effectively.
- Instruction Fine-Tuning with LoRA: We utilize Low-Rank Adaptation (LoRA) to fine-tune 7B-parameter models (e.g., Llama-2, Vicuna). This process aligns the pre-trained LLM with the specific structural and temporal logic of the TKG.
Experimental Results
We evaluated CoH on four benchmark datasets: ICEWS14, ICEWS18, ICEWS05-15, and YAGO. Performance was measured using the Hits@1 metric, representing the accuracy of the top-ranked prediction.
Our results demonstrate that CoH-tuned models consistently outperform or match state-of-the-art GNN-based models like TiRGN and HGLS. For instance, Vicuna-7b-CoH achieved a significant performance boost on the ICEWS05-15 and YAGO datasets.
Key Findings
- Fine-Tuning vs. Scale: Task-specific fine-tuning is more critical than model size. A fine-tuned 7B model significantly outperformed massive commercial models like GPT-4 (using 8-shot In-Context Learning) on political event datasets.
- The Reversal Curse: While LLMs struggle with backward reasoning out-of-the-box, including reverse data during fine-tuning (the "Ordinary" strategy) effectively mitigates this issue without harming forward reasoning performance.
- History Length: Performance does not always scale linearly with history length. Some datasets exhibit a "Goldilocks" zone where too much historical data introduces noise that degrades prediction accuracy.
Conclusion
The Chain of History framework demonstrates that with proper structural augmentation and parameter-efficient fine-tuning, relatively small LLMs can become powerful engines for temporal reasoning. By overcoming the reversal curse and leveraging local graph context, CoH sets a new standard for LLM-based forecasting in dynamic knowledge graphs. Future work will focus on reducing inference costs and exploring hybrid approaches that combine LLMs with traditional graph algorithms.
Summary updated