Abstract Existing traffic flow prediction models struggle to adequately capture spatiotemporal features and efficiently model long-term trends, particularly on multi-node sparse road networks. To address these limitations, we propose AmTGBiM, a long-term traffic flow prediction model that integrates an adaptive masked spatial Transformer (AMST), a dynamic graph attention network (GATv2), a dynamic gated mechanism, and a bidirectional Mamba with learnable weights (Bi-W-Mamba). First, AMST captures long-range spatial dependencies in traffic networks. Its attention mask merges a multi-hop adjacency matrix with node importance information, enabling the joint modeling of local topology and global long-range dependencies. This design improves spatiotemporal feature extraction accuracy while reducing computational overhead. Second, GATv2 excavates local heterogeneity and nonuniform node connectivity on road networks. The representations from GATv2 and AMST are then adaptively fused via the dynamic gated mechanism, further improving spatial modeling accuracy. Finally, Bi-W-Mamba models temporal dependencies through forward and backward branches to encode temporal sequences in reverse directions, where trainable weights balance two branches’ contributions. This architecture enhances the accuracy and stability of long-term traffic flow prediction. Experimental results demonstrate that AmTGBiM outperforms nine state-of-the-art baseline models in prediction accuracy, while maintaining low memory consumption and high computational efficiency. Such superiority is particularly prominent for long-term traffic flow prediction on sparse road networks. The source code is publicly available at https://github.com/mzw-coder/AmTGBiM .
Xu et al. (Sat,) studied this question.