A Comparative Study of Demonstration Selection for Practical Large Language Models-based Next POI Prediction
Organizations: National Institute of Advanced Industrial Science and Technology, Japan
Abstract
This paper investigates demonstration selection strategies for predicting a user's next point-of-interest (POI) using large language models (LLMs), aiming to accurately forecast a user's subsequent location based on historical check-in data. While in-context learning (ICL) with LLMs has recently gained attention as a promising alternative to traditional supervised approaches, the effectiveness of ICL significantly depends on the selected demonstration. Although previous studies have examined methods such as random selection, embedding-based selection, and task-specific selection, there remains a lack of comprehensive comparative analysis among these strategies. To bridge this gap and clarify the best practices for real-world applications, we comprehensively evaluate existing demonstration selection methods alongside simpler heuristic approaches such as geographical proximity, temporal ordering, and sequential patterns. Extensive experiments conducted on three real-world datasets indicate that these heuristic methods consistently outperform more complex and computationally demanding embedding-based methods, both in terms of computational cost and prediction accuracy. Notably, in certain scenarios, LLMs using demonstrations selected by these simpler heuristic methods even outperform existing fine-tuned models, without requiring further training. Our source code is available at: https://github.com/ryonsd/DS-LLM4POI.
Figures & tables
| NYC | TKY | CA | |
|---|---|---|---|
| Number of Users | 1,048 | 2,282 | 3,957 |
| Number of POIs | 4,981 | 7,833 | 9,690 |
| Number of Test Instances | 1,447 | 7,079 | 2,864 |
| Average Historical Data per User | 11.9 | 23.8 | 14.3 |
| NYC | TKY | CA | |||||||||
| 5 | 15 | 30 | 5 | 15 | 30 | 5 | 15 | 30 | |||
| Qwen-2.5-7B | All | Random | 0.1237 | 0.1313 | 0.1431 | 0.0743 | 0.0808 | 0.0930 | 0.0544 | 0.0583 | 0.0615 |
| EmbSim | 0.1320 | 0.1361 | 0.1348 | 0.0824 | 0.0903 | 0.0898 | 0.1082 | 0.1094 | 0.1023 | ||
| DTW | 0.1500 † | 0.1548 † | 0.1513 † | 0.1305 ‡ | 0.1302 ‡ | 0.1302 ‡ | 0.0985 | 0.1192 † | 0.1209 ‡ | ||
| Jaccard | 0.1790 ‡ | 0.1679 ‡ | 0.1755 ‡ | 0.1382 ‡ | 0.1420 ‡ | 0.1400 ‡ | 0.1041 | 0.1235 ‡ | 0.1230 ‡ | ||
| LCS | 0.1776 ‡ | 0.1804 ‡ | 0.1783 ‡ | 0.1291 ‡ | 0.1369 ‡ | 0.1321 ‡ | 0.1121 ‡ | 0.1279 ‡ | 0.1392 ‡ | ||
| NYC | TKY | CA | ||||||||
| 5 | 15 | 30 | 5 | 15 | 30 | 5 | 15 | 30 | ||
| GPT-4o | DTW+User | 0.3248 | 0.3504 | 0.3587 | 0.2517 | 0.2786 | 0.2969 | 0.1861 | 0.2050 | 0.2091 |
| Jaccard+User | 0.3276 | 0.3497 | 0.3435 | 0.2661 | 0.2935 | 0.3006 | 0.1924 | 0.2067 | 0.2057 | |
| LCS+User | 0.3317 | 0.3497 | 0.3580 | 0.2681 | 0.2931 | 0.2960 | 0.1941 | 0.2011 | 0.2053 | |
| Time+User | 0.3179 | 0.3449 | 0.3490 | 0.2612 | 0.2904 | 0.3047 | 0.1826 | 0.2095 | 0.2067 | |
| LLM-Mob | 0.2979 | 0.3283 | 0.3366 | 0.2212 | 0.2599 | 0.2671 | 0.1753 | 0.1962 | 0.1997 | |
In-Context Learning
In-context learning studies how models adapt to new tasks from examples or instructions supplied at inference time, without changing their weights.
See all 404 papers