Adaptive Sampling for Probabilistic Forecasting under Distribution Shift

Luca Masserano, Syama Sundar Rangapuram, Shubham Kapoor, Rajbir Singh Nirwan, Youngsuk Park, Michael Bohlke-Schneider

TL;DR

Standard deep learning time series models sample training windows uniformly across history, which hurts performance when real-world distributions shift over time. This paper introduces an adaptive sampling framework that uses Bayesian optimization to learn a discrete probability distribution over past time steps, focusing model training on historical periods relevant to the current regime. By fine-tuning a lightweight sub-network on these adaptively sampled windows, the method improves probabilistic forecast accuracy by 8.4% over standard DeepAR across multiple real-world benchmarks.

What Problem Does This Paper Address?

Most neural time series models assume data distributions remain stationary. In reality, external disruptions—such as economic shocks, evolving consumer behavior, or global pandemics—introduce severe distribution shifts.

Standard training procedures draw fixed-size temporal windows uniformly at random from the entire historical record. When distribution shifts are present, this uniform sampling feeds the network irrelevant or conflicting data from older, incompatible regimes. While prior work often relies on instance normalization or test-time adaptation, this paper tackles the problem from data curation: how can a model automatically identify and sample only the historical slices that match the current regime?

Methods

The authors propose Ada-DeepAR, a two-step training framework:

  1. Pre-training with Uniform Sampling: A full base forecasting model (a two-layer LSTM DeepAR architecture) is trained over the entire dataset history using standard uniform sampling to learn broad, temporal representations.
  2. Adaptive Fine-Tuning of a Lightweight Architecture: The network is split into frozen base weights and trainable "adaptive" weights (specifically, freezing the first LSTM layer and keeping only the second layer trainable). This lightweight module is fine-tuned on windows drawn from a discrete parametric probability distribution $p_\phi(t)$ over historical start times $t \in \{1, \dots, T\}$.
  3. Optimizing Sampling via Bayesian Optimization: The sampling distribution $p_\phi$ (modeled as either a Geometric distribution or a mixture of two Negative Binomial distributions) cannot be trained via backpropagation because window selection is non-differentiable. Instead, the authors treat $\phi$ as hyperparameters and optimize them using MOBSTER (a Bayesian optimization framework combining multi-fidelity bandit stopping with Gaussian processes). Optimization targets the continuous-ranked probability score (CRPS) evaluated on the most recent historical slice (the validation channel), assuming the recent past shares the regime of the impending forecast horizon.
       Pre-train (Uniform Sampling) ──► Freeze Base Layers
                                                │
[Historical Data] ──► Sample via p_φ(t) ───────► Fine-tune Adaptive Layers
                            ▲                           │
                            └──── Bayesian Opt ◄────────┘
                                 (eval on recent past)

Datasets

The authors evaluated their approach on:

  • Synthetic datasets: Sinusoidal time series injected with regime shifts distant in time or corrupted with localized noise segments.
  • Five real-world benchmark datasets (sourced from GluonTS, TSBench, and the Monash repository):
  • Covid-deaths (Daily counts)
  • Electricity (Hourly household electricity consumption)
  • Traffic (Hourly freeway occupancy rates in SF Bay Area)
  • Solar (Hourly photovoltaic power output)
  • Taxi (30-minute interval NYC taxi pickup counts)

No new datasets were introduced.

Key Insights and Ideas

  • Selective History as a Noise Filter: In synthetic experiments with injected noise shifts, the learned distribution $p_\phi$ placed zero mass on corrupted history. For recurring regimes, the bimodal distribution accurately bridged distant time periods that shared the target regime.
  • Isolating Fine-Tuning from Sampling: An ablation model, Ada-DeepAR-uniform (fine-tuning the top layer with uniform sampling), improved performance over vanilla DeepAR by 6.7%. However, learning $p_\phi$ yielded statistically significant further gains on datasets exhibiting clear shifts, proving that the improvement is not merely an artifact of extra training epochs.
  • Knowing When Not to Adapt: On stable, highly regular datasets (Traffic and Taxi), Ada-DeepAR-uniform slightly outperformed the adaptive variant. If no shift exists, uniform sampling across all available data remains optimal, indicating the distribution search space should ideally include the uniform distribution as a fallback.

Key Results

  • Overall Error Reduction: Ada-DeepAR achieved a normalized continuous-ranked probability score (nCRPS) of 0.190, representing an average 8.4% relative improvement over the baseline DeepAR (0.206).
  • Outperforming Baselines: Ada-DeepAR outperformed Reversible Instance Normalization (RevIn, 0.202) and Temporal Fusion Transformer (TFT, 0.302) on mean nCRPS and rank (mean rank 1.8 vs. 3.4 for RevIn and 4.2 for TFT).
  • Statistical Significance: The improvements of Ada-DeepAR over DeepAR were statistically significant (paired $t$-test, $p < 0.05$) on three of the five datasets (Covid-deaths, Electricity, and Solar).
Dataset Ada-DeepAR (Ours) Ada-DeepAR-uniform RevIn DeepAR TFT
Covid-deaths 0.074 0.088 0.130 0.103 0.053
Electricity 0.048 0.054 0.063 0.062 0.082
Traffic 0.172 0.171 0.172 0.176 0.306
Solar 0.370 0.376 0.376 0.388 0.562
Taxi 0.286 0.278 0.288 0.279 0.509
Mean nCRPS 0.190 0.193 0.202 0.206 0.302

Limitations and Future Work

  • Computational Cost: Tuning distribution parameters $\phi$ with Bayesian optimization requires evaluating dozens or hundreds of sequential/parallel training trials (up to 200 trials in their setup), making frequent online re-estimation computationally heavy.
  • The "No Free Lunch" Shift Horizon: The model relies on Assumption 1—that the most recent past mirrors the immediate forecast window. If a distribution shift occurs exclusively in the future forecasting window without any presence in the context window, the model cannot adapt.
  • Differentiable Sampling: The authors note that replacing Bayesian optimization with an end-to-end differentiable input-selection layer (e.g., using the Gumbel-Softmax or reparameterization trick) could substantially reduce training overhead.

Summary updated

BibTeX
@inproceedings{masserano2022adaptive,
  author = {Luca Masserano and Syama Sundar Rangapuram and Shubham Kapoor and Rajbir Singh Nirwan and Youngsuk Park and Michael Bohlke-Schneider},
  title = {{Adaptive Sampling for Probabilistic Forecasting under Distribution Shift}},
  booktitle = {DistShift @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=oPHuNpJl3c},
}
Figure