Manuscript Offprint
arXiv:2608.30479HF-SID: High-Fidelity Semantic IDs for Generative Retrieval in Location-Based Services
Haowen Lin
AMAP, Alibaba Group
Beijing, China
Jing Li
University of Science and Technology
of China
Hefei, China
Fangye Wang
wangfangye.wfy@alibaba-inc.com
AMAP, Alibaba Group
Beijing, China
Lihui Su
AMAP, Alibaba Group
Beijing, China
Zhibin Hao
Tsinghua University
Beijing, China
Song Yang
AMAP, Alibaba Group
Beijing, China
Xiaojiang Zhou
AMAP, Alibaba Group
Beijing, China
Abstract
Generative retrieval has attracted increasing attention in Location-Based Services (LBS), where each Point-of-Interest (POI) is represented as a Semantic ID (SID). As the SID is the only channel through which POI information reaches the generative model, whatever it fails to preserve is irrecoverable at decoding time, and LBS retrieval is especially sensitive to the fine-grained differences that existing SIDs blur. Specifically, (1) LLMs embed continuous coordinates discontinuously, so their numeric differences do not reflect true geographic distance; (2) dynamic numerical attributes differ vastly in scale, so an identical gap may be decisive for one attribute yet negligible for another; and (3) short text cannot convey hierarchical affiliation, as text-similar POIs may belong to different hierarchies. We therefore propose HF-SID, which restores geographic, numerical, and structural fidelity at the representation stage, before any information is committed to a discrete code. It transforms coordinates into a continuous 3D Cartesian form and encodes each numerical value as a single unit, consolidated inside the LLM by Geo-CPT and Num-CPT with type-aware embeddings; a Structure-based Contrastive Learning objective, applied only to the last-layer residual, then separates co-located POIs that share a coarse tag but differ at the fine level. Because these mechanisms enrich the representation rather than lengthen the identifier, HF-SID uses a 3-token SID at no extra decoding cost. On a large-scale industrial
Pengjie Wang
AMAP, Alibaba Group
Beijing, China
dataset it reduces the average intra-SID geographic distance by 95.9% and improves Hit@200 by 3.66 points over the strongest baseline, with online A/B gains of +6.74% PV_CVR and +6.03% UV_CVR. We further release AMap-S, a large-scale real-world POI dataset.
CCS Concepts
• Information systems → Information retrieval; Recommender systems.
ACM Reference Format:
Haowen Lin, Jing Li, Zhibin Hao, Fangye Wang, Lihui Su, Song Yang, Xiaojiang Zhou, and Pengjie Wang. 2025. HF-SID: High-Fidelity Semantic IDs for Generative Retrieval in Location-Based Services. In . ACM, New York, NY, USA, 12 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn
1 Introduction
Large language models (LLMs) [21, 22] have achieved remarkable success across many tasks, driving the emergence of Generative Retrieval (GR) [1, 13, 24]. A central challenge in GR is transforming diverse item attributes into Semantic IDs (SIDs) [4, 26, 38], since the SID is the only channel through which item information reaches the generative model: whatever it fails to preserve is permanently invisible at decoding time. This bottleneck is acute in Location-Based Services (LBS) [15, 31, 35], where retrieval outcomes hinge on fine-grained POI attributes that mainstream LLMs cannot perceive precisely: they fragment coordinates into digit sub-tokens [17], are insensitive to the scale of numerical attributes [12, 23], and infer structure only from surface text [20]. The central question for LBS generative retrieval is therefore not how to organize SIDs, but how to make them high-fidelity. Existing POI-oriented SID methods pursue this goal but intervene too late. They append discrete spatial tokens such as Geohash or S2 Cell IDs as geographic prefixes [2, 20],
These authors contributed equally to this research.
Corresponding author.
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.
Conference'17, Washington, DC, USA
© 2025 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-x-xxxx-xxxx-x/YYYY/MM https://doi.org/10.1145/nnnnnnn.nnnnnnn
Lin et al.
inject geographic offsets during codebook quantization [8], or fine-tune the embedding model with co-visit contrastive signals [31]. All of them operate on representations whose precision is already lost, since it vanishes the moment the tokenizer splits a coordinate into digit fragments; no downstream grid, rotation, or clustering can recover a value that was never continuous. Moreover, they address geography alone, leaving numerical attributes and structural information to plain text, and pay for their gains with longer identifiers that increase autoregressive decoding cost. Three challenges must therefore be resolved before the identifier is formed.
C1: Geographic coordinates. In LBS retrieval a difference of merely 0.1°, roughly 10 km, already carries substantial business impact, yet LLMs mishandle coordinates in three ways (Figure 1(a)). Their numeric encoding is discontinuous [10, 12, 34], so numerically close coordinates may land in distant embedding regions. Discrete grid encodings such as GeoHash [16] and S2 Cell [29], which some methods directly adopt as SID prefixes [2, 20], impose hard cell boundaries where two geographically adjacent POIs can be assigned entirely unrelated codes simply because a boundary falls between them. And coordinates are angular: the same longitude difference spans about 111 km at the equator but far less at high latitudes.
C2: Dynamic numerical attributes. POIs also carry ratings, average prices, favorite counts and so on, whose scales differ by orders of magnitude, so an identical gap means entirely different things (Figure 1(b)): 0.5 in rating (range 0–5) separates a well-regarded POI from a mediocre one, whereas 0.5 in visit count (range 0–120K) is indistinguishable from noise [7]. Prior work [8, 9, 31] serializes them as plain text without type awareness, forcing one shared numeric subspace to absorb all of them.
C3 Hierarchical structure. Each POI carries a system-annotated two-level tag such as “Shopping/Consumer Electronics”, and sits inside a geographic unit such as a business district [6], neither of which is recoverable from surface text. Tags may agree at the coarse level yet diverge at the fine level: “Apple Store” and “Apple Market” are textually almost identical and share the coarse tag “Shopping”, yet belong to “Consumer Electronics” and “Super Market” (Figure 1(c)). A business district likewise hosts many heterogeneous shops that proximity cannot separate, and stronger geographic modeling only aggravates this: the more tightly co-located POIs are grouped, the less distinguishable they become.
To address these challenges, we propose HF-SID, which restores fidelity at the representation stage, before any information is committed to a discrete code. For C1, we encode each coordinate as a single continuous unit through a dedicated numerical encoder [10] and transform spherical coordinates into a 3D Cartesian form, which replaces hard grid boundaries with a continuous space in which Euclidean distance is monotonic in true geographic distance; Geo-CPT then consolidates this geometry inside the LLM through pairwise-distance and nearest-pair reasoning samples. For C2, we give each attribute type an independent Type Embedding that projects it into its own subspace, and Num-CPT trains the model on cross-attribute comparison samples so that a magnitude is always read relative to the attribute it belongs to. For C3, Structure-based Contrastive Learning treats two POIs as positives only when both tag levels match exactly, making coarse-level-only matches hard negatives. We apply it solely to the residual before the last quantization layer, since the first two layers have by then collapsed co-located POIs.
(a) Problems of directly processing POI geographic coordinates with LLMs

