Abstract
Location recommendation is a critical component of personalized map services and urban planning, yet existing models often struggle with temporal flexibility and geographic precision. This paper introduces the Temporal Prompt-based and Geography-aware (TPG) framework, which rethinks location recommendation by treating target timestamps as explicit query prompts. This approach enables "interval prediction"—the ability to predict a user's location at any specific future time, even when intermediate check-in data is missing. Furthermore, TPG addresses the "hard boundary" problem inherent in geographic gridding through a novel shifted window mechanism. Extensive evaluations on five real-world datasets demonstrate that TPG significantly outperforms state-of-the-art methods in both accuracy and robustness.
Introduction
Predicting a user's next Point-of-Interest (POI) is essential for enhancing travel experiences. However, current state-of-the-art models face two primary limitations. First, they typically treat recommendation as a fixed sequence, implicitly fusing temporal intervals into the history. This makes them effective at predicting the immediate next step but poor at predicting locations further in the future (interval prediction). Second, the common practice of "gridding" geographic coordinates to handle data sparsity creates hard boundaries; two nearby POIs may be assigned to different cells, causing the model to ignore their physical proximity and violating Tobler’s First Law of Geography.
The TPG Framework
The TPG framework addresses these challenges through a Transformer-based architecture comprising three specialized modules:
1. Geography-aware Encoder
To resolve the hard boundary problem, the model employs a Shifted Window Mechanism. For every geographic grid cell, the encoder generates eight additional augmented neighbor grids by shifting the window along the X and Y axes. By applying n-gram processing on "quadkeys" (hierarchical grid identifiers), the model captures spatial relationships across multiple resolutions, ensuring that proximity is preserved even across grid lines.
2. History Encoder
A standard Transformer encoder processes the multi-modal embeddings of a user’s check-in history. This includes POI identifiers, user IDs, timestamps, and geographic data, creating a rich representation of past behavior.
3. Temporal Prompt-based Decoder
The core innovation of TPG is the use of the target timestamp as a query prompt rather than a simple input feature. By "prompting" the decoder with a specific time $T$, the model can selectively attend to relevant historical patterns to predict where a user will be at that exact moment. This decouples the historical sequence from the specific query, allowing for flexible predictions across varying time intervals.
Experimental Evaluation
Datasets
The framework was validated using five diverse, real-world Location-Based Social Network (LBSN) datasets:
- Gowalla & Brightkite: Large-scale datasets with global check-in coverage.
- Foursquare (NYC, TKY, SIN): City-specific datasets for New York, Tokyo, and Singapore, representing different urban densities and mobility patterns.
Performance and Key Results
TPG demonstrated clear superiority over eight leading baselines, including STAN, GeoSAN, and MobTCast:
- Accuracy: TPG achieved up to a 20.2% improvement in NDCG@5 and a 16.2% improvement in Recall@5 over the best-performing baselines.
- Interval Prediction: In scenarios where the most recent check-ins were masked (e.g., using check-ins 1–97 to predict the 100th), TPG’s performance remained stable. In contrast, traditional sequential models experienced sharp declines in accuracy, proving TPG's robustness for long-range forecasting.
- Computational Efficiency: By leveraging a Transformer-based design, TPG avoids the massive memory overhead associated with the matrix operations found in models like STAN.
Discussion and Future Work
An unexpected finding during the study was that the inclusion of User Embeddings actually hindered performance. The authors suggest this may be due to a misalignment between the vector spaces of behavioral sequences and specific geographic locations.
Future research will focus on:
- Intelligent Prompting: Incorporating natural language prompts (e.g., "Where will the user go for dinner on a rainy day?") to add semantic context to temporal queries.
- Foundation Models: Exploring large-scale pre-training on mobility data to develop a foundation model for human geography, similar to Large Language Models in the text domain.
Conclusion
By reframing timestamps as prompts and introducing a shifted window for geographic data, the TPG framework provides a more flexible and accurate solution for location recommendation. Its ability to perform interval prediction and overcome the limitations of discrete gridding represents a significant step forward in modeling human mobility.
Summary updated