Beijing Jiaotong's VisiFold Trains 17x Faster by Folding Time Into Graph Nodes
A new graph representation collapses time into single nodes, cutting training memory by more than 15x while beating strong baselines on long-horizon traffic forecasting.
ProTakeaways
- VisiFold introduces a Temporal Folding Graph that collapses a sequence of snapshots into a single graph representation.
- Node visibility uses MAE-style node masking and subgraph sampling to cut compute on large networks.
- 17.8x faster training and 15.7x less memory than STAEformer, the prior state-of-the-art baseline.
- Outperforms 12 baselines across PEMS04, PEMS08, and SEATTLE at 24, 36, and 48 step horizons.
- Maintains accuracy even when 80% of nodes are masked during training, indicating heavy sensor redundancy.
- MIT-licensed code available at github.com/PlanckChang/VisiFold; accepted at ICDE 2026.
Predicting traffic for the next 15 minutes is a solved problem. Predicting it for the next 4 hours across a city sensor network is where every state-of-the-art model starts hemorrhaging GPU memory and accuracy. A team from Beijing Jiaotong University has proposed VisiFold, a framework that rethinks how spatial-temporal graphs are tokenized in the first place, and the payoff is a model that trains roughly 17x faster than the previous SOTA while using 15x less memory.
Why long horizons break current models
Traffic networks are usually modeled as spatial-temporal graphs, where each timestep becomes a snapshot of sensor readings on a road graph, and a sequence of these snapshots is fed through separate spatial and temporal modules. Current approaches, which rely on spatial-temporal graphs and process temporal and spatial dimensions separately, suffer from snapshot-stacking inflation and cross-step fragmentation.
Those two terms describe the core failure modes. Snapshot-stacking inflation means GPU memory and runtime balloon as you stack more timesteps. Cross-step fragmentation means temporal signals have to hop through many intermediate representations between the spatial and temporal modules, weakening long-range dependencies. Push the horizon out to 48 steps and both problems compound.
Folding time into a single graph
VisiFold's central idea is a Temporal Folding Graph (TFG). Instead of feeding the model a sequence of N-node snapshots across T timesteps, it collapses the entire temporal window into the node itself. Each node becomes a single token whose attribute vector contains every observation for that sensor across the input window.

The consequence is that the model no longer needs a dedicated temporal module. Temporal dynamics live inside each node's embedding, and spatial dependencies are exchanged across nodes on a single graph. In VisiFold, the temporal folding graph eliminates the need for cross-step interaction and the temporal module, and reduces the token count from N x T to N, which drops complexity by an order of magnitude before any other tricks are applied.
Node visibility: aggressive masking without hurting accuracy
Folding time solves one bottleneck but leaves another: large road networks can have hundreds or thousands of nodes. VisiFold borrows an idea from masked autoencoders and applies it at the node level:
- Node-level masking: randomly remove a fraction of nodes so they are invisible to the encoder during training, following the MAE recipe rather than zeroing values.
- Subgraph sampling: partition the remaining nodes into small fixed-size subgraphs that get processed in parallel.
The masking is only applied during training, not inference. Ablations showed that fully removing nodes worked noticeably better than setting their attributes to zero or random values, because zeroing creates a train-test mismatch where the encoder learns to treat masked values as real signal.
The surprising empirical result is how aggressive you can be. Even with a high mask ratio of 80%, VisiFold maintains its performance advantage. The authors argue that traffic sensors near each other have such redundant patterns that hiding most of them forces the model to learn genuine multi-hop dependencies instead of taking neighborhood shortcuts.

The numbers
VisiFold was evaluated on three benchmarks: PEMS04 (307 sensors), PEMS08 (170 sensors), and SEATTLE (323 sensors), all at horizons of 24, 36, and 48 steps. It came in first on all nine (dataset x horizon) combinations against 12 baselines including STAEformer, STID, SSTBAN, DCRNN, and Graph WaveNet.
The efficiency gains are where things get interesting. Compared to STAEformer, the prior strongest model, VisiFold delivered a 17.8x training speedup, 18.5x inference speedup, and 15.7x lower memory use averaged across horizons. Against STID, the most efficient competitive baseline, it still ran 7.8x faster in training and used 5.1x less memory. The authors note inference completes in under one second, opening the door to real-time and edge deployment.
Where it stops being useful
The framework is purely data-driven and inherits the standard weakness that goes with that: it cannot react to events that were not in its training distribution. Accidents, closures, or unusual gatherings that break historical patterns will degrade predictions. Error analysis also shows accuracy dips during peak traffic hours (roughly 9:00 to 15:00) when flow shows violent pulse variations.
There are also caveats worth flagging. VisiFold currently handles a single traffic signal type per scenario (flow or speed, not both). Subgraph size needs to be tuned per dataset because pushing it close to the total node count triggers padding-related fluctuations. And the day-of-week embedding contributed only marginally on PEMS04, which the authors attribute to the dataset spanning only 8 weeks.
Getting the code
The official repository is MIT-licensed and light on dependencies: PyTorch 2.0, NumPy, Pandas, and PyYAML. A single training command looks like:
conda create -n visifold python=3.10 -y
conda activate visifold
pip install -r requirements.txt
python train.py -d pems04 -i 24 -o 24 -m "pems04-24"
The paper was accepted at ICDE 2026. For teams already running spatial-temporal GNNs for demand forecasting, sensor networks, or any tabular time series with a graph prior, TFG is worth trying as a drop-in tokenization change independent of the downstream backbone.