Introduction
Temporal Knowledge Graphs (TKGs) serve as structured repositories for time-stamped events, capturing complex relational dynamics over time (e.g., [Subject, Relation, Object, Timestamp]). Predicting future events within these graphs—known as TKG forecasting—has traditionally relied on specialized supervised learning architectures, such as Graph Convolutional Networks (GCNs) or Reinforcement Learning agents. These models require extensive training on historical data specific to each dataset. This research investigates whether Large Language Models (LLMs) can perform TKG forecasting through zero-shot in-context learning, effectively bypassing the need for task-specific training.
Methodology
The researchers proposed a three-stage pipeline to adapt TKG forecasting into a text-completion task suitable for LLMs:
- History Modeling: For a specific query, the system retrieves relevant historical facts. The study explored different retrieval strategies, focusing on entity-specific histories or specific subject-relation pairs to provide the model with sufficient context.
- Prompt Construction: Historical data is converted into a structured textual format. A critical component of this study was the comparison between Lexical prompts (using real entity names) and Index prompts (replacing names with arbitrary numerical identifiers).
- Response Generation: To ensure valid outputs, the researchers constrained the LLM's generation. By mapping candidate entities to numerical labels and analyzing the model's output logits, they could rank potential answers based on probability distributions rather than allowing free-form text generation.
Experimental Setup
The approach was evaluated across five diverse benchmarks:
- WIKI & YAGO: Historical datasets with yearly granularity.
- ICEWS14 & ICEWS18: Political event data from the Integrated Crisis Early Warning System, recorded daily.
- ACLED-CD22: A new dataset focusing on recent conflict data in Cabo Delgado (2021-2022), designed to test the models on contemporary, real-world scenarios.
Key Insights: Symbolic Reasoning vs. Semantic Knowledge
The most significant finding of this research is the LLMs' ability to perform "knowledge-free" forecasting. When entity names were replaced with random numbers (the Index setting), model performance remained remarkably stable. This suggests that LLMs are not merely relying on the semantic knowledge acquired during pre-training (e.g., historical facts about nations) but are instead performing sophisticated symbolic reasoning. They identify abstract temporal patterns and repetitions within the provided context to predict future events.
Interestingly, while base models (like GPT-NeoX) showed little difference between Lexical and Index prompts, instruction-tuned models (like GPT-3.5) performed better with real names. This indicates that instruction tuning may help models better integrate their internal semantic priors with the provided context.
Performance Results
The zero-shot LLM approach demonstrated parity with state-of-the-art (SOTA) supervised models:
- Competitive Accuracy: On the ICEWS14 dataset, GPT-NeoX achieved a Hits@1 score of 0.324, surpassing supervised models like RE-GCN (0.313) and Timetraveler (0.319).
- Heuristic Superiority: The LLM approach significantly outperformed rule-based heuristics. In the ICEWS18 dataset, the LLM achieved 0.192 Hits@1, compared to 0.141 for frequency-based and 0.120 for recency-based baselines.
- Scaling: Performance followed typical scaling laws, improving as model size and context length increased.
Limitations and Future Directions
Despite its success, the approach faces several challenges:
- Inductive Constraints: The current framework is inductive, meaning it can only predict entities that have appeared within the provided historical context. It cannot yet forecast "transductive" events involving entirely new entities.
- Tokenization Issues: Some models struggle with the numerical identifiers used in the Index setting due to tokenizer limitations with multi-digit numbers.
- Inference Cost: While it eliminates training costs, the requirement for long historical contexts in every prompt increases the computational expense during inference.
Future work will likely focus on enabling transductive forecasting and exploring fine-tuning strategies to further enhance the latent symbolic reasoning capabilities of LLMs for structured temporal data.
Summary updated