TimeR⁴ : Time-aware Retrieval-Augmented Large Language Models for Temporal Knowledge Graph Question Answering

Xinying Qian, Ying Zhang, Yu Zhao, Baohang Zhou, Xuhui Sui, Li Zhang, Kehui SongEMNLP 2024

Introduction: Addressing Temporal Blindness in LLMs

While Large Language Models (LLMs) have demonstrated remarkable reasoning capabilities, they often suffer from "temporal blindness" when tasked with Temporal Knowledge Graph Question Answering (TKGQA). Standard Knowledge Graphs represent facts as (Subject, Predicate, Object) triplets, but Temporal KGs introduce a critical fourth dimension: time.

The primary challenges identified in current LLM-based TKGQA are:

  1. Implicit Temporal Constraints: Many questions lack explicit dates. For instance, "Who visited Iraq after the Danish Ministry?" requires the model to first determine the date of the Danish Ministry's visit before identifying subsequent events. Without this intermediate step, LLMs frequently hallucinate.
  2. Temporal Retrieval Gap: Traditional retrieval methods like BM25 focus on semantic similarity, often ignoring the temporal relevance of facts. This leads to the retrieval of chronologically irrelevant information.
Comparison between implicit and explicit temporal questions and the resulting reasoning paths.

The TimeR⁴ Framework: A Four-Stage Pipeline

To overcome these hurdles, the authors propose TimeR⁴, a framework utilizing a specialized Retrieve-Rewrite-Retrieve-Rerank pipeline designed to bridge the gap between semantic and temporal retrieval.

The complete TimeR⁴ architecture, including Fact Retrieval, Rewriting, Time-aware (TA) Retrieval, and Reasoning stages.

The framework consists of four distinct stages:

  • Fact Retrieval (FKS): Background facts are retrieved from a Facts Knowledge Store to resolve implicit temporal references.
  • Rewriting: An LLM transforms the original question into an explicit version by replacing event descriptions with specific timestamps (e.g., "After 2016-01-05").
  • Time-aware Retrieval (TKS): A retriever (SentenceBERT) is fine-tuned using contrastive time-aware learning. It is trained to distinguish positive facts from negatives that are incorrect in time, content, or both.
  • Reranking: A time-filtering function ensures only chronologically relevant data within the required temporal window is passed to the LLM.

Finally, an open-source LLM (LLaMA2-7B) is fine-tuned to synthesize the final answer from these curated, time-stamped facts.

Experimental Setup and Datasets

TimeR⁴ was evaluated on two major benchmarks:

  • MULTITQ: The largest TKGQA dataset, containing 500,000 question-answer pairs across various temporal granularities spanning nearly a decade.
  • TimeQuestions: A dataset of 16,000 questions categorized into Explicit, Implicit, Temporal, and Ordinal types.

Notably, the researchers avoided the CronQuestions dataset due to spurious correlations that can inflate performance scores without requiring genuine temporal reasoning.

Key Results and Insights

TimeR⁴ achieved state-of-the-art performance, significantly outperforming traditional TKGQA methods and general-purpose models like ChatGPT.

  • Performance Gains: On MULTITQ, TimeR⁴ reached a 72.8% Hits@1 score, a 47.8% relative improvement over the previous best method (ARI). On TimeQuestions, it achieved 78.1% Hits@1, a 22.5% relative gain.
  • Explicit Reasoning: Converting implicit references to numerical timestamps drastically reduces hallucinations, as LLMs reason more reliably over explicit dates.
  • The "Goldilocks" Zone: The study found that retrieving exactly 15 facts provided the optimal balance between context and noise; fewer facts provided insufficient context, while more introduced confusing noise.

Limitations and Future Directions

While TimeR⁴ represents a significant step forward, challenges remain in retrieving complex, multi-hop temporal information. Additionally, LLMs still struggle with rigid output formatting (e.g., specific date formats) without specific fine-tuning. Future work will focus on more precise temporal extraction and the development of more robust evaluation metrics.

Summary updated

BibTeX
@inproceedings{qian2024timer,
  author = {Xinying Qian and Ying Zhang and Yu Zhao and Baohang Zhou and Xuhui Sui and Li Zhang and Kehui Song},
  title = {{TimeR⁴ : Time-aware Retrieval-Augmented Large Language Models for Temporal Knowledge Graph Question Answering}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.394},
}
Figure