SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.06207 · 2026

A Comparative Study of Demonstration Selection for Practical Large Language Models-based Next POI Prediction

Hiroya Takamura, Masayuki Kawarada, Tatsuya Ishigaki, Masaki Onishi, Ryo Nishida

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 11 failures of our instrument; 0 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2604.06207.json · badge: /api/ran/2604.06207.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ryonsd/DS-LLM4POI canonical (classifier label)
classifier basis: census
11 ran · 0 no recorded run
FunctionStatusWhere it lives
add_time_features Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/data_utils.py
code served (permissive licence) · get_code("78148b4f080610eb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np
from datetime import datetime, timedelta

# Create a sample DataFrame with the required columns
df = pd.DataFrame({
    'UTCTimeOffset': [
        '2024-01-01 08:30:45',
        '2024-01-02 14:45:30',
    ],
})

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_jaccard Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ryonsd/DS-LLM4POI/src/calc_traj_similarity.py
code served (permissive licence) · get_code("f03c01cf2583d6df")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd

def calc_jaccard(traj1, traj2):
    traj1_poi_list = traj1['PoiId'].tolist()
    traj2_poi_list = traj2['PoiId'].tolist()
    number_of_common_poi = len(set(traj1_poi_list).intersection(set(traj2_poi_list)))
    number_of_total_poi = len(set(traj1_poi_list).union(set(traj2_poi_list)))
    return number_of_common_poi / number_of_total_poi

# Create sample trajectory dataframes with PoiId column
traj1 = pd.DataFrame({
    'PoiId': [1, 2, 3, 4]
})

traj2 = pd.DataFrame({
    'PoiId': [2, 3, 5, 6]
})

ARGS = {
    'traj1': traj1,
    'traj2': traj2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_lcs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ryonsd/DS-LLM4POI/src/calc_traj_similarity.py
code served (permissive licence) · get_code("2e4baab0667496df")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

def calc_lcs(test_traj, train_traj):
    train_traj = train_traj['PoiId'].tolist()
    test_traj = test_traj['PoiId'].tolist()
    n = len(test_traj)
    m = len(train_traj)
    lcss = np.zeros((n + 1, m + 1))
    for i in range(1, n + 1):
        for j in range(1, m + 1):
            if test_traj[i - 1] == train_traj[j - 1]:
                lcss[i][j] = lcss[i - 1][j - 1] + 1
            else:
                lcss[i][j] = max(lcss[i - 1][j], lcss[i][j - 1])
    return lcss[n][m]

# Create test trajectory dataframe with PoiId column
test_traj = pd.DataFrame({
    'PoiId': [1, 2, 3, 4]
})

# Create train trajectory dataframe with PoiId column
train_traj = pd.DataFrame({
    'PoiId': [1, 2, 5, 6, 7]
})

ARGS = {
    'test_traj': test_traj,
    'train_traj': train_traj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_case_dict Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/prompt_utils.py
code served (permissive licence) · get_code("971154b20f643933")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd

# Create a mock checkin sequence DataFrame
# The function expects a DataFrame with columns: start_time, day_of_week, PoiId, PoiCategoryName
checkin_data = [
    {
        'start_time': '08:00',
        'day_of_week': 'Monday',
        'PoiId': 'poi_001',
        'PoiCategoryName': 'Coffee Shop'
    },
    {
        'start_time': '12:30',
        'day_of_week': 'Monday',
        'PoiId': 'poi_002',
        'PoiCategoryName': 'Restaurant'
    },
    {
        'start_time': '18:00',
        'day_of_week': 'Monday',
        'PoiId': 'poi_003',
        'PoiCategoryName': 'Bar'
    }
]

checkin_seq = pd.DataFrame(checkin_data)

ARGS = {
    'checkin_seq': checkin_seq,
    'is_test': False,
    'with_category': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
date_base_selection Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/demo_selection.py
code served (permissive licence) · get_code("a96fd8780ae79d5d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
from types import SimpleNamespace

# Create a small dataframe for user_current_data
user_current_data = pd.DataFrame({
    'user_id': [1, 2],
    'timestamp': [100, 200]
})

# Create user_historical_data with required columns
user_historical_data = pd.DataFrame({
    'UTCTimeOffsetEpoch': [1000, 2000, 3000, 4000, 5000],
    'pseudo_session_trajectory_id': ['traj_1', 'traj_2', 'traj_1', 'traj_3', 'traj_2']
})

# Create config with nested structure matching how it's used
config = SimpleNamespace(
    prompting=SimpleNamespace(
        reverse_order=False,
        num_demo=2
    )
)

ARGS = {
    'user_current_data': user_current_data,
    'user_historical_data': user_historical_data,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
encode_day_of_week Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/data_utils.py
code served (permissive licence) · get_code("62c168aca7e05f69")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def encode_day_of_week(x):
    if x == 0:
        return 'Monday'
    if x == 1:
        return 'Tuesday'
    if x == 2:
        return 'Wednesday'
    if x == 3:
        return 'Thursday'
    if x == 4:
        return 'Friday'
    if x == 5:
        return 'Saturday'
    if x == 6:
        return 'Sunday'

ARGS = {
    'x': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_time Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/data_utils.py
code served (permissive licence) · get_code("68a9758671ca0cda")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from datetime import datetime

# Create a mock row dict with the required keys
# The function expects:
# - row['UTCTimeOffset']: a datetime object with strftime method
# - row['UTCTimeOffsetHour']: an integer
# - row['start_time']: a string (fallback value)

row = {
    'UTCTimeOffset': datetime(2024, 1, 15, 14, 30, 45),
    'UTCTimeOffsetHour': 5,
    'start_time': '02:30 PM'
}

ARGS = {
    'row': row
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_selection Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ryonsd/DS-LLM4POI/src/utils/demo_selection.py
code served (permissive licence) · get_code("c2f74cb610cff6ef")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import random
import pandas as pd

class ConfigStandIn:
    def __init__(self):
        self.prompting = PromptingConfig()

class PromptingConfig:
    def __init__(self):
        self.num_demo = 3
        self.random_seed = 42

# Create user_current_data (minimal - not used in function but required)
user_current_data = pd.DataFrame({
    'item_id': [1, 2, 3],
    'timestamp': [100, 101, 102]
})

# Create user_historical_data with pseudo_session_trajectory_id column
user_historical_data = pd.DataFrame({
    'pseudo_session_trajectory_id': [10, 10, 20, 20, 30, 40, 50],
    'item_id': [1, 2, 3, 4, 5, 6, 7],
    'timestamp': [1000, 1001, 1002, 1003, 1004, 1005, 1006]
})

# Create config
config = ConfigStandIn()

ARGS = {
    'user_current_data': user_current_data,
    'user_historical_data': user_historical_data,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
record2text Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/prompt_utils.py
code served (permissive licence) · get_code("9af2b93dce373458")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def record2text(checkin_record, with_category=True):
    if with_category:
        return f"({checkin_record['start_time']}, {checkin_record['day_of_week']}, {checkin_record['PoiId']}, {checkin_record['PoiCategoryName']})"
    else:
        return f"({checkin_record['start_time']}, {checkin_record['day_of_week']}, {checkin_record['PoiId']})"

checkin_record = {
    'start_time': '14:30',
    'day_of_week': 'Monday',
    'PoiId': 12345,
    'PoiCategoryName': 'Restaurant'
}

ARGS = {
    'checkin_record': checkin_record,
    'with_category': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
record2text_target Ran
ran; our contract draft was wrong, not the code
ryonsd/DS-LLM4POI/src/utils/prompt_utils.py
code served (permissive licence) · get_code("c42545fa7d86051d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

checkin_record = {
    'start_time': '09:30',
    'day_of_week': 'Monday'
}

with_category = True

ARGS = {
    'checkin_record': checkin_record,
    'with_category': with_category
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
similarity_based_selection Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ryonsd/DS-LLM4POI/src/utils/demo_selection.py
code served (permissive licence) · get_code("b137c1bea84aa9a6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import pandas as pd
from types import SimpleNamespace

torch.manual_seed(0)

# Create user_current_data as a DataFrame with pseudo_session_trajectory_id
user_current_data = pd.DataFrame({
    'pseudo_session_trajectory_id': [42]
})

# Create user_historical_data with multiple trajectory IDs
user_historical_data = pd.DataFrame({
    'pseudo_session_trajectory_id': [10, 20, 30, 10, 20, 40, 50]
})

# Create additional_data - a dict mapping trajectory IDs to lists of similar trajectory IDs
additional_data = {
    '42': ['50', '40', '30', '20', '10']
}

# Create config with nested attributes
config = SimpleNamespace(
    prompting=SimpleNamespace(
        reverse_order=False,
        num_demo=2
    )
)

ARGS = {
    'user_current_data': user_current_data,
    'user_historical_data': user_historical_data,
    'additional_data': additional_data,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 embeddingbased 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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2604.06207")
get_code_for_paper("2604.06207")
have("2604.06207")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2604.06207.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2604.06207.svg)](https://syntology.ai/paper/2604.06207)

Connect an agent — have() is free.