(b) Problems of diverse numerical attribute distributions
(c) Problem of missing structure information in POI embeddings
Figure 1: Three key challenges in encoding POI information into Semantic IDs: geographic coordinates, dynamic numerical attributes, and hierarchical structure.
together while the fidelity they established remains untouched. As these mechanisms enrich the representation rather than append tokens to the identifier, HF-SID achieves this with a 3-token SID, adding no decoding step over the plain quantization baseline. It cuts the average intra-SID geographic distance by 95.9% and lifts Hit@200 by 3.66 points on a large-scale industrial dataset, with consistent online gains after deployment.
In summary, our main contributions are as follows:
-
We identify that existing POI SID methods lose geographic, numerical, and structural fidelity before quantization, and propose HF-SID, which restores all three at the representation level while keeping the SID length unchanged.
-
We introduce a unified numerical representation that encodes coordinates and dynamic attributes as single continuous units, combining a 3D Cartesian transformation with a numerical encoder and per-type type embeddings, and align it with the LLM through two-stage CPT, namely Geo-CPT for spatial reasoning and Num-CPT for scale-aware attribute comparison.
-
We design Structure-based Contrastive Learning, which separates POIs that are co-located or share only a coarse tag but differ at the fine-grained level, and apply it only to the residual of the last quantization layer so that this refinement does not disturb the geographic signal encoded at coarser levels.
-
We open-source AMap-S, a large-scale real-world dataset of POIs and trajectories, and validate HF-SID with large-scale offline experiments and a production deployment on AMap.
2 Related Work
Generative Retrieval reformulates item retrieval as a sequence-to-sequence task in which a language model directly generates structured item identifiers [27, 32]. Its central design choice is the Semantic ID (SID), a short discrete code that must be both generatable by the LLM and semantically faithful to the item. SIDs are commonly obtained by Residual-Quantized Variational AutoEncoders or hierarchical K-Means over item embeddings [19, 26, 37], yielding a coarse-to-fine codebook sequence whose prefixes are shared by similar items, which lets constrained beam search traverse a billion-scale item space and underpins industrial deployments [4, 38]. A direct consequence is that whatever an item embedding fails to encode is irreversibly discarded once quantization is applied, so embedding fidelity, rather than codebook design, is the decisive factor. POI scenarios break down precisely here: text-driven SIDs assign nearly identical codes to semantically similar but spatially distant POIs, while adjacent POIs of different categories share no prefix at all, causing geographical hallucination during generation.
Attribute Enhanced Semantic ID. To inject attribute awareness into POI-oriented SIDs, existing work follows three routes. Discrete spatial tokenization prepends quantized location codes to the semantic code, using S2 Cell encodings as hierarchical geographic prefixes [20], Geohash-based Geographic IDs under triconstrained decoding [2], or hierarchical geographic tokenization with residual quantization [9]. Token-level continuous injection instead perturbs embeddings, through the Geographic Position Embedding of GenPOI [2] and the geo-centroid Geo-RoPE frame of PROEO [8]. Behavior-driven alignment reshapes the embedding space with log-mined supervision, contrasting spatiotemporal co-visit pairs with EM-style [3] SID refinement [31], or adding a diversity loss to RQ-VAE [11] against semantic collapse [30]. All of them act after coordinates have already been serialized as text, and all treat geography as the only structured signal worth modeling. Numerical attributes fare no better: sub-word tokenization destroys numeric continuity and leaves LLMs unreliable at magnitude and comparison [12, 23, 34], and although dedicated encoders that embed a scalar as a single continuous unit largely restore this ability [10], they have been evaluated on reasoning tasks rather than identifier construction. Closest to us, ReSID [14] and HiD-VAE [5] quantize structured recommendation fields and multi-granularity semantics, yet both target general recommendation and neither confronts the heterogeneous attribute scales and spatial hierarchy of POIs.
3 Methods
Given a POI p with its textual description, HF-SID encodes it into a Semantic ID , guided by a single principle: restore geographic, numerical, and structural fidelity at the representation level, before quantization commits the POI to a discrete code. As illustrated in Figure 2, the framework consists of four stages. (1) Coordinate and Numerical Representation ( ): coordinates are converted from spherical to 3D Cartesian form, and every numerical value in the description, coordinates included, is decomposed into a polar representation of its sign, per-digit magnitude, and an angular encoding of its fractional part, with these positions marked as numerical tokens. (2) Numerical Encoder ( ): a dedicated encoder maps each polar representation to a continuous embedding, pretrained to reconstruct the sign, integer digits, and fractional part through three decoder heads, and then frozen and reused by all later stages. (3) Integrating the Numerical Encoder into the LLM ( ): each numerical embedding is projected into the LLM input space, offset by a Type Embedding that gives every attribute type its own subspace, and substituted at its original position to form a unified sequence together with text token embeddings; the LLM is then continually pre-trained by Geo-CPT and Num-CPT under a hybrid objective that applies cross-entropy at text positions and the numerical multi-task loss at numerical positions, and the hidden state of its last token becomes the POI representation. (4) HF-SID Generation with Structure-based Contrastive Learning ( ): the POI representations are hierarchically quantized, where the first two layers cluster on geographic and numerical semantics and therefore give nearby POIs a shared prefix, while Structure-based Contrastive Learning refines the second-order residual before the third layer, so that POIs collapsed together by the coarser levels are separated by their tags in the final SID token.
3.1 Coordinate and Numerical Representation
POIs carry two categories of numerical information: geographic coordinates and dynamic numerical attributes. Standard LLM tokenizers fragment both into sub-tokens but destroy numerical continuity. And coordinates suffer from an additional problem, as raw latitude and longitude differences do not scale linearly with true distance. We therefore introduce two representations: a Cartesian transformation applied to the coordinates, and a unified polar decomposition applied to every numerical value, coordinates included.
3.1.1 Coordinate Transformation. We convert geographic coordinates from spherical to Cartesian form before they are embedded:
where and denote latitude and longitude, and is the mean Earth radius, so that are expressed in meters. Two properties follow. The representation is continuous across the antimeridian, since and now yield adjacent points. And the Euclidean distance between two POIs becomes for a great-circle distance , a strictly monotonic and, at city scale, nearly linear function of true distance, which is far easier to model than raw latitude–longitude differences.
3.1.2 Polar Representation of Numerical Values. For every numerical value in the POI text, coordinates and dynamic attributes alike, we adopt a unified decomposition that treats each scalar as a single unit rather than a digit string. We call it polar because the fractional part is represented by its angle on the unit circle.
Formally, any scalar x is decomposed into a sign, N integer digits, and a fractional part:
where , is the -th integer digit, and is the fractional part. We set to 9, which covers the metric coordinates produced by Eq. (1) as well as all dynamic attributes, and pad shorter values with leading zeros.
Instead of feeding the raw digits , we augment each integer position with the magnitude that follows it:
so that carries both the digit itself and a fractional summary of all lower positions. This makes integer carries continuous: moves smoothly from 3.99 to 4.00 instead of changing three digits at once. Symmetrically, encoding as makes the fractional carry continuous, since and are adjacent on the unit circle.
Lin et al.

