Source-linked AI summary
RACE: Residual-Aware Test-Time Adaptation for Neighbor-Rich Time-Series Foundation Model Forecasting
Hao-Nan Shi, Tong Wu, Chen-Cong Sun, Yuan Jiang, Han-Jia Ye, De-Chuan Zhan
TL;DR
Neighbor-rich forecasting has related but nonidentical histories, yet their residual evidence may conflict and vary across forecasters. RACE aligns and aggregates compatible residuals, then gates whether to apply the correction; across four TSFMs it improves all three domain-aggregate metrics in both primary domains.
Problem
Per-series TSFM inference leaves related domain histories unused, while neighboring residuals can conflict and vary across models and tasks, making their relevance to a query uncertain.
Source: Introduction · p. 1, §3.4 · p. 4Method
RACE retrieves query-compatible completed windows, aligns and aggregates consistent residuals into a training-free proposal, and uses a lightweight domain-specific Gate to select its application without changing the backbone.
Source: Introduction · p. 2, §4.1 · p. 4Results
RACE improves all three domain-aggregate metrics in both primary domains across four TSFMs, with the largest gains on high-error queries.
Source: Introduction · p. 2Takeaways & Limitations
Across four TSFMs and two neighbor-rich domains, historical model errors serve as reusable test-time evidence for lightweight post-processing with consistent domain-aggregate gains.
Source: Conclusion · p. 9The query future is unavailable during correction construction, which must use the legal library available before that query.
Source: §3.3 · p. 4
Abstract
from arXiv · showhide
Time-series foundation models (TSFMs) perform strongly across forecasting tasks, but their per-series inference is ill-suited to neighbor-rich forecasting, where each query has access to related but nonidentical historical series. Continuous glucose monitoring (CGM) and Web/cloud workloads exemplify this setting: CGM trajectories share physiological patterns but vary across individuals, devices, and conditions, while Web/cloud workloads combine common operating regimes with non-stationarity, heavy tails, and bursts. These histories share useful structure, yet neighbors are not equally relevant. Existing methods either fine-tune TSFMs for each target domain, incurring additional costs and offering limited transferability across backbones, or append retrieved series without verifying whether they support the current forecast. The key challenges are conflicting residual evidence from neighboring series and residual patterns that vary across TSFMs and forecasting tasks. We formulate test-time neighborhood scaling: using same-domain neighbor evidence without modifying the backbone. We propose RACE (Residual-Aware Correction of Forecasting Errors), a two-stage framework for using historical neighbors. We first retrieve query-compatible neighbors, align their residuals to the query scale, and aggregate coherent evidence into the training-free RACE-TF correction. Full RACE then uses a lightweight, domain-specific Gate to determine when applying the correction is beneficial, with a reusable training workflow across TSFM backbones. Across four TSFMs, RACE improves all three domain-aggregate metrics on both primary domains, with the largest gains on high-error queries. Within each domain, a Gate trained on one TSFM transfers to other backbones without adaptation, and the resulting pipeline improves all 72 cross-backbone metric comparisons over the matched frozen targets.
Introduction
Neighbor-rich forecasting uses related historical windows as evidence, but their residuals may conflict and require selective use. RACE constructs residual corrections and gates their application, improving domain-aggregate metrics across four TSFMs in CGM and Web/cloud forecasting.
Introduction
- CGM and Web/cloud histories share useful structure but vary across patients, sensors, conditions, workloads, and operating regimes, so compatible neighbors may help while conflicting ones should be rejected.Web/cloud workloads also exhibit non-stationarity, heavy tails, and bursts.Source: Introduction · p. 1, Figure 1 · p. 2
- Existing retrieval approaches integrate or append neighboring sequences, but residuals can conflict and vary across backbones and tasks, making direct averaging risky and backbone-specific fusion harder to reuse.RACE instead formulates use of a reusable same-domain library as test-time neighborhood scaling without updating the backbone.Source: Introduction · pp. 1–2
- RACE retrieves query-compatible neighbors, aligns and aggregates consistent residual evidence into RACE-TF, then uses a lightweight domain-specific Gate to decide whether to apply the correction.The backbone remains unchanged; the Gate is fitted on development data and frozen at deployment.Source: Introduction · p. 2
- The evaluation covers four TSFMs across CGM and Web/cloud, with private CGM collections used only as retrieval resources.CGM performance is evaluated on the public dataset.Source: Introduction · p. 2
- RACE improves all three domain-aggregate metrics in both primary domains across four backbones, with the largest gains on high-error queries.A source-trained Gate also transfers within each domain: all 72 cross-backbone metric comparisons improve on matched frozen targets.Source: Introduction · p. 2
Related Work
Prior work reuses historical sequences through retrieval, augmentation, fusion, and personalization, while RACE focuses on residuals from the same frozen forecaster. Its scope is evaluating residual correction rather than comparing against health-specific systems.
Retrieval and post-hoc forecasting correction
- Retrieval-based forecasting uses related sequences; RAF augments frozen-model inputs, TimeRAG retrieves with DTW for LLM prompts (Yang et al., 2025), and TimeRAF, TS-RAG, and RAFT use learned retrieval or integration (Zhang et al., 2025; Ning et al., 2025; Han et al., 2025).Context-based calibration adapts a prediction head using context-similar samples (Chen et al., 2024).Source: Related Work · p. 3
Time-series foundation models and deployment residuals
- RACE is a postdeployment correction approach, not another TSFM backbone; it asks whether legally observed residual history can refine a later output under an information boundary.The cited backbone families include Chronos (Ansari et al., 2024a), TimesFM (Das et al., 2024), Moirai (Woo et al., 2024), Chronos-2 (Ansari et al., 2025), and Toto-2.0.Source: Related Work · pp. 2–3
Case-based prediction and personalization in health
- Health applications use case-based glucose prediction, neighbor-fusion personalization, GlyRAG (Soumma and Ghasemzadeh, 2026), and retrieval-based wearable stress personalization (Simon and Chetouani, 2026).These studies establish the value of historical cases and lightweight personalization.Source: Related Work · p. 3
Retrieval and post-hoc forecasting correction
- RACE differs by aligning and filtering residuals produced by the same frozen forecaster, then applying a consensus proposal through a utility-trained Gate; its experiments do not claim comparisons with health-specific systems.OFTTA adapts normalization and support-set prototypes for wearable activity recognition without backpropagation (Wang et al., 2023), unlike RACE's output-side residual correction.Source: Related Work · p. 3
Problem Definition and Challenges
Neighbor-rich forecasting pairs a query with related, nonidentical historical windows whose observed outcomes and frozen-model errors can serve as evidence. RACE uses only completed records available before the query and addresses retrieval, residual alignment, and correction reliability.
3.1 From Time-Series to Neighbor-Rich Forecasting
- Neighbor-rich forecasting gives each query a library of related but nonidentical series; completed windows provide realized futures, frozen forecasts, and reusable residuals.CGM and Web/cloud are representative settings, with common structure but individual differences and workload non-stationarity, bursts, and heavy tails.Source: §3.1 · p. 3
3.2 In-Domain Residual Adaptation
- Because per-series inference ignores completed related windows and their realized model errors, comparable historical residuals can inform an output correction without updating the frozen TSFM.Only earlier outcome-observed domain records modify the output.Source: §3.2 · p. 3
3.3 Residual-Correction and Information Boundary
- A historical residual is the observed future minus the frozen forecast, and query correction uses only the legal pre-query library because the query future is unavailable.Residuals are normalized and aligned to query scale; the proposal is dimensionless, and its scaled additive correction preserves quantile ordering and spread when applied across predicted quantiles.Source: §3.3 · pp. 3–4
3.4 Challenges and Motivation
- Retrieval must use both the visible context and frozen forecast, exclude unavailable outcomes, align residuals, and find shared patterns because compatible neighbors can still conflict or fail to help.The three challenges are finding effective neighbors, building a robust proposal, and judging whether applying it is reliable.Source: §3.4 · p. 4
RACE Method
RACE constructs a query-specific residual correction from compatible historical neighbors, then uses a lightweight Gate to decide whether to apply it. The evidence-construction stage is training-free; the Gate learns whether the proposal reduces MSE.
RACE Method
- RACE-TF retrieves, screens, aligns, and averages historical residuals into a consensus-mean proposal; full RACE selectively applies that unchanged proposal.The Gate neither changes the proposal nor retrains the frozen TSFM.Source: RACE Method · p. 4, §4.1 · p. 4, §4.2 · p. 5
4.1 Residual Evidence Construction
- Neighbors are retrieved using both query context and frozen forecast, then aligned to the query scale before residual evidence is aggregated.The default uses K = 60 eligible neighbors selected by squared Euclidean distance without accessing the query future.Source: §4.1 · p. 4
- The residual-consensus filter removes neighbors with displaced or unusually variable aligned residuals, then averages retained residuals coordinate-wise.If fewer than half of valid neighbors pass, the least anomalous are retained to that minimum; a standard-deviation fallback handles vanishing MAD scales.Source: §4.1 · p. 4
4.2 Utility-Aware Correction Gate
- The Utility-Aware Correction Gate estimates whether applying the proposal reduces MSE and applies it only when its predicted utility reaches a frozen threshold.An XGBoost classifier uses inference-visible features summarizing retained evidence, retrieval, query and forecast shape, and proposal alignment; all backbones share the feature schema and training workflow.Source: §4.2 · pp. 4–5
Experimental Setup
Experiments compare four frozen TSFMs in CGM and Web/cloud forecasting under a chronological protocol. Retrieval memories, target windows, and matched-base comparisons are specified to keep evaluation temporally valid and comparable.
Experimental Setup
- The evaluation uses four frozen TSFMs across CGM and Web/cloud domains under a common chronological protocol.Web includes six GIFT-Eval and four LOTSA workload subsets; CGM targets use ShanghaiT2DM, with four de-identified institutional collections reserved as retrieval memory.Source: Experimental Setup · p. 5, §5.1 · p. 5, §5.2 · p. 5
5.1 Data and Temporal Protocol
- All experiments use 512-step contexts and 64-step horizons, with fit, model-select, calibration, and test windows split chronologically.Test futures and residuals are excluded from retrieval, feature construction, threshold selection, and model selection.Source: §5.1 · p. 5
5.2 Backbones, Comparators, and Evaluation
- Comparisons cover four backbones and matched frozen-base forecasts, reporting per-window MSE, MAE, and CRPS as macro-averaged relative improvements.RAF re-runs the frozen backbone on a retrieved continuation; TS-RAG is evaluated only on its supported Chronos-Bolt Base interface.Source: §5.2 · pp. 5–6, Table 1 · p. 6
Results
Across four backbones and both primary domains, RACE improves domain-aggregate forecasting; the results also show cross-backbone Gate transfer, larger gains on high-error queries, and weaker utility when irregular continuations defeat historical resemblance.
6.1 End-to-End Forecasting Improvements
- 19 of 24 backbone–task–metric comparisons are best for RACE or RACE-TF together; full RACE leads 13 and improves all three domain-aggregate metrics across both tasks and four backbones.These are post-processing gains over frozen forecasts, without backbone updates, hidden-state adapters, or an additional backbone forecast.Source: §6.1 · p. 6
6.2 Cross-Backbone Gate Transfer
- Source-trained Gates preserve useful corrections across backbones without target-specific fitting or recalibration; Gate gains are larger on Web/cloud, with consistently improved MAE and CRPS but an MSE trade-off.The transfer evaluation fixes each source Gate’s feature schema and threshold while targets retain their own forecasts, residual pools, and proposals.Source: §6.2 · p. 7, Table 2 · p. 7
6.3 Factorized Mechanism Ablation
- Global bias misses local error structure, forecast-conditioned retrieval better matches residuals to backbone failures, and consensus prevents conflicting neighbors from forming an unbalanced correction.Controls also distinguish applying the consensus proposal to every query from selectively deploying it with the Gate.Source: §6.3 · p. 7
6.4 Residual-Evidence Audit
- Figure 3 links higher residual coherence to correction utility: query-conditioned retrieval reduces conflicting residuals, while MAD consensus generally maintains or strengthens agreement and improves mean gains on Web and three CGM backbones.The TimesFM-2.5 CGM mean is nearly unchanged; coherence and test-utility trends favor transferable error patterns over a global shift.Source: Figure 3 · p. 8, §6.4 · p. 8
6.5 Selective Residual-Transfer Audit
- Stricter Gate thresholds retain fewer but more reliable corrections, and RACE concentrates its largest gains on high-error queries while reducing harmful corrections on easier Web queries.Calibration selects stronger selectivity for Web and broader acceptance for CGM; substantial improvements persist in the high-error tails of both tasks.Source: §6.5 · pp. 8–9, Figure 4 · p. 8
6.6 Qualitative Case Analysis
- In the illustrated Chronos-2 CGM case, RACE and Residual Mean recover part of a missed rise; in the Web case, rapid fluctuations make all three corrections worsen the forecast.Similar Web histories did not ensure transferable future or residual structure, whereas the smoother CGM setting was more favorable for neighbor-based enhancement.Source: §6.6 · p. 9, Figure 5 · p. 9
6.7 Robustness
- Across 34 eligible GIFT-Eval subsets, RACE improves 11 of 12 backbone–metric aggregates, but Chronos-2 CRPS increases slightly by 0.089%, and domain gains do not imply gains on every Web subset.The complete pipeline also improves over matched frozen targets in all 72 cross-backbone domain–source–target–metric comparisons.Source: §6.7 · p. 9
Conclusion
RACE refines frozen TSFM forecasts by aggregating compatible residuals from completed same-domain windows and selectively applying the correction through a lightweight utility Gate. Across four TSFMs and two neighbor-rich domains, it delivers consistent domain-aggregate gains through lightweight post-processing.
Conclusion
- Across four TSFMs and two neighbor-rich domains, RACE delivers consistent domain-aggregate forecasting gains through lightweight post-processing.The paper presents historical model errors as reusable test-time evidence.Source: Conclusion · p. 9
- RACE aggregates compatible residuals from completed same-domain windows to refine frozen-TSFM forecasts.Source: Conclusion · p. 9
- A lightweight utility Gate selectively applies the resulting correction.Source: Conclusion · p. 9
Reader Navigation
The supplement maps sections to their evidence and defines notation for residual construction, scale alignment, and selective residual transfer. Its residual consensus procedure uses a robust scale and filters inconsistent neighbor evidence before forming a proposal.
Reader Navigation
- Appendices A–K organize notation, data scope, temporal roles, primary results, diagnostics, comparator and Gate implementations, figure provenance, resource measurements, study limitations, and backbone naming.Source: Reader Navigation · p. 12
A Notation, Scales, and Residual Evidence Construction
- Table 4 groups symbols by computation and distinguishes vectors from scalars, indices, sets, operators, and actions.It maps notation used in legal retrieval, residual-evidence construction, and selective residual transfer.Source: A Notation, Scales, and Residual… · p. 12, Table 4 · p. 13
- The RACE-specific mean-centred, MAD-based procedure uses the conventional median absolute deviation as a robust scale for across-neighbor residual consensus.Source: A Notation, Scales, and Residual… · p. 12
- Residual evidence is filtered using a two-sided score and a score that rejects excess variability, with a minimum retained-neighbor floor when needed.If robust scale falls below tolerance, the implementation uses population standard deviation; if that also vanishes, the outlier score is zero.Source: A Notation, Scales, and Residual… · p. 12
B Data Scope, Domain Libraries, and Release Boundary
The supplement specifies the domain libraries, chronological roles, leakage audits, and implementation and diagnostic records for the experiments. It also reports cross-backbone Gate transfer results and broader sensitivity analyses.
B Data Scope, Domain Libraries, and Release Boundary
- The Web library uses fit windows from ten logical subsets, while CGM uses four de-identified external collections; the public ShanghaiT2DM targets are never evidence.The processed Web manifest contains 15,541 univariate series.Source: B Data Scope, Domain Libraries, and… · p. 13, C Temporal Protocol and Leakage Audit · p. 14
C Temporal Protocol and Leakage Audit
- Target windows are assigned fit, model-select, calibration, and test roles by future-label boundaries, with choices frozen before test evaluation.Retrieval candidates cannot use query futures, residuals, utility, or test labels, and same-parent candidates must be temporally valid.Source: C Temporal Protocol and Leakage Audit · p. 14
C.1 Audit summary
- Audits report no target/evidence role violations, self-retrieval, or same-parent temporal-causality violations in the final candidate sets.Test windows also have no exact complete-window or context-only match with the eligible residual pool.Source: §C.1 · p. 14
C.2 Numerical implementation contract
- The numerical contract aligns neighbor residuals to query scale, filters inconsistent evidence, and averages retained aligned residuals into a proposal.The alignment ratio is clipped to [1/4, 4], and the filtering procedure uses a 2.5 threshold with a 50% retention floor.Source: §C.2 · p. 15
D Complete Primary-Result Ledger
- The reproducibility package records per-task and per-backbone results and includes robustness, transfer, and mechanism diagnostics.The verifier recomputes reported table entries from the machine-readable ledger.Source: D Complete Primary-Result Ledger · p. 15, E Robustness, Broader GIFT-Eval, and… · p. 15
E.1 Broader GIFT-Eval diagnostic
- The broader GIFT-Eval diagnostic includes 34 of 55 prepared logical subsets with usable 512+64 windows and is reported separately from the primary Web task.Its neighborhood structure is intentionally more heterogeneous.Source: §E.1 · p. 15
E.2 Target sensitivity and cross-TSFM zero-shot Gate transfer
- Cross-backbone Gate transfer applies the source Gate’s trees, feature schema, and threshold to the target without target-specific fitting or threshold updates.The target still uses its own frozen forecast, eligible residual-pool overlay, and consensus-mean proposal.Source: §E.2 · p. 15
- All 72 off-diagonal cross-backbone metric results improve over matched frozen targets, while transferred-Gate uplifts over RACE-TF vary by metric.Across domains and transfers, the three-metric mean Gate increment over RACE-TF is +0.336 percentage points; positive full-pipeline gains also include each target’s residual-evidence proposal.Source: §E.2 · p. 16
E.3.1 Direct learned residual-regression control.
The direct learned residual-regression control uses the same retrieved and consensus-filtered evidence but applies its learned correction to every query without a Gate. Its comparison with RACE varies by domain and metric, while Web subset counts show fewer MAE and CRPS losses with RACE than with RACE-TF.
E.3.1 Direct learned residual-regression control.
- CERR preserves the deployed retrieval pool, K = 60, query-scale alignment, and consensus mask, then learns a bounded residual correction without a Gate.It is fitted on the fit role, model-selected, and has no calibration threshold.Source: §E.3.1 · p. 16
- On CGM, four-backbone means favor CERR for MSE and MAE and RACE for CRPS; on Web, CERR reduces MSE but substantially harms MAE and CRPS.RACE is not uniformly best on every metric, and the Web degradation includes Toto-2.0-313m.Source: §E.3.1 · p. 16, Table 9 · p. 18
- The comparison supports the Utility-Aware Correction Gate as a harm-control mechanism, not as a guarantee of metric-wise wins for every backbone.Source: §E.3.1 · pp. 16–17
- Figures 6–8 extend the Figure 4 diagnostics across remaining backbones, plotting MSE precision against Gate acceptance and gains across five frozen-base-MSE bins.Test labels are not used to refit the Gate, choose a threshold, or alter inference.Source: §E.3.2 · p. 17
E.4 Web dataset-level robustness of RACE
- On Web, RACE raises MAE wins from 10 to 17 and CRPS wins from 11 to 17 relative to RACE-TF, while reducing losses for both metrics.These counts do not imply improvement for every subset–TSFM cell.Source: §E.4 · p. 18
F Comparator Implementation and Evaluation
The appendix specifies comparator implementations, the Utility-Aware Correction Gate contract, and figure and audit conventions. It also documents how evaluation and provenance controls are applied.
F Comparator Implementation and Evaluation
- RAF retrieves and reforecasts an augmented input, while TS-RAG is evaluated only through its supported Chronos-Bolt Base interface.RAF uses backbone-native representations and has no fitting, mixing coefficient, or test-label selection; TS-RAG's fine-tuned condition updates only its retrieval-augmentation module.Source: F Comparator Implementation and… · pp. 18–19
- Tables 10–14 define retrieval-scope controls, Gate audits, error-stratified outcomes, and Web subset–backbone win/loss counts.The captions specify diagnostic definitions and evaluation scope, but provide no cell values establishing comparative outcomes.Source: Table 10 · p. 19, Table 11 · p. 19, Table 12 · p. 20
- CERR reuses RACE-TF evidence construction but replaces the consensus-mean proposal with a supervised residual regressor and omits the Gate.This matched control isolates direct learned residual transfer from selective residual transfer.Source: F Comparator Implementation and… · p. 19
G Utility-Aware Correction Gate Contract
- The Gate uses an ordered, inference-visible feature schema and is trained to predict whether the complete consensus proposal reduces valid-horizon MSE.A calibration threshold is selected to maximize total accepted MSE utility; test outcomes do not select the threshold, correction, or model state.Source: G Utility-Aware Correction Gate Contract · pp. 20–22, Table 15 · p. 23
H Figure Provenance and Case Selection
- Figure 5's qualitative cases are sampled by per-window improvement strata, and the deployed correction aggregates retained neighbors rather than using the displayed candidate alone.The plotted RACE-TF and RACE forecasts coincide on the two accepted windows; only the last 256 of each 512-step history is displayed.Source: H Figure Provenance and Case Selection · pp. 22–23
I.1 Complete four-backbone compute ledger
The runtime ledger reports method-specific workflows with distinct measurement boundaries, alongside retrieval-latency diagnostics. The reproducibility materials support functional verification but are not a full benchmark reproduction.
I.1 Complete four-backbone compute ledger
- Web / CGM retrieval latency is 0.93 / 2.71 ms for RACE and RACE-TF, and 1.55 / 3.77 ms for TS-RAG.These diagnostics exclude representation and index construction and are separate from the four-backbone workflow times.Source: §I.1 · p. 23
- RACE and RACE-TF timings use post-cache replays, whereas RAF timing includes candidate and query encoding, retrieval, augmented-input forecasting, evaluation, and audit output.The table's workflow times have different boundaries and do not support a matched latency or universally fastest-method claim.Source: §I.1 · p. 23, Table 16 · p. 24
I.2 Reproducibility Package and Material Availability
- The prepared fixtures exercise the post-forecast route, but are not a replacement for full benchmark data or an independent reproduction of every reported number.The package is not bundled with the preprint or publicly linked in this version, and it excludes full Web data, model weights, and raw clinical records.Source: §I.2 · p. 24
J Limitations
The limitations bound the evidence to neighbor-rich deployments and an intentionally low-capacity design, with clinical experiments restricted to retrospective forecasting. The appendix also defines abbreviations for the evaluated backbones.
J Limitations
- RACE's strongest improvements are expected in neighbor-rich settings, and the results do not guarantee the same gain magnitude whenever a retrieval pool is available.The broader GIFT-Eval analysis does not establish uniformly large gains across general forecasting collections.Source: J Limitations · p. 24
- The low-capacity architecture does not evaluate high-capacity retrievers or correction modules, large-scale libraries, or broadly distributed test suites.Richer residual-transfer models and their scaling behavior remain directions for future work.Source: J Limitations · pp. 24–25
- The CGM experiments are retrospective forecasting analyses, not validation for diagnosis, treatment recommendations, or insulin dosing.Source: J Limitations · p. 25
K Backbone Naming Convention
- The appendix abbreviates Chronos 2 as Chr.2, Chronos-Bolt Base as ChrB.B, TimesFM 2.5 200M as TFM.25, and Toto 2 313M as Toto2.313M.Source: K Backbone Naming Convention · p. 25