NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

GTR: A General, Multi-View, and Dynamic Framework for Trajectory Representation Learning

Xiangheng Wang, Ziquan Fang, Chenglong Huang, Danlei Hu, Lu Chen, Yunjun Gao

TL;DR

GTR is a novel framework for trajectory representation learning that bridges the gap between "free-space" and "road-network" perspectives. By using a multi-view encoder and a dynamic spatio-temporal mixture of experts, it creates versatile embeddings that outperform 15 state-of-the-art methods across six different trajectory analysis tasks, while supporting efficient online updates for streaming data.

What Problem Does This Paper Address?

As GPS-enabled devices become ubiquitous, we are drowning in trajectory data. To make this data useful for AI, we must transform raw sequences of coordinates into compact, low-dimensional vectors (embeddings). However, existing methods suffer from three major "blind spots":

  1. Single-View Limitation: Most models look at a trajectory either as a sequence of points in "free space" (ignoring roads) or as a path on a road network (ignoring the surrounding context like parks or shopping malls). This misses the complex interplay between geography and topology.
  2. Task-Specific Rigidity: Many models are "one-trick ponies," trained for a specific task like travel time estimation. They struggle to generalize to other tasks like trajectory similarity or classification.
  3. Static Nature: Real-world traffic and movement patterns change constantly. Most models require expensive full retraining to stay current, making them poorly suited for dynamic, streaming environments.
Multi-view representation of a trajectory

Methods

To address these limitations, the authors introduce GTR (General, Multi-View, and Dynamic Trajectory Representation), which consists of three core components:

The GTR Framework Architecture
  • Multi-View Encoder (MVE): This module extracts features from four distinct angles:
  • Road Embedding: Uses Graph Attention Networks (GAT) to capture road topology.
  • Grid Embedding: Incorporates Point of Interest (POI) data to understand the "flavor" of a region.
  • Position & Time: Uses sine/cosine functions and multi-granularity temporal vectors (minutes, weeks, years) to anchor the movement in space and time.
  • Spatio-Temporal Fusion Pre-training (STP): To make the model generalizable, GTR uses a Spatio-Temporal Mixture of Experts (ST-MoE). A gating network dynamically weighs spatial vs. temporal features based on the specific downstream task. Pre-training involves a "span masking" technique (masking chunks of a path rather than single points) and a triplet loss to ensure similar trajectories stay close in the embedding space.
  • Online Frozen-hot Updating (OFU): To handle new data without full retraining, GTR employs a "frozen-hot" strategy. It freezes the lower layers of the Transformer (preserving historical knowledge) and only updates the upper layers with new data. This is mathematically grounded in Lyapunov stability to ensure the model remains robust during updates.

Datasets

The framework was evaluated on massive, real-world GPS datasets:

  • Porto: ~774,000 trajectories from taxi services in Porto, Portugal.
  • Beijing: ~889,000 trajectories from Beijing, China.
  • Chengdu: A larger dataset (~2.1 million trajectories) was used in the appendix to test the model's scalability.

Key Insights and Ideas

  • The "Chameleon" Effect: Different tasks prioritize different features. For example, Travel Time Estimation (TTE) cares deeply about temporal patterns, while Trajectory Similarity cares more about spatial overlap. The ST-MoE allows GTR to "shift its weight" between these experts automatically.
  • Span Masking is Essential: Because road segments are highly correlated, masking a single point is too easy for a model to "cheat" and predict. Masking entire sub-trajectories forces the model to learn the underlying global structure of movement.
  • Context Matters: By integrating POI data into grid embeddings, the model learns why a person might be in a certain area (e.g., a residential zone vs. a commercial hub), which significantly improves semantic tasks like trajectory classification.

Key Results

GTR was tested against 15 state-of-the-art baselines (including START, JGRM, and LightPath) across six tasks:

  1. Similarity Search: Achieved near-perfect Mean Rank (1.01) on the Beijing dataset.
  2. Imputation: Improved accuracy by 15%–60% over baselines when recovering missing parts of a path.
  3. Travel Time Estimation (TTE): Reduced error rates by 10%–90% compared to existing general-purpose models.
  4. Classification & Generation: Consistently outperformed specialized models in identifying transportation modes and generating realistic paths.
  5. Online Updates: The "GTR" (updated version) often performed better* than the static version, proving that the online updating strategy effectively captures evolving traffic patterns without losing historical accuracy.

Limitations and Future Work

  • Model Complexity: GTR is a heavy-hitter. With a parameter size of ~863 MB, it is significantly larger than some lightweight baselines (like LightPath at ~74 MB). This leads to longer pre-training times.
  • Inference Latency: While competitive, its inference time is slightly higher than the fastest specialized models due to the multi-view architecture.
  • Future Directions: The authors suggest exploring the integration of Large Language Models (LLMs) to further enhance the semantic understanding of trajectories and broaden the framework's applicability to even more complex urban planning tasks.

Summary updated

BibTeX
@inproceedings{wang2025gtr,
  author = {Xiangheng Wang and Ziquan Fang and Chenglong Huang and Danlei Hu and Lu Chen and Yunjun Gao},
  title = {{GTR: A General, Multi-View, and Dynamic Framework for Trajectory Representation Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=ehcWKZ2nEn},
}
Figure