InsTraj: Instructing Diffusion Models with Travel Intentions to Generate Real-world Trajectories

Yuanshao Zhu, Yuxuan Liang, Xiangyu Zhao, Liang Han, Xinwei Fang, Xun Zhou, Xuetao Wei, James Jianqiao YuarXiv 2026

TL;DR

InsTraj is a novel framework that allows diffusion models to generate realistic and diverse GPS trajectories directly from natural language instructions. By combining a Large Language Model (LLM) for semantic intent understanding with a Multimodal Trajectory Diffusion Transformer (MT-DiT), it successfully bridges the gap between abstract human travel purposes and physical spatio-temporal paths.

What Problem Does This Paper Address?

Generating realistic, synthetic GPS trajectories is crucial for urban planning, traffic simulation, and privacy-preserving data sharing. However, current generative models suffer from a semantic-spatio-temporal representation gap and a generative control dilemma.

Traditional methods rely on rigid geometric constraints (like origin-destination coordinate pairs) and lack the semantic depth to understand why a person is traveling (e.g., "going shopping after a walk in the park"). Furthermore, when forced to follow complex constraints, existing models either collapse into deterministic routing algorithms—sacrificing the natural diversity of human behavior—or fail to meet the constraints entirely.

Figure 1: Comparison of the proposed InsTraj method with existing trajectory generation or navigation methods. The InsTraj can effectively generate trajectories that are faithful to human travel intentions and exhibit diversity.

Methods

InsTraj tackles these challenges through a three-stage pipeline: Intention Distillation, Intention Encoding, and Intent-Aligned Generation.

Figure 2: Overview of the InsTraj framework. It distills travel intentions from trajectory data, encodes them via LLM into semantic blueprints, and employs MT-DiT with Joint Attention to generate instruction-faithful trajectories.
  1. Intention Distillation: Because paired text-trajectory datasets do not natively exist, the authors built an automated data-generation pipeline. They partition city spaces into grid cells and profile them using Point-of-Interest (POI) data. By analyzing functional transitions (e.g., moving from a Residential to a Commercial zone), they infer the primary travel intent and use GPT-4 to paraphrase these features into diverse, natural language descriptions.
  2. Intention Encoding: Standard LLMs use causal (one-way) attention, which is poorly suited for holistic text encoding. InsTraj leverages LLM2Vec to transform a pre-trained, decoder-only LLM (Meta-Llama-3-8B) into a powerful bidirectional text encoder, producing rich "semantic blueprints."
  3. Intent-Aligned Generation: Instead of using a traditional U-Net backbone, the authors introduce the Multimodal Trajectory Diffusion Transformer (MT-DiT). It tokenizes trajectories into non-overlapping patches and employs a Joint Attention Mechanism that allows bidirectional information flow between text tokens and trajectory tokens. This ensures the generation strictly adheres to the user's intent while preserving the stochastic nature of diffusion.
  4. TrajCLIP Evaluation: To quantitatively measure how well a trajectory matches a text prompt, the authors also introduced TrajCLIP, a twin-encoder model trained via contrastive learning to score trajectory-text alignment.

Datasets

The framework was trained and evaluated using:

  • Taxi-Chengdu & Taxi-Xi'an: Two large-scale, real-world taxi trajectory datasets commonly used as benchmarks in mobility research.
  • OpenStreetMap (OSM): Used to harvest POI data to construct city-wide functional maps for the distillation pipeline.

Key Insights and Ideas

  • Semantics Improve Realism: One of the most striking findings is that incorporating high-level semantic intentions actually improves spatial fidelity compared to purely geometric constraints. Understanding the purpose of a trip helps the model better capture true urban mobility distributions.
  • Bidirectional Fusion is Crucial: Simply appending text embeddings to a diffusion model causes the semantic signal to dilute during the denoising process. Bidirectional joint attention ensures deep, token-level interaction throughout every step of generation.
  • The Patch Size Trade-off: Tokenizing trajectories into patches significantly cuts down sequence length, leading to massive computational savings, though larger patch sizes introduce a slight drop in spatial fine-grained fidelity.

Key Results

  • Spatio-Temporal Fidelity: InsTraj consistently achieved state-of-the-art results on Jensen-Shannon Divergence (JSD) metrics across spatial density, trip distribution, and travel length for both datasets, outperforming strong baselines like ControlTraj and DiffTraj.
  • Instruction Faithfulness: InsTraj outperformed the strongest baseline by a large margin, achieving a +7.5% increase in Start Functional Consistency (FCR-S) and a +7.9% increase in Destination Functional Consistency (FCR-D) on the Chengdu dataset.
  • Efficiency: MT-DiT demonstrated a >2x inference speedup over U-Net-based baselines while maintaining the lowest peak GPU memory footprint.

Limitations and Future Work

The authors acknowledge two primary limitations:

  1. Data Modality Constraints: The evaluation is currently restricted to taxi trajectory datasets, which may not fully capture the distinct behavioral patterns of other mobility modes, such as walking or public transit.
  2. Cross-City Generalization: Achieving zero-shot generalization across different cities remains difficult due to significant topological heterogeneity.

In the future, the team plans to explore incorporating explicit topological priors to decouple trajectory generation from specific city layouts, enhancing the model's flexibility in dynamic environments.

Summary updated

BibTeX
@misc{zhu2026instraj,
  author = {Yuanshao Zhu and Yuxuan Liang and Xiangyu Zhao and Liang Han and Xinwei Fang and Xun Zhou and Xuetao Wei and James Jianqiao Yu},
  title = {{InsTraj: Instructing Diffusion Models with Travel Intentions to Generate Real-world Trajectories}},
  year = {2026},
  eprint = {2604.04106},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.04106},
}
Figure