SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.09972 · 2024

Efficient Large-Scale Traffic Forecasting with Transformers: A Spatial Data Management Perspective

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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, 1 violated it and 2 have no contract verdict; 1 failure of our instrument; 1 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/2412.09972.json · badge: /api/ran/2412.09972.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
lmissher/patchstg canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
lmissher/stgnn community (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
FunctionStatusWhere it lives
masked_mae Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lmissher/patchstg/lib/utils.py
code served (permissive licence) · get_code("f7098c6cfe715469")
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
import numpy as np

torch.manual_seed(0)

# Create small tensors for preds and labels
# preds: predictions, shape (2, 4) - batch size 2, 4 values
# labels: ground truth, shape (2, 4) - same shape as preds
preds = torch.randn(2, 4, dtype=torch.float32)
labels = torch.randn(2, 4, dtype=torch.float32)

# null_val: scalar value representing "null" entries
# Using np.nan as default to test the isnan branch
null_val = np.nan

ARGS = {
    "preds": preds,
    "labels": labels,
    "null_val": null_val,
}
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 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
metric Ran
ran, violated the contract we drafted
lmissher/patchstg/lib/utils.py
code served (permissive licence) · get_code("5b230abb2d7a66c3")
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 numpy as np

# Construct valid arguments for the metric function
# The function expects:
# - pred: predictions (numpy array of floats)
# - label: ground truth labels (numpy array of floats)

# Create small numpy arrays for predictions and labels
# Using distinct sizes to make shapes unambiguous
pred = np.array([1.5, 2.3, 0.8, 3.2, 1.1], dtype=np.float32)
label = np.array([1.0, 2.5, 0.0, 3.0, 1.2], dtype=np.float32)

ARGS = {
    "pred": pred,
    "label": label,
}
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 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
metric Ran
ran on a synthesized input
lmissher/stgnn/utils.py
code served (permissive licence) · get_code("1ba47a23adf07065")
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 numpy as np

# Create small numpy arrays for pred and label
np.random.seed(0)

# Create prediction array with shape (5,)
pred = np.random.randn(5).astype(np.float32)

# Create label array with shape (5,) containing mostly non-zero values
# but some zeros to test the masking logic
label = np.array([1.5, 2.3, 0.0, 4.1, 3.2], dtype=np.float32)

ARGS = {
    'pred': pred,
    'label': label
}
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 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
read_meta Ran
ran, honoured the contract we drafted
lmissher/patchstg/lib/utils.py
code served (permissive licence) · get_code("ddd6682056aa7c9b")
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, 2) 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
import pandas as pd
import tempfile
import os

# Create a temporary CSV file with the required columns
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "meta.csv")

# Create sample data with Lat and Lng columns
data = {
    'Lat': [40.7128, 34.0522],
    'Lng': [-74.0060, -118.2437]
}
df = pd.DataFrame(data)
df.to_csv(csv_path, index=False)

ARGS = {
    'path': csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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, 2) — shape (2, 2) 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
seq2instance Ran
ran on a synthesized input
lmissher/stgnn/utils.py
code served (permissive licence) · get_code("3fc58cdee460bc5d")
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 numpy as np

# The function seq2instance takes:
# - data: a 2D numpy array with shape (num_step, dims)
# - P: an integer representing the number of past steps
# - Q: an integer representing the number of future steps

# Create sample data
num_step = 10
dims = 4
data = np.random.randn(num_step, dims).astype(np.float32)

# Set P and Q such that num_sample = num_step - P - Q + 1 > 0
P = 3
Q = 2

ARGS = {
    "data": data,
    "P": P,
    "Q": Q
}
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 — 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
loadData Not yet run
unverified (harvested, no recorded run)
lmissher/stgnn/utils.py
code served (permissive licence) · get_code("78c234f574a9d6a2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 2 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
loadData 1 other paper
1 dated earlier
1911.08415 (2019-11)
GMAN: A Graph Multi-Attention Network for Traffic Prediction
masked_mae 1 other paper
1 dated earlier
2410.10524 (2024-10)
Get Rid of Isolation: A Continuous Multi-task Spatio-Temporal Learning Framework
metric 1 other paper
1 dated earlier
1911.08415 (2019-11)
GMAN: A Graph Multi-Attention Network for Traffic Prediction
seq2instance 1 other paper
1 dated earlier
1911.08415 (2019-11)
GMAN: A Graph Multi-Attention Network for Traffic Prediction

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

Road traffic forecasting is crucial in real-world intelligent transportation scenarios like traffic dispatching and path planning in city management and personal traveling. Spatio-temporal graph neural networks (STGNNs) stand out as the mainstream solution in this task. Nevertheless, the quadratic complexity of remarkable dynamic spatial modeling-based STGNNs has become the bottleneck over large-scale traffic data. From the spatial data management perspective, we present a novel Transformer framework called PatchSTG to efficiently and dynamically model spatial dependencies for large-scale traffic forecasting with interpretability and fidelity. Specifically, we design a novel irregular spatial patching to reduce the number of points involved in the dynamic calculation of Transformer. The irregular spatial patching first utilizes the leaf K-dimensional tree (KDTree) to recursively partition irregularly distributed traffic points into leaf nodes with a small capacity, and then merges leaf nodes belonging to the same subtree into occupancy-equaled and non-overlapped patches through padding and backtracking. Based on the patched data, depth and breadth attention are used interchangeably in the encoder to dynamically learn local and global spatial knowledge from points in a patch and points with the same index of patches. Experimental results on four real world large-scale traffic datasets show that our PatchSTG achieves train speed and memory utilization improvements up to $10\times$ and $4\times$ with the state-of-the-art performance.

For agents

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

get_harvested_code_for_paper("2412.09972")
get_code_for_paper("2412.09972")
have("2412.09972")

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

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

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

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

Connect an agent — have() is free.