Time-aware Prompting for Text Generation

Shuyang Cao, Lu Wang · DOI

Large language models (LLMs) are typically trained on static snapshots of the internet. While they excel at capturing linguistic patterns, they often suffer from "temporal shift"—a phenomenon where model performance degrades as the real-world context evolves beyond the training data's cutoff. For an AI, a news report from 2010 and one from 2023 are often indistinguishable without explicit temporal grounding, leading to knowledge obsolescence and temporal hallucinations.

To address this, researchers have introduced time-aware prompting, a method to explicitly inform models of a document's timestamp. By grounding generation in time, models can better navigate chronological shifts and maintain factuality in time-sensitive contexts.

Methodology: Textual vs. Linear Grounding

The study investigates two primary mechanisms for injecting temporal information into models like BART and T5:

  1. Textual Prompts: This approach uses natural language to provide context. A prefix such as "Today is 18 January 2015" is prepended to the input. This leverages the model's pre-existing understanding of date formats and linguistic time markers.
  2. Linear Prompts: This architectural approach treats time as a continuous signal. The year, month, and day are mapped into continuous vectors via linear projections. These "soft" prompts are learned during the fine-tuning process and prepended to the hidden states of the encoder or decoder.

Evaluating Temporal Awareness

The researchers evaluated these methods across three distinct tasks:

  • TEMPWIKIBIO: A new dataset containing 4 million chronologically ordered Wikipedia biography revisions (2004–2021). This dataset specifically tests a model's ability to extrapolate to "future" data points not seen during training.
  • Content Transfer: A task requiring the model to continue a passage based on a source document.
  • XSum: A benchmark for extreme summarization of BBC news articles.

Key Insights: The Sensitivity Paradox

The experiments revealed a nuanced relationship between the prompting method and the data type. Linear prompts proved most effective when dealing with structured data, such as Wikipedia infoboxes. Conversely, textual prompts were superior for natural language tasks, where both input and output were prose.

One of the most striking findings was the "Sensitivity Paradox." Through date perturbation experiments—where the model was intentionally given the wrong timestamp—the researchers found that textual prompts are highly sensitive to the specific date. This sensitivity is a strength; it allows the model to generate factually accurate dates and events tied to a specific moment.

In contrast, linear prompts were less sensitive to specific dates but acted as "content boosters." They appeared to signal the general "era" or style of the data, helping the model process non-temporal content more effectively even if the exact day was less critical.

Results and Performance

Time-aware prompting demonstrated broad utility, outperforming standard "no-prompt" baselines in 87.5% of comparisons across metrics like BLEU, ROUGE, and METEOR.

On the TEMPWIKIBIO dataset, the Linear Prompt (Encoder) achieved a 31.22 BLEU-4 score on future test data, compared to the baseline's 30.48. Human evaluations further confirmed that textual prompts significantly enhanced the factuality of temporal information, reducing the likelihood of the model "hallucinating" dates that contradicted the provided context.

Limitations and Future Directions

While time-aware prompting significantly improves performance, it does not grant the model deep temporal reasoning. A model might recognize a date but fail to understand complex periodicities (e.g., that the Olympics occur every four years) unless that logic is inherent in its training. Furthermore, the practical application of these methods is limited by the difficulty of obtaining accurate timestamps for all web-scale data.

Future research may focus on developing new metrics that specifically reward temporal accuracy, as standard metrics like ROUGE are often "time-blind." Additionally, integrating temporal grounding into the pre-training phase, rather than just fine-tuning, could yield even more robust temporal awareness.

Summary updated

BibTeX
@inproceedings{cao2022time,
  author = {Shuyang Cao and Lu Wang},
  title = {{Time-aware Prompting for Text Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.535},
}
Figure