Temporal Attention for Language Models

Guy D. Rosin, Kira Radinsky
2/4/2022
cs.CL
transformer-attention

Official code: guyrosin/temporal_attention (27 stars, Python, MIT, last commit 2023-04-14).

Abstract

Pretrained language models based on the transformer architecture have shown great success in NLP. Textual training data often comes from the web and is thus tagged with time-specific information, but most language models ignore this information.

Show full abstract

They are trained on the textual data alone, limiting their ability to generalize temporally. In this work, we extend the key component of the transformer architecture, i.e., the self-attention mechanism, and propose temporal attention - a time-aware self-attention mechanism. Temporal attention can be applied to any transformer model and requires the input texts to be accompanied with their relevant time points. It allows the transformer to capture this temporal information and create time-specific contextualized word representations. We leverage these representations for the task of semantic change detection; we apply our proposed mechanism to BERT and experiment on three datasets in different languages (English, German, and Latin) that also vary in time, size, and genre. Our proposed model achieves state-of-the-art results on all the datasets.

View on arXivView PDF

Code Implementations(1)

MIT

Code and data for the paper "Temporal Attention for Language Models", Findings of NAACL 2022

275PythonFeb 7, 20223 years agoMIT

Similar Papers

Cite this paper

@article{rosin2022temporal,
  title  = {Temporal Attention for Language Models},
  author = {Guy D. Rosin and Kira Radinsky},
  year   = {2022},
  eprint = {2202.02093},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.02093}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2202.02093.svg)](https://codeofpaper.com/paper/2202.02093)

Discussion