Can Language Models Serve as Temporal Knowledge Bases?

Ruilin Zhao, Feng Zhao, Guandong Xu, Sixiao Zhang, Hai Jin

While Large Language Models (LMs) are often utilized as static knowledge bases, they frequently struggle to keep pace with a world where facts change over time. This paper introduces LAMA-TK, a new benchmark for probing temporal knowledge, and demonstrates that while LMs can memorize millions of time-sensitive facts, "conflicting" information significantly hinders their performance and storage capacity.

The Challenge of Dynamic Knowledge

The "LM-as-KB" (Language Model as Knowledge Base) paradigm suggests that models like BERT or RoBERTa store vast amounts of relational facts in their parameters, retrievable via "cloze" queries (e.g., "The capital of France is [MASK]"). However, most research treats this knowledge as static. In reality, world knowledge is dynamic: Michael Jordan played for the Chicago Bulls from 1995 to 1998, but for the Washington Wizards in 2002.

Illustration of temporally-scoped knowledge retrieval in RoBERTa, showing how facts change over time.

This creates two major hurdles for LMs:

  1. Conflicting Information: A single entity-relation pair has multiple correct answers depending on the time.
  2. Temporal Scopes: Models need to understand not just the fact, but the specific start and end dates associated with it.

Methodology: Adapting LMs for Temporal Data

The authors propose a framework to adapt LMs into Temporal Knowledge Bases using several key techniques:

  • Prompt-based Temporal Scope Modeling: Natural language templates like "from [Start Time] to [End Time]" are used to explicitly link temporal boundaries to relational data.
  • Symbolic Representation: To avoid issues with multi-token entity names, each entity is mapped to a unique single token in the vocabulary, allowing for high-precision prediction.
  • Dynamic Time Masking: To prevent models from over-relying on correlations between start and end dates, the authors introduced a training technique that randomly masks either the start date, the end date, or both.
  • Reciting vs. Querying: The study distinguishes between "Reciting" (memorizing training data) and "Querying" (generalizing to new, unseen natural language templates).

The LAMA-TK Dataset

The paper introduces LAMA-TK (LAnguage Model Analysis for Temporal Knowledge), a massive probing dataset built from CronQuestions and Wikidata. It contains 639,000 temporally-scoped facts and 316,000 entities across 7 major relations. Unlike previous datasets, LAMA-TK explicitly includes both start and end dates and preserves "conflicting" multi-answer facts.

Key Results and Insights

The study reveals a significant "Cost of Conflict." Memorizing conflicting facts (1-N or N-M relations) is harder for LMs than 1-1 relations. Crucially, the presence of conflicting facts in the training set hinders the model's ability to memorize other, unrelated 1-1 facts.

Performance metrics across varying numbers of masked statements, highlighting the performance gap between non-conflict and conflict scenarios.

Storage and Boundaries

RoBERTa(12L) can memorize millions of facts, achieving ~84% Acc@1 on single-answer facts, which drops to ~78% when multiple correct answers are involved. While LMs are initially poor at identifying temporal boundaries (~12% Acc@1), Dynamic Time Masking improves this to ~48.8%.

The Pre-training Paradox

In "reciting" tasks, randomly initialized models sometimes outperform pre-trained ones, suggesting that general knowledge from pre-training can interfere with specific new temporal facts. However, pre-trained models are far more robust at "Zero-Shot Querying," maintaining high performance on new templates where randomly initialized models fail.

Limitations and Future Work

LAMA-TK focuses on retrieval rather than complex temporal reasoning (e.g., "Who held this position after person X?"). Additionally, the computational cost of symbolic representations for hundreds of thousands of entities is high. Future work may explore external memory banks or sophisticated temporal logic to manage the interference caused by conflicting world facts.

Summary updated

BibTeX
@inproceedings{zhao2022can,
  author = {Ruilin Zhao and Feng Zhao and Guandong Xu and Sixiao Zhang and Hai Jin},
  title = {{Can Language Models Serve as Temporal Knowledge Bases?}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.147},
}
Figure