TRACE: Trajectory Recovery with State Propagation Diffusion for Urban Mobility
Authors: Jinming Wang, Hai Wang, Hongkai Wen, Geyong Min, Man Luo
Organizations: University of Exeter Department of Computer Science Exeter, United Kingdom · Jingdong Logistics Beijing, China · University of Warwick Department of Computer Science Coventry, United Kingdom
High-quality GPS trajectories are essential for location-based web services and smart city applications, including navigation, ride-sharing and delivery. However, due to low sampling rates and limited infrastructure coverage during data collection, real-world trajectories are often sparse and feature unevenly distributed location points. Recovering these trajectories into dense and continuous forms is essential but challenging, given their complex and irregular spatio-temporal patterns. In this paper, we introduce a novel diffusion model for trajectory recovery named TRACE, which reconstruct dense and continuous trajectories from sparse and incomplete inputs. At the core of TRACE, we propose a State Propagation Diffusion Model (SPDM), which integrates a novel memory mechanism, so that during the denoising process, TRACE can retain and leverage intermediate results from previous steps to effectively reconstruct those hard-to-recover trajectory segments. Extensive experiments on multiple real-world datasets show that TRACE outperforms the state-of-the-art, offering >26% accuracy improvement without significant inference overhead. Our work strengthens the foundation for mobile and web-connected location services, advancing the quality and fairness of data-driven urban applications. Code is available at: https://github.com/JinmingWang/TRACE
Figures & tables
Figure 1. The trajectories collected from mobile edge devices are usually irregular and sparse, which fail to precisely describe the behavior of moving agents, thus cannot be used in data-driven applications. Irregular and sparse trajectories cannot be used in downstream data-driven applications, such as route planning, traffic managing, logistics and delivery applications.
Figure 2. TRACE Framework. (a) Merge querying timestamps into observed timestamps in chronological order. (b) Initialize missing points with Gaussian noise. (c) Prior knowledge are included to explicitly tell the model where to recover. (d) The embedding of multi-modal contextual information. (e) The denoising process with SPDM that generates the dense trajectory. TRACE first embeds all contextual data, then aggregate them into a single input tensor, finally underwent denoising process, which produces the dense and regular trajectory.
Figure 3. The architecture of the modified UNet (upper, red) and the proposed MCGRU (lower, green). In the proposed UNet architecture, each UNet stage takes state features as an additional input, then produces the processed state features, which serve as the input for the next denoising step.
Figure 4. Three ways of batch management. Top: Shared t among all samples in a batch. Middle: Different t for each sample with little offset. Bottom: Uniformly distributed t over the range [1,T] . A single data sample (trajectory) will be used many times consecutively, if we load the entire batch of data with the same t, the model training become unstable. In contrast, try to make t evenly distribution among data samples in a batch is better.
Metric
Method
Dataset
Xi’an
Chengdu
Logistics
MSE ↓
DeepMove
5.297
26.857
30.060
( ×10−3 )
AttnMove
0.068
0.234
3.201
PriSTI
0.019
0.292
2.206
DT + RP
0.326
6.919
4.250
TRACE w/o SPDM
0.017
0.202
2.025
Table 1. The overall comparisons of six models with three metrics on three dataset. The trajectory length is 512 points, with 50% GPS points erased and the models are asked to recover the erased points.
Figure 5. The trend of recovery errors as the trajectory gets more irregular in terms of spatial and temporal distributions. There are breaks in y-axis because the magnitude of MSE differs a lot for different methods. Tested on Xi’an with 70% points erased and trajectory length of 512 points. The proposed model shows the best scalability as the trajectory gets more irregular in terms of spatial and temporal distributions.
Figure 6. The comparison among sparsity levels and trajectory lengths. The proposed model (with SPDM) shows the best robustness across different trajectory lengths and sparsity levels.
Method
Steps
Time
MSE
NDTW
MAE
(s)
×10−3
×10−3
×10−3
500
119.176
0.0432
2.01
3.068
DDIM
51
12.36
0.0349
2.868
2.221
26
6.65
0.0351
2.897
2.239
11
3.18
0.0490
3.083
2.365
DDIM
500
129.57
0.0356
2.750
2.502
Table 2. The comparison of recovery time and quality with and without state propagation pipeline. Tested on Xi’an with 70% points erased and trajectory length of 512 points.
Method
Parameters
MACs
FLOPs
TRACE
6.28M
1.13G
2.28G
TRACE w/o SPDM
6.17M
0.99G
2.01G
DT + RP
9.10M
0.63G
1.27G
PriSTI
7.32M
3.24G
6.51G
AttnMove
8.15M
3.94G
7.92G
DeepMove
10.11M
1.94G
9.93G
Table 3. The number of parameters, multiply-accumulate operations (MACs), and floating point operations (FLOPs) of all methods.
Figure 7. The comparisons among: (a) Number of denoising steps included in single training iteration. (b) Three ways of batch managing introduced in Fig 4 . Tested on Xi’an with 70% points erased and trajectory length of 512 points. The number of denoising steps included in a single training iteration has very little effect on final performance. While the proposed batch management algorithm is necessary for a stable training and significantly reduces loss.
Average Speed
Moving Distance
(m/s)
(km)
Ground Truth
1
1
Sparse Traj
0.6180
0.5788
Recovered Traj
0.8252
0.8480
Table 4. The moving speed and distance estimations computed from trajectories after normalization.
Figure 8. The dataset of: (a) Dense trajectories as ground truth. (b) Trajectories with the same sparsity as usual logistics scenario. (c) Recovered trajectories using TRACE. The trajectories recovered by the proposed method makes sparse trajectory usable, and looks similar to ground truth.
The importance of mobile phone GPS trajectory data is widely recognized across many fields, yet the use of real data is often hindered by privacy concerns, limited accessibility, and high acquisition costs. As a result, generating pseudo-GPS trajectory data has become an active area of research. Recent diffusion-based approaches have achieved strong fidelity but remain limited in spatial scale (small urban areas), transportation-mode diversity, and efficiency (requiring numerous sampling steps). To address these challenges, we introduce TrajFlow, which to the best of our knowledge is the first flow-matching-based generative model for GPS trajectory generation. TrajFlow leverages the flow-matching paradigm to improve robustness and efficiency across multiple geospatial scales, and incorporates a trajectory harmonization and reconstruction strategy to jointly address scalability, diversity, and efficiency. Using a nationwide mobile phone GPS dataset with millions of trajectories across Japan, we show that TrajFlow or its variants consistently outperform diffusion-based and deep generative baselines at urban, metropolitan, and nationwide levels. As the first nationwide, multi-scale GPS trajectory generation model, TrajFlow demonstrates strong potential to support inter-region urban planning, traffic management, and disaster response, thereby advancing the resilience and intelligence of future mobility systems.
Peiran Li, Jiawei Wang, Haoran Zhang +4
Hitotsubashi University · The University of Tokyo · LocationMind Inc. +1
Generating high-fidelity synthetic GPS trajectories is increasingly important for applications in transportation, urban planning, and what-if scenario simulation, especially as privacy concerns limit access to real-world mobility data. Existing trajectory generation models face a trade-off between efficiency and faithfulness to road network topology: continuous-space methods enable fast generation but ignore the road network, while topology-aware approaches rely on search-based autoregressive decoding that limits generation speed. We propose TrajDLM, a topology-aware trajectory generation framework based on block diffusion language models that bridges this gap. TrajDLM models trajectories as sequences of discrete road segments, combining a block diffusion backbone for efficient denoising, topology-aware embeddings from a road network encoder, and topology-constrained sampling to ensure coherent and realistic trajectories. Across three city-scale datasets, TrajDLM achieves strong performance on fine-grained local similarity metrics while being up to 2.8× faster than prior work, and demonstrates strong zero-shot transfer across domains, including unseen transportation modes. These results highlight the effectiveness of block-wise discrete diffusion as a scalable approach to accurate and efficient trajectory generation. Our code is available at https://github.com/cruiseresearchgroup/TrajDLM/
Wilson Wongso, Lihuan Li, Arian Prabowo +4
University of New South Wales · Hong Kong University of Science and Technology (Guangzhou)
Urban trajectories play a crucial role in modeling urban dynamics and supporting various smart city applications. However, privacy concerns restrict access to large-scale and high-quality trajectory datasets. Trajectory generation provides a promising alternative by synthesizing realistic data to mitigate privacy risks. However, existing methods fail to explicitly capture travel patterns and can only generate fixed-length trajectories under a single condition. To address these limitations, we propose HTP, which Hierarchically generates Travel patterns first and then generates GPS Points by using large language models (LLMs), rather than directly generating GPS points. We first design a trajectory-specific residual quantization variational autoencoder (RQ-VAE) that quantizes micro-level GPS trajectories into compact, macro-level travel pattern tokens in a coarse-to-fine manner. These tokens capture rich segment spatial irregularities, such as point density variations caused by traffic conditions. Then, we extend the LLM vocabulary with travel pattern tokens to align trajectory representations with the LLM input, and apply supervised fine-tuning (SFT) to align the LLM with the trajectory generation task, enabling generation of travel pattern sequences under various conditions. Extensive experiments on two real-world datasets show that HTP outperforms the strongest baseline by an average of 29.78% in terms of generation quality. Our code is available at https://github.com/slzhou-xy/HTP.
Silin Zhou, Chenhao Wang, Yuntao Wen +3
University of Electronic Science and Technology of China Chengdu, China · King Abdullah University of Science and Technology Thuwal, Saudi Arabia