Table of Contents
Fetching ...

Calibration of Time-Series Forecasting: Detecting and Adapting Context-Driven Distribution Shift

Mouxiang Chen, Lefei Shen, Han Fu, Zhuo Li, Jianling Sun, Chenghao Liu

TL;DR

This work identifies context-driven distribution shift (CDS) as a core challenge in time-series forecasting, where observed and unobserved temporal contexts bias predictions. It introduces Reconditionor, a residual-based detector that uses mutual information between prediction residuals and contexts, and SOLID, a sample-level contextualized adapter that tunes only the prediction layer on a contextually similar dataset to mitigate CDS. Theoretical analysis shows a bias-variance trade-off guiding the calibration, and extensive experiments across eight real-world datasets demonstrate that Reconditionor reliably signals CDS and SOLID consistently improves forecasting performance, especially under strong CDS, with modest overhead. The framework is model-agnostic and can be layered onto various TSF architectures, offering a practical path to robust predictions in non-stationary, context-dependent environments.

Abstract

Recent years have witnessed the success of introducing deep learning models to time series forecasting. From a data generation perspective, we illustrate that existing models are susceptible to distribution shifts driven by temporal contexts, whether observed or unobserved. Such context-driven distribution shift (CDS) introduces biases in predictions within specific contexts and poses challenges for conventional training paradigms. In this paper, we introduce a universal calibration methodology for the detection and adaptation of CDS with a trained model. To this end, we propose a novel CDS detector, termed the "residual-based CDS detector" or "Reconditionor", which quantifies the model's vulnerability to CDS by evaluating the mutual information between prediction residuals and their corresponding contexts. A high Reconditionor score indicates a severe susceptibility, thereby necessitating model adaptation. In this circumstance, we put forth a straightforward yet potent adapter framework for model calibration, termed the "sample-level contextualized adapter" or "SOLID". This framework involves the curation of a contextually similar dataset to the provided test sample and the subsequent fine-tuning of the model's prediction layer with a limited number of steps. Our theoretical analysis demonstrates that this adaptation strategy can achieve an optimal bias-variance trade-off. Notably, our proposed Reconditionor and SOLID are model-agnostic and readily adaptable to a wide range of models. Extensive experiments show that SOLID consistently enhances the performance of current forecasting models on real-world datasets, especially on cases with substantial CDS detected by the proposed Reconditionor, thus validating the effectiveness of the calibration approach.

Calibration of Time-Series Forecasting: Detecting and Adapting Context-Driven Distribution Shift

TL;DR

This work identifies context-driven distribution shift (CDS) as a core challenge in time-series forecasting, where observed and unobserved temporal contexts bias predictions. It introduces Reconditionor, a residual-based detector that uses mutual information between prediction residuals and contexts, and SOLID, a sample-level contextualized adapter that tunes only the prediction layer on a contextually similar dataset to mitigate CDS. Theoretical analysis shows a bias-variance trade-off guiding the calibration, and extensive experiments across eight real-world datasets demonstrate that Reconditionor reliably signals CDS and SOLID consistently improves forecasting performance, especially under strong CDS, with modest overhead. The framework is model-agnostic and can be layered onto various TSF architectures, offering a practical path to robust predictions in non-stationary, context-dependent environments.

Abstract

Recent years have witnessed the success of introducing deep learning models to time series forecasting. From a data generation perspective, we illustrate that existing models are susceptible to distribution shifts driven by temporal contexts, whether observed or unobserved. Such context-driven distribution shift (CDS) introduces biases in predictions within specific contexts and poses challenges for conventional training paradigms. In this paper, we introduce a universal calibration methodology for the detection and adaptation of CDS with a trained model. To this end, we propose a novel CDS detector, termed the "residual-based CDS detector" or "Reconditionor", which quantifies the model's vulnerability to CDS by evaluating the mutual information between prediction residuals and their corresponding contexts. A high Reconditionor score indicates a severe susceptibility, thereby necessitating model adaptation. In this circumstance, we put forth a straightforward yet potent adapter framework for model calibration, termed the "sample-level contextualized adapter" or "SOLID". This framework involves the curation of a contextually similar dataset to the provided test sample and the subsequent fine-tuning of the model's prediction layer with a limited number of steps. Our theoretical analysis demonstrates that this adaptation strategy can achieve an optimal bias-variance trade-off. Notably, our proposed Reconditionor and SOLID are model-agnostic and readily adaptable to a wide range of models. Extensive experiments show that SOLID consistently enhances the performance of current forecasting models on real-world datasets, especially on cases with substantial CDS detected by the proposed Reconditionor, thus validating the effectiveness of the calibration approach.
Paper Structure (42 sections, 3 theorems, 19 equations, 9 figures, 8 tables, 2 algorithms)

This paper contains 42 sections, 3 theorems, 19 equations, 9 figures, 8 tables, 2 algorithms.

Key Result

Theorem 1

For $\hat{\theta}$ in Definition def:global-linear-regressor: where $\psi_i = X_i^\top X_i$, and $\overline \theta = (\sum_{i=1}^K{\psi_i})^{-1} (\sum_{i=1}^K{\psi_i \theta_i})$. The quantity $||\cdot||_{\psi_i}$ is the Mahalanobis distance norm, defined as $\|\theta\|^2_{\psi_i} = \theta^\top \psi_i \theta$.

Figures (9)

  • Figure 1: (a) Causal graph in the presence of context-driven distribution shift. (b) Impact of CDS: Autoformer's residual distribution on the entire Illness dataset, along with the residual distributions conditioned on two different periodic phases.
  • Figure 2: Illustrations of the traditional framework (top) and the proposed framework (bottom). By calibrating the model via contextualized adaptation before making each prediction, the context-driven distribution shift (CDS) can be alleviated.
  • Figure 3: Pipeline of our calibration framework to detect and adapt to context-driven distribution shift (CDS). We leverage ① residual-based context-driven distribution shift detector (Reconditionor) to assess how susceptible a trained model is to CDS. If we detect a significant susceptibility, we employ ② sample-level contextualized adapter (SOLID) to adapt the model for each test sample using preceding data that share similar contexts.
  • Figure 4: The relationship of Reconditionor metric $\bm{\log_{10} \delta_P}$ (X-axis) and MAE improvements achieved by SOLID (Y-axis) for 8 datasets and 6 models.
  • Figure 5: Further analysis of SOLID. (a)(b) Ablation studies for three contexts, temporal segment (T), periodic phase (P), and sample similarity (S). (c) Studies on tuning strategies to explore adaptation on prediction layer (PL) only vs. entire model (EM). (d)(e) Comparison studies against RevIN (R.IN) and Dish-TS (D.TS). (f) Efficiency studies on the prediction speed.
  • ...and 4 more figures

Theorems & Definitions (6)

  • Definition 1: Context-driven Distribution Shift
  • Definition 2: Global linear regressor
  • Theorem 1: Expected risk for GLR
  • Definition 3: Contextualized linear regressor
  • Theorem 2: Expected risk for CLR
  • Lemma A.1: Risk decomposition