Abstract
Spatial-Temporal Graph (STG) forecasting is critical for urban computing but faces challenges in modeling dynamic, non-stationary data with high computational efficiency. We present STG-Mamba, the first framework to adapt Selective State Space Models (SSSMs) for STG tasks. By integrating a Kalman Filtering Graph Neural Network (KFGN) for noise reduction and a Graph Selective Scan Algorithm within a Spatial-Temporal Selective State Space Module (ST-S3M), STG-Mamba achieves state-of-the-art accuracy with $O(n)$ linear complexity. Experimental results on real-world datasets demonstrate significant improvements in both predictive performance and inference speed compared to traditional Transformer-based models.
Introduction
Spatial-Temporal Graph (STG) data, such as traffic flow, metro ridership, and air quality, is inherently dynamic and heterogeneous. Existing modeling approaches typically rely on Graph Neural Networks (GNNs) or Transformers. While GNNs capture local node relationships, they often fail to model long-term system-level evolution. Conversely, Transformer-based models excel at long-range dependencies but suffer from $O(n^2)$ quadratic complexity, creating a computational bottleneck for large-scale sensor networks.
STG-Mamba addresses these limitations by treating the STG as a physical system evolving through states. It leverages the efficiency of State Space Models to provide a scalable solution for complex urban forecasting.
Methods
The STG-Mamba architecture consists of two primary components designed to handle noise and capture complex spatial-temporal dependencies efficiently.
Kalman Filtering Graph Neural Networks (KFGN)
To mitigate the impact of noisy sensor data, KFGN processes input streams across multiple temporal granularities: recent, periodic, and trend. Grounded in Kalman Filtering statistical theory, the module dynamically weights these streams based on estimated variances. This approach ensures that reliable temporal features are prioritized while filtering out stochastic noise.
Spatial-Temporal Selective State Space Module (ST-S3M)
The core of STG-Mamba is the ST-S3M, which adapts the Selective State Space Model (SSSM) for graph-structured data. Unlike standard SSSMs designed for 1D sequences, the proposed Graph Selective Scan Algorithm integrates dynamic graph adjacency information into the state transition process. This allows the model to focus on relevant latent features across both spatial and temporal dimensions with linear computational complexity.
Experimental Evaluation
The model was evaluated on three benchmark datasets: PeMS04 (traffic speed, 307 nodes), HZMetro (metro flow, 80 nodes), and KnowAir (air quality, 184 cities).
Results and Discussion
STG-Mamba consistently outperformed state-of-the-art baselines, including STGCN, ASTGNN, and STAEformer.
Key findings include:
- Superior Accuracy: STG-Mamba achieved the lowest RMSE and MAE across all datasets, indicating a more precise fit for non-stationary STG data.
- Computational Efficiency: The model demonstrates linear scaling ($O(n)$). On the PeMS04 dataset, it reduced FLOPs by 2.22x compared to STAEformer and improved inference speed by 18% to 26%.
- Robustness: Analysis of "Rush Hour" vs. "Non-Rush Hour" performance showed that STG-Mamba maintains stable accuracy even during periods of extreme volatility.
Conclusion
STG-Mamba represents a significant step forward in efficient spatial-temporal modeling. By combining the statistical rigor of Kalman filtering with the linear-time efficiency of Selective State Space Models, it provides a scalable framework for large-scale urban forecasting. Future work will explore the model's generalizability to other domains like energy grids and investigate methods to improve the interpretability of the underlying SSSM states.
Summary updated