Colloquium
Is Mamba a Better Choice? - A Comparison of Mamba,MHSA, and LSTM Neural Networks for Individual Next-Location Prediction
By Chanling Wang
Abstract
The next location prediction is a fundamental task in human mobility research and location-based services. However, existing deep learning models—such as Long Short-Term Memory (LSTM) networks and Transformer architectures—face significant challenges in modeling long-range dependencies and scaling efficiently with sequence length. The emerging Mamba architecture, grounded in State Space Models (SSMs), presents a promising alternative due to its linear time complexity and demonstrated capacity to capture long-sequence temporal dependencies effectively. This study presents a comprehensive comparative evaluation of Mamba, an encoder-only Transformer based on Multi-Head Self-Attention (MHSA), and LSTM for the next-location prediction task. Model performance is assessed across three key dimensions: prediction accuracy, computational efficiency, and robustness to domain shifts. To achieve systematic analysis, this study employs two synthetic benchmark datasets with distinct behavioral characteristics. The first dataset is generated based on the Exploration and Preferential Return (EPR) mechanism, simulating highly uncertain exploratory movement behavior; the second is generated based on the Density Transition-EPR (DT-EPR) mechanism, depicting highly regular daily travel patterns. Based on these two benchmark datasets, three next-location prediction networks(Mamba,MHSA, and LSTM) are trained and evaluated for performance. Subsequently, the trained models are tested on a structured causal interventional dataset, which achieves controlled domain transfer of group exploration tendencies by regulating the key parameters of the mechanistic generative simulator, to systematically assess the robustness of the models. The experimental results show that all models perform similarly on the regularity behavior dataset, while MHSA has a slight advantage in scenarios with higher uncertainty. Notably, both MHSA and Mamba significantly out-perform LSTM, with Mamba demonstrating strong competitiveness under various conditions. Model robustness exhibits context-dependent characteristics: when the training data has higher uncertainty, MHSA shows stronger adaptability to changes in exploratory behavior. At the same time, LSTM is more robust when transitioning to regular patterns. Mamba maintains near-optimal prediction accuracy in both scenarios, consistently ranking second, with performance closely following the best network. Additionally, Mamba has a significant advantage in computational efficiency, with higher throughput and lower latency than MHSA and LSTM, especially as the sequence length increases. In conclusion, the model based on Mamba achieves an optimal overall trade-off in the next-location prediction task, and thus can be regarded as a highly competitive framework for future human mobility modeling research and scalable application deployment.
Keywords: Human Mobility; Next Location Prediction; Mamba; Deep Learning; Robustness; Causal Inference.