Beyond Sunny Skies: Using Large Language Models to Predict Urban Traffic in Adverse Weather
Authors: Zhu Xiao, Kuan Feng, Tong Li, Chenxi Liu, Gang Wang, Zhuo Tang, Kenli Li
Organizations: College of Computer Science and Electronic Engineering, the Ministry of Education Key Laboratory of “Fusion Computing of Supercomputing and Artificial Intelligence”, Hunan University, Changsha 410082, China. · Hong Kong Institute of Science & Innovation, Chinese Academy of Sciences, Hong Kong. · CETC Key Laboratory of Aerospace Information Applications, Shijiazhuang, China.
Urban traffic flow prediction is a cornerstone of intelligent transportation systems, yet accurate forecasting under adverse weather conditions remains a significant challenge. Existing data-driven models, while effective for routine patterns, often struggle with the sparse data and complex non-linear shifts associated with rare meteorological events. These methods typically treat environmental contexts as shallow numerical features, failing to capture the underlying semantic reasoning-why and how specific adverse conditions alter mobility behaviors across regions with different functional compositions. To address this limitation, we propose Multi-STG, a unified framework that integrates Large Language Model (LLM)-derived semantic priors with graph-based spatiotemporal learning. Multi-STG introduces an LLM-empowered semantic enhancement module that transforms comprehensive context descriptions such as weather, POIs, and holidays into high-level semantic embeddings, effectively providing a knowledge-driven complement to data scarcity. Furthermore, we design a multimodal attentional fusion mechanism to dynamically weigh heterogeneous inputs and a semantic-enhanced prediction head with gated residual calibration to robustly adjust forecasts based on semantic guidance. Extensive experiments on real-world multi-city private car datasets demonstrate that Multi-STG outperforms state-of-the-art baselines, reducing MAE by 11.82% on average relative to the strongest baseline across three cities, while maintaining stable performance under sparse and non-stationary conditions.
Figures & tables
Fig. 1: Statistical analysis of traffic trajectory volume, weather conditions, and holiday events in Xi’an, illustrating the correlation between traffic flow fluctuations and external environmental factors.
POI Category
Low
High
Diff.
Commercial Services
−1.77
−1.19
+0.58
Cultural & Entertainment
−1.55
−1.64
−0.08
Tourism & Travel
−1.19
−1.80
−0.61
Transportation Facilities
−1.19
−2.22
−1.04
Residential & Office
−1.97
−1.13
+0.84
TABLE I: Precipitation sensitivity by POI composition in Xi’an, measured as the percentage change in daily flow per millimeter after accounting for weekday and holiday effects. Low and High denote the bottom and top terciles of each POI category’s regional share. Diff. denotes High minus Low.
Fig. 2: Overview of the proposed Multi-STG framework. The architecture consists of four key components: (1) Regional Feature Modeling for grid-based region partitioning and initial spatiotemporal encoding; (2) LLM-Empowered Semantic Enhancement for inferring traffic impacts from external contexts (weather, holidays); (3) Multimodal Attentional Fusion for dynamically integrating traffic, semantic, and POI features; and (4) a Graph Transformer Module that combines learned graph propagation with spatial and temporal attention, culminating in a semantic-enhanced residual prediction.
Fig. 3: Example of inferring traffic flow influence using a pre-trained LLM. The prompt is structured with task instruction, contextual factors (weather and holiday), and regional POI composition. The LLM generates a semantic reasoning response and outputs an 8-dimensional influence vector with entries in [−1,1] indicating the intensity of traffic flow variation.
Fig. 4: Graph Transformer architecture with adaptive graph propagation and gated fusion of representations at zero and one hop, spatial and temporal attention, and a semantic residual prediction head for contextual calibration.
City
#Trips
#Vehicles
#Events
Modeling Period
Longitude Range
Latitude Range
Grid
#Regions
Xi’an
1,024,825
18,695
1,743,732
2023/12/01–2024/05/24
108.85 – 109.05∘E
34.15 – 34.35∘N
12×10
120
Shenyang
1,294,948
13,803
2,305,984
2023/12/01–2024/05/24
123.32 – 123.52∘E
41.64 – 41.94∘N
17×9
153
Urumqi
519,226
6,429
767,107
2023/12/01–2024/05/24
87.55 – 87.65∘E
43.75 – 43.85∘N
6×5
30
TABLE II: Statistics of the private vehicle trip dataset. #Trips denotes deduplicated trips with at least one endpoint within the city and modeling period. #Events counts eligible departures and arrivals, with two events when both endpoints qualify. #Vehicles denotes unique vehicles in the selected trips.
Attribute
Description
Attribute
Description
RecID
Unique trip record identifier
StartLon
Longitude of the trip origin
ObjectID
Unique vehicle identifier
StartLat
Latitude of the trip origin
StartTime
Trip start timestamp
StopLon
Longitude of the trip destination
StopTime
Trip end timestamp
StopLat
Latitude of the trip destination
TABLE III: Attributes of the private vehicle trip dataset.
Groups destinations associated with commercial and service activities, encompassing routine visits, discretionary travel, and essential medical trips.
Cultural & Entertainment
Leisure, Education, Sports, Culture
Combines destinations for educational, cultural, sporting, and leisure activities, with travel demand shaped by activity schedules, weather conditions, and holidays.
Tourism & Travel
Scenic Spots, Hotels, Lodging
Groups tourist attractions and accommodation facilities associated with visitor activity, holiday travel, and movement between regions.
Transportation Facilities
Transportation Hubs, including Stations, Airports, and Ports
Represents mobility terminals connecting local and regional travel, with demand influenced by transport schedules and holiday travel patterns.
Residential & Office
Residential, Business, Office Areas
Captures residential origins and workplace destinations that structure routine commuting and recurring travel between regions.
TABLE IV: POI category aggregation and functional rationale.
Model
Xi’an
Shenyang
Urumqi
MAE
RMSE
WAPE (%)
R 2
MAE
RMSE
WAPE (%)
R 2
MAE
RMSE
WAPE (%)
R 2
DSTAGNN
0.8386
1.3001
25.58
0.8725
0.8962
1.4237
25.45
0.9079
1.2280
1.9650
20.35
0.9277
STGCN
0.8425
1.3407
25.70
0.8644
0.8936
1.4763
25.37
0.9009
1.1732
1.9935
19.44
0.9256
GWaveNet
0.9131
1.4512
27.85
0.8411
0.9498
1.5739
26.97
0.8874
1.2415
2.0970
20.57
0.9176
SARAF
0.8798
1.3426
26.84
0.8640
0.9013
1.4336
25.59
0.9066
1.1827
1.9098
19.60
0.9317
LSTM
0.8936
1.4197
27.26
0.8479
0.9324
1.5417
26.47
0.8920
1.2011
2.0200
19.90
0.9236
TABLE V: Forecasting performance across three cities. Best and second best results are shown in bold and underlined, respectively. Improv. reports percentage reductions in MAE, RMSE, and WAPE and absolute gains in R2 relative to the strongest baseline for each city and metric.
Fig. 5: Sensitivity of the residual weight λ in the Semantic-Enhanced Prediction Head across three cities.
Fig. 6: Sensitivity analysis over historical length (seq_len) and prediction length (pred_len).
Fig. 7: Sensitivity analysis of training data volume on model performance. Left: MAE and RMSE; right: R2 and WAPE.
Fig. 8: Cross-city generalization. (a) Multi-STG. (b) DSTAGNN. Each subfigure reports MAE, RMSE, WAPE, and R2 . Within each heatmap, rows denote source cities and columns denote target cities; XA, SY, and UR denote Xi’an, Shenyang, and Urumqi, respectively. Colors are normalized per metric across both methods, and darker indicates better performance. The diagonal corresponds to in-city evaluation.