Why Do Time Series Models Need Long Context Windows?

Luca Butera, Giovanni De Felice, Andrea Cini, Cesare AlippiNeurIPS 2026

TL;DR

Why do modern time series foundation models demand massive input windows of thousands of steps when the actual data only depends on the recent past? It turns out these models are secretly doing two jobs at once: predicting the future, and playing detective to figure out which underlying system generated the data in the first place. By separating these two tasks, we can make forecasting models drastically faster and cheaper without sacrificing accuracy.

What Problem Does This Paper Address?

Traditionally, if you wanted to forecast a time series—say, a city's electricity usage—you fit a local statistical model specifically to that single series. Today, deep learning relies on global models (and zero-shot foundation models) trained across thousands of wildly different time series simultaneously, from traffic patterns to weather.

Here is the puzzle: to get good predictions from these global models, researchers have to feed them increasingly massive "context windows" of past observations. Standard wisdom claims this is necessary to capture "long-range temporal dependencies." Yet, if you look at standard statistical metrics like partial autocorrelation, the actual memory of these systems dies out pretty quickly—long before the massive window lengths modern models prefer.

Partial autocorrelation dies out quickly, yet popular models choose massive input windows.

Why does a model need 4,000 past steps to predict a system whose memory only lasts for 50?

Methods

The authors reframe global forecasting using Bayesian probability, showing that minimizing prediction error over heterogeneous time series inherently splits into two distinct tasks:

  1. Generative Process Identification (GPI): Inferring which specific underlying process (e.g., highway traffic vs. solar power, and its specific parameters) generated the sequence.
  2. Conditional Forecasting (CF): Actually predicting the next values using recent history, given you know the process.

While standard monolithic architectures mash these together by feeding one giant contiguous window into the network, the authors propose decoupling GPI and CF:

  • The Embedding Module ($G$): A network (implemented with PatchTST) looks at an older, long historical context ($C$) and compresses it into a latent vector $e^n$ summarizing the data-generating process.
  • The Base Forecaster ($F$): A lightweight predictor (tested across attention, MLP, convolutional, and recurrent backbones) takes only a tiny window of the most recent observations ($W$), conditioned on $e^n$, to predict the future.

Crucially, because the underlying identity of a time series rarely changes minute-to-minute, $e^n$ can be cached and reused across many future predictions. Instead of reprocessing $C + W$ steps every time you want a forecast, you just process the tiny window $W$.

Datasets

  • Synthetic Data: Collections of time series generated by Nonlinear Autoregressive (NAR) processes with strictly bounded, known memory lengths ($P \in \{1, 2, 4, 6\}$).
  • Real-World Benchmarks: Four datasets spanning distinct domains: LargeST-SD (traffic), CEREn (energy), and ClmUS-T / ClmUS-R (US climate temperature and rainfall). No newly collected benchmark datasets were introduced, though existing datasets were structured to test inductive (held-out series) and multi-domain setups.

Key Insights and Ideas

  • In-Context Learning for Time Series: GPI is essentially implicit Bayesian inference. Just as LLMs use prompt examples to figure out what task they are doing, time series models use extra history to shrink uncertainty about which system they are looking at.
  • Strict Mathematical Overhead: Even if a time series is strictly Markovian of order $P$ (meaning the future only depends on the last $P$ steps), the authors prove that a global model strictly requires a window $W > P$ to achieve optimal error, purely to resolve process ambiguity.
  • Contiguity Doesn't Matter for GPI: When the authors took pre-trained foundation models (Moirai2 and TimerXL), gave them a tiny recent window ($W=24$), and prepended a "disconnected" chunk of data from two weeks prior (leaving the model blind to the gap), error dropped almost identically to expanding a normal, contiguous window! That two-week-old data carried zero temporal momentum for CF, proving the models use long windows to identify the underlying process.
Figure 2: Pre-trained foundation models MAE, H =24. For each pair of subplots, the left his- togram (orange) shows the error for the contiguous setting (increasing W, C = 0), while the right histogram (blue) shows the error for the disconnected setting (minimum W, increasing C).
  • The Flexibility Tax of Foundation Models: Because foundation models are pre-trained on everything from finance to meteorology, they start with massive prior uncertainty about what data you are feeding them. Consequently, they require much longer context windows at inference time to match the accuracy of a smaller global model trained specifically on your target domain.
Figure 5: 24-step-ahead forecasting error (MAE, inductive, 3 runs ±std) against window length W. Foundation models (F, dashed) against domain-specific global models (S, solid).

Key Results

  • Synthetic Validation: On synthetic NAR($P=2$) data, a local model hits the minimum possible noise floor immediately at window $W=2$. A standard global model fails at $W=2$ and needs $W=48$ to catch up. However, giving the global model a disconnected past context ($C=46$) lets it hit near-optimal error right at $W=2$.
  • Scalability & Pareto Optimality: Across all four real-world datasets and four SOTA architectures (PatchTST, TSMixer, ModernTCN, LRU), the decoupled design ($C=720$ cached, small $W$) matches the accuracy of standard monolithic models operating on massive windows.
  • Efficiency Gains: By caching the GPI embedding, predicting $m$ steps sequentially requires processing $C + m \cdot W$ observations rather than $m \cdot (C + W)$, making the decoupled approach strictly Pareto-optimal across MSE vs. FLOPs, CPU/CUDA time, and peak GPU memory.

Limitations and Future Work

  • No Decoupled Foundation Model Yet: While the authors prove the decoupled concept on domain-specific architectures, building and pre-training a full-scale foundation model from scratch using this paradigm is left for future work.
  • Non-Stationary Drifts: Caching the process embedding assumes the underlying generative process is relatively stationary; highly dynamic, shifting environments will require clever strategies to know when to refresh the context.
  • Exact Theoretical Bounds: Proposition 3.2 proves that $W > P$ is necessary, but does not quantify how much larger $W$ needs to be as a mathematical function of the training distribution's diversity.

Summary updated

Abstract

Modern deep learning models for forecasting *groups of time series* rely on increasingly longer observation windows. However, the benefit of increasing the window size is often simply attributed to capturing long-range dependencies, and broader discussion on how *global* forecasting models leverage input observations has been limited. In this paper, we show that forecasting groups of time series involves two objectives: (i) *generative process identification* (GPI), i.e., inferring the specific process generating the input sequence, and (ii) *conditional forecasting* (CF), i.e., predicting future values given input observations. From this perspective, optimal predictions can be interpreted as an average over plausible data-generating processes, weighted by their likelihood given the input window. This suggests another explanation for the benefits of long context windows: they reduce the uncertainty about which specific process is generating the input time series during operation. We prove that even for processes with memory length $P$, an input window size strictly larger than $P$ is *necessary* to achieve the minimum attainable error. Finally, we show how decoupling GPI and CF can improve computational scalability without compromising accuracy. Experiments on synthetic and real-world data validate our insights and their relevance for designing forecasting architectures.
BibTeX
@inproceedings{butera2026why,
  author = {Luca Butera and Giovanni De Felice and Andrea Cini and Cesare Alippi},
  title = {{Why Do Time Series Models Need Long Context Windows?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=n51PuFNKYi},
}
Figure