SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.04163 · 2025

Retrieval Augmented Time Series Forecasting

arXiv · PDF · Open in the Atlas

Code that ran

7 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 1 failure of our instrument; 6 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2505.04163.json · badge: /api/ran/2505.04163.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
archon159/RAFT canonical (classifier label)
classifier basis not recorded on the link
7 ran · 6 no recorded run
FunctionStatusWhere it lives
divide_no_nan Ran
ran, honoured the contract we drafted
archon159/RAFT/utils/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from seungyoon-Choi/CoSPOT, is pointer only (licence: NONE) · get_code("bdc787c888ab83a2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from seungyoon-Choi/CoSPOT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

group_values Ran
ran, violated the contract we drafted
archon159/RAFT/utils/m4_summary.py
code served (permissive licence) · get_code("c7809c2a271dca7d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data
np.random.seed(0)

# values: array-like that will be indexed by groups
# needs to support indexing with boolean array
values = np.array([
    np.array([1.0, 2.0, np.nan, 4.0]),
    np.array([5.0, np.nan, 7.0, 8.0]),
    np.array([9.0, 10.0, 11.0, np.nan]),
    np.array([np.nan, 13.0, 14.0, 15.0])
])

# groups: array that will be compared with group_name via ==
# should have same length as values
groups = np.array(['A', 'B', 'A', 'B'])

# group_name: the value to filter groups by
group_name = 'A'

ARGS = {
    'values': values,
    'groups': groups,
    'group_name': group_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
jitter Ran
ran on a synthesized input
archon159/RAFT/utils/augmentation.py
code served (permissive licence) · get_code("7e91f7d6b90183d5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

np.random.seed(0)

# The function takes x (an array-like object) and sigma (a float)
# x is used with .shape attribute and passed to np.random.normal
# sigma is a scale parameter for the normal distribution

# Create a small numpy array to use as x
x = np.random.randn(2, 4).astype(np.float32)

# sigma is optional with default 0.03, but we'll provide it explicitly
sigma = 0.03

ARGS = {
    'x': x,
    'sigma': sigma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mase Ran
ran; our contract draft was wrong, not the code
archon159/RAFT/utils/m4_summary.py
code served (permissive licence) · get_code("a835854e98db22c5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float32, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# MASE (Mean Absolute Scaled Error) takes:
# - forecast: predicted values
# - insample: historical/training data used to compute the scale
# - outsample: actual test values to compare against forecast
# - frequency: seasonal frequency for computing scaled error

# Create small numpy arrays for time series data
np.random.seed(0)

# insample: historical training data (needs at least frequency+1 points)
insample = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], dtype=np.float32)

# outsample: test/holdout data to evaluate against
outsample = np.array([7.5, 8.2, 9.1, 10.3], dtype=np.float32)

# forecast: predictions matching outsample length
forecast = np.array([7.0, 8.0, 9.0, 10.0], dtype=np.float32)

# frequency: seasonal period (must be less than len(insample))
frequency = 2

ARGS = {
    "forecast": forecast,
    "insample": insample,
    "outsample": outsample,
    "frequency": frequency
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float32, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
scaling Ran
ran on a synthesized input
archon159/RAFT/utils/augmentation.py
code served (permissive licence) · get_code("570f35b7d04be7f7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small numpy array with shape (batch=2, height=3, width=4)
# The function expects x.shape[0] (batch), x.shape[2] (width)
x = np.random.randn(2, 3, 4).astype(np.float32)

ARGS = {
    "x": x,
    "sigma": 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
shape_dtw Ran
ran on a synthesized input
archon159/RAFT/utils/dtw.py
code served (permissive licence) · get_code("4967a8f159950811")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create small numpy arrays for prototype and sample
# These are sequences with shape [sequence_length, feature_dim]
prototype = np.random.randn(10, 3)  # 10 time steps, 3 features
sample = np.random.randn(12, 3)     # 12 time steps, 3 features

ARGS = {
    'prototype': prototype,
    'sample': sample,
    'return_flag': 0,  # RETURN_VALUE
    'slope_constraint': 'asymmetric',
    'window': None,
    'descr_ratio': 0.05
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
smape_2 Ran
ran, honoured the contract we drafted
archon159/RAFT/utils/m4_summary.py
code served (permissive licence) · get_code("27a243751eb26480")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small numpy arrays for forecast and target
# Using distinct shapes to make them proble-able: 2x4 arrays
forecast = np.array([
    [1.5, 2.3, 0.8, 3.2],
    [2.1, 1.9, 2.5, 0.5]
], dtype=np.float32)

target = np.array([
    [1.2, 2.5, 1.0, 3.0],
    [2.0, 2.0, 2.3, 0.7]
], dtype=np.float32)

ARGS = {
    "forecast": forecast,
    "target": target
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
accelerated_dtw Not yet run
unverified (harvested, no recorded run)
archon159/RAFT/utils/dtw_metric.py
code served (permissive licence) · get_code("19d697bd6bbd21c0")
How it ran

no invocation recorded.

calculate_ADF Not yet run
unverified (harvested, no recorded run)
archon159/RAFT/utils/ADFtest.py
code served (permissive licence) · get_code("6aa5559ae4d6a717")
How it ran

no invocation recorded.

calculate_target_ADF Not yet run
unverified (harvested, no recorded run)
archon159/RAFT/utils/ADFtest.py
code served (permissive licence) · get_code("447f4eb6d094eb7f")
How it ran

no invocation recorded.

dtw Not yet run
unverified (harvested, no recorded run)
archon159/RAFT/utils/dtw.py
code served (permissive licence) · get_code("66037d9834a6eeb5")
How it ran

no invocation recorded.

dtw Not yet run
unverified (harvested, no recorded run)
archon159/RAFT/utils/dtw_metric.py
code served (permissive licence) · get_code("79cd2766b7a4c49f")
How it ran

no invocation recorded.

rotation Not yet run
unverified (harvested, no recorded run)
archon159/RAFT/utils/augmentation.py
code served (permissive licence) · get_code("3e06f3c627157901")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 1 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
divide_no_nan 14 other papers
11 dated earlier, 2 later, 1 same year, order not determinable
2401.09093 (2024-01)
RWKV-TS: Beyond Traditional Recurrent Neural Network for Time Series Tasks
2402.04852 (2024-02)
Multi-Patch Prediction: Adapting LLMs for Time Series Representation Learning
2403.01493 (2024-03)
ConvTimeNet: A Deep Hierarchical Fully Convolutional Model for Multivariate Time Series Analysis
and 11 more not named here
dtw 1 other paper
1 dated earlier
2007.15951 (2020-07)
An Empirical Survey of Data Augmentation for Time Series Classification with Neural Networks
group_values 1 other paper
1 dated earlier
2403.05798 (2024-03)
$\textbf{S}^2$IP-LLM: Semantic Space Informed Prompt Learning with LLM for Time Series Forecasting
jitter 1 other paper
1 dated earlier
2007.15951 (2020-07)
An Empirical Survey of Data Augmentation for Time Series Classification with Neural Networks
mase 1 other paper
1 dated earlier
2403.05798 (2024-03)
$\textbf{S}^2$IP-LLM: Semantic Space Informed Prompt Learning with LLM for Time Series Forecasting
scaling 1 other paper
1 dated earlier
2007.15951 (2020-07)
An Empirical Survey of Data Augmentation for Time Series Classification with Neural Networks
shape_dtw 1 other paper
1 dated earlier
2007.15951 (2020-07)
An Empirical Survey of Data Augmentation for Time Series Classification with Neural Networks
smape_2 1 other paper
1 dated earlier
2403.05798 (2024-03)
$\textbf{S}^2$IP-LLM: Semantic Space Informed Prompt Learning with LLM for Time Series Forecasting

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Time series forecasting uses historical data to predict future trends, leveraging the relationships between past observations and available features. In this paper, we propose RAFT, a retrieval-augmented time series forecasting method to provide sufficient inductive biases and complement the model's learning capacity. When forecasting the subsequent time frames, we directly retrieve historical data candidates from the training dataset with patterns most similar to the input, and utilize the future values of these candidates alongside the inputs to obtain predictions. This simple approach augments the model's capacity by externally providing information about past patterns via retrieval modules. Our empirical evaluations on ten benchmark datasets show that RAFT consistently outperforms contemporary baselines with an average win ratio of 86%.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.04163")
get_code_for_paper("2505.04163")
have("2505.04163")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2505.04163.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2505.04163.svg)](https://syntology.ai/paper/2505.04163)

Connect an agent — have() is free.