Context-aware multi-head self-attentional neural network model for next location prediction

Ye Hong, Yatao Zhang, Konrad Schindler, Martin Raubal

TL;DR

Researchers have developed a new Multi-Head Self-Attention (MHSA) model that predicts an individual's next location by fusing historical movement with rich environmental context, such as land-use patterns and activity duration. The model demonstrates that "collective intelligence"—learning from a whole population rather than just one person—yields higher accuracy and better efficiency in predicting personal travel.

What Problem Does This Paper Address?

Predicting where someone will go next isn't just about knowing their last stop; it’s about understanding the context of their day. While deep learning has improved location prediction, many models treat movement as a simple sequence of coordinates, ignoring the "why" and "what" of a visit.

The challenge lies in the high-dimensional nature of mobility. How do you integrate the fact that someone spent four hours at a "Residential" area on a Tuesday versus thirty minutes at a "Commercial" hub? Previous models struggled to combine diverse data types—like time, duration, and surrounding land use—into a single, cohesive prediction framework that captures both long-term habits and short-term spontaneity.

Methods

The authors propose a Transformer-based architecture (specifically a GPT-like decoder) using Multi-Head Self-Attention (MHSA). The core innovation lies in how they represent context:

  1. Multi-Scale Land Use: Instead of just looking at the immediate point of interest (POI), they use Latent Dirichlet Allocation (LDA) to summarize the "functional flavor" of a location across 11 different spatial scales (from 0 to 500 meters). This treats a location like a "document" and the surrounding POIs like "words."
  2. Spatio-Temporal Embeddings: The model doesn't just see raw numbers. It uses embedding layers to transform categorical data—location IDs, time of day (minute/hour/day), and activity duration—into dense vectors that the neural network can relate to one another.
  3. Collective Learning: Rather than training a tiny model for every single user, they train one large model on the entire population but include a User Embedding. This allows the model to learn general human behavior patterns while still recognizing individual quirks.

Datasets

The model was rigorously tested on two major longitudinal GNSS tracking datasets:

  • Green Class (GC) Dataset: 139 participants in Switzerland with very high tracking coverage (93%), providing a high-fidelity look at daily routines.
  • Geolife Dataset: A classic benchmark from Microsoft Research involving 178 users in China, though with lower tracking coverage (44%).
  • Check-in Benchmarks: To prove generalizability, they also tested the model on sparse LBSN data from Foursquare NYC and Gowalla.

Key Insights and Ideas

  • The Power of the Crowd: Surprisingly, models trained on the whole population outperformed those trained on individuals. The "collective" model learns common transition motifs (like the home-work-home loop) that provide a strong baseline, which the user-specific embedding then fine-tunes.
  • The "Weekly Rhythm" is Real: By analyzing attention weights, the researchers found that the model naturally focuses most on what you did yesterday and exactly one week ago. This confirms that human mobility is deeply periodic; your behavior last Monday is a better predictor for today than what you did last Friday.
  • Duration Matters: Including "how long" someone stayed at a location significantly boosted Acc@1 (the accuracy of the top prediction). Duration acts as a proxy for the type of activity (e.g., a 10-minute stop is a chore; an 8-hour stop is work).
  • Land Use as a Filter: While duration helps identify the specific next stop, land-use context helps the model narrow down the "choice set" of possible locations, effectively acting as a semantic filter.

Key Results

The MHSA model consistently outperformed state-of-the-art baselines like LSTMs, Markov Chains, and specialized mobility models (DeepMove, MobTcast).

  • Accuracy: On the high-quality GC dataset, the model achieved an Acc@1 of 45.6%, a significant lead over the second-best model (44.8%).
  • Top-10 Performance: The model’s Acc@10 reached nearly 70% on the GC dataset, meaning the true next location was in the model's "top ten" list seven out of ten times.
  • Efficiency: Despite being more accurate, the collective MHSA model used fewer parameters and trained significantly faster than maintaining hundreds of individual-level models.

Limitations and Future Work

The authors identify a few hurdles for the future:

  • The "Cold Start" Problem: The current model relies on having a history for a user. Generalizing to completely new or "unknown" users remains a challenge.
  • Data Quality Sensitivity: Performance drops when tracking coverage is low (as seen in the Geolife results). Future work could focus on making models more robust to "gaps" in GPS data.
  • Advanced Semantics: While LDA is effective for land use, the authors suggest that more modern embedding techniques like Word2Vec or Place2Vec could capture even richer spatial relationships.

Reference: Hong, Y., Zhang, Y., Schindler, K., & Raubal, M. (2023). Context-aware multi-head self-attentional neural network model for next location prediction. arXiv:2212.01953v3.

Summary updated

BibTeX
@inproceedings{hong2023context,
  author = {Ye Hong and Yatao Zhang and Konrad Schindler and Martin Raubal},
  title = {{Context-aware multi-head self-attentional neural network model for next location prediction}},
  booktitle = {Transportation},
  year = {2023},
  doi = {10.1016/j.trc.2023.104315},
}
Figure