Learning from Yesterday's Error: An Efficient Online Learning Method for Traffic Demand Prediction
Organizations: Key Laboratory of Road and Traffic Engineering, Ministry of Education at Tongji University, 4800 Cao’an Road, Shanghai, 201804, Shanghai, China · Urban Mobility Institute, Tongji University, 1239 Siping Road, Shanghai, 200092, Shanghai, China
Abstract
Accurately predicting short-term traffic demand is critical for intelligent transportation systems. While deep learning models achieve strong performance under stationary conditions, their accuracy often degrades significantly when faced with distribution shifts caused by external events or evolving urban dynamics. Frequent model retraining to adapt to such changes incurs prohibitive computational costs, especially for large-scale or foundation models. To address this challenge, we propose FORESEE (Forecasting Online with Residual Smoothing and Ensemble Experts), a lightweight online adaptation framework that is accurate, robust, and computationally efficient. FORESEE operates without any parameter updates to the base model. Instead, it corrects today's forecast in each region using yesterday's prediction error, stabilized through exponential smoothing guided by a mixture-of-experts mechanism that adapts to recent error dynamics. Moreover, an adaptive spatiotemporal smoothing component propagates error signals across neighboring regions and time slots, capturing coherent shifts in demand patterns. Extensive experiments on seven real-world datasets with three backbone models demonstrate that FORESEE consistently improves prediction accuracy, maintains robustness even when distribution shifts are minimal (avoiding performance degradation), and achieves the lowest computational overhead among existing online methods. By enabling real-time adaptation of traffic forecasting models with negligible computational cost, FORESEE paves the way for deploying reliable, up-to-date prediction systems in dynamic urban environments. Code and data are available at https://github.com/xiannanhuang/FORESEE
Figures & tables
| Method | Parameters for updating | Updating style |
|---|---|---|
| Onenet ( Wen et al., 2023 ) | Ensemble weights of different models | Exponentiated Gradient Descent and offline reinforcement learning |
| FSNet ( Pham et al., 2023 ) | Parameters in convolutional layers and feature modification weights after convolutional layers | Gradient decent with two-stream exponential moving averaging |
| D3A ( Zhang et al., 2024 ) | Full parameters of the model | 1. Update only when distribution drift happens. 2. Use accumulated and noised data to update the model |
| DSOF ( Lau et al., 2025 ) | Parameters in an student model that maps the output of original model and the input to prediction | Online gradient decent combined with replay buffer |
| Proceed ( Zhao and Shen, 2025 ) | Low-rank scaling coefficients for model parameters | Updating using gradients and estimated concept drifts |
| SOLID ( Chen et al., 2024 ) | Parameters in the final Layer | 1. Update only when distribution drift is detected. 2. using samples with temporal proximity, periodic phase similarity and input similarity to finetune |
| Hyperparameters | Value |
|---|---|
| 10 | |
| 0.01 |
| Dataset | NTCBIKE | NYCTAXI | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | STGCN | GWNET | Opencity | STGCN | GWNET | Opencity | ||||||
| Metrics | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE |
| Ori | 11.043 | 5.142 | 10.492 | 5.168 | 12.909 | 6.912 | 17.188 | 6.713 | 18.623 | 6.575 | 15.964 | 5.763 |
| FSNet | 9.716 | 4.88 | 9.674 | 4.793 | - | - | 11.478 | 4.667 | 11.635 | 4.563 | - | - |
| Onenet | 10.593 | 5.264 | - | - | - | - | 11.618 | 4.879 | - | - | - | - |
| ADCSD | 9.439 | 4.843 | 9.995 | 5.126 | 12.732 | 6.862 | 10.756 | 4.31 | 11.138 | 4.323 | 15.386 | 5.563 |
| Dataset | CHIBIKE | CHITAXI | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | STGCN | GWNET | Opencity | STGCN | GWNET | Opencity | ||||||
| Metrics | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE |
| Ori | 2.605 | 1.337 | 2.527 | 1.309 | 2.826 | 1.706 | 3.389 | 1.386 | 3.449 | 1.362 | 3.832 | 1.46 |
| FSNet | 2.549 | 1.353 | 2.498 | 1.332 | - | - | 3.369 | 1.258 | 3.363 | 1.243 | - | - |
| Onenet | 2.523 | 1.444 | - | - | - | - | 3.318 | 1.746 | - | - | - | - |
| ADCSD | 2.451 | 1.383 | 2.383 | 1.349 | 2.801 | 1.689 | 3.297 | 1.205 | 3.283 | 1.168 | 3.743 | 1.414 |
| Dataset | BOSBIKE | BAYBIKE | TORBIKE | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | STGCN | GWNET | Opencity | STGCN | GWNET | Opencity | STGCN | GWNET | Opencity | |||||||||
| Metrics | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | RMSE | MAE | RMSE | RMSE | MAE | RMSE | RMSE | MAE | RMSE |
| Ori | 2.077 | 1.154 | 2.033 | 1.135 | 2.244 | 1.384 | 3.22 | 1.552 | 3.09 | 1.506 | 2.865 | 1.648 | 2.206 | 1.182 | 2.146 | 1.171 | 2.355 | 1.436 |
| FSNet | 2.024 | 1.158 | 2.001 | 1.131 | - | - | 2.913 | 1.503 | 2.862 | 1.493 | - | - | 2.128 | 1.189 | 2.123 | 1.163 | - | - |
| Onenet | 2.028 | 1.220 | - | - | - | - | 2.796 | 1.557 | - | - | - | - | 2.114 | 1.253 | - | - | ||
| ADCSD | 1.97 | 1.186 | 1.948 | 1.177 | 2.185 | 1.35 | 2.669 | 1.496 | 2.783 | 1.514 | 3.043 | 1.718 | 2.103 | 1.246 | 2.103 | 1.23 | 2.322 | 1.41 |
| Model | STGCN | GWNET | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | Ori | Foresee | Foresee- | Ori | Foresee | Foresee- | ||||||
| Dataset | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE |
| NYCBIKE | 11.0430 | 5.1420 | 9.1480 | 4.4290 | 9.1960 | 4.4460 | 10.4920 | 5.1680 | 9.6560 | 4.7540 | 9.6113 | 4.7672 |
| NYCTAXI | 13.1880 | 6.7130 | 10.3810 | 3.9090 | 10.4440 | 3.9900 | 18.6230 | 6.5750 | 10.5670 | 3.9330 | 10.6139 | 3.9848 |
| CHIBIKE | 2.6050 | 1.3370 | 2.4350 | 1.2980 | 2.5100 | 1.3120 | 2.5270 | 1.3090 | 2.3360 | 1.2680 | 2.4128 | 1.2809 |
| CHITAXI | 3.3890 | 1.3860 | 3.2300 | 1.1940 | 3.2460 | 1.2070 | 3.4490 | 1.3620 | 3.2160 | 1.1610 | 3.2068 | 1.1661 |