Capturing Context-Aware Route Choice Semantics for Trajectory Representation Learning

Cao, Ji, Wang, Yu, Zheng, Tongya, Song, Jie, Guo, Qinghong, Ren, Zujie, Jin, Canghong, Chen, Gang, Song, Mingli

arXiv.org Artificial Intelligence 

Abstract--Trajectory representation learning (TRL) aims to encode raw trajectory data into low-dimensional embeddings for downstream tasks such as travel time estimation, mobility prediction, and trajectory similarity analysis. From a behavioral perspective, a trajectory reflects a sequence of route choices within an urban environment. However, most existing TRL methods ignore this underlying decision-making process and instead treat trajectories as static, passive spatiotemporal sequences, thereby limiting the semantic richness of the learned representations. T o bridge this gap, we propose CORE, a TRL framework that integrates context-aware route choice semantics into trajectory embeddings. CORE first incorporates a multi-granular Environment Perception Module, which leverages large language models (LLMs) to distill environmental semantics from point of interest (POI) distributions, thereby constructing a context-enriched road network. Building upon this backbone, CORE employs a Route Choice Encoder with a mixture-of-experts (MoE) architecture, which captures route choice patterns by jointly leveraging the context-enriched road network and navigational factors. Extensive experiments on 4 real-world datasets across 6 downstream tasks demonstrate that CORE consistently outperforms 12 state-of-the-art TRL methods, achieving an average improvement of 9.79% over the best-performing baseline. Our code is available at https://github.com/caoji2001/CORE. Ji Cao, Y u Wang, Gang Chen, and Mingli Song are with the College of Computer Science and Technology, Zhejiang University, Hangzhou 310027, China; Ji Cao is also with the Zhejiang Lab, Hangzhou 311121, China (email: {caoj25, yu.wang, cg, brooksong}@zju.edu.cn). Tongya Zheng and Canghong Jin are with the Zhejiang Provincial Engineering Research Center for Real-Time SmartTech in Urban Security Governance, Hangzhou City University, Hangzhou 310015, China (e-mail: doujiang zheng@163.com; Jie Song is with the School of Software Technology, Zhejiang University, Ningbo 315100, China (e-mail: sjie@zju.edu.cn).