Papers
Topics
Authors
Recent
Search
2000 character limit reached

Stationarity-Aware Retrieval-Augmented Time Series Forecasting

Published 2 Jun 2026 in cs.LG | (2606.04135v1)

Abstract: Time series forecasting relies on historical patterns, but real-world series often exhibit non-stationarity and regime shifts that challenge fully parametric forecasters. Inspired by Retrieval-Augmented Generation (RAG), recent work augments forecasters by retrieving relevant historical segments and using them as external evidence at inference time. However, due to the intrinsic non-stationarity of real-world time series, a highly similar past segment does not necessarily imply a similar future, rendering similarity-only retrieval brittle and prone to redundancy. We propose Stationarity-Aware Retrieval-Augmented Time Series Forecasting (SARAF), a framework that adaptively balances relevance and diversity in retrieval. SARAF first forms a candidate pool via temporal similarity with time-aligned enhancement, then applies a diversity-aware selection strategy to cover heterogeneous historical regimes, with the diversification strength automatically modulated by dataset-level stationarity. Moreover, SARAF uses stationarity-aware aggregation to fuse the retrieved futures. Extensive experiments on eight real-world datasets show that SARAF achieves competitive forecasting performance and improves average accuracy and robustness over strong baselines, with particularly clear benefits under challenging non-stationary settings. Code: https://github.com/ShiqiaoZhou/SARAF.

Summary

  • The paper introduces SARAF, a lightweight retrieval-augmented forecasting framework that adapts retrieval diversity and Gaussian fusion to dataset stationarity, reducing average MSE by 3.85% versus RAFT and 4.05% versus DUET.
  • SARAF combines time-aligned similarity retrieval, stationarity-guided diverse selection, and adaptive aggregation, delivering its strongest gains on non-stationary data such as Exchange, where it achieves an MSE of 0.955 versus 1.129 for RAFT at horizon 720.
  • The paper shows that retrieval reliability declines as stationarity decreases, while SARAF reduces retrieved-input redundancy by up to 16.09% and remains computationally efficient with 0.088 million parameters and 0.334 ms per iteration on ETTh1.

Motivation: when similar pasts do not imply similar futures

Retrieval-augmented time series forecasting rests on an implicit assumption: that a historical segment similar to the query input will have a future resembling the ground-truth continuation. The paper's diagnostic experiment shows this assumption is strongly dataset-dependent. Using Pearson correlation to rank training segments by input similarity and then measuring the similarity of their paired futures to the ground truth, the authors report Spearman rank correlation ρ\rho between input-induced and future-induced rankings. On Electricity (ADF stationary ratio 97.2%), ρ=1.000\rho = 1.000, so input similarity is a nearly perfect proxy for future usefulness. On Exchange (ADF stationary ratio 12.5%), ρ\rho drops to 0.285, and many retrieved futures have near-zero similarity to the target. Across all eight benchmarks, both the rank correlation and a "similarity retention ratio" increase monotonically with dataset stationarity.

This brittleness compounds a second practical problem: sliding-window databases make top-KK retrieval highly redundant, returning near-duplicate evidence that wastes the retrieval budget and can aggregate mismatched cases into a misleading consensus. Existing remedies—down-weighting unreliable retrieved evidence in methods such as RAFT, PFRP, and PIR—address neither the root cause nor the redundancy, and can suppress partially useful neighbors enough to revert the model to purely parametric behavior.

The SARAF framework

SARAF (Stationarity-Aware Retrieval-Augmented Forecasting) augments a lightweight linear forecaster with a stationarity-controlled retriever operating over a database of (xi,yi)(\mathbf{x}_i, \mathbf{y}_i) pairs built from the training split via stride-1 sliding windows. The pipeline has three stages.

Time-aligned similarity retrieval. Beyond Pearson correlation on centered, vectorized windows—which is robust to scale and mean shifts—the retriever adds a timestamp-based bonus across hour-of-day, day-of-week, month-of-year, and minute-of-hour resolutions, using circular distances and exponential kernels for cyclic components. The fused score blends temporal similarity with this bonus under a weight αtime\alpha_{\text{time}}, and the top-MM candidates (M=100M=100) form the pool.

Stationarity-guided diversity selection. A stochastic Maximal Marginal Relevance procedure selects KK items from the pool. The MMR balance coefficient λ(sˉ)\lambda(\bar{s}) interpolates between ρ=1.000\rho = 1.0000 and ρ=1.000\rho = 1.0001 according to a dataset-level stationarity score ρ=1.000\rho = 1.0002, so non-stationary datasets receive stronger diversification. To avoid the ρ=1.000\rho = 1.0003 cost of pairwise candidate similarity, redundancy is approximated by closeness of candidates' query-similarity scores, reducing selection to ρ=1.000\rho = 1.0004. Selection is stochastic, sampling from a softmax over MMR scores rather than taking the argmax.

