Researchers Da Wang and Kun Zhang have developed a computational framework designed to predict urban traffic speeds across multiple future time horizons. Published in Discover Artificial Intelligence in November 2026, the study introduces a Spatio-Temporal Graph Transformer, or ST-GT, which integrates fixed road network structures with deep learning attention mechanisms. The model addresses the complexity of traffic forecasting, where speed measurements at one sensor depend on both its own historical data and the conditions of connected road segments. By combining spatial graph aggregation with temporal self-attention, the system aims to capture the non-stationary nature of daily and weekly traffic patterns that traditional statistical methods often fail to represent accurately.
The study utilizes the METR-LA dataset, a benchmark collection of traffic speed observations from 207 loop detectors located along major thoroughfares in Los Angeles County. The data spans a four-month period from March to June 2012, recording average speeds every five minutes. This results in 34,272 temporal steps, which are divided into training, validation, and test sets using a chronological split of approximately 70%, 10%, and 20%, respectively. The dataset includes geographical distances between sensors, allowing for the construction of a spatial graph that represents the physical road network. This fixed topology is derived from the standard adjacency file released with the Diffusion Convolutional Recurrent Neural Network, ensuring that the spatial relationships are grounded in actual road infrastructure rather than learned abstractions.
The architecture of the ST-GT model is built around a single non-autoregressive design that predicts all 12 future steps simultaneously in one forward pass. The input consists of 12 historical five-minute observations, representing a 60-minute window, which are processed through four pre-norm Transformer encoder layers. Each layer uses four attention heads to model temporal dependencies, while spatial information is propagated through the normalized METR-LA graph. The model dimension is set to 96, with a feed-forward dimension of 384 and a dropout rate of 0.1. To account for periodic traffic cycles, the model incorporates sinusoidal encodings for time-of-day and day-of-week, allowing it to recognize that late-night hours are temporally adjacent to early morning hours. This periodic context is added to the projected speed features, enhancing the model’s ability to capture daily and weekly rhythms in traffic flow.
Training the model involved optimizing parameters using the AdamW optimizer with a cosine annealing learning rate schedule. The loss function employed was a masked Huber loss, which excludes invalid sensor readings from the calculation to prevent erroneous data from skewing the results. The training process was conducted on a single NVIDIA Tesla T4 GPU, with the model containing 944,364 trainable parameters. Early stopping was applied based on validation loss, terminating the training process at epoch 49. The entire training sequence required approximately 2.62 hours. Because all neural network results are derived from a single run with a random seed of 42, the study explicitly notes that observed differences in performance are not interpreted as statistically significant, highlighting a limitation in the generalizability of the specific numerical outcomes.
Evaluation of the model’s performance was conducted using mean absolute error, root mean square error, and mean absolute percentage error. A common validity mask was applied to all models and metrics, excluding exact zeros and true speeds at or below 1 mph to ensure internal comparability. At the 15-minute horizon, the Vanilla LSTM baseline achieved the smallest MAE and RMSE, while the ST-GT model recorded slightly larger errors. However, as the forecasting horizon extended to 30 minutes, the comparison became metric-specific, with LSTM maintaining a lower MAE but ST-GT achieving lower RMSE and MAPE. At the 60-minute horizon, the ST-GT model demonstrated the lowest error across all three metrics among the original baselines, with an MAE of 4.094 mph, RMSE of 7.658 mph, and MAPE of 11.406%.
When compared against lightweight graph-based implementations, the ST-GT model showed consistent improvements in mean absolute error. Specifically, the model outperformed DCRNN-lite, Graph WaveNet-lite, and GMAN-lite across all three horizons. At the 60-minute mark, the reductions in MAE compared to these three models were approximately 23.6%, 21.2%, and 19.9%, respectively. These comparisons are intended to support controlled evaluation under specific experimental conditions, where the comparison models are resource-constrained implementations. The study cautions that these results should not be taken as definitive comparisons with all full published implementations, nor as a universal claim of state-of-the-art superiority.
Ablation experiments were conducted to isolate the contributions of individual architectural components. Removing the temporal self-attention mechanism resulted in the largest increase in prediction error, particularly at the 60-minute horizon, where the MAE rose to 4.78 mph. Eliminating time-of-day features also significantly increased error, indicating the importance of periodic context for long-horizon forecasting. Replacing the fixed graph aggregation with a learned graph attention network did not improve performance, suggesting that the predefined road network topology was beneficial in this implementation. Additionally, multi-head attention outperformed single-head attention, confirming the value of parallel attention mechanisms. These findings validate that the model’s accuracy stems from the complementary integration of spatial, temporal, and periodic components rather than any single feature.
The study acknowledges several limitations that constrain the broader applicability of the results. The preprocessing step involved bidirectional interpolation of missing values before the data split, which may introduce limited temporal leakage around split boundaries. The reliance on a single random seed means that uncertainty due to initialization and stochastic optimization is not quantified. Furthermore, the model only uses traffic speed as an input variable, excluding other factors such as volume, occupancy, weather, or calendar events that could influence abrupt congestion. The qualitative prediction traces provided in the study are illustrative and were not selected by a predefined sampling rule, so they do not serve as evidence of general forecasting performance across all sensors or traffic regimes.
Despite these limitations, the research provides a controlled architectural integration that offers insights into the utility of jointly modeling spatial structure and temporal dependencies. The ST-GT framework demonstrates that a direct multi-horizon approach can effectively capture the complex dynamics of urban traffic networks. The fixed graph topology, derived from real-world road distances, proves to be a robust foundation for spatial aggregation, outperforming learned alternatives in this specific context. The inclusion of periodic temporal features further enhances the model’s ability to predict speeds during peak and off-peak hours, addressing the non-stationary nature of traffic data.
Future work in this area should focus on multi-seed evaluations to provide standard deviations and confidence intervals, ensuring that performance differences are statistically robust. Implementing leakage-free causal preprocessing would further strengthen the validity of the training and testing protocols. Benchmarking against full reference implementations under matched protocols would allow for more comprehensive comparisons with existing state-of-the-art models. Additionally, exploring dynamic graph learning and efficient long-context attention mechanisms could improve scalability and adaptability to changing road network conditions. The integration of multimodal traffic inputs, such as weather and incident data, may also enhance the model’s ability to forecast abrupt changes in traffic speed.
The study’s emphasis on controlled component analysis and consistent evaluation protocols provides a clear understanding of which architectural elements contribute most to prediction accuracy.
While the current implementation is limited to a single dataset and a single variable, the underlying principles of combining spatial graph aggregation with temporal attention offer a promising direction for future research.
Subject of Research: Spatio-temporal graph transformer for multi-horizon urban traffic speed forecasting
Article Title: A spatio-temporal graph transformer for multi-horizon urban traffic speed forecasting
Article References: Wang, D., & Zhang, K. (2026). A spatio-temporal graph transformer for multi-horizon urban traffic speed forecasting. Discover Artificial Intelligence, 6(1), Article 1813. https://doi.org/10.1007/s44163-026-02649-3
Image Credits: AI Generated
DOI: 10.1007/s44163-026-02649-3
Keywords: traffic forecasting, graph transformer, spatio-temporal modeling, urban traffic, deep learning, METR-LA dataset, machine learning, transportation systems, spatio-temporal, graph, transformer, multi-horizon
News Source: Blake Davidson. (November 13, 2026). Graph Transformer Model Forecasts Urban Traffic Speeds. Scienmag.



