Harnessing Temporal Databases for Systematic Evaluation of Factual Time-Sensitive Question-Answering in LLMs

Soyeon Kim, Jindong Wang, Xing Xie, Steven Euijong Whang

This paper introduces TDBench, a novel framework that leverages temporal database principles to automate the creation and evaluation of time-sensitive factual benchmarks for Large Language Models (LLMs).

TL;DR

TDBench automates the generation of complex, time-sensitive question-answering (TSQA) benchmarks by applying database techniques—such as temporal functional dependencies and SQL—to structured data. It also introduces "time accuracy," a new evaluation metric that reveals a significant reliability gap in modern AI: LLMs frequently provide the correct factual answer while hallucinating the associated dates and timeframes.

The Problem: Static Benchmarks in a Dynamic World

Facts are not static; they evolve. The answer to "Who is the president of the U.S.?" changes depending on whether the year is 2020 or 2024. To be reliable, LLMs must possess temporal reasoning (understanding contexts like "before 2019") and temporal alignment (staying up-to-date with current facts).

Existing TSQA benchmarks suffer from three major bottlenecks:

  1. Manual Labor: Most benchmarks rely on human writers or a small set of rigid templates (e.g., "Who was [Role] in [Year]?"), limiting both diversity and scale.
  2. Maintenance Costs: As the world changes, benchmarks become obsolete. Manually updating them is so expensive that many popular datasets have ceased updates altogether.
  3. Superficial Evaluation: Current metrics usually only check the final answer. A model might correctly name a leader but hallucinate their term dates in the explanation—a "right for the wrong reason" scenario that goes undetected.

Methods: The TDBench Pipeline

The authors propose a three-step systematic pipeline to transform any temporal database into a robust TSQA benchmark.

TDBench Pipeline Overview
  1. Knowledge Selection via TFDs: The system uses Temporal Functional Dependencies (TFDs) to identify attributes that change over time but are unique at any given point (e.g., a country can have only one monarch at a time). This ensures the generated questions have a single, verifiable "gold" answer.
  2. Temporal SQL Query Generation: Instead of simple templates, TDBench uses Allen’s interval algebra—a logic framework covering 13 distinct temporal relations (like meets, overlaps, and contains)—to generate complex SQL queries.
  3. Conversion to Natural Language: An LLM acts as a "translator," turning these structured SQL queries into diverse, natural-sounding questions. Because the answers are derived directly from the database, they are strictly grounded in ground-truth data.

Crucially, the authors introduce Time Accuracy (T). This metric evaluates whether the time references provided in a model's explanation (e.g., "He served from 2001 to 2009") match the database, evaluated alongside traditional Answer Accuracy (A).

Datasets

The authors evaluated eight contemporary LLMs (including GPT-4o, Llama 3, and Qwen2) across several data sources:

  • Wikipedia/Wikidata: Covering standard domains like Countries, Athletes, and Organizations.
  • Domain-Specific Data: Sourced from Kaggle and government portals, including Legal (same-sex marriage laws), Environmental (carbon taxation), Cultural (UNESCO heritage), and Entertainment (Netflix remakes).
  • Synthetic Data: A medical dataset of patient records to test reasoning in specialized, non-public domains.

Key Insights and Ideas

  • The "Temporal Hallucination" Gap: There is a massive discrepancy between a model's ability to name an entity and its ability to accurately place that entity in time. On Wikipedia data, there was a 21.7% average drop in performance when moving from "Answer Accuracy" to "Answer-Time Accuracy."
  • RAG is Not a Silver Bullet: While Retrieval-Augmented Generation (RAG) helps with factual updates, it often fails on temporal nuances. RAG systems frequently retrieve documents that are semantically relevant but "temporally misaligned" (e.g., returning info about the 1964 Olympics when asked about the 1956 edition).
  • Autoregressive Bias in Time: LLMs are significantly better at identifying "start" dates than "end" dates. The authors suggest this is due to the autoregressive nature of training data, where start dates typically appear earlier in a text sequence than end dates.
Model Performance across Temporal Relations
  • Complexity Matters: As shown in the performance heatmap, models struggle most with contain and overlap relations. These require reasoning over two distinct time points simultaneously, which proves far more difficult than simple before/after logic.

Key Results

  • Top Performer: GPT-4o emerged as the strongest overall performer, particularly in complex multi-hop reasoning. However, it still suffered from significant date hallucinations in domain-specific tasks like Carbon Tax and Netflix data.
  • Scalability: TDBench reduced input token costs and inference time compared to LLM-only benchmark generation methods by filtering for only necessary attributes via SQL.
  • Multi-hop Reasoning: By performing "temporal joins" (linking two tables via overlapping time intervals), TDBench successfully generated difficult questions like "Who was the leader of the host country during the 7th Winter Olympics?" without manual curation.

Limitations and Future Work

  • Database Quality: The framework is only as good as the underlying data. If the source database contains errors or "noisy" TFDs, the generated QA pairs will be flawed.
  • Granularity: The current implementation focuses largely on discrete dates (years/months). Extending this to fuzzy intervals (e.g., "early 2000s") or non-standard units (fiscal quarters) is a necessary next step.
  • Reasoning vs. Retrieval: While the paper identifies the "right answer, wrong date" problem, more work is needed to determine if this is a failure of internal knowledge retrieval or a fundamental weakness in LLM temporal logic.

Summary updated

BibTeX
@inproceedings{kim2026harnessing,
  author = {Soyeon Kim and Jindong Wang and Xing Xie and Steven Euijong Whang},
  title = {{Harnessing Temporal Databases for Systematic Evaluation of Factual Time-Sensitive Question-Answering in LLMs}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=W7RNxsTKKZ},
}
Figure