Time series forecasting improved by dual context retrieval and refinement

Dual-Context Analog Retrieval for Time Series Forecasting

Machine Learning

Summary

Forecasting future events based on past data is hard, especially for long periods ahead. The authors found that simply trying to predict everything at once misses important historical clues. They built a system called DuoTS that first makes a basic guess, then improves it by looking at recent patterns and similar past events along with what happened after them. This step-by-step approach matches each future part with the most helpful information from the past, leading to better forecasts.

What this means in practice

  • For energy demand planners: Produce more accurate multi-period forecasts by combining recent data trends with historical analogs and their outcomes to improve resource allocation.
  • For supply chain managers: Refine demand or inventory forecasts over long horizons by integrating retrieved similar past scenarios and their subsequent trajectories patchwise.

Authors

Jung Min Choi, Ngoc Son Le, Ibram Abdelmalak, Vijaya Krishna Yalavarthi, Lars Schmidt-Thieme

Abstract

Most long-term time-series forecasting models map the look-back window directly to the full horizon in a single pass. While efficient, this design does not explicitly identify which historical states are most relevant to different future segments or exploit what followed those states. Analog forecasting addresses this by retrieving past states similar to the present and using their observed continuations, but single nearest matches can be unreliable and overlapping patches may produce redundant candidates. We propose DuoTS, a Dual-Context Time Series forecasting model that uses retrieved evidence without relying on it exclusively. DuoTS first produces a base forecast with a parallel patch encoder and linear prediction head, then progressively refines it one future patch at a time. Each refinement combines two views: a current context that attends to recent tokens and captures the latest dynamics, and a detail context that provides distinct retrieved analogs together with their subsequent trajectories. Patch-wise refinement allows the model to balance these views across the forecast horizon and associate each future segment with evidence appropriate to its temporal distance from the present. Experiments on multiple real-world datasets show that DuoTS achieves state-of-the-art performance, while ablations confirm the contribution of each context. The refinement mechanism is also model-agnostic, requiring only an encoded look-back window and the future-patch position, and can therefore be integrated into existing forecasting models.