Figure 2: Overview of the HF-SID framework.
Concatenating all components yields the polar vector
Since the entries of play different semantic roles, we lift each of them into a -dim vector and add a learnable field embedding:
where is the -th entry of , , are shared learnable parameters, and returns the field type of position . All integer positions share a single embedding , because their order is already encoded in . We write for the resulting representation. Together, the two carry-smoothing encodings and the field embeddings ensure that numerically proximate values are mapped to geometrically adjacent points in the input space.
3.2 Numerical Encoder
We pass the field-augmented polar representation through the Numerical Encoder , a multi-layer perceptron (MLP), to obtain a numerical embedding:
where is the encoder embedding dimension. Note that is far larger than the dimension of , so lifts a single scalar into a high-dimensional space rather than compressing it.
To make this space numerically structured, we pretrain with a multi-task objective requiring every component of the decomposition to be recoverable from h alone. The sign and the N integer positions are predicted by softmax classifiers,
for , while the fractional part is predicted by regression through a sigmoid-activated linear layer:
This objective is not a trivial reconstruction. Since increases dimensionality, no information is at risk of being discarded; what the objective constrains is how that information is arranged. A single h must simultaneously support N independent 10-way classifications, one per digit position, together with a sign classification and a fractional regression, which forces the digit-wise magnitude structure of x to be linearly decodable from separate directions of the embedding. This is also what later allows the same three heads to be attached to the LLM output ( ), since they define what counts as a valid numerical representation.
For a single scalar x, the pretraining loss combines three heads:
where and are cross-entropy losses for the sign and the i-th integer digit, is the mean squared error of the fractional regression, and balance the three terms. The positional weight mildly favours higher-order digits, whose errors shift the value by larger amounts, while keeping the low-order digits supervised; a steeper weighting would let the model ignore the trailing digits, which for attributes such as ratings carry most of the discriminative signal.
After pretraining, is frozen and reused across all downstream stages of HF-SID, providing one consistent embedding space for geographic coordinates and heterogeneous numerical attributes alike.
3.3 Integrating Numerical Encoder into the LLM
3.3.1 Type Embedding. Since the Numerical Encoder is frozen, we bridge it to the LLM with two lightweight trainable components. A linear projection first aligns its output with the LLM input space:
where is the encoder output for the -th numerical token, and are learnable parameters, and is the input embedding dimension of the LLM.
A single shared projection, however, maps every attribute into one common numeric subspace, in which a value of 0.5 is indistinguishable whether it denotes a rating or a visit count. We therefore add a learnable type embedding, drawn from a matrix indexed by a finite set of attribute types , to each numerical embedding according to its own type :
Because the offset is constant within a type, magnitude relations among values of the same attribute are preserved exactly, while different attributes are translated into separate regions of the input space. This is exactly the behavior we want: the model can compare two ratings on a common scale, yet it can no longer confuse a rating with a visit count. The mechanism is analogous to positional embeddings in Transformers [28], which likewise inject a prior about the role of a position without modifying its content.
3.3.2 Fused Embedding Construction. When a POI is serialized, every numerical value is replaced by a single placeholder token [NUM], so that one scalar occupies exactly one position irrespective of how many digits it has; as a side effect this also shortens the input sequence, since a multi-digit number no longer expands into several sub-tokens. We then substitute the type-aware numerical embeddings at these positions and keep ordinary token embeddings elsewhere, before feeding the sequence to the pretrained LLM:
where denotes the [NUM] positions of the input sequence, is the LLM token embedding lookup, is the -th text token, and with the total sequence length. Following common decoder-based embedding models [36], we take the hidden state of the last token as the POI representation , serving as the input to HF-SID generation (§3.4).
3.3.3 Two-Stage Continual Pre-Training
Training Data Construction. We construct two categories of training samples, one for geographic reasoning and one for numerical reasoning, to explicitly supervise the LLM on both dimensions. In every sample, all numerical quantities appear as [NUM] tokens and are encoded by the frozen Numerical Encoder, both in the input and in the target sequence.
Geographic-enhanced Continual Pre-Training (Geo-CPT). To train the model to reason about spatial relationships between POIs, we construct two types of geographic samples: Pairwise Distance Computation. Given two POIs and , whose Cartesian coordinates and are supplied as numerical tokens, the model is asked to predict the distance between them at a single [NUM] position of the target sequence. The ground truth is the great-circle distance in kilometers, computed by the Haversine formula. Note that the quantity directly available from the Cartesian inputs is the chord length rather than itself; the two agree to within for POI pairs closer than 100 km, so at the scale relevant to LBS retrieval this target is effectively the Euclidean distance in the transformed space, while remaining the geographically meaningful quantity. Nearest Pair Identification. Given three POIs , , and , the model is asked to identify the closest pair among , , and , and to emit it as text tokens. This requires jointly reasoning over three pairwise distances rather than computing a single one.
Numerical-enhanced Continual Pre-Training (Num-CPT). We construct samples in which two POIs and are described with multiple numerical attributes, and the model is asked which of them has the larger value of a queried attribute . The target is emitted as text tokens, and we define it over the two candidate labels :
where and are the values of the two POIs under attribute type . Pairs with are discarded, since ties carry no comparative signal and would otherwise train a spurious preference for one of the two positions; we also balance the two labels so that the answer cannot be inferred from position alone. Instantiated across attributes, this formulation forces the model to locate the value belonging to the queried attribute and to compare it against its counterpart of the same type, even though different types differ by orders of magnitude in scale.
Hybrid Training Objective. Because the target sequences contain both discrete text tokens and numerical tokens, we adopt a hybrid objective that applies a different loss at each kind of position. Let and denote the text and numerical positions of the target sequence, and let denote the fused prefix of position k, which may contain both text token embeddings and injected numerical embeddings. At text positions we apply the standard cross-entropy next-token prediction (NTP) loss:
where is the ground-truth text token at position . Conditioning on rather than on is what allows a numerical value to act as context for the tokens that follow it.
At numerical positions we reuse the multi-task loss , applying the same three decoder heads to the LLM output representation:
where is the target value at position k, and its sign, integer, and fractional losses are computed from the LLM hidden state at that position. Both terms are averaged over their own positions so that their relative weight does not drift with the text-to-number ratio of a sample. And each of the two stages is trained with
where balances the numerical alignment loss against next-token prediction. We run Geo-CPT first and Num-CPT second, since geographic fidelity is the dominant factor for LBS retrieval
Lin et al.
and therefore benefits from being established on the unmodified backbone.
3.4 HF-SID Generation with Structure-based Contrastive Learning
We obtain Semantic IDs by residual-quantizing the POI representations of the entire corpus with three layers of K-means. Writing , layer fits a codebook of size over the -th order residuals of all POIs, assigns each POI to its nearest centroid, and forwards the remaining residual:
where is the last-token embedding of the LLM and every layer uses the same codebook size . The first two layers are applied in standard form and yield the coarse tokens and , which reflect the geographic and numerical semantics.
Precisely because these two layers are geographically compact, POIs located in the same business district are largely collapsed into a shared prefix irrespective of what they actually are. We therefore refine the second-order residual before the final quantization, supervised by the two-level tag of each POI. Two POIs form a positive pair only when both levels of their tags coincide, and every other POI in the mini-batch serves as a negative, so that POIs agreeing on the coarse level alone act as hard negatives. The residual is linearly projected,
and optimized with an InfoNCE objective over inner products:
where and are learnable projection parameters with output dimension and the only parameters updated at this stage, collects the in-batch POIs whose tag differs from that of at either level, is a temperature hyperparameter, and the loss is averaged over all positive pairs in the batch. Since the LLM and the first two codebooks stay fixed, is a constant input and the refinement never invalidates the coarse tokens.
The refined residual is then quantized by the third K-means layer into , so that POIs sharing a fine-grained tag tend to fall into the same third-layer cluster, and each POI is finally represented as
Note that this last layer operates in the projected space rather than in , and therefore no longer reconstructs in the strict residual-quantization sense. This is deliberate: an SID serves only as an identifier to be generated autoregressively and is never used to reconstruct the POI representation, so the final layer can trade reconstruction error for discriminative power. Restricting the projection to the last layer is what keeps the geographic and numerical fidelity of intact, as the analysis in §4.4 confirms.
The resulting sequence retains the prefix-sharing property of residual quantization: POIs with similar representations agree on
Table 1: Dataset statistics.
| Dataset | #Users | #POIs | #Inter. | Avg.Len |
|---|---|---|---|---|
| NYC | 1,083 | 5,135 | 104,074 | 136 |
| TKY | 2,293 | 7,873 | 361,430 | 195 |
| AMap-L | 11.0M | 48.1M | 16.3M | 305 |
| AMap-S | 0.90M | 4.58M | 0.97M | 453 |
their leading tokens, while the last token separates them by fine-grained tag. Candidate generation can thus be performed by beam search constrained to the prefix tree of valid SIDs.
4 Experiments
4.1 Experimental Setup
Datasets. We evaluate on two industrial datasets from the AMap platform and two public Foursquare check-in datasets (NYC, TKY). AMap-L is built from one full day of anonymized user interaction logs. For data quality, we remove POIs with no associated interaction sequence and exclude sessions without authenticated user identifiers. AMap-S is a publicly released subset from the same platform: smaller in scale but retaining the same attributes, it can serve as a standardized benchmark for future work. Statistics are summarized in Table 1.
Baselines. We compare our HF-SID against the following SID construction methods. RQ-KMeans [19], RQ-OPQ [1], GNPR-SID [30], Cosine-RQ [39], Pro-GEO [8], GenPOI [2], GeoGR [31]. Detailed information can be found in the given references. For fair comparison, all baselines are re-implemented under the same configuration as HF-SID: codebook depth , per-layer codebook size on AMap-L and on AMap-S, and identical dataset splits.
Evaluation Metrics. We evaluate both the quality of HF-SID and downstream performance through Next POI recommendation task [8, 30]. (1) Quantization Metrics of SID. Follow prior work [8], we use 4 metrics: ICR, Avg.Dist, p90 Dist, p95 Dist. ICR (Independent Codeword Rate, ↑) measures the degree to which codewords are assigned uniquely across items. Avg.Dist (↓) computes the mean Euclidean distance from each POI's position to the centroid of its quantification SID, providing a measure of intra-group spatial compactness. Additionally, we report p90 Dist and p95 Dist, representing the maximum distance to the SID centroid within the top 90% and 95% of POIs. (2) Offline Recommendation Metrics. Hit@200 and Hit@300 (↑) measure the proportion of ground-truth target POIs appearing within the top-200 and top-300 generated candidates, respectively, jointly reflecting retrieval precision and recall coverage. (3) Online Recommendation Metrics. We evaluate online performance using five metrics: WinRate (↑), a composite metric that quantifies overall user engagement gains by weighting strategic actions such as clicks, route navigation, and bookings according to their value, reflecting holistic improvements in both user satisfaction and platform utility. PV_CTR and UV_CTR measure click-through rates at the exposure and user levels, respectively. PV_CVR and UV_CVR measure conversion rates at the exposure and user levels, respectively.
Implementation Details. All experiments are implemented in PyTorch. Following prior work [10], we implement the Numerical Encoder. The embedding model's backbone is initialized from
Table 2: Performance comparison on AMap-L and AMap-S datasets. Bold denotes the best result within each dataset.
| Dataset | Method | SID Length | Quantization Metrics | Rec. Metrics | ||||
|---|---|---|---|---|---|---|---|---|
| ICR(↑) | Avg.Dist.(↓) | p90 Dist.(↓) | p95 Dist.(↓) | Hit@200(↑) | Hit@300(↑) | |||
| AMap-L | RQ-KMeans [19] | 3 | 80.92% | 6.07 km | 2.66 km | 15.21 km | 54.47% | 56.02% |
| RQ-OPQ [1] | 3 | 98.93% | 7.27 km | 5.03 km | 23.78 km | 54.88% | 55.31% | |
| GNPR-SID [30] | 3 | 77.57% | 10.67 km | 5.08 km | 16.27 km | 58.38% | 67.65% | |
| Cosine-RQ [39] | 3 | 82.63% | 5.26 km | 2.33 km | 13.32 km | 55.62% | 58.83% | |
| Pro-GEO [8] | 3 | 81.18% | 7.02 km | 4.84 km | 23.33 km | 65.69% | 70.51% | |
| GeoGR [31] | 3 | 54.69% | 0.49 km | 0.74 km | 1.19 km | 77.58% | 80.42% | |
| GenPOI [2] | 6(3+3) | 83.80% | 0.97 km | 0.55 km | 5.53 km | 70.61% | 73.82% | |
| HF-SID (Ours) | 3 | 84.22% | 0.25 km | 0.12 km | 0.69 km | 81.24% | 83.36% | |
| AMap-S | RQ-KMeans [19] | 3 | 61.34% | 37.91 km | 88.48 km | 207.85 km | 27.36% | 33.07% |
| RQ-OPQ [1] | 3 | 98.71% | 41.20 km | 96.94 km | 226.36 km | 26.26% | 26.71% | |
| GNPR-SID [30] | 3 | 47.52% | 77.82 km | 229.70 km | 485.91 km | 29.64% | 36.83% | |
| Cosine-RQ [39] | 3 | 63.68% | 36.32 km | 74.59 km | 197.81 km | 28.95% | 33.78% | |
| Pro-GEO [8] | 3 | 64.64% | 24.25 km | 49.54 km | 132.85 km | 34.54% | 38.39% | |
| GeoGR [31] | 3 | 37.83% | 8.94 km | 14.07 km | 46.15 km | 35.02% | 40.50% | |
| GenPOI [2] | 5(2+3) | 62.12% | 4.84 km | 15.71 km | 25.14 km | 38.04% | 43.29% | |
| GenPOI [2] | 6(3+3) | 65.97% | 3.22 km | 11.30 km | 18.19 km | 42.20% | 46.91% | |
| HF-SID (Ours) | 3 | 59.79% | 3.99 km | 5.49 km | 11.12 km | 48.98% | 57.92% | |
Qwen3-0.6B [36] for POI representation learning and SID generation, while the downstream next-POI prediction task uses Qwen3-4B [33] with full-parameter supervised fine-tuning (SFT). Beam search is performed with a width of 300 to generate the final list of POIs. Continual pre-training runs for 1 epoch with AdamW [18] at learning rate . SFT also runs for 1 epoch with a cosine scheduler, learning rate , per-device batch size 8, and gradient accumulation of 4 steps, using DeepSpeed ZeRO-2 [25] with bf16 mixed precision. For RQ-KMeans we set layers, consistent with prior work [4]. All experiments run on 64 NVIDIA A100 GPUs.
4.2 Overall Performance
We examine whether the representation-level fidelity that HF-SID enforces actually translates into better SIDs and better retrieval performance. Table 2 compares HF-SID against seven baselines covering the three ways of building POI SIDs: text-only quantization, post-hoc geographic injection, and embedding-space alignment.
HF-SID Quality. On both datasets the compactness of the SID space improves monotonically with how early geography enters the pipeline, and HF-SID, which intervenes earliest, is the most compact of all. Methods that quantize text-only embeddings stay at 5.26–10.67 km of Avg. Dist. on AMap-L and 36.32–77.82 km on AMap-S, regardless of how their codebooks are refined: orthogonal product quantization [1], a codeword diversity loss [30], and stronger text representations [39] all leave the geographic error essentially untouched, because none of them puts geographic information into the embedding to begin with. Injecting geography afterwards helps (7.02 km for Pro-GEO, 0.97 km for the 6-token GenPOI), and reshaping the embedding space with behavioral supervision helps further (0.49 km for GeoGR), but HF-SID reaches 0.25 km and 3.99 km, cutting Avg. Dist. by 95.9% and 89.5% relative to plain RQ-KMeans and by a further 48.98% and 55.4% relative to GeoGR. Its advantage is largest in the tail, which is the regime that produces visibly wrong candidates: p90 Dist. drops by 83.8% and 61.0% and p95 Dist. by 42.0% and 75.9% against the same baseline. Notably, on AMap-S HF-SID halves the p90 Dist. of the 6-token GenPOI (11.30 → 5.49 km) and reduces its p95 Dist. by 38.9% (18.19 → 11.12 km) using half the identifier length, although GenPOI retains a slightly lower mean of 3.22 km under that doubled token budget.
Two baselines further show that codeword uniqueness on its own is not a meaningful objective. RQ-OPQ attains a near-saturated ICR of 98.93% and 98.71%, yet its Avg. Dist. is worse than that of plain RQ-KMeans on both datasets and its Hit@300 is the lowest of all methods on both (55.31% and 26.71%): spreading items evenly over the codebook says nothing about whether the code carries usable structure. GeoGR fails in the opposite direction, buying geographic compactness with the lowest ICR of the table (54.69% and 37.83%), because contrastive fine-tuning on co-visit pairs collapses behaviorally similar POIs onto shared codewords. HF-SID avoids both failure modes because it encodes the coordinate itself rather than a proxy of it, and with an ICR of 84.22% on AMap-L it is the most collision-resistant among all methods whose Avg. Dist. stays below 1 km.
Retrieval Performance. The gains in SID quality carry over to downstream retrieval in full, and the ordering of methods by Hit mirrors their ordering by SID compactness almost exactly. All methods are fine-tuned under identical settings and differ only in their SIDs. HF-SID attains Hit@200 of 81.24% and 48.98% and Hit@300 of 83.36% and 57.92%, exceeding the strongest baseline on each dataset by 3.66 and 6.78 points on Hit@200 and by 2.94 and 11.01 points on Hit@300, the latter amounting to a 23.48% relative gain on AMap-S while using half the tokens of the 6-token GenPOI it surpasses. Across the eight AMap-L systems, Hit@200 rises from the 54–58% range for the four text-only methods, to 65.69% and 70.61% once geography is injected post hoc, to 77.58% and 81.24% once the embedding itself becomes geography-aware. That the two orderings coincide is the central evidence of this paper: the retrieval gain is not an artefact of a particular codebook design but a direct consequence of how much geographic and numerical fidelity survives into the identifier.
4.3 Ablation Study
We ablate HF-SID on AMap-L in a leave-one-out fashion. No variant removes any information: when a component is disabled, the corresponding attribute stays in the POI description as plain text.
Lin et al.
Table 3: Ablation study on AMap-L.
| Method | Hit@200 (↑) | ΔHit@200 | Hit@300 (↑) | ΔHit@300 |
|---|---|---|---|---|
| HF-SID (Full) | 81.24% | - | 83.36% | - |
| w/o Num | 77.73% | -4.32% | 80.65% | -3.25% |
| w/o Struct | 71.88% | -11.52% | 78.35% | -6.01% |
| w/o Geo | 68.34% | -15.88% | 71.11% | -14.69% |
| w/o All (Baseline) | 54.47% | -32.95% | 56.02% | -32.79% |
w/o Geo drops the Cartesian transformation, the Numerical Encoder on coordinates, and Geo-CPT; w/o Num drops the Numerical Encoder on dynamic attributes, the Type Embedding, and Num-CPT; w/o Struct drops the contrastive refinement, letting the third layer quantize directly; w/o All reduces to plain RQ-KMeans. All variants therefore see identical content and differ only in how faithfully it is represented, so the drops below measure the value of representation fidelity rather than of information availability.
Every component contributes, and the size of its contribution follows the level of the SID hierarchy at which it acts. Removing the geographic pathway costs the most, with Hit@200 falling from 81.24% to 68.34% (-15.88%) and Hit@300 from 83.36% to 71.11% (-14.69%): geographic fidelity is established before quantization and thus shapes the first two codebook layers, that is, the entire prefix tree over which generation is constrained, so degrading it corrupts every subsequent decoding decision. Structure-based Contrastive Learning acts on only one token out of three, and its cost accordingly halves from Hit@200 (-11.52%) to Hit@300 (-6.01%), indicating that tag purity matters mainly for ranking the correct POI early rather than for reaching it at all. The numerical pathway is the smallest (-4.32% and -3.25%), as ratings and visit counts refine the ordering among already plausible candidates instead of deciding which region of the identifier space is explored.
The entire gap to the baseline is attributable to the representation alone. With all three components disabled the model returns to plain RQ-KMeans at 54.47% and 56.02%, so HF-SID's 26.77-point gain on Hit@200 is obtained without changing the quantization algorithm, the codebook size, or the identifier length. The same procedure that ranks last in Table 2 ranks first once the representation it quantizes is made geography- and numeracy-aware.
4.4 Visualization Analysis of HF-SID
Through detailed experiments, we explore how much geographic, numerical, and structural information HF-SID carries.
4.4.1 Visualization of Geographic Information. We sample 1,554 POIs across three administrative levels (Province, City, and District), embed them with t-SNE using the geographic label as color, and report the NMI before and after Geo-CPT. As shown in Figure 3, the baseline embeddings remain largely overlapped at every granularity, whereas HF-SID forms tight and well-separated clusters, with NMI rising from 0.1993 to 0.7454 at Province, 0.2615 to 0.9796 at City, and 0.3972 to 0.9399 at District. This embedding-space geometry is exactly what produces the SID-space compactness of Table 2: fidelity established in the representation survives into the code.
4.4.2 Analysis of Numerical Awareness. To assess numerical awareness, we measure the intra-HF-SID dispersion of five heterogeneous attributes: Rating, POI Visited, POI Index, Collect UV, and Week

