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
Figure 1: An overview of the next POI prediction task and an overview of heuristic-based demonstration selection methods. This task is to predict the next POI the user is likely to visit, given a sequence of users’ check-in records. The heuristic-based methods (1) retrieve similar instances from a demonstration pool (i.e., past check-in records) and (2) predict the next POI including them in a prompt as demonstrations.
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
Table 1: Statistics of datasets used in our experiments. NYC, TKY, and CA represent Foursquare-New York, Foursquare-Tokyo, and Gowalla-California, respectively.
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 ‡
Table 2: ACC@1 scores for each demonstration selection method using historical data from all users (All) and using historical data from the target user only (User) using Qwen-2.5-7B-Instruct and GPT-4o. Random in the User column is equivalent to Random+User, and this correspondence holds for the other selection methods. The highest ACC@1 score is highlighted in bold for each of the four settings defined by the combination of model (Qwen-2.5-7B or GPT-4o) and historical data pool (All or User). Additionally, for each setting, we perform McNemar’s test to compare the performance of each method against Random or Random+User, and denote † and ‡ when p<0.1 and p<0.05 , respectively.
Figure 3: Comparison of demonstration selection computational cost and ACC@1 by each demonstration selection method under GPT-4o with user-filtering settings.
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
Table 3: ACC@1 scores of selected methods from GPT-4o in the user-filtering setting and fine-tuned models. Fine-tuned models’ results are reported values extracted from [ 9 ] . McNemar’s test is not applied to this table, as the results of the existing fine-tuned models are not publicly available.
Figure 4: ACC@1 performance of each method across different numbers of current check-ins under the user-filtering setting using GPT-4o.
Figure 5: Comparison of the number of target POI labels included as demonstrations in the prompt. Our proposed method efficiently includes the correct labels, which is especially prominent when the number of demonstrations is small.
Predicting a user's next Point-of-Interest (POI) based on their historical check-in records is a fundamental task in location-based services. While recent methods incorporating large language models have shown strong reasoning capabilities and promising results, they typically formulate the prediction task as a one-step trajectory-to-location mapping problem, making predictions prone to shallow trajectory correlations and historical frequency bias. We argue that users rarely choose locations directly and instead, they usually first form a traveling intention and then accordingly select specific POIs. Motivated by this insight, we propose IntentPOI, a two-stage intention-guided reasoning framework. In the thinking stage, we infer users' intermediate intentions by incorporating historical mobility patterns, similar peer behaviors, and the temporal contexts. In the acting stage, we first construct a compact candidate pool, and then perform intention-guided reasoning to identify locations that best align with the inferred intention. By explicitly decoupling intention inference from location prediction, IntentPOI transforms the next POI prediction from direct trajectory matching into intention-guided reasoning. Extensive experiments on three real-world datasets demonstrate that IntentPOI consistently outperforms eleven state-of-the-art baselines.
Qingxiang Liu, Anqi Liang, Zhuoyang Jiang +5
The Hong Kong University of Science and Technology (Guangzhou) China · Shanghai Jiao Tong University China · The Hong Kong University of Science and Technology Hong Kong +2
Predicting a user's next POI is a task in human mobility modeling, yet LLM-based approaches focus on semantic reasoning from previous mobility records, while neglecting real-world spatial context. However, human mobility is inherently shaped by spatial cognition, including geographic distance and neighborhood context. This issue is further compounded by prior evidence that LLMs often struggle with spatial reasoning tasks, including distance estimation and geographically biased prediction. To address these limitations, we propose our framework, a multi-agent LLM framework that decomposes next-POI prediction into three stages: Firstly, a Pattern Extraction Agent that captures temporal and categorical mobility patterns from trajectory history; Secondly, a Spatial Reasoning Agent that structures candidate activity choices by combining behavioral preferences with real-world spatial constraints, including geographic distance, road network distance, and neighborhood affiliation; and Thirdly, a Decision Synthesis Agent that integrates behavioral patterns and spatial reasoning for final prediction. Experiments on the NYC benchmark dataset with two LLM backbones show improvements over baseline methods, with up to 493% Hit@1 improvement and 37% relative improvement in Hit@5. Ablations show that combining neighborhood affiliation with distance-based features generally outperforms distance-only settings, and that the Spatial Reasoning Agent plays a crucial role in final prediction by integrating behavioral preferences with real-world spatial constraints, especially for smaller models. Overall, the results highlight the importance of spatial reasoning in mobility prediction. Accurate next-POI prediction requires combining behavioral patterns with explicit real-world spatial constraints, and multi-agent decomposition provides an effective structure for organizing these forms of context.
Shangyu Lou, Ziqi Cui
University of California & Santa Barbara & San Diego State University California, USA · Politecnico di Milano Milan, Italy
Generative point-of-interest (POI) recommendation models based on large language models (LLMs) have shown promising results by formulating next POI prediction as a sequence generation task. However, the knowledge encoded in these models remains fixed after training, making them unable to perceive evolving real-world conditions that shape user mobility decisions, such as local events and cultural trends. To bridge this gap, we propose AWARE (Agent-based World knowledge Augmented REcommendation), which employs an LLM agent to generate location- and time-aware contextual narratives that capture regional cultural characteristics, seasonal trends, and ongoing events relevant to each user. Rather than introducing generic or noisy information, AWARE further anchors these narratives in each user's behavioral context, grounding external world knowledge in personalized spatial-temporal patterns. Extensive experiments on three real-world datasets demonstrate that AWARE consistently outperforms competitive baselines, achieving up to 12.4% relative improvement.