Temporal Attention for Language Models

Guy D. Rosin, Kira Radinsky

Language is a living entity; the meaning of words shifts as society and technology evolve. For instance, "zoom" meant a rapid movement in 2018, but by 2021, it primarily referred to video conferencing. While humans adapt to these shifts instinctively, standard Large Language Models (LLMs) are often "frozen in time," trained on static snapshots of data. In their NAACL 2022 paper, "Temporal Attention for Language Models," Guy D. Rosin and Kira Radinsky propose a novel architectural modification to bake the dimension of time directly into the Transformer.

The Challenge: Static Models in a Dynamic World

Most language models treat a sentence from 1850 identically to one from 2020. This lack of temporal awareness hinders Semantic Change Detection—the task of identifying how word meanings evolve over time (diachronic change). Previous attempts to address this often relied on "time prepending," where a date token (e.g., [2022]) is added to the input. However, this treats time as just another token rather than a fundamental context that should influence every word's representation.

Methods: Integrating Time into Attention

The authors introduce Temporal Attention, which conditions word representations on their specific point in time by modifying the self-attention mechanism. In a standard Transformer, attention is computed using Query ($Q$), Key ($K$), and Value ($V$) matrices. The authors introduce a fourth element: a Time matrix ($T$).

Architecture of the Temporal Attention mechanism.

For every input text, a timestamp is converted into a time embedding ($T$) via a trainable weight matrix. The attention is then calculated as: $$\text{softmax}\left(\frac{QT^T T K^T}{\sqrt{d_k}}\right)V$$ By multiplying the Query by the Time matrix ($QT^T T$), the attention weights become mathematically dependent on the era. This allows the model to generate "time-specific contextualized representations" without increasing input sequence length or computational overhead.

Experimental Setup and Results

The model was evaluated on the SemEval-2020 Task 1 benchmark for Unsupervised Detection of Lexical Semantic Change across English, German, and Latin. Temporal Attention achieved state-of-the-art (SOTA) results across all three languages, significantly outperforming previous BERT-based methods.

Performance comparison of Temporal Attention against baseline methods across three languages.

As shown in the results table, the model reached a Pearson correlation ($r$) of 0.620 in English and a Spearman correlation ($\rho$) of 0.763 in German—a substantial improvement over prior benchmarks. The model successfully identified high-change words like "plane" and "tip" while remaining stable on static words like "chair."

Key Insights: The "Small Model" Paradox

A notable finding was that smaller models (like BERT-tiny) often outperformed larger ones (BERT-base) on temporal tasks. The authors hypothesize that massive models may overfit to specific sentence contexts, while smaller models are forced to learn more robust, generalized representations of how time affects word usage. Furthermore, the approach is highly efficient; adding the Time matrix introduces only about 49,000 parameters to a 110M-parameter BERT-base model, a negligible increase for a significant performance gain.

Conclusion

By treating time as a fundamental dimension of language rather than an external label, Temporal Attention enables models to understand not just the content of a message, but its historical context. This paves the way for more nuanced AI that can track the pulse of evolving language.

Summary updated

BibTeX
@inproceedings{rosin2022temporal,
  author = {Guy D. Rosin and Kira Radinsky},
  title = {{Temporal Attention for Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-naacl.112},
}
Figure