arXiv:2609.03937cs.LGSep 2026

Manuscript Offprint

arXiv:2609.03937

RATL: Learning from Retrieved Residuals for Robust Multivariate Time-Series Forecasting

Yuchen He, Yueyang Cang, Zhiyuan Ning, Ningyu Wang, Li Shi

Abstract

Retrieval-augmented generation (RAG) complements parametric models with retrieved external evidence. The same idea is attractive for continuous-output regression, but directly reusing retrieved target values is often not robust when samples differ in output level, numerical scale, or local dynamics. Moreover, conventional forecasting pipelines generally use residuals for model optimization and error diagnosis, but do not retain individual historical residual examples as memory that can be accessed at inference time. For multivariate time-series forecasting, we propose RATL, a plug-in residual-retrieval and feedback-correction method. RATL freezes a base forecaster to construct retrieval keys and turns its historical forecast residuals into a train-only memory specific to that base model. At inference time, RATL retrieves residual trajectories from similar historical contexts subject to causal availability constraints, then uses a set-aware router operating over forecast blocks and variables to select and combine these trajectories. Experiments show that historical residuals matched to the current context contain reusable forecasting information and that RATL improves frozen base forecasters in most experimental settings. Ablations further show that learned routing strengthens raw residual feedback, while validation-based correction-strength selection limits residual over-injection. On real-world benchmarks, we use iTransformer as the primary frozen base forecaster, compare against multiple strong forecasting baselines, and test transferability across backbones. The results show that RATL can further improve base-forecaster performance in most settings. Overall, RATL shifts the retrieved object from historical target values to base-model-specific historical forecast errors, providing a plug-in, residual-memory-based paradigm for learned feedback correction in continuous-output forecasting.

Introduction

Long-horizon multivariate forecasting maps a local context window to a future trajectory. Modern linear, MLP, and Transformer forecasters have improved this mapping substantially (Zeng et al. 2023; Nie et al. 2023; Liu et al. 2024), yet their prediction is still conditioned on a fixed lookback and on historical patterns compressed into learned parameters. When a relevant pattern occurred far outside the lookback, a parametric forecaster cannot explicitly inspect that occurrence at inference time.

Retrieval-augmented forecasting addresses this limitation by searching a historical datastore and incorporating the futures associated with similar contexts (Zhang et al. 2025; Han et al. 2025; Du, Han, and Guo 2026). However, raw future reuse creates two coupled risks. First, similar contexts need not share the same future level or scale. Second, an imperfect retrieved signal may be injected even when the base prediction is already accurate, causing negative transfer. Both issues become pronounced in multivariate, long-horizon settings, where the correction must vary across variables and forecast blocks.

We investigate a different retrieval target: the forecast error of a fixed base model. For each training window, we store the base-model residual rather than treating the observed future as a stand-alone prediction, yielding an output-space correction. RATL retrieves only historical residuals whose target windows are temporally available from the training memory. In its main configuration, RATL uses the frozen base forecaster's per-variable hidden representations as retrieval keys. J5, a set-aware learned residual router, constructs block-variable candidate tokens from the query, candidate residual blocks, a Direct residual reference, and positional features. Set attention assigns weights to retrieved residual candidates and an explicit zero-residual candidate, while a global correction-strength hyperparameter γ∈[0,1]\gamma \in [0, 1] is selected on validation. As a control, the non-parametric Direct baseline uses only retrieval similarity as weights for a raw weighted correction over the same residual candidates, with γ=1\gamma = 1 and no separate correction-strength tuning. Figure 1 presents the overall design: the central pipeline consists of frozen-base forecasting, causal residual retrieval, block-variable routing, and correction-strength selection, while four side panels expand its key operations.

Experiments show that RATL can turn context-matched historical errors into useful corrections across different forecasting settings and improves overall forecasting performance over the Direct baseline.

Our contributions are:

• We formulate retrieval-augmented forecasting as base-specific residual retrieval, with a train-only memory and an explicit temporal admissibility rule that prevents target leakage.

• We develop RATL around J5, a set-aware, block-variable

∗^{*}Corresponding author.

MethodRetrieved valueIntegration
kNN-MTSfuture segmentsimilarity aggregation
RAFTfuture patchesinput/feature augmentation
PFRPglobal predictionconfidence/output gates
RATLfrozen-base residualraw Direct / J5 + val. strength

Table 1: Retrieval target and integration differ across related forecasters.

residual router with oracle imitation and a no-correction candidate; similarity-weighted Direct serves as the non-parametric retrieval baseline.

  • We conduct a 156-run study covering 13 datasets and 52 settings, together with audited transfer studies on frozen DLinear, PatchTST, TimesNet, and TimeMixer checkpoints. RATL improves mean MSE by 9.57%9.57\% in the main study. The transfer results show that its gains vary substantially with the base-forecaster architecture, dataset, and retrieval-key choice.

References (21)