TimeLMs: Diachronic Language Models from Twitter

Daniel Loureiro, Francesco Barbieri, Leonardo Neves, Luis Espinosa Anke, José Camacho-Collados

Abstract

Language is a moving target, yet most AI models are frozen in the year they were trained. This paper introduces TimeLMs, a suite of "diachronic" language models specifically for Twitter that are updated quarterly to keep pace with evolving slang, world events, and "concept drift." By treating time as a first-class variable, these models significantly outperform static baselines on contemporary social media tasks.

Introduction: The Problem of Temporal Misalignment

Most state-of-the-art language models (LMs) like BERT or RoBERTa suffer from temporal misalignment. They are trained on a massive snapshot of the internet and then deployed. However, language—especially on social media—is highly dynamic. A model trained in 2018 has no concept of "COVID-19," "lockdown," or "Squid Game."

When these "static" models are used to analyze data from later periods, their performance degrades because the distribution of words and meanings has shifted. This research tackles the challenge of building models that "age gracefully" by implementing a continual learning strategy that keeps the model’s internal knowledge up to date with the pulse of Twitter.

Methodology

The researchers developed TimeLMs using a two-phase training approach:

  1. Base Training: Starting with a standard RoBERTa-base architecture, the model underwent domain adaptation on 90 million tweets posted up until the end of 2019.
  2. Continual Learning: Instead of retraining from scratch, the researchers performed "continual pre-training." Every quarter, the existing model was updated with approximately 4.2 million new tweets from that period.

To evaluate these models, the team used Pseudo-perplexity (PPPL). Designed for masked language models, PPPL measures how "surprised" a model is by a sequence of text. A lower PPPL indicates that the model finds the text more familiar and predictable.

Key Insights: Quantifying Model Spoilage

The authors quantified model degradation, finding that a model trained on 2020 data sees its performance drop by nearly 10% after just one year of "future" data. This confirms that for high-velocity environments like social media, a "train once and forget" approach is insufficient.

Qualitative analysis demonstrated that the models successfully "learned" new world facts. For example, when asked to fill in the blank for "I keep forgetting to bring a [MASK]," early 2020 models suggested "bag" or "purse," while late 2020 models correctly predicted "mask."

Pseudo-log-likelihood (PLL) of specific tweets over time, illustrating how models become more familiar with new concepts like 'Squid Game' as they are updated.

As shown in the figure above, the model's familiarity (measured by PLL) for a tweet about Squid Game increases sharply in late 2021 as the model is updated with data from that period, whereas a static model would remain highly "surprised" by the new context.

Results

TimeLMs achieved state-of-the-art or highly competitive results on the TweetEval benchmark, despite being trained on significantly less total data than some specialized baselines like BERTweet.

Comparison of TimeLMs against various baselines on the TweetEval benchmark.

Notably, TimeLMs outperformed the much larger BERTweet on irony detection, suggesting that temporal relevance is a key factor in understanding nuanced social media tropes. In time-aware evaluations, the "corresponding" model (e.g., using the 2021-Q1 model for 2021-Q1 tweets) consistently outperformed older versions.

Limitations and Future Work

While effective, the current TimeLMs are limited to English. Expanding to multilingual social media trends is a priority. Additionally, future work may explore explicit time encoding (e.g., prepending "Year: 2022" to inputs) to help the model distinguish between eras. While optimized for Twitter, the generalizability of these diachronic models to slower-moving domains like news or scientific literature remains an open question.

Summary updated

BibTeX
@inproceedings{loureiro2022timelms,
  author = {Daniel Loureiro and Francesco Barbieri and Leonardo Neves and Luis Espinosa Anke and José Camacho-Collados},
  title = {{TimeLMs: Diachronic Language Models from Twitter}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-demo.25},
}
Figure