SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.17898 · ICML · 2024

FlashST: A Simple and Universal Prompt-Tuning Framework for Traffic Prediction

Chao Huang, Lianghao Xia, Zhonghang Li, Yong Xu

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2405.17898.json · badge: /api/ran/2405.17898.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
HKUDS/FlashST canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
hkuds/flashst community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
MAE_torch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HKUDS/FlashST/lib/metrics.py
code served (permissive licence) · get_code("c40b9c932efa74c7")
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 tuple. The image it ran in was not recorded. If your copy returns the same type 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 torch

torch.manual_seed(0)

# Create small tensors for pred and true
pred = torch.randn(2, 4)
true = torch.randn(2, 4)

# mask_value can be None or a float value
mask_value = None

ARGS = {
    "pred": pred,
    "true": true,
    "mask_value": mask_value,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
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
MSE_torch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HKUDS/FlashST/lib/metrics.py
code served (permissive licence) · get_code("bb1134c39c66c490")
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 Tensor, 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 torch

torch.manual_seed(0)

# Create small tensors for pred and true
pred = torch.randn(2, 4)
true = torch.randn(2, 4)

# mask_value is optional, can be None or a numeric value
mask_value = None

ARGS = {
    "pred": pred,
    "true": true,
    "mask_value": mask_value,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
calculate_scaled_laplacian Ran
ran, honoured the contract we drafted
HKUDS/FlashST/lib/predifineGraph.py
code served (permissive licence) · get_code("a49a2f0364137c7f")
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 (4, 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 adjacency matrix for testing
# Using a 4x4 undirected graph (symmetric adjacency matrix)
adj = np.array([
    [0, 1, 1, 0],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 1, 1, 0]
], dtype=np.float64)

ARGS = {
    "adj": adj
}
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 (4, 4) — shape (4, 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
get_logger Ran
ran; our contract draft was wrong, not the code
HKUDS/FlashST/lib/logger.py
code served (permissive licence) · get_code("996764623af1eab9")
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 Logger. The image it ran in was not recorded. If your copy returns the same type 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 os
import logging
import tempfile

# Create a temporary directory for the logger to use
temp_dir = tempfile.mkdtemp()

ARGS = {
    'root': temp_dir,
    'name': 'test_logger',
    'debug': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
huber_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HKUDS/FlashST/lib/metrics.py
code served (permissive licence) · get_code("0e86124fe7fa990b")
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 tuple, ndim 1, 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 torch

torch.manual_seed(0)

# Create small tensors for pred and true
pred = torch.randn(2, 4)
true = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    "pred": pred,
    "true": true,
    "mask_value": None,
    "delta": 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
init_lr_scheduler Ran
ran; our contract draft was wrong, not the code
HKUDS/FlashST/lib/TrainInits.py
code served (permissive licence) · get_code("e246ed362e86604f")
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 MultiStepLR. The image it ran in was not recorded. If your copy returns the same type 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple optimizer
model = nn.Linear(4, 3)
optim = torch.optim.SGD(model.parameters(), lr=0.1)

# Create a config object with the required attributes
class OptConfig:
    def __init__(self):
        self.lr_decay_steps = [10, 20, 30]
        self.lr_scheduler_rate = 0.1

opt = OptConfig()

ARGS = {
    "optim": optim,
    "opt": opt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MultiStepLR — a MultiStepLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MultiStepLR output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
init_optim Ran
ran; our contract draft was wrong, not the code
HKUDS/FlashST/lib/TrainInits.py
code served (permissive licence) · get_code("ffe6b5e6a255061f")
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 Adam. The image it ran in was not recorded. If your copy returns the same type 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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class OptConfig:
    def __init__(self):
        self.lr_init = 0.001

model = SimpleModel()
opt = OptConfig()

ARGS = {
    'model': model,
    'opt': opt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
load_pickle Ran
ran; our contract draft was wrong, not the code
HKUDS/FlashST/lib/predifineGraph.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from coco0106/MO-STEP, is pointer only (licence: NONE) · get_code("cd17080a788963f3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from coco0106/MO-STEP, 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.

split_data_by_ratio Ran
ran; our contract draft was wrong, not the code
HKUDS/FlashST/lib/data_process.py
code served (permissive licence) · get_code("f06b9dde37d1edca")
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 tuple. The image it ran in was not recorded. If your copy returns the same type 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 torch
import numpy as np

torch.manual_seed(0)

# The function expects:
# - data: an array-like object with a .shape[0] attribute and supports indexing/slicing
# - val_ratio: a float between 0 and 1
# - test_ratio: a float between 0 and 1

# Create a small numpy array as the data
data = np.random.randn(10, 4)

# Define validation and test ratios
val_ratio = 0.2
test_ratio = 0.1

ARGS = {
    "data": data,
    "val_ratio": val_ratio,
    "test_ratio": test_ratio,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
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
time_add Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HKUDS/FlashST/lib/data_process.py
code served (permissive licence) · get_code("393d9fa92fbb7360")
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 tuple, ndim 3, 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 a small 2D numpy array for data
# The function uses data.shape[0] to iterate and indexes with [index:index + 1, :]
# So we need a 2D array
data = np.random.rand(20, 4)

# week_start: integer indicating which day of week to start with
week_start = 1

# interval: time interval in minutes (default 5)
interval = 5

# weekday_only: boolean flag
weekday_only = False

# holiday_list: optional list of indices or None
holiday_list = None

# day_start: starting day value
day_start = 0

# hour_of_day: number of hours in a day (default 24)
hour_of_day = 24

ARGS = {
    "data": data,
    "week_start": week_start,
    "interval": interval,
    "weekday_only": weekday_only,
    "holiday_list": holiday_list,
    "day_start": day_start,
    "hour_of_day": hour_of_day,
}
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 tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
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
FlashST Not yet run
unverified (harvested, no recorded run)
hkuds/flashst/model/FlashST.py
code served (permissive licence) · get_code("9ddd482ace302247")
How it ran

no invocation recorded.

get_adjacency_matrix Not yet run
unverified (harvested, no recorded run)
HKUDS/FlashST/lib/predifineGraph.py
code served (permissive licence) · get_code("bcbb414ef2d71a4e")
How it ran

no invocation recorded.

init_device Not yet run
unverified (harvested, no recorded run)
HKUDS/FlashST/lib/TrainInits.py
code served (permissive licence) · get_code("d7187fc207b2d503")
How it ran

no invocation recorded.

load_st_dataset Not yet run
unverified (harvested, no recorded run)
HKUDS/FlashST/lib/data_process.py
code served (permissive licence) · get_code("276cf31cff24137f")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
HKUDS/FlashST/conf/FlashST/Params_pretrain.py
code served (permissive licence) · get_code("bfcf8880c515ac93")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 1 the same month, 1 later) and 8 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
load_pickle 7 other papers
4 dated earlier, 2 the same month, 1 later
aaai_25976 (2023 (year only))
Spatio-Temporal Meta-Graph Learning for Traffic Forecasting
2401.03138 (2024-01)
TelTrans: Applying Multi-Type Telecom Data to Transportation Evaluation and Prediction via Multifaceted Graph Modeling
2402.00397 (2024-02)
Multi-scale Traffic Pattern Bank for Cross-city Few-shot Traffic Forecasting
and 4 more not named here
MSE_torch 2 other papers
2 dated earlier
2203.15737 (2022-03)
Towards Spatio-Temporal Aware Traffic Time Series Forecasting--Full Version
2303.10909 (2023-03)
Graph Neural Rough Differential Equations for Traffic Forecasting
split_data_by_ratio 2 other papers
2 dated earlier
2208.04360 (2022-08)
SDWPF: A Dataset for Spatial Dynamic Wind Power Forecasting Challenge at KDD Cup 2022
2303.10909 (2023-03)
Graph Neural Rough Differential Equations for Traffic Forecasting
get_logger 1 other paper
1 dated earlier
2303.10909 (2023-03)
Graph Neural Rough Differential Equations for Traffic Forecasting
init_device 1 other paper
1 dated earlier
2303.10909 (2023-03)
Graph Neural Rough Differential Equations for Traffic Forecasting
init_lr_scheduler 1 other paper
1 dated earlier
2303.10909 (2023-03)
Graph Neural Rough Differential Equations for Traffic Forecasting
init_optim 1 other paper
1 dated earlier
2303.10909 (2023-03)
Graph Neural Rough Differential Equations for Traffic 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-22.

Repositories linked to this paper

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

Abstract

The objective of traffic prediction is to accurately forecast and analyze the dynamics of transportation patterns, considering both space and time. However, the presence of distribution shift poses a significant challenge in this field, as existing models struggle to generalize well when faced with test data that significantly differs from the training distribution. To tackle this issue, this paper introduces a simple and universal spatio-temporal prompt-tuning framework-FlashST, which adapts pre-trained models to the specific characteristics of diverse downstream datasets, improving generalization in diverse traffic prediction scenarios. Specifically, the FlashST framework employs a lightweight spatio-temporal prompt network for in-context learning, capturing spatio-temporal invariant knowledge and facilitating effective adaptation to diverse scenarios. Additionally, we incorporate a distribution mapping mechanism to align the data distributions of pre-training and downstream data, facilitating effective knowledge transfer in spatio-temporal forecasting. Empirical evaluations demonstrate the effectiveness of our FlashST across different spatio-temporal prediction tasks using diverse urban datasets. Code is available at https://github.com/HKUDS/FlashST.

For agents

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

get_harvested_code_for_paper("2405.17898")
get_code_for_paper("2405.17898")
have("2405.17898")

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

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

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

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

Connect an agent — have() is free.