Abstract
Predicting the future routes of logistics workers is a critical task for modern delivery platforms, directly impacting dispatching efficiency and the accuracy of Estimated Time of Arrival (ETA) predictions. While existing deep learning approaches rely on supervised learning, they often suffer from a "training-test mismatch" where models are trained on differentiable loss functions that do not align with real-world evaluation metrics. This paper introduces DRL4Route, a novel framework that casts Pick-up and Delivery Route Prediction (PDRP) as a reinforcement learning problem. By utilizing an Actor-Critic architecture with a Generalized Advantage Estimator (GAE), DRL4Route optimizes directly for non-differentiable metrics like Location Square Deviation (LSD). Experimental results on large-scale real-world datasets demonstrate that DRL4Route significantly outperforms state-of-the-art supervised models in both offline evaluations and online production environments.
Introduction
In the logistics and food delivery sectors, Pick-up and Delivery Route Prediction (PDRP) is the task of forecasting the sequence of tasks a worker will perform given their current location and pending assignments. Accurate predictions are the backbone of efficient logistics; they allow platforms to optimize dispatching and provide customers with reliable delivery windows.
Traditionally, PDRP has been approached through Supervised Learning (SL), where models are trained to minimize Cross-Entropy (CE) loss. However, CE loss treats all prediction errors equally, failing to account for the sequential nature of routes. In practice, being "slightly off" in a sequence is far more acceptable than a total deviation, yet standard SL models struggle to capture this nuance because the relevant evaluation metrics—such as Location Square Deviation (LSD)—are non-differentiable. DRL4Route addresses this gap by treating route generation as a sequential decision process, allowing the model to learn from the metrics that define real-world success.
The DRL4Route Framework
DRL4Route formulates route prediction as a Markov Decision Process (MDP). In this setup, the model (the agent) observes the current state of unfinished tasks and worker context, then sequentially selects the next task to perform.
Architectural Components
- The Actor (Policy Network): The agent utilizes a sequence-to-sequence architecture. A Transformer encoder captures the complex spatial-temporal relationships between pending tasks, while an Attention-based LSTM decoder generates the route step-by-step. This combination allows the model to weigh the importance of different tasks relative to the worker's current trajectory.
- The Critic (Value Network): To stabilize training, a secondary network estimates the expected reward (the "value") of a given state. This helps the actor understand whether a specific routing decision was better or worse than the average expected outcome.
- Generalized Advantage Estimator (GAE): Reinforcement learning in high-dimensional spaces often suffers from high variance. DRL4Route employs GAE to balance bias and variance through a tunable parameter ($\lambda$). This ensures more stable policy gradients and faster convergence during the fine-tuning phase.
Reward Function and Training
Instead of simple binary feedback, the framework uses a reward function based on the LSD of the predicted task's position relative to the ground truth. To avoid the "cold start" problem common in RL, the model is first pre-trained using standard Supervised Learning before being fine-tuned with the RL objective. This two-stage approach ensures the agent begins with a baseline understanding of routing logic before optimizing for specific performance metrics.
Experimental Evaluation
Datasets
The framework was evaluated using two massive, real-world datasets provided by Cainiao Network (Alibaba's logistics arm):
- Logistics-HZ: 90 days of pick-up records from 1,117 workers in Hangzhou (approx. 373,000 samples).
- Logistics-SH: 60 days of records from 2,344 workers in Shanghai (approx. 208,000 samples).
Results
DRL4Route-GAE consistently outperformed both traditional heuristics (Greedy algorithms) and state-of-the-art deep learning models like Graph2Route and DeepRoute.
- Offline Performance: On the Logistics-HZ dataset, the framework achieved a 2.7% improvement in LSD and a 3.2% increase in Accuracy@3 (ACC@3) over the strongest baselines. The use of GAE was particularly effective, with optimal performance observed when $\lambda$ was set between 0.90 and 0.99.
- Online Deployment: During A-B testing in Cainiao's production system, the model demonstrated a 6.1% improvement in LSD and a 6.2% reduction in Mean Absolute Error (MAE) for arrival time estimations. These improvements directly translate to more efficient dispatching and higher customer satisfaction.
Discussion and Conclusion
DRL4Route demonstrates that Reinforcement Learning can serve as a powerful optimizer for sequence generation tasks where traditional loss functions fall short. By providing rewards at each decoding step, the framework mitigates the problem of compounding errors—where a single mistake early in a sequence leads to a completely incorrect route.
While the current framework is optimized for logistics pick-up, future work will explore its application in food delivery, which involves stricter constraints (e.g., pick-up must precede delivery for a specific order). Additionally, the authors aim to refine the reward function to include multi-objective goals such as fuel efficiency and worker fatigue, further bridging the gap between algorithmic prediction and real-world operational excellence.
Summary updated