Datasets & methods

Temporal distribution shift, three time-indexed domains, and one drift-matrix protocol.

// 1  temporal distribution shift

Machine learning models are typically trained under the assumption that training and test data are drawn from the same distribution. In practice this rarely holds: as a system operates over months, years, or decades, the data-generating process evolves, producing a temporal distribution shift between training and deployment. This shift takes three forms, which commonly co-occur.

Covariate shift: the point cloud migrates into a new region between t1 and t2 while the decision boundary stays fixed

Covariate shift

The inputs \(P(X)\) drift into new regions while the labelling rule \(P(Y \mid X)\) stays fixed: the points move, the decision boundary does not.

Label shift: class A grows to dominate class B between t1 and t2 while each class keeps its position

Label shift

The class balance \(P(Y)\) changes while each class keeps its appearance \(P(X \mid Y)\): here one class comes to dominate, though the boundary is unchanged.

Concept drift: the points stay fixed while the decision boundary swings between t1 and t2, flipping the class of many points

Concept drift

The labelling rule \(P(Y \mid X)\) itself changes: the points stay put, but the decision boundary swings, so identical inputs switch class.

// 2  the datasets

We study these three forms of drift in three datasets, chosen so that the modality, the task, and the dominant form of drift differ across datasets, and so that each spans a decade or more: Yearbook (photographs), Amazon Reviews (product reviews), and arXiv (research papers).

// 3  the models

On every dataset we train the same set of architectures, each encoding a different inductive bias over its input. Some are trained end to end; others freeze a pretrained encoder and train only a linear head on its features. Varying the inductive bias and the use of pretraining lets us measure how each shapes temporal robustness.

3.1 Image models

On Yearbook, four families are trained end to end from raw pixels: a multilayer perceptron, a convolutional network, a residual network, and a vision Transformer, each at three sizes (S, M, L). Nine pretrained vision encoders are evaluated as frozen backbones, each with a single linear layer on top.

MLP treats the image as an unordered vector of pixels
CNN / ResNet locality and translation invariance
ViT image patches compared by self-attention
Frozen features from a frozen pretrained encoder

3.2 Text models

Amazon Reviews and arXiv share the same trained text families, differing in the output layer and loss. The four trained bodies (feed-forward, convolutional, recurrent, and Transformer) do not learn token embeddings; each is trained over frozen RoBERTa-base representations. The remaining models train a single linear head on a frozen pretrained encoder, with MiniLM-L6 included for arXiv only.

FFN ignores word order
TextCNN local n-gram features
Recurrent reads tokens in sequence
Transformer self-attention over all positions
Frozen features from a frozen pretrained encoder

// 4  the protocol

To compare these models under temporal shift, we evaluate every one with a single protocol based on temporal drift matrices. We divide each dataset's timeline into \(K\) disjoint intervals \(T_1, \dots, T_K\). For training cutoff \(i\), a model \(f_i\) is fit on the cumulative history \(\mathcal{D}_{\le i} = \bigcup_{j \le i} \mathcal{D}_j\), all data observed up to interval \(i\), which mirrors realistic deployment where models are periodically retrained on the available history. The temporal drift matrix \(M \in \mathbb{R}^{K \times K}\) records \[ M_{ij} = \mathrm{perf}(f_i, \mathcal{D}_j), \] the performance of a model trained through period \(i\) when evaluated on data from period \(j\). Every reported cell is averaged over distinct model seeds before any model, family, or cohort aggregation: 5 seeds for Yearbook and 3 seeds for arXiv and Amazon Reviews. This repeated-seed aggregation reduces sensitivity to random initialization and training-order stochasticity while keeping dataset construction fixed.

Measured matrices: each row appears as training reaches that period; cells are averaged over distinct model seeds first (Yearbook: 5 seeds; Amazon/arXiv: 3), then averaged over completed models and block-averaged only for this legible grid. Full-resolution matrices are on the results page.
An idealized temporal drift matrix: a warm in-distribution diagonal cooling toward forward generalization in the lower-right
An idealized drift matrix for reference: training time increases upward, evaluation time rightward, and the origin sits in the lower-left corner.
Diagonal \(M_{ii}\)in-distribution performance on held-out data from the training period
Upper-left region \(j < i\)in-distribution performance on earlier periods included in training
Lower-right region \(j > i\)forward generalization to future data unseen during training

The matrix shows how performance degrades, or improves, as the temporal gap between training and evaluation widens.

Split time divide each timeline into periods
Train on history all data up to a cutoff
Test across time earlier and later periods
Drift matrix every train and test pair, one cell
The evaluation protocol: a model trained on each slice of history is scored on every period, filling a temporal drift matrix.

To avoid leakage, in-distribution cells (\(j \le i\)) are scored only on the held-out test split of \(\mathcal{D}_j\); future cells (\(j > i\)) use all of \(\mathcal{D}_j\), since none of it was seen during training. The loss matches each task's imbalance: cross-entropy for Yearbook, a class-weighted binary cross-entropy over the \(C = 7\) arXiv subjects, and an inverse-frequency-weighted MSE over the five Amazon rating levels.

// 5  metrics

To compare models across time and architectures, we require scalar performance measures that are both aligned with the task and robust to the class imbalance present in each dataset. The metric that populates the entries of the drift matrix \(M\) differs across the three datasets, reflecting their respective label structures.

a 2 by 2 confusion matrix with correct predictions shaded on the diagonal
AccuracyYearbook

For binary classification, standard accuracy is appropriate given the two classes and the roughly balanced label distribution.

an ROC curve with the area underneath shaded, equal to the AUC
Macro AUCarXiv

For multi-label classification, the macro-averaged Area Under the ROC Curve is threshold-independent and remains meaningful under severe label imbalance; uniform averaging over the \(C = 7\) subjects prevents frequent categories from dominating.

\(\overline{\mathrm{AUC}} = \tfrac{1}{C}\sum_{c=1}^{C}\mathrm{AUC}_c\)
a bar per star rating, the squared error averaged equally across ratings
Balanced MSEAmazon Reviews

The rating distribution is skewed toward five-star reviews, so a global MSE would reflect the majority class; averaging the squared error within each rating level keeps changes visible across the full spectrum.

\(\mathrm{MSE}_{\mathrm{bal}} = \tfrac{1}{|\mathcal{R}|}\sum_{r \in \mathcal{R}}\tfrac{1}{|\mathcal{S}_r|}\sum_{i \in \mathcal{S}_r}(y_i - \hat{y}_i)^2,\quad \mathcal{S}_r = \{i : y_i = r\},\ \mathcal{R} = \{r : |\mathcal{S}_r| > 0\}\)