Spectral Adaptive Graph Transformer for Efficient and Scalable Traffic Forecasting
Organizations: Future Computing Group, University of Oulu, 90570 Oulu, Finland
Abstract
Traffic forecasting models based on spectral graph convolution offer an interpretable account of how information is mixed between sensors, but they rely on an eigendecomposition of the graph Laplacian. It costs cubic time, is fixed by the road network, and provides a symmetric operator that cannot represent the directed propagation of traffic congestion. Attention-based spatio-temporal transformers remove these limitations but generate a dense sensor-by-sensor attention map at each layer and time step, so memory, rather than accuracy, becomes the binding constraint on large networks. We introduce the spectral adaptive graph transformer, whose spatial operator is learned rather than derived from the Laplacian, directed rather than symmetric, and conditioned on the current traffic state rather than a static state, at a cost linear in the number of sensors. A sparse road graph diffusion branch provides the strictly local propagation that a low-rank operator cannot express, and a zero-initialized gate learns the balance between the two. Before spatial mixing, a unit-mean-gain frequency-bin attention module reweights each sensor's short-term periodicities according to its identity and current context. Across six public benchmarks spanning 170 to 1843 sensors, evaluated over three random seeds, the proposed model attains the lowest error of any single end-to-end model on one benchmark and remains competitive with the strongest current attention models on the others, while using about a quarter of their memory and training about twice as fast.
Figures & tables
| Symbol | Meaning | Value / shape |
| Sizes and hyperparameters | ||
| number of sensors (nodes) | 170–1843 | |
| input window length | 12 | |
| forecast horizon | 12 | |
| input channels | 3 | |
| model (token) width | 152 | |
| Variant | Spatial layer | Freq. attention |
|---|---|---|
| SAGT-D | single-basis, ( 37 ) | no |
| SAGT-E | single-basis, ( 37 ) | yes |
| SAGT-F (full) | hybrid, Sec. III-F | yes |
| Dataset | Steps | Interval | Signal | ||
|---|---|---|---|---|---|
| PEMS08 | 170 | 17 856 | 5 min | 288 | flow |
| METR-LA | 207 | 34 272 | 5 min | 288 | speed |
| PEMS04 | 307 | 16 992 | 5 min | 288 | flow |
| PEMS-BAY | 325 | 52 116 | 5 min | 288 | speed |
| PEMS07 | 883 | 28 224 | 5 min | 288 | flow |
| EXPY-TKY | 1843 | 13 248 | 10 min | 144 | speed |
| Model | PEMS08 | METR-LA | PEMS04 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAPE | MAE | RMSE | MAPE | MAE | RMSE | MAPE | |
| STGCN | 16.66 0.07 | 25.85 0.06 | 11.15 0.31% | 3.13 0.00 | 6.35 0.02 | 8.70 0.07% | 20.36 0.13 | 32.16 0.33 | 14.26 0.30% |
| DCRNN | 15.64 0.06 | 24.66 0.06 | 10.21 0.07% | 3.59 0.39 | 7.04 0.56 | 9.39 0.31% | 20.71 0.09 | 32.44 0.10 | 14.57 0.14% |
| AGCRN | 15.86 0.11 | 25.15 0.07 | 10.81 0.53% | 3.19 0.01 | 6.45 0.01 | 8.86 0.06% | 19.40 0.05 | 31.26 0.15 | 13.44 0.28% |
| StemGNN | 17.53 0.55 | 27.52 0.60 | 11.37 0.46% | 3.71 0.28 | 7.32 0.43 | 10.77 1.00% | 22.96 0.51 | 35.59 0.59 | 15.94 0.31% |
| MegaCRN | 15.42 0.30 | 24.39 0.37 | 9.95 0.30% | 4.19 0.24 | 10.12 0.65 | 10.35 0.49% | 19.91 1.15 | 31.44 0.90 | 14.64 1.98% |
| Model | Horizon 3 | Horizon 6 | Horizon 12 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAPE | MAE | RMSE | MAPE | MAE | RMSE | MAPE | |
| PEMS08 | |||||||||
| PDFormer | 14.50 0.74 | 22.42 0.35 | 14.34 3.33% | 15.25 0.85 | 24.01 0.28 | 14.98 3.45% | 16.61 0.88 | 26.15 0.32 | 16.26 3.68% |
| STAEformer | 13.88 0.08 | 22.29 0.11 | 8.94 0.12% | 14.75 0.12 | 23.96 0.15 | 9.54 0.12% | 16.36 0.13 | 26.50 0.15 | 10.80 0.21% |
| TESTAM | 13.77 0.12 | 22.40 0.16 | 8.94 0.03% | 14.59 0.13 | 24.11 0.21 | 9.44 0.03% | 16.01 0.20 | 26.39 0.29 | 10.41 0.12% |
| SAGT-F (ours) | 13.43 0.15 | 21.86 0.07 | 8.75 0.15% | 14.38 0.12 | 23.66 0.02 | 9.27 0.11% | 15.89 0.06 | 26.03 0.06 | 10.37 0.07% |
| Var. | Modification introduced | MAE | RMSE | MAPE |
|---|---|---|---|---|
| A | Learned adjacency | 25.96 0.86 | 39.39 1.42 | 24.06 2.67% |
| B | Learned orthonormal basis | 25.08 0.50 | 38.80 0.62 | 18.07 0.70% |
| C | Input-conditioned filter | 25.05 0.56 | 38.63 0.63 | 18.45 0.78% |
| D | Transformer temporal backbone | 19.14 0.19 | 31.12 0.30 | 13.38 0.22% |
| E | + frequency-bin attention | 19.04 0.13 | 30.98 0.31 | 13.10 0.01% |
| F | + directed 2-basis, local (full) | 18.89 0.13 | 30.52 0.33 | 13.14 0.20% |
| Configuration | PEMS04 | PEMS08 | ||
|---|---|---|---|---|
| MAE | MAE | |||
| SAGT-F (full) | 18.89 0.13 | – | 14.39 0.11 | – |
| w/o local diffusion | 18.89 0.05 | 14.56 0.12 | ||
| w/o global spectral | 19.08 0.23 | 14.64 0.07 | ||
| w/o freq. attention | 19.25 0.35 | 14.38 0.29 | ||
| Configuration | PEMS04 | PEMS08 | ||
|---|---|---|---|---|
| MAE | MAE | |||
| k = 16 | 19.04 0.09 | 14.39 0.09 | ||
| k = 32 (default) | 18.89 0.13 | – | 14.39 0.11 | – |
| k = 64 | 18.92 0.08 | 14.49 0.07 | ||
| Model | Params | Batch size 1 (all models fit) | Batch size 8 | ||||
|---|---|---|---|---|---|---|---|
| Mem. (GB) | Train (ms) | Infer (ms) | Mem. (GB) | Train (ms) | Infer (ms) | ||
| STGCN | 1.08 M | 0.15 | 10.9 | 4.0 | 0.61 | 47.5 | 16.5 |
| DCRNN | 0.37 M | 0.54 | 372.8 | 104.4 | 4.17 | 647.7 | 269.4 |
| StemGNN | 11.33 M | 0.53 | 636.9 | 214.6 | 2.53 | 670.8 | 284.0 |
| MegaCRN | 0.45 M | 4.29 | 987.7 | 466.5 | 7.50 | 1650.5 | 672.6 |
| AGCRN | 0.76 M | 9.47 | 419.9 | 239.7 | 10.65 | 586.4 | 247.7 |
Spatiotemporal Forecasting
Spatiotemporal forecasting predicts how quantities change across locations and time, from traffic and weather to disease and environmental systems.
See all 410 papers