Enhancing Large Language Models for Mobility Analytics with Semantic Location Tokenization

Yile Chen, Yicheng Tao, Yue Jiang, Shuai Liu, Han Yu, Gao Cong

Abstract

Human mobility analytics is crucial for urban planning but faces challenges in Large Language Models (LLMs) due to the semantic poverty of discrete location IDs. We present QT-Mob, a framework that utilizes Semantic Location Tokens derived from hierarchical vector quantization of rich textual descriptions. By employing multi-objective fine-tuning—including next-location prediction, mobility recovery, and location alignment—QT-Mob significantly outperforms existing methods, achieving a 38.5% improvement in Hit@1 on New York City datasets.

Introduction

Human mobility analytics, which involves predicting future movements or imputing missing trajectory data, is a cornerstone of modern urban planning and personalized recommendation systems. Traditional approaches have relied on deep learning architectures like RNNs or Transformers, which typically treat locations as arbitrary numerical identifiers (e.g., "Location 402"). However, these identifiers lack inherent semantic meaning, forcing models to learn spatial relationships from scratch. While LLMs offer powerful reasoning capabilities, they struggle with this "semantic poverty" and often fail to capture the complex, bidirectional dependencies of human movement through simple instruction tuning.

Methods

The QT-Mob framework addresses these limitations through a two-stage process: Semantic Location Tokenization and Multi-Objective Knowledge Infusion.

First, instead of using opaque IDs, QT-Mob generates comprehensive textual descriptions for each location, incorporating names, categories, GPS coordinates, and nearby Points of Interest (POIs). These descriptions are compressed using a Residual Quantized Variational AutoEncoder (RQ-VAE). This hierarchical vector quantization ensures that locations with similar semantic or spatial characteristics share common token prefixes, allowing the LLM to process mobility data with an inherent understanding of urban geography.

Overview of the QT-Mob framework, illustrating semantic encoding, vector quantization into location tokens, and mobility-specific knowledge infusion.

Second, the model undergoes supervised fine-tuning via LoRA across three objectives:

  1. Next Location Prediction: Aided by a "User Profile Plugin" that summarizes historical behavior to provide context without exceeding context windows.
  2. Mobility Recovery: A mask-and-fill task that forces the model to learn bidirectional movement patterns.
  3. Location Alignment: Training the LLM to translate between the new location tokens and their natural language descriptions, ensuring the model understands the underlying semantics.

Results

Evaluation was conducted on real-world datasets from New York City (NYC), Singapore (SG), and a large-scale cellular trajectory dataset (CE). QT-Mob consistently outperformed state-of-the-art baselines, including specialized models like STHGCN and general LLM approaches like MobilityLLM. Notably, on the NYC dataset, QT-Mob achieved a Hit@1 of 0.2550, representing a 38.5% relative improvement over prior LLM-based methods.

Performance comparison between numerical IDs and the proposed Location Tokens across different training objectives on Hit@5 and N@5 metrics.

The framework also demonstrated robust generalization to unseen locations and maintained performance across various backbone models, including Llama 3.2 and Qwen 2.5, suggesting the methodology is model-agnostic.

Conclusion

QT-Mob demonstrates that treating mobility as a cross-modal alignment task—aligning semantic tokens with textual descriptions—is far more effective than traditional sequence modeling. While challenges remain regarding inference latency and vocabulary management for dynamic urban environments, the shift from "points" to "semantic places" marks a significant advancement in applying LLMs to spatial-temporal data. Future work may explore agentic frameworks to reason about the underlying motivations of human movement.

Summary updated

BibTeX
@inproceedings{chen2025enhancing,
  author = {Yile Chen and Yicheng Tao and Yue Jiang and Shuai Liu and Han Yu and Gao Cong},
  title = {{Enhancing Large Language Models for Mobility Analytics with Semantic Location Tokenization}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2025},
}
Figure