TL;DR
Predicting a user's next point-of-interest (POI) using Large Language Models (LLMs) via few-shot prompting is highly flexible, but its success depends entirely on picking the right examples. This paper demonstrates that simple, lightning-fast spatiotemporal heuristics (like matching overlapping locations or sequence orders) consistently beat complex, expensive embedding-based retrieval methods. Remarkably, these simple selection strategies allow frozen LLMs to outperform fully fine-tuned, task-specific models without any training.
What Problem Does This Paper Address?
Next POI prediction uses historical check-in data to anticipate where a user will go next, which is vital for location-based recommendations and urban planning. Traditional approaches rely on supervised deep learning architectures (like Graph Neural Networks). While accurate, these models require expensive retraining whenever new users join or new venues open.
In-context learning (ICL) with LLMs offers a elegant alternative: by feeding a few historical examples (demonstrations) directly into the prompt, the model can predict the next location on the fly without any weight updates. However, LLMs are notoriously sensitive to prompt composition. Standard natural language processing (NLP) techniques typically select examples randomly or use dense text embeddings to find "similar" context. The problem? Text embeddings fail to capture the strict spatiotemporal dynamics of human mobility (like geographical proximity and chronological order) and are computationally heavy to generate.
Methods
The authors systematically evaluate how different demonstration selection strategies affect an LLM's (Qwen-2.5-7B-Instruct and GPT-4o) next-POI prediction accuracy. They introduce three intuitive, low-cost spatiotemporal heuristics to replace complex embedding models:
- Spatial-based Selection (DTW): Treats a user's check-in sequence as a time series of 2D coordinates and uses Dynamic Time Warping (DTW) to find past trajectories with the most similar physical paths.
- Set-based Selection (Jaccard): Ignores order and treats trajectories as unordered sets of POI IDs, selecting examples that share the highest proportion of identical locations using the Jaccard coefficient.
- Sequence-based Selection (LCS): Preserves chronological order, using the Longest Common Subsequence (LCS) algorithm to find past trajectories where the same POIs were visited in the exact same sequence.
Additionally, they explore User-based filtering—restricting the pool of potential examples strictly to the target user's own history versus drawing from a global pool of all users' data.
Datasets
The strategies were benchmarked across three diverse, real-world check-in datasets:
- Foursquare-New York (NYC): 1,048 users, 4,981 POIs.
- Foursquare-Tokyo (TKY): 2,282 users, 7,833 POIs.
- Gowalla-California (CA): 3,957 users, 9,690 POIs.
As the number of unique POIs increases, the prediction task becomes significantly more challenging.
Key Insights and Ideas
- Simpler is Smarter: Complex text embeddings (e.g., using Llama2-7B to embed textual descriptions of check-ins) perform poorly because they don't inherently understand spatial coordinates or strict sequential ordering.
- Personalization Trumps Scale: Restricting the demonstration pool to the target user's own history (User-based filtering) drastically improves accuracy compared to drawing examples from a massive global pool of all users. Human mobility is highly habitual; your own past behavior is a much better predictor than a stranger's.
- The "Ground Truth" Shortcut: Why do Jaccard and LCS work so well? Analysis reveals that when the number of allowed few-shot examples ($k$) is small, these heuristics naturally tend to retrieve past sequences that contain the actual ground-truth target POI. This effectively provides the LLM with a highly relevant "candidate list" right inside its prompt.
Key Results
- Beating Fine-Tuned Models: On the NYC dataset using GPT-4o ($k=30$), the heuristic methods achieved an Accuracy@1 of 0.3587 (DTW+User). This beats the state-of-the-art fine-tuned model LLM4POI (0.3372) and traditional deep learning models like GETNext (0.2435) and STHGCN (0.2734)—all without a single training step.
- Massive Efficiency Gains: Embedding-based selection (EmbSim) requires heavy GPU acceleration to generate features. In contrast, Jaccard and LCS run entirely on a standard CPU in milliseconds, offering a highly scalable solution for production environments.
Limitations and Future Work
- The Cold-Start Problem: User-based filtering relies heavily on a user having a rich check-in history. For new users with sparse data, performance drops significantly. The authors note that developing hybrid strategies that gracefully blend global and user-specific pools is a critical next step.
- Missing Semantic Cues: To ensure a fair comparison with existing benchmarks, this study omitted actual POI names (e.g., "Starbucks" vs. "Coffee Shop ID #480"). Since LLMs excel at semantic reasoning, incorporating real venue names could unlock even higher predictive accuracy.
Summary updated