Adaptive Gaussian aggregation and fusion. Retrieved futures are combined with Gaussian kernel weights whose bandwidth ρ=1.000\rho = 1.0005 widens as stationarity decreases, spreading weight across more plausible futures; stationary datasets get sharper, precision-focused aggregation. The aggregated retrieval forecast is averaged with the direct linear forecast and passed through a final horizon-wise projection.

The stationarity score itself is deliberately lightweight: each window is partitioned into sub-windows, and the normalized variation of local means and standard deviations yields a scale-invariant score in ρ=1.000\rho = 1.0006. This costs ρ=1.000\rho = 1.0007 overall, versus roughly ρ=1.000\rho = 1.0008 for per-channel ADF testing, and the paper reports broad consistency between the proposed score and ADF stationary ratios across datasets (e.g., Exchange scores lowest at 0.4203; Electricity highest at 0.8648).

Main results

Across eight benchmarks (ETTh1/2, ETTm1/2, Exchange, Solar, Electricity, Traffic) with look-back 720 and horizons {96, 192, 336, 720}, SARAF achieves the best average MSE and MAE on 5 of 8 datasets against nine baselines including RAFT, DUET, TimeMixer, CycleNet, PatchTST, DLinear, TimesNet, Non-stationary Transformer, and Autoformer. Averaged over all datasets, SARAF reduces MSE by 3.85% and MAE by 1.87% relative to RAFT, and MSE by 4.05% and MAE by 0.75% relative to DUET. Gains are largest on non-stationary data: on Exchange at horizon 720, SARAF attains MSE 0.955 versus 1.129 for RAFT and 1.202 for DUET. The improvements are described as competitive rather than uniformly dominant—DUET remains better on Traffic and Solar, and PatchTST retains the best MAE on several Traffic horizons.

Ablations and analyses

Three ablation axes support the design. Removing the retriever entirely degrades MSE on all tested datasets, while random retrieval is consistently worse than structured retrieval, confirming gains come from evidence quality rather than the fusion machinery alone. Notably, removing the forecaster (predicting solely from aggregated retrieved futures) collapses performance on most datasets but yields the best result on Exchange (MSE 0.377), indicating that on severely non-stationary series the retrieval branch can dominate the parametric branch. Among retriever components, the time-aligned enhancement contributes most consistently—removing it increases MSE everywhere—whereas diversity control and stationarity estimation matter mainly on non-stationary data (Exchange, Traffic) and are near-neutral or slightly negative on stable ones such as Electricity, consistent with the adaptive design.

Redundancy analysis quantifies the mechanism: SARAF lowers intra-set inter-similarity of retrieved inputs by 14.57% relative to its own ablated variant and 16.09% relative to RAFT, and on ETTh2 produces fused futures more similar to the ground truth than similarity-only baselines. The retriever also functions as a plug-in module: attaching it to PatchTST reduces ETTh1 average MSE from 0.635 to 0.540 and ETTm1 from 0.548 to 0.477; attaching it to DLinear improves ETTh1 from 0.521 to 0.413. Efficiency is favorable—SARAF uses only 0.088M parameters and runs at 0.334 ms/iter on ETTh1, second fastest behind DLinear and faster than RAFT (0.590 ms/iter, 122.996 MiB total memory versus SARAF's 54.077 MiB)—though it holds more runtime memory than pure forecasters due to the external database.

Hyperparameter analyses show the optimal retrieval budget ρ=1.000\rho = 1.0009 is dataset-dependent: larger ρ\rho0 monotonically helps stationary Electricity while large ρ\rho1 hurts ETTh2 at long horizons, and longer look-back windows improve accuracy with saturation beyond moderate lengths, particularly at long horizons where short windows weaken the input-similarity-to-future-similarity link.

Limitations and open questions

The authors identify three constraints. First, retrieval uses a global similarity function over the full multivariate window; channel-wise or group-wise similarity could capture heterogeneous cross-variable dynamics but would raise retrieval and storage costs. Second, the dense sliding-window database is memory-intensive for long sequences and large corpora, motivating compression via clustering, prototypes, or learned indexing. Third—and most substantively—the stationarity signal is estimated at the dataset level, so it cannot adapt to instance-level regime shifts within a single deployment; whether a context-dependent stationarity estimate would further improve robustness is left open. The hyperparameters bounding ρ\rho2 and ρ\rho3 are fixed globally, and the sensitivity of results to these bounds is not systematically explored.

Conclusion

SARAF reframes retrieval-augmented forecasting around an empirically demonstrated failure mode: the reliability of similarity-only retrieval degrades predictably with dataset non-stationarity, as measured by rank agreement between input- and future-similarity orderings. By coupling time-aligned retrieval enhancement with stationarity-controlled diversity selection and bandwidth-adaptive Gaussian fusion, the framework converts a scalar dataset statistic into concrete retrieval behavior, achieving competitive accuracy on eight benchmarks with clear advantages on non-stationary data and negligible inference overhead. The central open question is whether stationarity-awareness can be pushed from the dataset level to the instance level without sacrificing the simplicity that makes the approach practical.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.