Abstract
Large pre-trained language models (LPLM) have shown spectacular success when fine-tuned on downstream supervised tasks. Yet, it is known that their performance can drastically drop when there is a distribution shift between the data used during training and that used at inference time. In this paper we focus on data distributions that naturally change over time and introduce four new REDDIT datasets, namely the WALLSTREETBETS, ASKSCIENCE, THE DONALD, and POLITICS sub-reddits. First, we empirically demonstrate that LPLM can display average performance drops of about 88% (in the best case!) when predicting the popularity of future posts from sub-reddits whose topic distribution changes with time. We then introduce a simple methodology that leverages neural variational dynamic topic models and attention mechanisms to infer temporal language model representations for regression tasks. Our models display performance drops of only about 40% in the worst cases (2% in the best ones) when predicting the popularity of future posts, while using only about 7% of the total number of parameters of LPLM and providing interpretable representations that offer insight into real-world events, like the GameStop short squeeze of 2021.
Introduction: The Challenge of Temporal Distribution Shift
Modern NLP relies heavily on Large Pre-trained Language Models (LPLMs) like BERT and RoBERTa. These models are typically fine-tuned on specific tasks under the assumption that the data distribution remains stationary. However, real-world language is inherently non-stationary; topics evolve, new terminology emerges, and public interest shifts rapidly. This phenomenon, known as temporal distribution shift, poses a significant challenge for predictive tasks. For instance, a model trained on Reddit posts from 2019 to predict post popularity (measured by comment count) may fail significantly when applied to 2021 data, where conversations are dominated by unforeseen events like the COVID-19 pandemic or the GameStop short squeeze.
Methodology: Dynamic Topic Attention Models
To address this, the authors propose D-TAM-GRU (Dynamic Topic Attention Model with a Gated Recurrent Unit). This architecture separates high-level topic dynamics from low-level word statistics, allowing the model to adapt to shifting contexts without the massive parameter overhead of a full Transformer.
The model consists of three primary components:
- Neural Variational Dynamic Topic Model (DTM): This component infers latent topics and tracks their proportions over time using a variational approach to handle uncertainty in shifts.
- Neural Language Model (NLM): A GRU encodes word sequences into contextualized representations.
- Temporal Attention Mechanism: This core innovation uses time-dependent topic proportions from the DTM to weight the word representations from the NLM. It effectively tells the model which topics are currently relevant for predicting popularity.
Experimental Setup and Datasets
The study introduces four longitudinal datasets from Reddit, selected for their high "topic churn":
- r/wallstreetbets: Characterized by high volatility, particularly around the 2021 "meme stock" events.
- r/askscience: Discussions shift in response to global scientific and health events.
- r/politics: Dynamic US-centric political discourse.
- r/the_donald: Used as a control; this subreddit exhibited relatively stationary topic distributions before its ban.
The data is split chronologically into "Up-to-date" (training/validation) and "Prediction" (future testing) sets to evaluate performance under distribution shift.
Key Results: The Performance Cliff
The empirical results highlight a stark "performance cliff" for standard LPLMs. When transitioning from past data to future prediction, models like BERT and RoBERTa experienced average performance drops of approximately 88%.
In contrast, the D-TAM-GRU model demonstrated remarkable stability. Its performance drop was limited to 40% in the worst-case scenarios and as low as 2% in the best cases. Notably, on the r/wallstreetbets and r/politics datasets, D-TAM-GRU consistently achieved higher $R^2$ scores for future prediction than fine-tuned BERT models. The only exception was r/the_donald, where the static nature of the topics allowed LPLMs to maintain their edge, confirming that LPLMs primarily fail when the future significantly diverges from the past.
Discussion and Conclusion
The findings suggest that for temporal prediction, specialized architectures that explicitly model change are more effective than massive models that only understand state. D-TAM-GRU achieves superior robustness while using only 7% of the parameters of a standard LPLM. Furthermore, the DTM component provides interpretability, allowing researchers to visualize topic trajectories and understand the drivers behind popularity shifts.
While effective, the model has limitations. In stationary environments, the added complexity of dynamic modeling offers no advantage. Additionally, while the GRU is efficient, future iterations could integrate more powerful encoders. Ultimately, this work underscores the need for models that can "forecast" relevance in a changing linguistic landscape.
Summary updated