TrajCogn: Leveraging LLMs for Cognizing Movement Patterns and Travel Purposes from Trajectories
Zeyu Zhou, Yan Lin, Haomin Wen, Qisen Xu, Shengnan Guo, Jilin Hu, Youfang Lin, Huaiyu Wan
TL;DR
TrajCogn addresses the challenge of learning versatile representations from spatio-temporal trajectories by leveraging large language models (LLMs). It introduces a trajectory semantic embedder and a trajectory prompt that encode movement patterns and travel purposes, combined with a task-p-tuning suffix to adapt to multiple tasks. A LoRA-enhanced LLM Encoder for Trajectory (LET) processes a concatenated trajectory prompt, enabling downstream tasks such as Travel Time Estimation, Destination Prediction, and Similar Trajectory Search, trained with a cross-reconstruction pretext task and task-specific fine-tuning. Experiments on Chengdu and Xi'an taxi data show TrajCogn achieves state-of-the-art performance, strong data efficiency, and interpretable pattern semantics via anchor-word attention, suggesting practical potential for flexible, scalable trajectory analytics. The code is provided at the project URL.
Abstract
Spatio-temporal trajectories are crucial in various data mining tasks. It is important to develop a versatile trajectory learning method that performs different tasks with high accuracy. This involves effectively extracting two core aspects of information--movement patterns and travel purposes--from trajectories. However, this is challenging due to limitations in model capacity and the quality and scale of trajectory datasets. Meanwhile, large language models (LLMs) have shown great success in versatility by training on large-scale, high-quality datasets. Given the similarities between trajectories and sentences, there's potential to leverage LLMs to develop an effective trajectory learning method. However, standard LLMs are not designed to handle the unique spatio-temporal features of trajectories and cannot extract movement patterns and travel purposes. To address these challenges, we propose a model called TrajCogn that effectively utilizes LLMs to model trajectories. TrajCogn leverages the strengths of LLMs to create a versatile trajectory learning approach while addressing the limitations of standard LLMs. First, TrajCogn incorporates a novel trajectory semantic embedder that enables LLMs to process spatio-temporal features and extract movement patterns and travel purposes. Second, TrajCogn introduces a new trajectory prompt that integrates these patterns and purposes into LLMs, allowing the model to adapt to various tasks. Extensive experiments on two real-world datasets and two representative tasks demonstrate that TrajCogn successfully achieves its design goals. Codes are available at https://anonymous.4open.science/r/TrajCogn-5021.
