arXiv:2610.03491cs.LGOct 2026

Manuscript Offprint

arXiv:2610.03491

Dual-Context Analog Retrieval for Time Series Forecasting

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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 determine which historical state is most relevant to each future segment or consider what followed that state. Analog forecasting can provide such evidence by retrieving a past state similar to the present and examining its observed continuation. However, relying on a single nearest match can be unreliable, and overlapping patches may yield highly similar or near-duplicate candidates. To address these limitations, we propose DuoTS, a Dual-Context Time Series forecasting model, which leverages retrieved evidence without depending on it exclusively. DuoTS first generates a base forecast using a fully parallel patch encoder and a linear prediction head, and then progressively refines this forecast one future patch at a time. Each refinement considers two complementary views. The first view, the current context, attends to recent tokens and captures the latest dynamics of the series. The second view, the detail context, provides distinct retrieved analogs together with the trajectories that followed them. Since the refinement is performed separately for each future patch, the model weighs the two views differently across the forecast horizon and associates each segment of the prediction with the evidence most appropriate to its temporal distance from the present. Extensive experiments on multiple real-world time-series datasets show that DuoTS achieves state-of-the-art performance, while component-wise ablation studies verify the contribution of each context. Moreover, the refinement mechanism is independent of the remaining DuoTS architecture. It requires only the encoded look-back window and the position of the future patch, allowing it to be applied as a model-agnostic module to improve existing forecasting models.

1 INTRODUCTION

Forecasting models predict the future from the past, and much of what they exploit is recurring structure: trends that persist and cycles that repeat. Models differ in how they use this structure. One class learns it implicitly. PatchTST, iTransformer, and TSMixer map the look-back window directly to the horizon and achieve strong accuracy without an explicit notion of trend or cycle (Nie et al., 2023; Liu et al., 2024b; Chen et al., 2023). A second class separates recurring structure explicitly. Decomposition models such as Autoformer, DLinear, and TimeMixer split or mix trend and seasonal components (Wu et al., 2021; Zeng et al., 2023; Wang et al., 2024), while CycleNet learns a recur-

(a) One-shot forecast

Figure

(b) DuoTS: current + detail view revision

Figure 1: Forecast, retrieve, revise. (a) One-shot forecasting predicts the full horizon directly. (b) DuoTS revises each future patch using current and retrieved-detail evidence with learned view weights.

rent cycle for each channel and adds it back to the prediction (Lin et al., 2024).

Both classes rely on structure learned across the training set. An implicit model must discover for itself which past states matter for a given window, whereas an explicit cycle describes a typical period and stays fixed after training. Neither is designed to use what the current window itself reveals. Consider electricity demand during a heat wave. A learned daily cycle describes a typical day, but a heat-wave day is not typical. The most relevant evidence is the earlier days of the same heat wave and how demand evolved after them, and the window already holds it. This is the principle of analog forecasting: find a past state resembling the present and use what followed it (Lorenz, 1969; van den Dool, 1994).

We propose DuoTS, which consists of a base forecaster and a corrector. The base forecaster is a fully patch-based model that mixes information sparsely across channels and across time through local dynamics. The corrector makes window-specific evidence explicit and uses it to refine each future patch of the base prediction. It looks at the past through two views: the current context, which attends to recent tokens and captures what the series has just been doing, and the detail context, which retrieves earlier states resembling the present together with what followed them. Retrieved analogs can nevertheless be misleading: the nearest match is not always the most predictive, overlapping patches yield near-duplicates, and sometimes no good analog exists. The corrector therefore refines the base prediction rather than overriding it, adjusting it only as far as the retrieved evidence warrants. Figure 1 contrasts this forecast–retrieve–revise process with one-shot forecasting.

The corrector reads only patch embeddings, so it can be attached to other patch-based forecasters without changing its design. Attached to SRSNet, TimeKAN, and PatchTST, it improves 15 of 24 tested settings under joint training. The full DuoTS model achieves the lowest MSE in 22 and the lowest MAE in 23 of 32 dataset–horizon settings across eight benchmarks.

Our contributions are as follows.

• We propose DuoTS, which pairs a base forecaster with a corrector that makes window-specific evidence explicit through two views of the past: recent dynamics and retrieved analogs.

• DuoTS achieves state-of-the-art results on eight long-term forecasting benchmarks, obtaining the lowest MSE in 22 and the lowest MAE in 23 of 32 dataset–horizon settings.

• The corrector is model-agnostic: it requires only patch embeddings and transfers across backbones. Attached to SRSNet, TimeKAN, and PatchTST, it improves accuracy in 15 of 24 tested settings. Code is available at https://anonymous.4open.science/r/DuoTS-244D.

References (41)