TrajDLM: Topology-Aware Block Diffusion Language Model for Trajectory Generation

Wilson Wongso, Lihuan Li, Arian Prabowo, Xiachong Lin, Baiyu Chen, Hao Xue, Flora D. SalimarXiv 2026 · arXiv

TL;DR

TrajDLM is a new trajectory generation framework that uses block-wise discrete diffusion to bridge the gap between generation speed and road network faithfulness. By combining graph-based road embeddings with constrained sampling, it produces realistic, city-scale synthetic mobility data up to 2.8x faster than previous topology-aware methods.

What Problem Does This Paper Address?

High-fidelity synthetic GPS trajectories are essential for urban planning, traffic forecasting, and "what-if" simulations, especially as privacy regulations make real-world mobility data harder to access. However, researchers have faced a frustrating trade-off:

  1. Continuous-space models (like DiffTraj) are fast because they generate coordinates in parallel, but they often ignore road network topology, producing "off-road" paths or physically impossible jumps.
  2. Topology-aware models (like HOSER) are much more realistic because they treat trajectories as sequences of road segments, but they rely on slow, search-based autoregressive decoding that makes generating millions of trajectories computationally expensive.

The authors of TrajDLM aim to provide the best of both worlds: the efficiency of parallel generation with the structural integrity of a road-network-aware model.

Methods

TrajDLM represents trajectories as sequences of discrete road segment tokens and employs a Block Discrete Denoising Diffusion Language Model (BD3-LM). The architecture consists of three main pillars:

  • Block Diffusion Backbone: Unlike standard autoregressive models that generate one token at a time, TrajDLM generates "blocks" of road segments. Within each block, tokens are denoised in parallel, significantly boosting generation speed.
  • Road Network Encoder (RNE): To give the model a sense of geography, the authors use a Graph Attention Network (GATv2) to encode road segments (nodes) and their intersections (edges). These topology-aware embeddings are injected into the Large Language Model (LLM) backbone, replacing standard text embeddings.
  • Topology-Constrained Sampling (TCS): During the reverse diffusion process, the model applies an "adjacency penalty." This ensures that the next predicted road segment is physically connected to the previous one in the real-world road graph. It also includes a destination-aware termination mechanism to ensure trajectories end where they are supposed to.
Figure 1: Proposed TrajDLM architecture. TrajDLM consists of a Block Diffusion Language Model backbone, a Road Network Encoder for topology-aware road embeddings, and a Topology- Constrained Sampling strategy for valid trajectory generation via block-wise denoising.

Datasets

The model was trained and evaluated on three major city-scale GPS datasets:

  • Beijing (Taxi data)
  • Porto (Taxi data)
  • San Francisco (Taxi data)

For cross-domain evaluation, the authors used the GeoLife dataset, which includes various transportation modes (walking, biking, bus) in Beijing, to test how well the model generalizes to unseen movement patterns.

Key Insights and Ideas

  • Discrete Diffusion for Mobility: The "aha moment" here is applying discrete diffusion—typically used for text—to road segments. This allows the model to refine a trajectory iteratively while maintaining the efficiency of intra-block parallelism.
  • Inductive Bias via GNNs: Rather than hoping the LLM learns the city's layout from sequences alone, the RNE explicitly injects the road graph's structure. The ablation studies showed that removing this graph information significantly degrades performance.
  • Zero-Shot Transferability: Surprisingly, a model trained only on taxi data can effectively generate walking or biking trajectories in a zero-shot setting. This suggests TrajDLM captures fundamental "local" mobility patterns that transcend specific transportation modes.

Key Results

  • Efficiency: TrajDLM is up to 2.8x faster than HOSER, the previous state-of-the-art topology-aware model.
  • Fidelity: It achieved the best performance on 8 out of 15 metrics across the three cities. It particularly excelled in local similarity metrics like Dynamic Time Warping (DTW) and Hausdorff distance, which measure how closely the shape of the generated path matches real-world routes.
  • Qualitative Realism: Heatmap visualizations show that TrajDLM's generated trajectories align closely with real-world traffic density, whereas continuous-space models like DiffTraj tend to produce more "scattered" and unrealistic distributions.
Figure 3: Heatmap visualizations of generated trajectories in Beijing. Additional visualiza- tions are provided in Appendix G.

Limitations and Future Work

While TrajDLM is a significant step forward, the authors note a few hurdles:

  • Map-Matching Dependency: The model requires raw GPS data to be pre-processed into road segments (map-matching). This adds a pre-processing step and means the model's quality is partially tied to the accuracy of the map-matching algorithm used.
  • Vocabulary Scaling: For massive metropolitan areas (like Sydney, with >200k road segments), the number of unique "tokens" might exceed the vocabulary limits of current LLM backbones.
  • Temporal Modeling: Currently, TrajDLM focuses on the spatial sequence of roads. It does not explicitly model the time spent on each segment, which is a crucial next step for full spatio-temporal simulation.

Summary updated

Abstract

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\times$ 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/
BibTeX
@misc{wongso2026trajdlm,
  author = {Wilson Wongso and Lihuan Li and Arian Prabowo and Xiachong Lin and Baiyu Chen and Hao Xue and Flora D. Salim},
  title = {{TrajDLM: Topology-Aware Block Diffusion Language Model for Trajectory Generation}},
  year = {2026},
  eprint = {2605.10020},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.10020},
}

Loading related content...

Figure