A Spatial–Temporal Transformer with Query Enhancement and Fourier Analysis for Traffic Forecasting
Abstract
1. Introduction
- We propose STFQET, a query-enhanced spatio-temporal Transformer that targets delayed query influence, key node-centered spatial dependency, and noise-robust frequency-domain temporal modeling for traffic speed forecasting.
- We use query data as auxiliary information to build a query-enhanced attention module to learn the delay time relationship between query data and traffic data, thereby improving the model’s ability to integrate external information.
- We construct a key node attention module to identify key nodes and construct a key node subgraph to distinguish the importance of different nodes in the road network graph, enabling the model to learn deep spatial features between nodes.
- We design a Fourier filter module and an FFT-based temporal period extraction module to adaptively filter the data and learn periodic features according to its frequency domain characteristics, thereby enhancing the model’s learning of time periodic features.
- Experiments show that STFQET outperforms existing baseline models on real urban network traffic datasets, and ablation experiments confirm the independent contribution of each module.
2. Related Work
2.1. Traffic Forecasting Methods
2.2. GNN
3. Preliminary
3.1. Regions and Query
3.2. Road Network Map
3.3. Traffic Prediction
4. Methodology
4.1. Hierarchical Model Architecture
4.2. Spatial Temporal Embedding
4.2.1. Spatial Embedding
4.2.2. Temporal Embedding
4.3. Fourier Filtering Module
4.4. Query-Enhanced Attention Module
4.4.1. Query Processing Module
4.4.2. Query Attention Module
4.5. ST Block
4.5.1. Key Node Attention Module
4.5.2. FFT-Based Temporal Period Extraction Module
4.6. Standard Attention Components
4.7. Complexity Analysis
5. Experiments
5.1. Dataset
- The road network data presents the complete architecture of Beijing’s road network, providing a foundation for building a road network graph. The road network is divided into regions along the X and Y axes and provides detailed information on the road segments within each region.
- The user query data includes a total of 114 million user query records recorded from 1 April 2017 to 31 May 2017. Each query contains the user ID, search timestamp, and current location coordinates of the user, as well as the coordinates of the starting and destination locations and query keywords.
- The traffic speed data covers 15,073 road sections with a total mileage of approximately 738.91 km. This data records the real-time vehicle speed on road segments covered by the study area, and its coverage area and time period fully correspond to the user query data.
5.2. Baseline Methods
- •
- GMAN [9]: GMAN employs a graph multi-attention network with an encoder–decoder architecture, featuring spatial and temporal attention mechanisms to model dynamic spatio-temporal correlations. It includes a transform attention layer to alleviate error propagation by capturing direct relationships between historical and future time steps.
- •
- DeepSTUQ [10]: DeepSTUQ proposes a unified approach for uncertainty quantification in traffic forecasting, estimating both aleatoric and epistemic uncertainties. It combines Monte Carlo dropout and adaptive weight averaging re-training methods, enhanced with a post-processing calibration technique based on temperature scaling.
- •
- RDAT [36]: RDAT leverages reinforced dynamic adversarial training to enhance adversarial robustness. It uses a reinforcement learning-based method to dynamically select a subset of nodes as adversarial examples, reducing overfitting and incorporating self-knowledge distillation regularization to mitigate forgetting issues.
- •
- STG-NCDE [34]: STG-NCDE designs two neural controlled differential equations for temporal and spatial processing, respectively, and demonstrates robustness to irregular time series.
- •
- STWave [33]: Spatial–Temporal Wavelet Framework utilizes discrete wavelet transform to disentangle traffic series into trends and events, combined with efficient spectral graph attention networks.
- •
- STD-PLM [32]: Spatial–Temporal Data Pre-trained Language Model adapts pre-trained language models to understand spatial–temporal properties through specifically designed tokenizers and sandglass attention modules.
- •
- EAC [30]: Expand and Compress framework employs prompt tuning principles for continual spatio-temporal forecasting, using continuous prompt pools to adapt to streaming data.
- •
- ST-ReP [29]: Reconstruction and Prediction integrated learning combines current value reconstruction with future value prediction in a pre-training framework, using a compression–extraction–decompression structure for efficient encoding.
- •
- LightST [27]: LightST is an efficient traffic forecasting framework based on spatio-temporal distillation. It transfers spatial and temporal knowledge from a high-capacity GNN teacher to a lightweight MLP student through prediction-level alignment and representation-level distribution alignment, achieving competitive accuracy with much higher inference efficiency.
- •
- STDN [21]: STDN is a spatio-temporal-aware trend-seasonality decomposition network for traffic flow forecasting. It combines spatio-temporal embedding learning, dynamic relationship graph learning, and trend-seasonality decomposition to disentangle traffic flow components and enhance the representation learning of traffic nodes.
- •
- ST-SSDL [14]: ST-SSDL is a spatio-temporal forecasting framework with self-supervised deviation learning. It introduces historical anchors, learnable prototypes, contrastive loss, and deviation loss to capture the discrepancy between current observations and historical patterns, thereby improving the adaptability of forecasting under dynamic traffic conditions.
- •
- Hybrid [6]: Hybrid is the full model proposed with the Q-Traffic dataset. It combines online route queries with geographical, event-related, and road intersection auxiliary information in an encoder–decoder sequence learning framework.
5.3. Experiment Results
5.4. Parameter Study
5.5. Multi-Region Experiments
5.6. Ablation Experiments
5.7. Query Temporal Perturbation Study
5.8. Comparison of Different Graph Embedding Methods
- DeepWalk [38] leverages random walks and the Skip-gram model to learn node embeddings, effectively capturing community structures and homophily in networks.
- GF [39] employs matrix factorization to learn embeddings by directly approximating the adjacency matrix, focusing primarily on first-order proximity.
- Node2vec [40] extends DeepWalk with a biased random walk strategy, controlled by parameters p and q, to balance between exploring homophily and structural equivalence.
- GraRep [41] explicitly captures higher-order proximities by factorizing different powers of the transition matrix, integrating multi-scale network relationships.
- HOPE [42] preserves high-order proximity and asymmetric transitivity by approximating and factorizing a defined similarity matrix like Katz index.
- HIN2Vec [43] employs multi-task learning to model multiple relationship types and meta-paths between nodes, framing it as a binary classification problem.
- LLE [44] assumes local linearity and learns embeddings by reconstructing each node from its neighbors, preserving the local geometric structure of the graph.
- SDNE [45] utilizes deep autoencoders to jointly optimize for first-order and second-order proximity, capturing highly non-linear network structures.
6. Discussion
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Chen, M.; Pang, G.; Wang, W.; Yan, C. Information Bottleneck-guided MLPs for Robust Spatial-temporal Forecasting. In Proceedings of the Forty-second International Conference on Machine Learning, Vancouver, BC, Canada, 13–19 July 2025. [Google Scholar]
- Kong, W.; Guo, Z.; Liu, Y. Spatio-Temporal Pivotal Graph Neural Networks for Traffic Flow Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; Volume 38, pp. 8627–8635. [Google Scholar] [CrossRef]
- Wang, Y.; Xu, Y.; Yang, J.; Wu, M.; Li, X.; Xie, L.; Chen, Z. Fully-Connected Spatial-Temporal Graph for Multivariate Time Series Data. arXiv 2023, arXiv:2309.05305. [Google Scholar] [CrossRef]
- Almousa, G.; Lee, Y. Traffic forecasting using spatio-temporal dynamics and attention with graph attention PDEs. Inf. Sci. 2025, 711, 122108. [Google Scholar] [CrossRef]
- Wu, H. Revisiting attention for multivariate time series forecasting. In Proceedings of the Thirty-Ninth AAAI Conference on Artificial Intelligence and Thirty-Seventh Conference on Innovative Applications of Artificial Intelligence and Fifteenth Symposium on Educational Advances in Artificial Intelligence (AAAI’25/IAAI’25/EAAI’25), Philadelphia, PA, USA, 25 February–4 March 2025; AAAI Press: Washington, DC, USA, 2025. [Google Scholar] [CrossRef]
- Liao, B.; Zhang, J.; Wu, C.; McIlwraith, D.; Chen, T.; Yang, S.; Guo, Y.; Wu, F. Deep Sequence Learning with Auxiliary Information for Traffic Prediction. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD’18), London, United Kingdom, 19–23 August 2018; pp. 537–546. [Google Scholar] [CrossRef]
- Cai, W.; Liang, Y.; Liu, X.; Feng, J.; Wu, Y. MSGNet: Learning Multi-Scale Inter-series Correlations for Multivariate Time Series Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; Volume 38, pp. 11141–11149. [Google Scholar] [CrossRef]
- Wu, Y.; Meng, X.; Hu, H.; Zhang, J.; Dong, Y.; Lu, D. Affirm: Interactive Mamba with Adaptive Fourier Filters for Long-term Time Series Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 21599–21607. [Google Scholar] [CrossRef]
- Zheng, C.; Fan, X.; Wang, C.; Qi, J. GMAN: A Graph Multi-Attention Network for Traffic Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 1234–1241. [Google Scholar] [CrossRef]
- Qian, W.; Zhang, D.; Zhao, Y.; Zheng, K.; Yu, J.J. Uncertainty Quantification for Traffic Forecasting: A Unified Approach. In Proceedings of the 2023 IEEE 39th International Conference on Data Engineering (ICDE), Anaheim, CA, USA, 3–7 April 2023; pp. 992–1004. [Google Scholar] [CrossRef]
- Guo, S.; Lin, Y.; Gong, L.; Wang, C.; Zhou, Z.; Shen, Z.; Huang, Y.; Wan, H. Self-Supervised Spatial-Temporal Bottleneck Attentive Network for Efficient Long-term Traffic Forecasting. In Proceedings of the 2023 IEEE 39th International Conference on Data Engineering (ICDE), Anaheim, CA, USA, 3–7 April 2023; pp. 1585–1596. [Google Scholar] [CrossRef]
- Ma, X.; Li, X.; Fang, L.; Zhao, T.; Zhang, C. U-Mixer: An Unet-Mixer Architecture with Stationarity Correction for Time Series Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; Volume 38, pp. 14255–14262. [Google Scholar] [CrossRef]
- Li, Z.; Hu, Z.; Han, P.; Gu, Y.; Cai, S. SSL-STMFormer Self-Supervised Learning Spatio-Temporal Entanglement Transformer for Traffic Flow Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 12130–12138. [Google Scholar] [CrossRef]
- Gao, H.; Dong, Z.; Yong, J.; Fukushima, S.; Taura, K.; Jiang, R. How Different from the Past? Spatio-Temporal Time Series Forecasting with Self-Supervised Deviation Learning. In Proceedings of the Thirty-ninth Annual Conference on Neural Information Processing Systems, San Diego, CA, USA, 2–7 December 2025. [Google Scholar]
- Liu, J.; Wang, Y.; Zhu, J.; Bai, W.; Zhang, H.; Zuo, L.; Zhou, T.; Li, K. A Multilayer Spatiotemporal Correlation-Aware Graph Attention Network for Traffic Flow Prediction. IEEE Trans. Neural Netw. Learn. Syst. 2026, 37, 2235–2249. [Google Scholar] [CrossRef] [PubMed]
- Xian, J.; Ye, Y.; Zhang, W.; Chen, Z.; Huang, J.; Lin, Z.; Zhou, T. MDHGFN: Multiscale Dual Hypergraph Fusion Spatiotemporal Network for traffic flow prediction. Chaos Solitons Fractals 2025, 201, 117228. [Google Scholar] [CrossRef]
- Yu, C.; Lin, Z.; Cheng, H.; Cao, C.; Zhou, T.; Leung, M.F. Quantum-Inspired Dynamic Spatiotemporal Matching Transformer for Traffic Flow Forecasting. IEEE Trans. Consum. Electron. 2025, 72, 2527–2539. [Google Scholar] [CrossRef]
- Liao, B.; Zhang, J.; Cai, M.; Tang, S.; Gao, Y.; Wu, C.; Yang, S.; Zhu, W.; Guo, Y.; Wu, F. Dest-ResNet: A Deep Spatiotemporal Residual Network for Hotspot Traffic Speed Prediction. In Proceedings of the 26th ACM International Conference on Multimedia, Seoul, Republic of Korea, 22–26 October 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 1883–1891. [Google Scholar] [CrossRef]
- Lu, Z.; Lv, W.; Xie, Z.; Du, B.; Xiong, G.; Sun, L.; Wang, H. Graph Sequence Neural Network with an Attention Mechanism for Traffic Speed Prediction. ACM Trans. Intell. Syst. Technol. 2022, 13, 20:1–20:24. [Google Scholar] [CrossRef]
- Qiu, Z.; Zhu, T.; Jin, Y.; Sun, L.; Du, B. A Graph Attention Fusion Network for Event-Driven Traffic Speed Prediction. Inf. Sci. 2023, 622, 405–423. [Google Scholar] [CrossRef]
- Cao, L.; Wang, B.; Jiang, G.; Yu, Y.; Dong, J. Spatiotemporal-aware Trend-Seasonality Decomposition Network for Traffic Flow Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 11463–11471. [Google Scholar] [CrossRef]
- Yang, X.; Sun, Y.; Chen, X.; Zhang, Y.; Yuan, X. Graph Structure Learning for Spatial-Temporal Imputation: Adapting to Node and Feature Scales. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 959–967. [Google Scholar] [CrossRef]
- Ma, M.; Hu, J.; Jensen, C.S.; Teng, F.; Han, P.; Xu, Z.; Li, T. Learning Time-Aware Graph Structures for Spatially Correlated Time Series Forecasting. In Proceedings of the 2024 IEEE 40th International Conference on Data Engineering (ICDE), Utrecht, The Netherlands, 13–17 May 2024; pp. 4435–4448. [Google Scholar] [CrossRef]
- Zheng, Y.; Luo, C.; Shao, R. Enhancing Traffic Flow Forecasting with Delay Propagation: Adaptive Graph Convolution Networks for Spatio-Temporal Data. IEEE Trans. Intell. Transp. Syst. 2025, 26, 650–660. [Google Scholar] [CrossRef]
- Yuan, Q.; Wang, J.; Han, Y.; Liu, Z.; Liu, W. DAGCAN: Decoupled Adaptive Graph Convolution Attention Network for Traffic Forecasting. IEEE Trans. Intell. Transp. Syst. 2025, 26, 3513–3526. [Google Scholar] [CrossRef]
- Prabowo, A.; Shao, W.; Xue, H.; Koniusz, P.; Salim, F.D. Because Every Sensor Is Unique, so Is Every Pair: Handling Dynamicity in Traffic Forecasting. In Proceedings of the 8th ACM/IEEE Conference on Internet of Things Design and Implementation (IoTDI’23), San Antonio, TX, USA, 9–12 May 2023; pp. 93–104. [Google Scholar] [CrossRef]
- Zhang, Q.; Gao, X.; Wang, H.; Yiu, S.M.; Yin, H. Efficient traffic prediction through spatio-temporal distillation. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 1093–1101. [Google Scholar]
- Jiang, R.; Wang, Z.; Yong, J.; Jeph, P.; Chen, Q.; Kobayashi, Y.; Song, X.; Fukushima, S.; Suzumura, T. Spatio-Temporal Meta-Graph Learning for Traffic Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; Volume 37, pp. 8078–8086. [Google Scholar] [CrossRef]
- Zheng, Q.; Yao, Z.; Zhang, Y. ST-ReP: Learning Predictive Representations Efficiently for Spatial-Temporal Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 13419–13427. [Google Scholar] [CrossRef]
- Chen, W.; Liang, Y. Expand and Compress: Exploring Tuning Principles for Continual Spatio-Temporal Graph Forecasting. arXiv 2024, arXiv:2410.12593. [Google Scholar] [CrossRef]
- Wang, B.; Wang, P.; Zhang, Y.; Wang, X.; Zhou, Z.; Bai, L.; Wang, Y. Towards Dynamic Spatial-Temporal Graph Learning: A Decoupled Perspective. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; Volume 38, pp. 9089–9097. [Google Scholar] [CrossRef]
- Huang, Y.; Mao, X.; Guo, S.; Chen, Y.; Shen, J.; Li, T.; Lin, Y.; Wan, H. STD-PLM: Understanding Both Spatial and Temporal Properties of Spatial-Temporal Data with PLM. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 11817–11825. [Google Scholar] [CrossRef]
- Fang, Y.; Qin, Y.; Luo, H.; Zhao, F.; Xu, B.; Zeng, L.; Wang, C. When Spatio-Temporal Meet Wavelets: Disentangled Traffic Forecasting via Efficient Spectral Graph Attention Networks. In Proceedings of the 2023 IEEE 39th International Conference on Data Engineering (ICDE), Anaheim, CA, USA, 3–7 April 2023; pp. 517–529. [Google Scholar] [CrossRef]
- Choi, J.; Choi, H.; Hwang, J.; Park, N. Graph Neural Controlled Differential Equations for Traffic Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtual Event, Online, 22 February–1 March 2022; Volume 36, pp. 6367–6374. [Google Scholar] [CrossRef]
- Jiang, J.; Han, C.; Zhao, W.X.; Wang, J. PDFormer: Propagation Delay-Aware Dynamic Long-Range Transformer for Traffic Flow Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; Volume 37, pp. 4365–4373. [Google Scholar] [CrossRef]
- Liu, F.; Zhang, W.; Liu, H. Robust Spatiotemporal Traffic Forecasting with Reinforced Dynamic Adversarial Training. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD’23), Long Beach, CA, USA, 6–10 August 2023; pp. 1417–1428. [Google Scholar] [CrossRef]
- Zhang, H.K.; Zhang, Y.G.; Zhou, Z.; Li, Y.F. HONGAT: Graph Attention Networks in the Presence of High-Order Neighbors. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; Volume 38, pp. 16750–16758. [Google Scholar] [CrossRef]
- Perozzi, B.; Al-Rfou, R.; Skiena, S. DeepWalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD’14), New York, NY, USA, 24–27 August 2014; pp. 701–710. [Google Scholar] [CrossRef]
- Ahmed, A.; Shervashidze, N.; Narayanamurthy, S.; Josifovski, V.; Smola, A.J. Distributed large-scale natural graph factorization. In Proceedings of the 22nd International Conference on World Wide Web (WWW’13), Rio de Janeiro, Brazil, 13–17 May 2013; pp. 37–48. [Google Scholar] [CrossRef]
- Grover, A.; Leskovec, J. node2vec: Scalable Feature Learning for Networks. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD’16), San Francisco, CA, USA, 13–17 August 2016; pp. 855–864. [Google Scholar] [CrossRef]
- Cao, S.; Lu, W.; Xu, Q. GraRep: Learning Graph Representations with Global Structural Information. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management (CIKM’15), Melbourne, Australia, 19–23 October 2015; pp. 891–900. [Google Scholar] [CrossRef]
- Ou, M.; Cui, P.; Pei, J.; Zhang, Z.; Zhu, W. Asymmetric Transitivity Preserving Graph Embedding. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD’16), San Francisco, CA, USA, 13–17 August 2016; pp. 1105–1114. [Google Scholar] [CrossRef]
- Fu, T.; Lee, W.; Lei, Z. HIN2Vec: Explore Meta-paths in Heterogeneous Information Networks for Representation Learning. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, Singapore, 6–10 November 2017; Lim, E., Winslett, M., Sanderson, M., Fu, A.W., Sun, J., Culpepper, J.S., Lo, E., Ho, J.C., Donato, D., Agrawal, R., et al., Eds.; ACM: New York, NY, USA, 2017; pp. 1797–1806. [Google Scholar] [CrossRef]
- Roweis, S.T.; Saul, L.K. Nonlinear Dimensionality Reduction by Locally Linear Embedding. Science 2000, 290, 2323–2326. [Google Scholar] [CrossRef] [PubMed]
- Wang, D.; Cui, P.; Zhu, W. Structural Deep Network Embedding. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD’16), San Francisco, CA, USA, 13–17 August 2016; pp. 1225–1234. [Google Scholar] [CrossRef]







