Abstract
Predicting passenger mobility is a cornerstone for the efficiency of ride-hailing platforms. Traditional models often overlook the directional nature of traffic or struggle with the inherent sparsity of urban trip data. This paper presents Gallat (Graph prediction with all attention), a novel framework that treats city traffic as a Dynamic, Directed, and Weighted (DDW) graph. Gallat utilizes a tripartite attention mechanism—spatial, temporal, and transferring—to learn robust representations of regional demand and origin-destination (OD) flows. Evaluations on large-scale datasets from Beijing and Shanghai show that Gallat consistently outperforms existing state-of-the-art spatiotemporal models.
Introduction: The Challenge of Urban Mobility
For ride-hailing platforms, the ability to anticipate demand allows for proactive driver dispatching, which minimizes passenger wait times and maximizes driver utility. However, modeling urban mobility is challenging due to two primary factors:
- Directional Semantics: Traffic flows are inherently asymmetric. Morning commutes from residential to business districts differ fundamentally from evening returns. Treating these relationships as simple undirected links loses critical semantic information.
- Data Sparsity: Many urban regions, particularly in the suburbs or during off-peak hours, have very few recorded trips. Standard Graph Neural Networks (GNNs) often fail to learn meaningful patterns when edges are sparse or weights are negligible.
As shown in the neighbor distribution analysis, the connectivity of the urban graph is highly dynamic and often sparse, necessitating a model that can adapt to varying densities of information.
Methodology: The Gallat Framework
Gallat addresses these challenges by modeling the city as a DDW graph and processing it through three specialized attention layers.
1. Spatial Attention Layer
Gallat distinguishes between three types of regional relationships: Forward neighbors (destinations), Backward neighbors (origins), and Geographical neighbors (physical proximity). By using "pre-weighted functions" based on historical trip intensity and distance, the model incorporates prior knowledge to stabilize learning in data-sparse regions.
2. Temporal Attention Layer
To capture the periodic nature of traffic, Gallat employs a multi-channel temporal attention mechanism. It analyzes snapshots from the same time slots on previous days alongside immediately preceding intervals. Scaled dot-product attention is used to dynamically weigh the relevance of these historical states.
3. Transferring Attention Layer
The final prediction is a two-stage process. Gallat first predicts the total outbound demand for a region. It then applies a transferring attention mechanism to calculate the probability of that demand being distributed to specific destination regions, effectively solving the complex OD flow prediction task.
Experimental Results
The model was rigorously tested on Didi datasets from Beijing and Shanghai, each partitioned into 400 grids with 1-hour granularity.
- Accuracy: Gallat achieved significant improvements over baselines like LSTNet and GCRN. In the Beijing OD prediction task, Gallat recorded a MAPE-0 of 0.7283, a substantial lead over the next best model's 0.8347.
- Interpretability: Visualization of the learned embeddings confirmed that the model successfully identifies functional zones, such as residential clusters and business districts, based on their unique inflow and outflow signatures.
- Pretraining Benefit: A key finding was that pretraining the model on the simpler task of predicting total regional demand significantly accelerated convergence and improved the accuracy of the more complex OD flow predictions.
Conclusion
Gallat demonstrates that modeling traffic as a Dynamic, Directed, and Weighted graph provides a more accurate representation of urban mobility than traditional methods. By leveraging multi-layered attention and pre-weighted spatial priors, it effectively overcomes the hurdles of data sparsity and directional complexity. Future work may involve extending the model to irregular road networks and incorporating external variables like weather and public events to further enhance predictive precision.
Summary updated