(a) Province Baseline

(b) City Baseline

(c) District Baseline

(d) Province HF-SID

(e) City HF-SID

(f) District HF-SID
Figure 3: t-SNE visualization of POI embeddings.
View UV. For every HF-SID cluster with more than one POI we compute the Standard Deviation (Std), Coefficient of Variation (CV), and Mean Absolute Deviation (MAD), and report their macro-averages, where lower values indicate greater numerical coherence (Table 4).
HF-SID attains the best dispersion on all five attributes, and the margin scales with how demanding the attribute is. On Rating, which is confined to a narrow 0–5 range, the improvement over the second-best baseline Pro-GEO is small but consistent (Avg.Std 0.1831 → 0.1817, Avg.CV 0.0918 → 0.0916, Avg.MAD 0.2610 → 0.2608). The advantage widens sharply on heavy-tailed attributes spanning several orders of magnitude: on POI Visited, HF-SID cuts Avg.Std by 77.5% (222.486 → 49.955) and Avg.MAD by 76.9% (208.249 → 48.180) against the second-best baseline on each metric, and also lowers Avg.CV from 1.0600 to 1.0297, showing that relative dispersion is reduced even under extreme scale. The same pattern holds on POI Index (Avg.Std -9.3%, Avg.CV -7.2%, Avg.MAD -9.5% over Pro-GEO) and on Collect UV and Week View UV (Avg.Std -38.2% and -42.4%, Avg.MAD -29.5% and -38.2% over their second-best baselines). That a single frozen encoder handles all five distributions confirms that the numerical pathway generalizes across scales rather than fitting any one attribute.
4.4.3 Visualization of Structural Awareness. Here each POI's structure is its two-level tag of the form “parent/child”, e.g., “Food/Chinese Food”. We compare HF-SID with RQ-KMeans by visualizing the tag, region, and rating distributions induced by SID prefixes of increasing length, namely , , and (Figure 4). HF-SID shows better geographic and rating organization at all three prefix lengths, while its structural advantage emerges specifically at the third token: under a shared parent prefix (3443, 2290, *), its L3 children are almost tag-pure, each corresponding to a distinct fine-grained food category. This is by design, as Structure-based Contrastive Learning acts only on the third-level residual. The first two levels are left to encode geographic, numerical, and semantic information, geography above all; applying the contrastive objective there would compete with the geographic signal that dominates retrieval, which is precisely the failure the last-layer-only design avoids.
4.5 Experiments on Public Datasets
In this section, we evaluate on two public Foursquare check-in datasets, NYC and TKY. Unlike the AMap dataset, these datasets
Table 4: Intra-SID numerical attribute dispersion comparison across methods. Bold denotes the best result.
| Method | Rating ↓ | POI Visited ↓ | POI Index ↓ | Collect UV ↓ | Week View UV ↓ | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Avg.Std | Avg.CV | Avg.MAD | Avg.Std | Avg.CV | Avg.MAD | Avg.Std | Avg.CV | Avg.MAD | Avg.Std | Avg.CV | Avg.MAD | Avg.Std | Avg.CV | Avg.MAD | |
| GeoGR | 0.2474 | 0.1001 | 0.2880 | 1.2474 | 0.6121 | 0.4063 | 0.5695 | 24.953 | 0.4537 | 24.897 | 7.631 | 0.7137 | 7.196 | ||
| Pro-GEO | 0.1831 | 0.0918 | 0.2610 | 1.0661 | 0.4894 | 0.3381 | 0.4696 | 30.018 | 0.3716 | 33.077 | 7.924 | 0.6292 | 7.830 | ||
| GenPOI | 0.2027 | 0.0947 | 0.2731 | 253.178 | 1.0600 | 236.968 | 0.5133 | 0.3462 | 0.4951 | 30.554 | 0.3701 | 33.572 | 8.188 | 0.6244 | 8.166 |
| RQ-KMeans | 0.2138 | 0.0982 | 0.2808 | 222.486 | 1.0753 | 208.249 | 0.5124 | 0.3554 | 0.4934 | 27.755 | 0.3697 | 30.237 | 7.573 | 0.6307 | 7.515 |
| HF-SID | 0.1817 | 0.0916 | 0.2608 | 49.955 | 1.0297 | 48.180 | 0.4438 | 0.3138 | 0.4251 | 15.426 | 0.3650 | 17.545 | 4.366 | 0.5962 | 4.451 |

