Leveraging language foundation models for human mobility forecasting

Hao Xue, Bhanu Prakash Voutharoja, Flora D. Salim

Abstract

Accurate human mobility forecasting is essential for urban planning, public health, and smart city management. While traditional approaches rely on numerical time-series models, they often fail to capture the semantic context—such as the type of location or the significance of specific dates—that influences human behavior. This paper presents AuxMobLCast, a novel framework that reformulates mobility forecasting as a natural language processing task. By leveraging pre-trained Language Foundation Models (LFMs) and an auxiliary classification task, the framework demonstrates superior performance over state-of-the-art numerical models in predicting urban foot traffic.

1. Introduction

Predicting the flow of people to specific Points-of-Interest (POIs) has historically been treated as a purely numerical problem. In this "numerical paradigm," historical visitor counts are treated as abstract sequences (e.g., [7, 2, 6, 8]) and fed into models to predict the next value in the series. However, this approach ignores the underlying semantics that drive mobility. A sequence of numbers alone does not convey that a location is a commercial bank—likely to be closed on weekends—or a hotel, which may see peak occupancy during those same periods.

To bridge this gap, we introduce a "language paradigm" for mobility forecasting. By converting numerical data into natural language prompts, we can utilize the "common sense" and sequential reasoning capabilities of LFMs like BERT and GPT-2, which have been pre-trained on vast corpora of human knowledge.

2. The AuxMobLCast Framework

The AuxMobLCast framework consists of two primary components: Mobility Prompting and a dual-task Encoder-Decoder architecture.

2.1 Mobility Prompting

Instead of raw integers, the framework uses natural language templates to represent mobility data. For instance, a data point might be transformed into: "From June 17 to July 01, there were 11, 11, 10... people visiting POI 385. On July 02, there will be..." This transformation allows the model to interpret dates, days of the week, and location identifiers as semantic tokens, enabling it to recognize patterns associated with specific calendar events or venue types.

2.2 Pipeline Architecture

The model utilizes an encoder-decoder structure designed to fuse semantic understanding with predictive generation:

  • Encoder: The framework evaluates several pre-trained models, including BERT, RoBERTa, and XLNet, to process the input prompts and extract high-level features.
  • Decoder: GPT-2 is employed as the decoder to generate the predicted visitor count as a text token.
  • Auxiliary Task: A critical innovation is the addition of an auxiliary classification head to the encoder. While the primary task is forecasting, the model is simultaneously trained to classify the category of the POI (e.g., "Restaurant" vs. "Shoe Store"). This forces the encoder to learn the specific relationship between a venue's category and its visiting patterns, acting as a semantic regularizer.

3. Experimental Setup

The study utilized real-world mobility data from SafeGraph, focusing on three major U.S. metropolitan areas between June and November 2020:

  • New York City (NYC): 479 POIs across 39 categories.
  • Dallas: 1,374 POIs across 65 categories.
  • Miami: 1,007 POIs across 51 categories.

The data was partitioned into 70% training, 10% validation, and 20% testing. Models used a 15-day historical window to predict the visitor count for the 16th day.

4. Results and Discussion

AuxMobLCast was compared against several high-performance numerical models, including Informer, Autoformer, and standard Transformers.

4.1 Performance Comparison

The BERT-based AuxMobLCast achieved a Root Mean Square Error (RMSE) of 10.641, significantly outperforming the best numerical Transformer-based model (Informer at 11.289) and the baseline numerical Transformer (12.176). These results suggest that the semantic context provided by the language paradigm allows for more accurate predictions than numerical sequences alone.

4.2 The Impact of Semantic Grounding

Ablation studies confirmed the importance of the auxiliary task. When the POI classification task was removed, BERT’s average RMSE rose from 10.641 to 12.204. This indicates that forcing the model to "understand" the type of location it is forecasting for is essential to its predictive accuracy.

4.3 Generalization and Zero-Shot Potential

Interestingly, the models demonstrated promising generalization abilities. When trained on one city and tested on another, the performance remained relatively stable. This suggests that the LFMs are learning general patterns of human behavior—such as weekly cycles and venue-specific trends—rather than merely memorizing the layout of a specific city.

5. Conclusion and Future Work

By treating human mobility as a language problem, AuxMobLCast demonstrates that foundation models can be effectively repurposed for spatial-temporal forecasting. The integration of semantic context through natural language prompting and auxiliary tasks provides a clear advantage over traditional numerical methods.

Future research will focus on moving beyond manual prompting toward automated "prompt learning" and integrating multivariate data—such as weather patterns and local events—into the language templates. While the computational cost of LFMs remains higher than simpler models, their superior accuracy and generalization potential mark a significant step forward for smart city analytics.

Summary updated

BibTeX
@inproceedings{xue2022leveraging,
  author = {Hao Xue and Bhanu Prakash Voutharoja and Flora D. Salim},
  title = {{Leveraging language foundation models for human mobility forecasting}},
  booktitle = {SIGSPATIAL/GIS},
  year = {2022},
  doi = {10.1145/3557915.3561026},
}
Figure