# TrajFM: A Vehicle Trajectory Foundation Model for Region and Task Transferability

arXiv: https://arxiv.org/abs/2408.15251 · HTML: https://mlsanity.com/paper/2408.15251/

## Key facts

- Cited by 16 papers in the map (data through 14 Oct 2026).
- Builds on 16 of its 43 references that are in the map.
- First posted on arXiv 9 Aug 2024.

## Builds on (most cited first, 16 of 16)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://mlsanity.com/paper/1810.04805/) (2018)
- [Learning Transferable Visual Models From Natural Language Supervision](https://mlsanity.com/paper/2103.00020/) (2021)
- [A Simple Framework for Contrastive Learning of Visual Representations](https://mlsanity.com/paper/2002.05709/) (2020)
- [RoFormer: Enhanced Transformer with Rotary Position Embedding](https://mlsanity.com/paper/2104.09864/) (2021)
- [Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling](https://mlsanity.com/paper/1412.3555/) (2014)
- [GLM: General Language Model Pretraining with Autoregressive Blank Infilling](https://mlsanity.com/paper/2103.10360/) (2021)
- [Self-supervised Trajectory Representation Learning with Temporal Regularities and Travel Semantics](https://mlsanity.com/paper/2211.09510/) (2022)
- [Contrastive Trajectory Similarity Learning with Dual-Feature Attention](https://mlsanity.com/paper/2210.05155/) (2022)
- [LightPath: Lightweight and Scalable Path Representation Learning](https://mlsanity.com/paper/2307.10171/) (2023)
- [Deep Spatially and Temporally Aware Similarity Computation for Road Network Constrained Trajectories](https://mlsanity.com/paper/2112.09339/) (2021)
- [A Simple Baseline for Travel Time Estimation using Large-Scale Trip Data](https://mlsanity.com/paper/1512.08580/) (2015)
- [Pre-training General Trajectory Embeddings with Maximum Multi-view Entropy Coding](https://mlsanity.com/paper/2207.14539/) (2022)
- [Origin-Destination Travel Time Oracle for Map-based Services](https://mlsanity.com/paper/2307.03048/) (2023)
- [Micro-Macro Spatial-Temporal Graph-based Encoder-Decoder for Map-Constrained Trajectory Recovery](https://mlsanity.com/paper/2404.19141/) (2024)
- [Trajectory-User Linking via Hierarchical Spatio-Temporal Attention Networks](https://mlsanity.com/paper/2302.10903/) (2023)

## Built on by (most cited first, 16 of 16)

- [Foundation Models for Spatio-Temporal Data Science: A Tutorial and Survey](https://mlsanity.com/paper/2503.13502/) (2025)
- [UniTraj: Learning a Universal Trajectory Foundation Model from Billion-Scale Worldwide Traces](https://mlsanity.com/paper/2411.03859/) (2024)
- [BIGCity: A Universal Spatiotemporal Model for Unified Trajectory and Traffic State Data Analysis](https://mlsanity.com/paper/2412.00953/) (2024)
- [Unraveling Spatio-Temporal Foundation Models via the Pipeline Lens: A Comprehensive Review](https://mlsanity.com/paper/2506.01364/) (2025)
- [Self-Supervised Representation Learning for Geospatial Objects: A Survey](https://mlsanity.com/paper/2408.12133/) (2024)
- [TrajAgent: An LLM-Agent Framework for Trajectory Modeling via Large-and-Small Model Collaboration](https://mlsanity.com/paper/2410.20445/) (2024)
- [S2Vec: Self-Supervised Geospatial Embeddings for the Built Environment](https://mlsanity.com/paper/2504.16942/) (2025)
- [From Points to Places: Towards Human Mobility-Driven Spatiotemporal Foundation Models via Understanding Places](https://mlsanity.com/paper/2506.14570/) (2025)
- [Learning Generalized and Flexible Trajectory Models from Omni-Semantic Supervision](https://mlsanity.com/paper/2505.17437/) (2025)
- [MoveGPT: Scaling Mobility Foundation Models with Spatially-Aware Mixture of Experts](https://mlsanity.com/paper/2505.18670/) (2025)
- [Breaking Data Silos: Towards Open and Scalable Mobility Foundation Models via Generative Continual Learning](https://mlsanity.com/paper/2506.06694/) (2025)
- [MoveFM-R: Advancing Mobility Foundation Models via Language-driven Semantic Reasoning](https://mlsanity.com/paper/2509.22403/) (2025)
- [Understanding the Geospatial Reasoning Capabilities of LLMs: A Trajectory Recovery Perspective](https://mlsanity.com/paper/2510.01639/) (2025)
- [Building a Foundation Model for Trajectory from Scratch](https://mlsanity.com/paper/2511.20610/) (2025)
- [TrajGANR: Trajectory-Centric Urban Multimodal Learning via Geospatially Aligned Neural Representations](https://mlsanity.com/paper/2605.06990/) (2026)
- [Industrial Kinematic Trajectory Model (IKTM): Coordinate-Free Autoregressive Generator](https://mlsanity.com/paper/2609.22173/) (2026)

## Abstract (arXiv)

Vehicle trajectories provide valuable movement information that supports various downstream tasks and powers real-world applications. A desirable trajectory learning model should transfer between different regions and tasks without retraining, thus improving computational efficiency and effectiveness with limited training data. However, a model's ability to transfer across regions is limited by the unique spatial features and POI arrangements of each region, which are closely linked to vehicle movement patterns and difficult to generalize. Additionally, achieving task transferability is challenging due to the differing generation schemes required for various tasks. Existing efforts towards transferability primarily involve learning embedding vectors for trajectories, which perform poorly in region transfer and still require retraining of prediction modules for task transfer. To address these challenges, we propose TrajFM, a vehicle trajectory foundation model that excels in both region and task transferability. For region transferability, we introduce STRFormer as the main learnable model within TrajFM. It integrates spatial, temporal, and POI modalities of trajectories to effectively manage variations in POI arrangements across regions and includes a learnable spatio-temporal Rotary position embedding module for handling spatial features. For task transferability, we propose a trajectory masking and recovery scheme. This scheme unifies the generation processes of various tasks into the masking and recovery of modalities and sub-trajectories, allowing TrajFM to be pre-trained once and transferred to different tasks without retraining. Experiments on two real-world vehicle trajectory datasets under various settings demonstrate the effectiveness of TrajFM. Code is available at https://anonymous.4open.science/r/TrajFM-30E4.