| Dataset | No. of Nodes | Epochs | Avg. Train/Epoch (s) | Train + Val Time (min) |
|---|---|---|---|---|
| Q-24-33 | 223 | 26 | 73.0 | 32.6 |
| Q-26-31 | 123 | 20 | 63.7 | 21.9 |
| Q-32-37 | 134 | 22 | 62.4 | 23.7 |
| Q-3335-3840 | 1074 | 29 | 336.8 | 168.1 |
| Q-4346-2629 | 922 | 30 | 252.2 | 130.3 |
| Data | Model | 60 min | 90 min | 120 min | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAPE | MAE | RMSE | MAPE | MAE | RMSE | MAPE | ||
| Q-24-33 | GMAN | 2.29 ± 0.03 | 3.44 ± 0.06 | 7.76 ± 0.14% | 2.32 ± 0.03 | 3.48 ± 0.06 | 7.85 ± 0.14% | 2.34 ± 0.03 | 3.51 ± 0.07 | 7.93 ± 0.14% |
| DeepSTUQ | 2.22 ± 0.02 | 3.35 ± 0.02 | 7.51 ± 0.06% | 2.28 ± 0.02 | 3.45 ± 0.02 | 7.76 ± 0.07% | 2.35 ± 0.02 | 3.56 ± 0.02 | 8.03 ± 0.08% | |
| RDAT | 2.42 ± 0.16 | 3.50 ± 0.17 | 8.19 ± 0.39% | 2.48 ± 0.14 | 3.58 ± 0.17 | 8.44 ± 0.38% | 2.52 ± 0.15 | 3.66 ± 0.19 | 8.60 ± 0.39% | |
| STG-NCDE | 2.26 ± 0.01 | 3.44 ± 0.01 | 7.72 ± 0.03% | 2.35 ± 0.01 | 3.55 ± 0.03 | 8.00 ± 0.07% | 2.44 ± 0.01 | 3.68 ± 0.03 | 8.30 ± 0.12% | |
| STWave | 2.44 ± 0.02 | 3.61 ± 0.05 | 8.32 ± 0.07% | 2.56 ± 0.02 | 3.78 ± 0.05 | 8.78 ± 0.11% | 2.67 ± 0.03 | 3.93 ± 0.05 | 9.20 ± 0.12% | |
| STD-PLM | 2.40 ± 0.11 | 3.62 ± 0.11 | 8.15 ± 0.40% | 2.60 ± 0.03 | 3.87 ± 0.07 | 8.86 ± 0.09% | 2.71 ± 0.03 | 3.98 ± 0.14 | 8.87 ± 0.87% | |
| EAC | 2.70 ± 0.15 | 3.94 ± 0.18 | 9.17 ± 0.48% | 2.94 ± 0.21 | 4.25 ± 0.25 | 9.99 ± 0.71% | 3.15 ± 0.27 | 4.54 ± 0.34 | 10.69 ± 0.91% | |
| ST-ReP | 2.31 ± 0.12 | 3.42 ± 0.13 | 7.84 ± 0.56% | 2.39 ± 0.13 | 3.47 ± 0.15 | 8.20 ± 0.42% | 2.46 ± 0.18 | 3.71 ± 0.51 | 8.71 ± 1.00% | |
| LightST | 2.21 ± 0.01 | 3.37 ± 0.01 | 7.57 ± 0.03% | 2.29 ± 0.01 | 3.48 ± 0.02 | 7.83 ± 0.05% | 2.35 ± 0.02 | 3.58 ± 0.03 | 8.07 ± 0.07% | |
| STDN | 2.13 ± 0.01 | 3.25 ± 0.04 | 7.27 ± 0.08% | 2.16 ± 0.01 | 3.37 ± 0.01 | 7.39 ± 0.10% | 2.20 ± 0.01 | 3.35 ± 0.05 | 7.54 ± 0.06% | |
| ST-SSDL | 2.14 ± 0.01 | 3.28 ± 0.06 | 7.33 ± 0.05% | 2.18 ± 0.01 | 3.35 ± 0.06 | 7.49 ± 0.07% | 2.22 ± 0.02 | 3.38 ± 0.03 | 7.62 ± 0.09% | |
| Hybrid | 2.59 ± 0.02 | 3.80 ± 0.03 | 8.74 ± 0.05% | 2.73 ± 0.03 | 3.99 ± 0.04 | 9.23 ± 0.08% | 2.87 ± 0.03 | 4.15 ± 0.04 | 9.74 ± 0.09% | |
| STFQET | 2.11 ± 0.01 | 3.24 ± 0.03 | 7.21 ± 0.07% | 2.14 ± 0.01 | 3.30 ± 0.03 | 7.31 ± 0.04% | 2.16 ± 0.02 | 3.34 ± 0.02 | 7.42 ± 0.06% | |
| Q-26-31 | GMAN | 2.53 ± 0.03 | 4.12 ± 0.06 | 8.80 ± 0.20% | 2.58 ± 0.04 | 4.21 ± 0.07 | 9.06 ± 0.19% | 2.64 ± 0.04 | 4.30 ± 0.07 | 9.34 ± 0.18% |
| DeepSTUQ | 2.34 ± 0.02 | 3.90 ± 0.02 | 8.48 ± 0.14% | 2.41 ± 0.02 | 4.02 ± 0.03 | 8.87 ± 0.11% | 2.48 ± 0.03 | 4.13 ± 0.03 | 9.35 ± 0.07% | |
| RDAT | 2.65 ± 0.09 | 4.16 ± 0.08 | 9.71 ± 0.11% | 2.84 ± 0.11 | 4.39 ± 0.10 | 10.67 ± 0.20% | 2.94 ± 0.11 | 4.54 ± 0.09 | 11.35 ± 0.17% | |
| STG-NCDE | 2.41 ± 0.02 | 4.04 ± 0.02 | 8.86 ± 0.10% | 2.50 ± 0.03 | 4.19 ± 0.04 | 9.43 ± 0.17% | 2.58 ± 0.04 | 4.30 ± 0.03 | 9.95 ± 0.17% | |
| STWave | 2.65 ± 0.06 | 4.27 ± 0.08 | 9.54 ± 0.34% | 2.82 ± 0.08 | 4.52 ± 0.10 | 10.47 ± 0.41% | 2.97 ± 0.07 | 4.74 ± 0.10 | 11.34 ± 0.44% | |
| STD-PLM | 2.42 ± 0.02 | 3.99 ± 0.03 | 8.51 ± 0.02% | 2.50 ± 0.01 | 4.11 ± 0.01 | 9.24 ± 0.02% | 2.53 ± 0.03 | 4.16 ± 0.01 | 9.52 ± 0.02% | |
| EAC | 2.73 ± 0.18 | 4.33 ± 0.29 | 8.34 ± 0.25% | 2.95 ± 0.18 | 4.65 ± 0.28 | 9.14 ± 0.22% | 3.17 ± 0.11 | 4.96 ± 0.19 | 10.33 ± 0.29% | |
| ST-ReP | 2.47 ± 0.05 | 3.93 ± 0.05 | 9.07 ± 0.30% | 2.56 ± 0.11 | 4.06 ± 0.09 | 9.45 ± 0.62% | 2.68 ± 0.16 | 4.21 ± 0.15 | 9.84 ± 0.68% | |
| LightST | 2.37 ± 0.01 | 3.97 ± 0.03 | 8.50 ± 0.13% | 2.48 ± 0.03 | 4.14 ± 0.05 | 9.24 ± 0.22% | 2.57 ± 0.02 | 4.30 ± 0.05 | 9.93 ± 0.18% | |
| STDN | 2.33 ± 0.06 | 3.87 ± 0.03 | 8.39 ± 0.17% | 2.39 ± 0.06 | 3.99 ± 0.08 | 8.66 ± 0.12% | 2.46 ± 0.05 | 4.08 ± 0.02 | 9.09 ± 0.06% | |
| ST-SSDL | 2.39 ± 0.17 | 3.96 ± 0.19 | 8.72 ± 0.87% | 2.49 ± 0.22 | 4.13 ± 0.23 | 11.00 ± 0.10% | 2.56 ± 0.25 | 4.26 ± 0.27 | 11.70 ± 0.14% | |
| Hybrid | 2.73 ± 0.01 | 4.37 ± 0.02 | 10.07 ± 0.12% | 2.98 ± 0.02 | 4.70 ± 0.04 | 11.38 ± 0.09% | 3.10 ± 0.04 | 4.82 ± 0.05 | 11.84 ± 0.09% | |
| STFQET | 2.30 ± 0.03 | 3.85 ± 0.05 | 8.12 ± 0.20% | 2.38 ± 0.03 | 4.00 ± 0.06 | 8.35 ± 0.27% | 2.42 ± 0.03 | 4.06 ± 0.04 | 8.64 ± 0.27% | |
| Q-32-37 | GMAN | 3.17 ± 0.05 | 4.87 ± 0.08 | 11.15 ± 0.20% | 3.22 ± 0.05 | 4.95 ± 0.07 | 11.32 ± 0.23% | 3.27 ± 0.04 | 5.02 ± 0.06 | 11.51 ± 0.21% |
| DeepSTUQ | 3.00 ± 0.01 | 4.86 ± 0.01 | 10.65 ± 0.14% | 3.12 ± 0.01 | 5.08 ± 0.01 | 11.05 ± 0.10% | 3.24 ± 0.01 | 5.29 ± 0.04 | 11.44 ± 0.10% | |
| RDAT | 3.28 ± 0.07 | 4.98 ± 0.12 | 11.56 ± 0.42% | 3.49 ± 0.18 | 5.29 ± 0.27 | 12.43 ± 0.78% | 3.66 ± 0.23 | 5.57 ± 0.38 | 14.30 ± 0.63% | |
| STG-NCDE | 3.09 ± 0.03 | 4.99 ± 0.04 | 10.98 ± 0.10% | 3.24 ± 0.04 | 5.27 ± 0.05 | 11.52 ± 0.13% | 3.38 ± 0.05 | 5.54 ± 0.08 | 12.12 ± 0.21% | |
| STWave | 3.31 ± 0.08 | 5.20 ± 0.09 | 11.59 ± 0.21% | 3.50 ± 0.08 | 5.50 ± 0.09 | 12.21 ± 0.29% | 3.67 ± 0.10 | 5.75 ± 0.11 | 12.80 ± 0.30% | |
| STD-PLM | 2.98 ± 0.02 | 4.71 ± 0.06 | 10.40 ± 0.10% | 3.08 ± 0.01 | 4.98 ± 0.03 | 10.82 ± 0.03% | 3.24 ± 0.03 | 5.17 ± 0.03 | 10.39 ± 0.02% | |
| EAC | 3.78 ± 0.44 | 5.47 ± 0.12 | 12.56 ± 0.33% | 4.02 ± 0.24 | 5.82 ± 0.24 | 13.33 ± 0.69% | 4.24 ± 0.16 | 6.16 ± 0.38 | 12.48 ± 0.36% | |
| ST-ReP | 3.13 ± 0.11 | 4.90 ± 0.23 | 11.15 ± 0.43% | 3.17 ± 0.11 | 5.07 ± 0.43 | 11.27 ± 0.44% | 3.23 ± 0.13 | 5.17 ± 0.39 | 11.51 ± 0.47% | |
| LightST | 3.02 ± 0.02 | 4.91 ± 0.04 | 10.64 ± 0.09% | 3.16 ± 0.03 | 5.15 ± 0.05 | 11.13 ± 0.12% | 3.28 ± 0.03 | 5.37 ± 0.07 | 11.61 ± 0.15% | |
| STDN | 2.89 ± 0.01 | 4.67 ± 0.03 | 10.12 ± 0.13% | 2.96 ± 0.01 | 4.79 ± 0.04 | 10.37 ± 0.16% | 3.05 ± 0.02 | 4.92 ± 0.05 | 10.73 ± 0.22% | |
| ST-SSDL | 3.02 ± 0.08 | 4.90 ± 0.11 | 10.62 ± 0.25% | 3.13 ± 0.11 | 5.07 ± 0.16 | 11.01 ± 0.38% | 3.22 ± 0.13 | 5.21 ± 0.18 | 11.32 ± 0.46% | |
| Hybrid | 3.40 ± 0.05 | 5.23 ± 0.03 | 11.91 ± 0.20% | 3.77 ± 0.12 | 5.67 ± 0.12 | 12.51 ± 0.32% | 3.69 ± 0.03 | 5.59 ± 0.02 | 12.85 ± 0.22% | |
| STFQET | 2.85 ± 0.02 | 4.56 ± 0.05 | 9.78 ± 0.03% | 2.92 ± 0.03 | 4.71 ± 0.03 | 9.86 ± 0.13% | 2.99 ± 0.01 | 4.84 ± 0.05 | 9.94 ± 0.29% | |
| MAE | RMSE | MAPE | |
|---|---|---|---|
| 1 | 2.1315 | 3.2700 | 7.18% |
| 2 | 2.1148 | 3.2534 | 7.16% |
| 3 | 2.0554 | 3.1864 | 7.03% |
| 4 | 2.0677 | 3.1914 | 7.11% |
| 5 | 2.0596 | 3.1918 | 7.02% |
| 6 | 2.0549 | 3.1844 | 7.05% |
| Data | Model | 60 min | 90 min | 120 min | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAPE | MAE | RMSE | MAPE | MAE | RMSE | MAPE | ||
| Q-3335-3840 | GMAN | 2.46 ± 0.05 | 3.67 ± 0.04 | 9.73 ± 0.23% | 2.51 ± 0.04 | 3.74 ± 0.04 | 9.91 ± 0.25% | 2.55 ± 0.05 | 3.79 ± 0.05 | 10.10 ± 0.27% |
| DeepSTUQ | 2.44 ± 0.07 | 3.71 ± 0.09 | 9.72 ± 0.29% | 2.51 ± 0.09 | 3.81 ± 0.14 | 10.05 ± 0.54% | 2.56 ± 0.10 | 3.90 ± 0.17 | 10.26 ± 0.40% | |
| RDAT | 2.71 ± 0.07 | 3.94 ± 0.09 | 10.81 ± 0.28% | 2.85 ± 0.11 | 4.13 ± 0.13 | 11.48 ± 0.43% | 2.97 ± 0.14 | 4.31 ± 0.17 | 12.03 ± 0.51% | |
| STG-NCDE | 2.75 ± 0.21 | 4.12 ± 0.29 | 9.74 ± 0.39% | 2.91 ± 0.30 | 4.38 ± 0.41 | 10.00 ± 0.59% | 3.02 ± 0.34 | 4.57 ± 0.50 | 10.20 ± 0.62% | |
| STWave | 2.72 ± 0.12 | 4.06 ± 0.14 | 10.86 ± 0.49% | 2.88 ± 0.14 | 4.29 ± 0.17 | 11.56 ± 0.54% | 2.99 ± 0.22 | 4.45 ± 0.27 | 12.03 ± 0.90% | |
| STD-PLM | 2.72 ± 0.22 | 4.09 ± 0.30 | 10.61 ± 0.83% | 2.90 ± 0.30 | 4.37 ± 0.41 | 9.59 ± 0.07% | 3.06 ± 0.37 | 4.59 ± 0.51 | 9.80 ± 0.06% | |
| EAC | 2.94 ± 0.06 | 4.33 ± 0.08 | 11.58 ± 0.08% | 3.20 ± 0.06 | 4.71 ± 0.08 | 12.66 ± 0.13% | 3.44 ± 0.08 | 5.05 ± 0.09 | 13.64 ± 0.19% | |
| ST-ReP | 2.54 ± 0.08 | 3.73 ± 0.08 | 10.11 ± 0.32% | 2.56 ± 0.07 | 3.76 ± 0.08 | 10.16 ± 0.28% | 2.62 ± 0.06 | 3.85 ± 0.06 | 10.40 ± 0.22% | |
| LightST | 2.43 ± 0.01 | 3.71 ± 0.02 | 9.61 ± 0.07% | 2.50 ± 0.01 | 3.82 ± 0.02 | 9.92 ± 0.07% | 2.57 ± 0.02 | 3.94 ± 0.02 | 10.26 ± 0.10% | |
| STDN | 2.38 ± 0.01 | 3.61 ± 0.01 | 9.45 ± 0.08% | 2.43 ± 0.00 | 3.70 ± 0.01 | 9.65 ± 0.07% | 2.51 ± 0.01 | 3.81 ± 0.01 | 9.98 ± 0.08% | |
| ST-SSDL | 2.63 ± 0.33 | 4.08 ± 0.65 | 10.20 ± 0.52% | 2.74 ± 0.36 | 4.24 ± 0.70 | 10.64 ± 0.59% | 2.82 ± 0.38 | 4.37 ± 0.72 | 10.95 ± 0.63% | |
| Hybrid | 2.92 ± 0.00 | 4.30 ± 0.01 | 11.35 ± 0.01% | 3.15 ± 0.01 | 4.59 ± 0.02 | 12.30 ± 0.02% | 3.34 ± 0.01 | 4.82 ± 0.03 | 13.06 ± 0.04% | |
| STFQET | 2.36 ± 0.02 | 3.59 ± 0.01 | 9.26 ± 0.03% | 2.40 ± 0.02 | 3.65 ± 0.01 | 9.52 ± 0.09% | 2.46 ± 0.02 | 3.74 ± 0.02 | 9.76 ± 0.09% | |
| Q-4346-2629 | GMAN | 2.56 ± 0.01 | 3.98 ± 0.01 | 9.30 ± 0.06% | 2.62 ± 0.01 | 4.10 ± 0.02 | 9.58 ± 0.08% | 2.68 ± 0.01 | 4.19 ± 0.03 | 9.82 ± 0.10% |
| DeepSTUQ | 2.54 ± 0.01 | 4.03 ± 0.03 | 9.56 ± 0.11% | 2.64 ± 0.01 | 4.20 ± 0.02 | 10.04 ± 0.10% | 2.72 ± 0.01 | 4.30 ± 0.01 | 10.40 ± 0.11% | |
| RDAT | 2.94 ± 0.09 | 4.43 ± 0.13 | 10.94 ± 0.39% | 3.25 ± 0.18 | 4.86 ± 0.22 | 12.22 ± 0.61% | 3.45 ± 0.26 | 5.15 ± 0.31 | 13.09 ± 0.89% | |
| STG-NCDE | 2.98 ± 0.23 | 4.65 ± 0.38 | 11.12 ± 0.91% | 3.22 ± 0.33 | 5.06 ± 0.52 | 10.40 ± 0.46% | 3.40 ± 0.36 | 5.37 ± 0.58 | 11.02 ± 0.45% | |
| STWave | 3.01 ± 2.19 | 4.69 ± 2.59 | 11.19 ± 7.65% | 3.28 ± 2.10 | 5.11 ± 2.42 | 12.47 ± 7.23% | 3.50 ± 1.99 | 5.44 ± 2.27 | 13.60 ± 6.80% | |
| STD-PLM | 2.90 ± 0.27 | 4.54 ± 0.40 | 10.34 ± 0.89% | 3.15 ± 0.38 | 4.94 ± 0.56 | 9.41 ± 0.05% | 3.33 ± 0.47 | 5.21 ± 0.67 | 9.67 ± 0.06% | |
| EAC | 3.22 ± 0.06 | 4.86 ± 0.09 | 12.01 ± 0.23% | 3.57 ± 0.08 | 5.39 ± 0.09 | 13.58 ± 0.18% | 3.85 ± 0.10 | 5.78 ± 0.13 | 14.78 ± 0.25% | |
| ST-ReP | 2.78 ± 0.11 | 4.18 ± 0.16 | 10.18 ± 0.53% | 2.89 ± 0.14 | 4.37 ± 0.19 | 10.67 ± 0.71% | 2.99 ± 0.19 | 4.51 ± 0.23 | 11.08 ± 0.86% | |
| LightST | 2.55 ± 0.02 | 4.01 ± 0.03 | 9.36 ± 0.06% | 2.67 ± 0.02 | 4.22 ± 0.03 | 9.99 ± 0.09% | 2.79 ± 0.03 | 4.41 ± 0.04 | 10.55 ± 0.11% | |
| STDN | 2.55 ± 0.01 | 4.04 ± 0.03 | 9.61 ± 0.16% | 2.63 ± 0.01 | 4.19 ± 0.03 | 10.00 ± 0.13% | 2.73 ± 0.02 | 4.35 ± 0.03 | 10.46 ± 0.08% | |
| ST-SSDL | 2.64 ± 0.06 | 4.15 ± 0.08 | 9.93 ± 0.26% | 2.81 ± 0.10 | 4.45 ± 0.13 | 10.87 ± 0.44% | 2.92 ± 0.12 | 4.62 ± 0.15 | 11.43 ± 0.59% | |
| Hybrid | 3.10 ± 0.01 | 4.74 ± 0.01 | 11.05 ± 0.08% | 3.41 ± 0.02 | 5.20 ± 0.02 | 12.51 ± 0.07% | 3.62 ± 0.02 | 5.48 ± 0.03 | 13.54 ± 0.07% | |
| STFQET | 2.44 ± 0.02 | 3.89 ± 0.05 | 8.89 ± 0.22% | 2.52 ± 0.03 | 4.03 ± 0.04 | 9.28 ± 0.18% | 2.59 ± 0.04 | 4.13 ± 0.04 | 9.59 ± 0.17% | |
| Query Setting | Avg. MAE | Avg. RMSE | Avg. MAPE |
|---|---|---|---|
| full | 2.0554 | 3.1864 | 7.03% |
| zero | 2.1087 | 3.2534 | 7.19% |
| current_only | 2.1194 | 3.2621 | 7.27% |
| temporal_shuffle | 2.1055 | 3.2749 | 7.29% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Zhao, S.; Ta, X. A Spatial–Temporal Transformer with Query Enhancement and Fourier Analysis for Traffic Forecasting. Information 2026, 17, 542. https://doi.org/10.3390/info17060542
Zhao S, Ta X. A Spatial–Temporal Transformer with Query Enhancement and Fourier Analysis for Traffic Forecasting. Information. 2026; 17(6):542. https://doi.org/10.3390/info17060542
Chicago/Turabian StyleZhao, Shufang, and Xuxiang Ta. 2026. "A Spatial–Temporal Transformer with Query Enhancement and Fourier Analysis for Traffic Forecasting" Information 17, no. 6: 542. https://doi.org/10.3390/info17060542
APA StyleZhao, S., & Ta, X. (2026). A Spatial–Temporal Transformer with Query Enhancement and Fourier Analysis for Traffic Forecasting. Information, 17(6), 542. https://doi.org/10.3390/info17060542
