Introduction
Spatio-temporal graph (STG) forecasting is a critical task in modern urban computing, with applications ranging from traffic management to energy grid optimization. The core challenge lies in capturing complex, long-range dependencies across both spatial and temporal dimensions. While Graph Neural Networks (GNNs) and Recurrent Neural Networks (RNNs) have been the standard, they often fail to model long-term patterns effectively. Transformers offer a solution via self-attention but suffer from quadratic computational complexity, making them difficult to scale for large-scale STGs.
This paper introduces SpoT-Mamba, a novel framework that utilizes the Mamba (Selective State Space) architecture to achieve efficient, long-range dependency modeling with linear scaling. By integrating Mamba blocks into both spatial and temporal processing stages, SpoT-Mamba achieves state-of-the-art performance while maintaining high computational efficiency.
Proposed Methodology
The SpoT-Mamba architecture is designed to replace traditional GNN message passing and heavy Transformer layers with efficient selective state space scans.
Spatial Walk Sequence Embedding
Instead of standard neighborhood aggregation, SpoT-Mamba extracts structural information by generating multi-way walk sequences. Using Depth-First Search (DFS), Breadth-First Search (BFS), and Random Walks (RW), the model samples the graph's local and global structure. These sequences are then processed by bi-directional Mamba blocks. Unlike Transformers, Mamba's recurrent nature allows it to inherently respect the order of these walks, capturing spatial dependencies more effectively.
Temporal Scanning and Integration
The temporal dynamics are modeled by concatenating spatial node embeddings with periodic features (e.g., time-of-day). A selective recurrent scan is performed along the time axis using Mamba blocks. This selection mechanism allows the model to dynamically prioritize relevant historical data, effectively filtering out noise while preserving long-term periodicities. Finally, a spatial Transformer layer integrates global information at each time step, followed by an MLP for the final prediction.
Experimental Evaluation
The model was evaluated on the PEMS04 dataset, a benchmark for highway traffic flow forecasting in California. The dataset consists of 307 sensors recording traffic every 5 minutes over a two-month period.
Key Results
SpoT-Mamba demonstrates superior performance compared to a wide range of baselines, including GNN-based models (GWNet, DCRNN) and attention-based models (STAEformer, GMAN).
As shown in the results table, SpoT-Mamba achieved the best average rank across Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Mean Absolute Percentage Error (MAPE). Notably, it achieved a MAPE of 11.86%, outperforming the highly competitive STAEformer.
Ablation and Efficiency
Ablation studies confirmed that using Mamba for spatial walk scans is more effective than using Transformer encoders, which saw a performance drop (MAPE increased to 12.12%). Furthermore, Mamba's linear complexity provided significant memory advantages; while Transformers encountered Out-of-Memory (OOM) errors at standard batch sizes (32), Mamba remained efficient, highlighting its suitability for long-range spatio-temporal sequences.
Conclusion
SpoT-Mamba represents a significant step forward in STG forecasting by bridging the gap between RNN efficiency and Transformer expressiveness. By leveraging selective state spaces, the model efficiently captures long-range dependencies in both space and time. Future work will explore extending this architecture to heterogeneous graphs and dynamic network structures.
Summary updated