Figure 4: Hierarchical semantic consistency of SID prefixes. For prefixes of increasing length , , , we visualize the tag, region, and rating distributions under each. HF-SID shows stronger geographic locality and more concentrated ratings at deeper levels; under a shared parent (3443, 2290, *), its L3 children are nearly tag-pure, each a distinct fine-grained category, reflecting Structure-based Contrastive Learning on the third-level residual.
Table 5: Performance comparison on public datasets.
| Dataset | Method | ICR (↑) | Avg.Dist. (↓) | Hit@5 (↑) |
|---|---|---|---|---|
| NYC | RQ-KMeans | 52.13% | 6.96 km | 41.23% |
| GNPR-SID | 19.74% | 5.52 km | 44.34% | |
| Cosine-RQ | 16.57% | 4.61 km | 42.87% | |
| Pro-GEO | 55.29% | 6.10 km | 53.00% | |
| HF-SID | 56.12% | 3.99 km | 59.83% | |
| TKY | RQ-KMeans | 49.12% | 7.21 km | 30.00% |
| GNPR-SID | 18.50% | 5.67 km | 33.68% | |
| Cosine-RQ | 13.69% | 5.66 km | 35.27% | |
| Pro-GEO | 45.60% | 6.19 km | 49.27% | |
| HF-SID | 54.46% | 4.41 km | 57.37% |
provide only coordinates and check-in records, without the rich dynamic numerical attributes or fine-grained category structure that Num-CPT and Structure-based Contrastive Learning rely on. We therefore apply only Geo-CPT and report results in Table 5.
HF-SID achieves the best performance on both datasets across all three metrics. On the SID quality side, Avg.Dist. drops from 6.96 km to 3.99 km on NYC (-42.7%) and from 7.21 km to 4.41 km on TKY (-38.8%), while ICR improves to 56.12% and 54.46% respectively—both the highest among all methods. Notably, while GNPR-SID and Cosine-RQ achieve better Avg.Dist. than RQ-KMeans on NYC (5.52 km and 4.61 km), their ICR collapses to below 20%, indicating severe codeword collision at the cost of geographic coherence.
Table 6: Online A/B experiments.
| Online Metrics | WinRate | PV_CTR | UV_CTR | PV_CVR | UV_CVR |
|---|---|---|---|---|---|
| Restaurant | +0.35% | +0.24% | +0.14% | +5.89% | +5.63% |
| Life Services | +1.54% | +0.79% | +0.23% | +2.81% | +2.68% |
| Tourist Attraction | +0.87% | +0.97% | +0.50% | +11.51% | +9.79% |
| Ave. Imp. | +0.92% | +0.67% | +0.29% | +6.74% | +6.03% |
HF-SID is the only method that improves both metrics simultaneously. On the retrieval side, HF-SID achieves Hit@5 of 59.83% on NYC and 57.37% on TKY, outperforming the strongest baseline Pro-GEO by 6.83 and 8.10 points respectively, demonstrating that finer geographic SIDs directly translate to better retrieval accuracy.
The relative Avg.Dist. reduction is smaller than on AMap-L (-42.7% vs. -95.9%), which is expected: public datasets contain far fewer POIs, so each codebook cluster spans a larger and more geographically dispersed set of POIs, making fine-grained spatial aggregation inherently harder. Even so, consistent gains across two independent cities confirm that Geo-CPT's Cartesian coordinate encoding is robust and platform-agnostic.
4.6 Online A/B Test
HF-SID has been deployed on the AMap homepage POI recommendation pipeline, replacing a previously deployed generative retrieval method that already encodes geographic information into its SIDs.
Lin et al.
The inference pipeline is unchanged: a prompt is assembled from personalized preferences, historical behaviour trajectories, and real-time context including current location, timestamp, and search query; candidates are then generated autoregressively via beam search and passed to the downstream fine-ranking and re-ranking modules. Since the two systems differ only in the SID generation model, the comparison isolates the contribution of HF-SID itself. We ran a one-week A/B test across three representative scenarios, namely Restaurant, Life Services, and Tourist Attraction.
As shown in Table 6, HF-SID improves every metric in every scenario, and the gains concentrate where fidelity is decisive. Averaged over the three scenarios, PV_CVR rises by 6.74% and UV_CVR by 6.03%, an order of magnitude beyond the corresponding CTR gains of 0.67% and 0.29%. The asymmetry is expected: clicks are driven largely by surface content such as the POI title and cover image, whereas conversion depends on whether the POI is genuinely reachable and genuinely of the intended category, which is exactly what a higher-fidelity identifier preserves. Consistently, Tourist Attraction benefits most with PV_CVR up 11.51%, as it combines the widest geographic span of candidates with dense co-located POIs inside a single scenic area. These gains are obtained over a production system that was already geography-aware.
5 Conclusion
In this paper, we present HF-SID, a high-fidelity Semantic ID framework for generative POI retrieval in LBS. HF-SID converts coordinates into a continuous 3D Cartesian form and encodes every numerical value as a single unit through a dedicated Numerical Encoder, fuses these embeddings into the LLM with a Type Embedding that gives each attribute type its own subspace, and aligns the model via Geo-CPT and Num-CPT. A Structure-based Contrastive Learning objective, applied only to the residual before the last quantization layer, then separates co-located POIs that share a coarse tag but differ at the fine level. All mechanisms act at the embedding level and add no token overhead. Deployed on the AMap platform, HF-SID consistently improves both offline SID quality and online business metrics over the previous system, and we release AMap-S, a large-scale real-world POI benchmark.
References
[1] Ben Chen, Xian Guo, Siyuan Wang, Zihan Liang, Yue Lv, Yufei Ma, Xinlong Xiao, Bowen Xue, Xuxin Zhang, Ying Yang, et al. 2025. Onesearch: A preliminary exploration of the unified end-to-end generative framework for e-commerce search. arXiv preprint arXiv:2509.03236 (2025).
[2] Dong Chen, Shuai Zheng, Haoyang Shao, Hongsheng Wu, Muhao Xu, Yeyu Yan, Ruifang Li, and Zhenfeng Zhu. 2026. Revisiting General Map Search via Generative Point-of-Interest Retrieval. arXiv:2605.03397 [cs.IR]
[3] Arthur P Dempster, Nan M Laird, and Donald B Rubin. 1977. Maximum likelihood from incomplete data via the EM algorithm. Journal of the royal statistical society: series B (methodological) 39, 1 (1977), 1–22.
[4] Jiaxin Deng, Shiyao Wang, Kuo Cai, Lejian Ren, Qigen Hu, Weifeng Ding, Qiang Luo, and Guorui Zhou. 2025. Onerec: Unifying retrieve and rank with generative recommender and iterative preference alignment. arXiv preprint arXiv:2502.18965 (2025).
[5] Dengzhao Fang, Jingtong Gao, Chengcheng Zhu, Yu Li, Xiangyu Zhao, and Yi Chang. 2025. Hid-vae: Interpretable generative recommendation via hierarchical and disentangled semantic ids. arXiv preprint arXiv:2508.04618 (2025).
[6] Yunfan Gao, Yun Xiong, Siqi Wang, and Haofen Wang. 2022. GeoBERT: Pretraining geospatial representation learning on point-of-interest. Applied Sciences 12, 24 (2022), 12942.
[7] Xingzhuo Guo, Junwei Pan, Ximei Wang, Baixu Chen, Jie Jiang, and Mingsheng Long. 2024. On the Embedding Collapse when Scaling up Recommendation
Models. arXiv:2310.04400 [cs.LG]
[8] Tian He, Chen Yang, Jiawei Zhang, Lin Guo, Wei Lin, and Zhuqing Jiang. 2026. Birds of a Feather Cluster Nearby: a Proximity-Aware Geo-Codebook for Local Service Recommendation. arXiv:2604.23156 [cs.IR]
[9] Hao Jiang, Guoquan Wang, Donglin Zhou, Sheng Yu, Yang Zeng, Wencong Zeng, Kun Gai, and Guorui Zhou. 2025. LLM-Aligned Geographic Item Tokenization for Local-Life Recommendation. arXiv:2511.14221 [cs.IR]
[10] Shengkai Jin, Tianyu Chen, Chonghan Gao, and Jun Han. 2026. GeoNum: Bridging Numerical Continuity and Language Semantics via Geometric Embedding. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 40. 22426–22434.
[11] Doyup Lee, Chiheon Kim, Saehoon Kim, Minsu Cho, and Wook-Shin Han. 2022. Autoregressive image generation using residual quantization. In 2022 IEEE/CVF conference on computer vision and pattern recognition (CVPR). IEEE, 11513–11522.
[12] Haoyang Li, Xuejia Chen, Zhanchao Xu, Darian Li, Nicole Hu, Fei Teng, Yiming Li, Luyu Qiu, Chen Jason Zhang, Li Qing, et al. 2025. Exposing numeracy gaps: A benchmark to evaluate fundamental numerical abilities in large language models. In Findings of the Association for Computational Linguistics: ACL 2025. 20004–20026.
[13] Xiaoxi Li, Jiajie Jin, Yujia Zhou, Yuyao Zhang, Peitian Zhang, Yutao Zhu, and Zhicheng Dou. 2025. From matching to generation: A survey on generative information retrieval. ACM Transactions on Information Systems 43, 3 (2025), 1–62.
[14] Yu Liang, Zhongjin Zhang, Yuxuan Zhu, Kerui Zhang, Zhiluohan Guo, Wenhang Zhou, Zonqi Yang, Kangle Wu, Yabo Ni, Anxiang Zeng, et al. 2026. Rethinking Generative Recommender Tokenizer: Recsys-Native Encoding and Semantic Quantization Beyond LLMs. arXiv preprint arXiv:2602.02338 (2026).
[15] Haitao Lin, Zhen Yang, Jiawei Xue, Ziji Zhang, Luzhu Wang, Yikun Gu, Yao Xu, and Xin Li. 2025. Spacetime-gr: A spacetime-aware generative model for large scale online poi recommendation. arXiv preprint arXiv:2508.16126 (2025).
[16] Jiajun Liu, Haoran Li, Yong Gao, Hao Yu, and Dan Jiang. 2014. A geohash-based index for spatial data management in distributed memory. In 2014 22Nd international conference on geoinformatics. IEEE, 1–4.
[17] Wei Liu, Zhao Liu, Muzu Xie, Huaijie Zhu, Jianxing Yu, Jian Yin, and Wang-Chien Lee. 2026. Geography-aware large language models for next poi recommendation. In 2026 IEEE 42nd International Conference on Data Engineering (ICDE). IEEE, 2264–2277.
[18] Ilya Loshchilov and Frank Hutter. 2019. Decoupled Weight Decay Regularization. arXiv:1711.05101 [cs.LG]
[19] Xinchen Luo, Jiangxia Cao, Tianyu Sun, Jinkai Yu, Rui Huang, Wei Yuan, Hezheng Lin, Yichen Zheng, Shiyao Wang, Qigen Hu, Changqing Qiu, Jiaqi Zhang, Xu Zhang, Zhiheng Yan, Jingming Zhang, Simin Zhang, Mingxing Wen, Zhaojie Liu, Kun Gai, and Guorui Zhou. 2024. QARM: Quantitative Alignment Multi-Modal Recommendation at Kuaishou. arXiv:2411.11739 [cs.IR]
[20] Dongyi Lv, Qiuyu Ding, Heng-Da Xu, Zhaoxu Sun, Zhi Wang, Feng Xiong, and Mu Xu. 2026. Reasoning Over Space: Enabling Geographic Reasoning for LLM-Based Generative Next POI Recommendation. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 7322–7336.
[21] Shervin Minaee, Tomas Mikolov, Narjes Nikzad, Meysam Chenaghlu, Richard Socher, Xavier Amatriain, and Jianfeng Gao. 2024. Large language models: A survey. arXiv preprint arXiv:2402.06196 (2024).
[22] Humza Naveed, Asad Ullah Khan, Shi Qiu, Muhammad Saqib, Saeed Anwar, Muhammad Usman, Naveed Akhtar, Nick Barnes, and Ajmal Mian. 2025. A comprehensive overview of large language models. ACM Transactions on Intelligent Systems and Technology 16, 5 (2025), 1–72.
[23] Aoxin Ni. 2026. Numeracy in Large Language Models: Fundamental Limitations and Paths to Improvement. arXiv preprint arXiv:2608.13129 (2026).
[24] Ming Pang, Chunyuan Yuan, Xiaoyu He, Zheng Fang, Donghao Xie, Fanyi Qu, Xue Jiang, Changping Peng, Zhangang Lin, Zheng Luo, et al. 2025. Generative retrieval and alignment model: A new paradigm for e-commerce retrieval. In Companion Proceedings of the ACM on Web Conference 2025. 413–421.
[25] Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. 2020. ZeRO: Memory Optimizations Toward Training Trillion Parameter Models. arXiv:1910.02054 [cs.LG]
[26] Shashank Rajput, Nikhil Mehta, Anima Singh, Raghunandan Hulikal Keshavan, Trung Vu, Lukasz Heldt, Lichan Hong, Yi Tay, Vinh Tran, Jonah Samost, et al. 2023. Recommender systems with generative retrieval. Advances in Neural Information Processing Systems 36 (2023), 10299–10315.
[27] Yi Tay, Vinh Q. Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, Kai Hui, Zhe Zhao, Jai Gupta, Tal Schuster, William W. Cohen, and Donald Metzler. 2022. Transformer Memory as a Differentiable Search Index. arXiv:2202.06991 [cs.CL]
[28] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. 2023. Attention Is All You Need. arXiv:1706.03762 [cs.CL]
[29] Eric Veach, Jim Rosenstock, Eric Engle, and Tom Manshreck. 2017. S2 Geometry Library: Computational geometry and spatial indexing on the sphere. Software (2017).
[30] Dongsheng Wang, Yuxi Huang, Shen Gao, Yifan Wang, Chengrui Huang, and Shuo Shang. 2025. Generative Next POI Recommendation with Semantic ID. arXiv:2506.01375 [cs.IR]
[31] Fangye Wang, Haowen Lin, Yifang Yuan, Siyuan Wang, Xiaojiang Zhou, Song Yang, and Pengjie Wang. 2026. GeoGR: A Generative Retrieval Framework for Spatio-Temporal Aware POI Recommendation. arXiv:2602.10411 [cs.IR]
[32] Yujing Wang, Yingyan Hou, Haonan Wang, Ziming Miao, Shibin Wu, Hao Sun, Qi Chen, Yuqing Xia, Chengmin Chi, Guoshuai Zhao, Zheng Liu, Xing Xie, Hao Allen Sun, Weiwei Deng, Qi Zhang, and Mao Yang. 2023. A Neural Corpus Indexer for Document Retrieval. arXiv:2206.02743 [cs.IR]
[33] An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, Chujie Zheng, Dayiheng Liu, Fan Zhou, Fei Huang, Feng Hu, Hao Ge, Haoran Wei, Huan Lin, Jialong Tang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jing Zhou, Jingren Zhou, Junyang Lin, Kai Dang, Keqin Bao, Kexin Yang, Le Yu, Lianghao Deng, Mei Li, Mingfeng Xue, Mingze Li, Pei Zhang, Peng Wang, Qin Zhu, Rui Men, Ruize Gao, Shixuan Liu, Shuang Luo, Tianhao Li, Tianyi Tang, Wenbiao Yin, Xingzhang Ren, Xinyu Wang, Xinyu Zhang, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yinger Zhang, Yu Wan, Yuqiong Liu, Zekun Wang, Zeyu Cui, Zhenru Zhang, Zhipeng Zhou, and Zihan Qiu. 2025. Qwen3 Technical Report. arXiv:2505.09388 [cs.CL]
[34] Haotong Yang, Yi Hu, Shijia Kang, Zhouchen Lin, and Muhan Zhang. 2025. Number Cookbook: Number Understanding of Language Models and How to Improve It. arXiv:2411.03766 [cs.CL]
[35] Fuwei Zhang, Xiaoyu Liu, Xinyu Jia, Yingfei Zhang, Zenghua Xia, Fei Jiang, Fuzhen Zhuang, Wei Lin, and Zhao Zhang. 2025. HierGR: Hierarchical semantic representation enhancement for generative retrieval in food delivery search. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 6: Industry Track). 444–455.
[36] Yanzhao Zhang, Mingxin Li, Dingkun Long, Xin Zhang, Huan Lin, Baosong Yang, Pengjun Xie, An Yang, Dayiheng Liu, Junyang Lin, Fei Huang, and Jingren Zhou. 2025. Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models. arXiv:2506.05176 [cs.CL]
[37] Bowen Zheng, Yupeng Hou, Hongyu Lu, Yu Chen, Wayne Xin Zhao, Ming Chen, and Ji-Rong Wen. 2024. Adapting Large Language Models by Integrating Collaborative Semantics for Recommendation. arXiv:2311.09049 [cs.IR]
[38] Guorui Zhou, Hengrui Hu, Hongtao Cheng, Huanjie Wang, Jiaxin Deng, Jinghao Zhang, Kuo Cai, Lejian Ren, Lu Ren, Liao Yu, et al. 2025. Onerec-v2 technical report. arXiv preprint arXiv:2508.20900 (2025).
[39] Jingyi Zhou, Cheng Chen, Kai Zuo, Manjie Xu, Zhendong Fu, Yibo Chen, Xu Tang, and Yao Hu. 2026. HyMiRec: A Hybrid Multi-interest Learning Framework for LLM-based Sequential Recommendation. In Proceedings of the ACM Web Conference 2026. 5998–6008.
A Appendix
A.1 Case Study
We further provide a case study to illustrate how the SID quality improvements translate into concrete retrieval behavior. Figure 5 compares the generated POI candidates of the baseline and HF-SID under the same user context.
The baseline retrieves candidates that are only partially category-consistent but geographically scattered: although 29 out of the top-30 candidates share the target category, their average distance from the target reaches 9.22 km, and the ground-truth target is missed. In contrast, HF-SID concentrates the retrieved candidates around the target region, reduces the average distance to 2.40 km, improves category consistency to 30/30, and ranks the target POI at the first position. This example is consistent with the aggregate results in Table 2: preserving geographic and structural fidelity in the representation yields SIDs whose candidate sets are both spatially compact and semantically reliable.
A.2 CPT Prompt Templates
Table 7 summarizes the prompt templates used for continual pre-training. We design two groups of templates corresponding to Geo-CPT and Num-CPT. Geo-CPT focuses on spatial representation

