Skip to main content
QUICK REVIEW

[Paper Review] TESTAM: A Time-Enhanced Spatio-Temporal Attention Model with Mixture of Experts

Hyunwook Lee, Sungahn Ko|arXiv (Cornell University)|Mar 5, 2024
Domain Adaptation and Few-Shot LearningComputer Science3 citations
TL;DR

TESTAM is a Mixture-of-Experts model that dynamically selects among three spatial modeling experts—temporal-only, static graph, and dynamic graph—using a gating network redefined as a classification task to improve traffic forecasting. It achieves state-of-the-art performance on METR-LA, PEMS-BAY, and EXPY-TKY by outperforming 13 existing methods through context-aware, in-situ modeling of recurring and non-recurring traffic patterns.

ABSTRACT

Accurate traffic forecasting is challenging due to the complex dependency on road networks, various types of roads, and the abrupt speed change due to the events. Recent works mainly focus on dynamic spatial modeling with adaptive graph embedding or graph attention having less consideration for temporal characteristics and in-situ modeling. In this paper, we propose a novel deep learning model named TESTAM, which individually models recurring and non-recurring traffic patterns by a mixture-of-experts model with three experts on temporal modeling, spatio-temporal modeling with static graph, and dynamic spatio-temporal dependency modeling with dynamic graph. By introducing different experts and properly routing them, TESTAM could better model various circumstances, including spatially isolated nodes, highly related nodes, and recurring and non-recurring events. For the proper routing, we reformulate a gating problem into a classification problem with pseudo labels. Experimental results on three public traffic network datasets, METR-LA, PEMS-BAY, and EXPY-TKY, demonstrate that TESTAM achieves a better indication and modeling of recurring and non-recurring traffic. We published the official code at https://github.com/HyunWookL/TESTAM

Motivation & Objective

  • To address the challenge of modeling complex, dynamic spatio-temporal dependencies in large road networks with both recurring and non-recurring traffic patterns.
  • To overcome the limitations of static or dynamic graph modeling alone by enabling in-situ selection of the most appropriate spatial modeling method for each traffic condition.
  • To improve routing accuracy in Mixture-of-Experts architectures by reformulating the gating problem as a multi-label classification task with dual loss functions.
  • To enhance model robustness and adaptability in diverse traffic scenarios, including isolated roads and high-traffic events.
  • To demonstrate superior forecasting performance across multiple real-world datasets with varying network scales and dynamics.

Proposed method

  • TESTAM employs a Mixture-of-Experts framework with three distinct experts: one without spatial modeling (temporal-only), one using a learnable static graph, and one using a dynamic graph learned via attention.
  • The gating network selects the optimal expert for each time step based on input traffic conditions and the last hidden state of each expert, using a classification-based routing mechanism.
  • Routing is trained via two loss functions: one to avoid the worst expert choice and another to guide selection toward the best-performing expert, improving routing stability and accuracy.
  • Time-enhanced self-attention is introduced to better capture temporal dynamics, with periodic embeddings to model recurring patterns such as rush hours.
  • The model uses a hybrid graph learning strategy, combining static and dynamic graph representations to balance stability and adaptability.
  • A two-stage training protocol is applied: first, experts are trained independently; then, the gating network is fine-tuned with the dual loss objective to optimize routing decisions.
Figure 1: Overview of TESTAM. Left : The architecture of each expert. Middle : The workflow and routing mechanism of TESTAM. Solid lines indicate forward paths, and the dashed lines represent backward paths. Right : The three spatial modeling methods of TESTAM. The black lines indicate spatial conne
Figure 1: Overview of TESTAM. Left : The architecture of each expert. Middle : The workflow and routing mechanism of TESTAM. Solid lines indicate forward paths, and the dashed lines represent backward paths. Right : The three spatial modeling methods of TESTAM. The black lines indicate spatial conne

Experimental results

Research questions

  • RQ1Can dynamic expert routing based on traffic context improve forecasting accuracy compared to fixed or ensemble-based spatial modeling?
  • RQ2Does reformulating the gating problem as a classification task lead to more stable and accurate routing than standard MoE training?
  • RQ3Is the combination of static and dynamic graph modeling more effective than using either alone in capturing both recurring and non-recurring traffic patterns?
  • RQ4How does the inclusion of time-enhanced attention improve modeling of periodic traffic behaviors?
  • RQ5Does TESTAM generalize well to large-scale, real-world traffic networks with complex topologies?

Key findings

  • TESTAM achieves the best performance across all three benchmark datasets—METR-LA, PEMS-BAY, and EXPY-TKY—outperforming 13 existing methods in MAE, RMSE, and MAPE metrics.
  • On METR-LA, TESTAM achieves 2.93 MAE, 5.95 RMSE, and 7.99% MAPE, surpassing the next-best method by 0.07 MAE and 0.17 RMSE.
  • On PEMS-BAY, TESTAM records 1.53 MAE, 3.47 RMSE, and 3.41% MAPE, showing a 0.03 MAE and 0.10 RMSE improvement over the second-best method.
  • On EXPY-TKY, TESTAM achieves 6.40 MAE, 10.40 RMSE, and 28.67% MAPE, demonstrating strong performance on large-scale, complex road networks.
  • Ablation studies confirm that both routing losses are essential: removing the best-route guidance increases MAE by 0.04 on METR-LA, while removing worst-route avoidance leads to performance degradation.
  • Replacing the identity expert with a GCN-based expert (Replaced setting) results in significantly worse performance than even the worst-route avoidance variant, confirming the value of diverse expert architectures.
Figure 2: Visualization of a recurring pattern in a hard-to-predict road, Road 1349, from Dec 14th to Dec 17th. Road 1349 is a highway entrance located near Tokyo station. The locations of the roads are indicated in Fig. 7 .
Figure 2: Visualization of a recurring pattern in a hard-to-predict road, Road 1349, from Dec 14th to Dec 17th. Road 1349 is a highway entrance located near Tokyo station. The locations of the roads are indicated in Fig. 7 .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.