(a) W/O All
(b) HF-SID
Figure 5: Case study of generated POI candidates. The baseline misses the target and produces a geographically dispersed candidate set, whereas HF-SID ranks the target first while achieving lower average distance and higher category consistency among the top-30 candidates.
and geographic reasoning, including POI spatial information serialization, pairwise distance prediction, and nearest-location identification. Num-CPT focuses on heterogeneous numerical attribute comparison, where the model is required to compare values under a specified attribute type rather than relying on raw numerical magnitude alone.
Lin et al.
Table 7: Prompt templates for Geo-CPT and Num-CPT.
| Template Type | Prompt Template |
|---|---|
| Prompt 1 | The 3D spatial coordinates of {POI A} are <|start_num_0|>{X_A}<|end_num_0|>, <|start_num_0|>{Y_A}<|end_num_0|>, and |
| Pairwise Geographic Distance Prediction | <|start_num_0|>{Z_A}<|end_num_0|>; its address is {Address A}. The 3D spatial coordinates of {POI B} are <|start_num_0|>{X_B}<|end_num_0|>, <|start_num_0|>{Y_B}<|end_num_0|>, and <|start_num_0|>{Z_B}<|end_num_0|>; its address is {Address B}. The spherical distance between the two locations is <|start_num_1|>{Distance}<|end_num_1|> meters. |
| Prompt 2 | The 3D spatial coordinates of {POI A} are <|start_num_0|>{X_A}<|end_num_0|>, <|start_num_0|>{Y_A}<|end_num_0|>, and |
| Nearest-Location Identification | <|start_num_0|>{Z_A}<|end_num_0|>. The 3D spatial coordinates of {POI B} are <|start_num_0|>{X_B}<|end_num_0|>, <|start_num_0|>{Y_B}<|end_num_0|>, and <|start_num_0|>{Z_B}<|end_num_0|>. The 3D spatial coordinates of {POI C} are <|start_num_0|>{X_C}<|end_num_0|>, <|start_num_0|>{Y_C}<|end_num_0|>, and <|start_num_0|>{Z_C}<|end_num_0|>. The location closer to {Query POI} is {Answer POI}. |
| Prompt 3 | {POI A} has rating <|start_num_2|>{Rating_A}<|end_num_2|>, weekly views <|start_num_6|>{WeekView_A}<|end_num_6|>, and collected users <|start_num_5|>{Collect_A}<|end_num_5|>.{POI B} has rating <|start_num_2|>{Rating_B}<|end_num_2|>, weekly views <|start_num_6|>{WeekView_B}<|end_num_6|>, and collected users <|start_num_5|>{Collect_B}<|end_num_5|>.{POI A} has a higher {Queried Attribute} than {POI B}. |