A next point of interest recommendation method based on a large language model

By combining the construction of an interest point transition map with a large language model, the problem of lacking evidence of movement behavior in existing technologies is solved, enabling accurate prediction of elusive trajectories and improving the accuracy of next interest point recommendations.

CN123157989APending Publication Date: 2026-11-24BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611625116.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing next point of interest recommendation methods lack direct evidence of movement behavior when the context of the trajectory to be predicted has not appeared in historical data or has appeared insufficiently, making it difficult to accurately predict the user's next point of interest.

Method used

By combining graph neural networks and large language models, trajectory representations are generated by constructing interest point transition maps, region transition maps, and user-interest point interaction maps. In the training phase, the category probability distribution and global empirical category prior of the large language model are used to perform two-stage training to improve prediction ability.

Benefits of technology

While maintaining personalized recommendation capabilities, it has improved the ability to predict mobile patterns that are not present or poorly supported in historical data, thereby increasing the accuracy of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157989A_ABST
    Figure CN123157989A_ABST
Patent Text Reader

Abstract

This invention proposes a next point of interest (POI) recommendation method based on a large language model, belonging to the fields of artificial intelligence, recommendation systems, spatiotemporal data mining, and large language model technology. The method includes: learning spatiotemporal movement patterns from historical check-ins through motion modeling to generate basic POI scores; then, when there is no exact match between the trajectory context and the training data, adaptively activating offline large language model supervision, constructing bounded residuals relative to empirical priors for category-level semantic knowledge, and converting only the cross-category order inversion supported by the residuals into ranking constraints; finally, applying category-level score offsets to the zero-support context during the inference stage, maintaining the original order of POIs within the same category while adjusting inter-category preferences, and without requiring online invocation of the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, recommendation systems, spatiotemporal data mining, and large language models, and particularly to a method for recommending next points of interest based on a large language model. Background Technology

[0002] With the development of location services, mobile internet, and smart terminals, users generate a large amount of check-in data containing time and space information in places such as dining, shopping, transportation, entertainment, office, and residence. The points of interest visited by users continuously constitute movement trajectories with obvious temporal and spatial patterns and individual preferences. Predicting the next points of interest that users may visit based on their historical trajectories is an important task in location services, intelligent transportation, personalized recommendations, and urban mobility behavior analysis.

[0003] Existing methods for recommending next points of interest mainly include those based on recurrent neural networks (RNNs), Transformers, and graph neural networks (GNNs). These methods typically learn user preferences, point-of-interest (POI) shift relationships, geospatial relationships, and temporal patterns from the user's historical check-in sequence, and predict the user's next POI based on this. Among these, GNNs can utilize the shift relationships between POIs and the interaction relationships between the user and POIs, while Transformers can capture long-distance trajectory dependencies using a self-attention mechanism, thus providing a better description of the user's historical movement patterns.

[0004] However, there is a problem with next point of interest recommendation methods that rely solely on historical check-in data: when the trajectory context to be predicted has not appeared in the historical data or has appeared insufficiently, the model lacks evidence of movement behavior that directly corresponds to the current context. For example, for the trajectory of a user after leaving the office during a specific time period on a workday, if the training data does not contain trajectory contexts that share the same combination of time, scene, and recently visited category, it is difficult to determine the next activity category by relying solely on historical check-in data.

[0005] In recent years, large language models have demonstrated strong semantic understanding and reasoning capabilities regarding general activity patterns. They can infer potential next activities based on a user's past activity sequences. For example, if a user visits their workplace after a workday, a large language model might infer from general daily routines that the user's next destination is likely a restaurant.

[0006] Therefore, this invention proposes a next point of interest recommendation method based on a large language model. Summary of the Invention

[0007] This invention provides a next point of interest recommendation method based on a large language model to solve the aforementioned technical problems.

[0008] This invention provides a next point of interest recommendation method based on a large language model, comprising: The system acquires users' historical check-in data and arranges it chronologically to form user trajectories. It maps the original point of interest categories to a unified set of activity categories, divides geographical regions and time periods, and constructs point of interest transfer maps, regional transfer maps, and user-point of interest interaction maps. The graph neural network is used to process the constructed interest point transition map, region transition map and user-interest point interaction map to obtain interest point embedding and region embedding. The user representation is calculated by combining the access frequency and the access time is time-encoded to obtain the time embedding. The user representation, interest point embedding, region embedding and time embedding are concatenated and input into the sequence encoder to obtain the trajectory representation and generate the basic interest point score based on historical data. Based on the recent access category sequence, date type, time interval and scene type corresponding to the current trajectory, a strict movement mode key is constructed and matched with the historical mode key index constructed from the training set to determine whether the current trajectory is a strict zero support context. During the training phase, the basic interest point score is directly applied to the current trajectory with historical support; For the current trajectory with strict zero support, the large language model is called offline to generate the category probability distribution, the global empirical category prior is statistically analyzed, the difference between the two is calculated in the log probability space and truncated to a preset range to obtain the bounded semantic residual. Interest points with high basic interest point scores are selected to form a candidate set, and two-stage training is conducted. During the inference phase, the historical support status of the trajectory to be predicted is determined. For the trajectory to be predicted with strict zero support, the category marginal distribution is obtained according to the category aggregation probability. The category marginal distribution is then subtracted from the category prediction branch output in the log probability space to obtain the category projection offset. Apply the same category projection offset to all points of interest within the same category, and generate a recommendation list of the next points of interest in descending order of their projected scores.

[0009] The next point of interest recommendation method according to claim 1 is characterized by a two-stage training process, comprising: The first stage combines multi-task prediction loss and class consistency loss to train the entire network, resulting in a purely data-driven basic model. The second stage freezes the shared layer and the remaining prediction branches, updates only the category prediction branches, and learns the category semantic reasoning rules of the large language model through semantic distillation loss.

[0010] Preferably, the unified activity category set contains a preset number of activity categories; the original categories and the unified activity categories adopt a many-to-one mapping. Before mapping, the leading and trailing spaces of the original tags are removed and known aliases are normalized. Each original tag is uniquely mapped to a unified activity category. After the mapping is completed, a full tag coverage check is performed.

[0011] Preferably, when performing historical support determination during the training phase, the strict movement mode key corresponding to the current trajectory is temporarily removed from the reference index table constructed from the historical mode key index before performing the matching operation.

[0012] Preferably, the large language model is only invoked offline for trajectories with strict zero support during the training phase, and the actual next access point of interest, time, or category label of the current trajectory is not input into the large language model during the invocation. The non-negative weights output by the large language model are normalized using the first norm to obtain the class probability distribution.

[0013] Preferably, the global experience category prior is obtained based on statistics of the global training set. During the statistics, the contribution of the current trajectory itself is deducted from the total number of samples of each category before normalization.

[0014] Preferably, cross-category sorting constraints are constructed only for interest point pairs belonging to different activity categories, and constraints are not constructed for interest point pairs within the same activity category.

[0015] Preferably, the same category projection offset is applied to all points of interest in the same category, and the score difference between any two points of interest in the same category remains constant before and after projection.

[0016] Compared with the prior art, the present invention has the following beneficial effects: By integrating users' historical spatiotemporal movement patterns with the activity semantic knowledge of a large language model, the ability to predict movement patterns that are not present or poorly supported in historical data is improved while maintaining personalized recommendation capabilities.

[0017] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0018] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0019] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating the next point of interest recommendation method based on a large language model in an embodiment of the present invention. Detailed Implementation

[0020] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0021] Example 1: This invention proposes a next point of interest recommendation method based on a large language model, such as... Figure 1 As shown, it includes: The system acquires users' historical check-in data and arranges it chronologically to form user trajectories. It maps the original point of interest categories to a unified set of activity categories, divides geographical regions and time periods, and constructs point of interest transfer maps, regional transfer maps, and user-point of interest interaction maps. The graph neural network is used to process the constructed interest point transition map, region transition map and user-interest point interaction map to obtain interest point embedding and region embedding. The user representation is calculated by combining the access frequency and the access time is time-encoded to obtain the time embedding. The user representation, interest point embedding, region embedding and time embedding are concatenated and input into the sequence encoder to obtain the trajectory representation and generate the basic interest point score based on historical data. Based on the recent access category sequence, date type, time interval and scene type corresponding to the current trajectory, a strict movement mode key is constructed and matched with the historical mode key index constructed from the training set to determine whether the current trajectory is a strict zero support context. During the training phase, the basic interest point score is directly applied to the current trajectory with historical support; For the current trajectory with strict zero support, the large language model is called offline to generate the category probability distribution, the global empirical category prior is statistically analyzed, the difference between the two is calculated in the log probability space and truncated to a preset range to obtain the bounded semantic residual. Interest points with high basic interest point scores are selected to form a candidate set, and two-stage training is conducted. During the inference phase, the historical support status of the trajectory to be predicted is determined. For the trajectory to be predicted with strict zero support, the category marginal distribution is obtained according to the category aggregation probability. The category marginal distribution is then subtracted from the category prediction branch output in the log probability space to obtain the category projection offset. Apply the same category projection offset to all points of interest within the same category, and generate a recommendation list of the next points of interest in descending order of their projected scores.

[0022] Preferably, in the first stage, the entire network is trained by combining multi-task prediction loss and category consistency loss to obtain a purely data-driven basic model. In the second stage, the shared layer and the remaining prediction branches are frozen, only the category prediction branches are updated, and the category semantic reasoning rules of the large language model are learned through semantic distillation loss.

[0023] Preferably, the unified activity category set contains a preset number of activity categories; the original categories and the unified activity categories adopt a many-to-one mapping. Before mapping, the leading and trailing spaces of the original tags are removed and known aliases are normalized. Each original tag is uniquely mapped to a unified activity category. After the mapping is completed, a full tag coverage check is performed.

[0024] Preferably, when performing historical support determination during the training phase, the strict movement mode key corresponding to the current trajectory is temporarily removed from the reference index table constructed from the historical mode key index before performing the matching operation.

[0025] Preferably, the large language model is only invoked offline for trajectories with strict zero support during the training phase, and the actual next access point of interest, time, or category label of the current trajectory is not input into the large language model during the invocation. The non-negative weights output by the large language model are normalized using the first norm to obtain the class probability distribution.

[0026] Preferably, the global experience category prior is obtained based on statistics of the global training set. During the statistics, the contribution of the current trajectory itself is deducted from the total number of samples of each category before normalization.

[0027] Preferably, cross-category sorting constraints are constructed only for interest point pairs belonging to different activity categories, and constraints are not constructed for interest point pairs within the same activity category.

[0028] Preferably, the same category projection offset is applied to all points of interest in the same category, and the score difference between any two points of interest in the same category remains constant before and after projection.

[0029] In this embodiment, each check-in record includes at least a user identifier, a point of interest identifier, a point of interest category, geographical coordinates, and a timestamp. For users Arrange their historical check-ins in chronological order to form a user trajectory. , among which, the The first of the trajectories Each sign-in record is represented as follows: ,in, For the first Trajectory number Each check-in corresponds to a point of interest; This refers to the time of the sign-in. For points of interest The geographical coordinates, and For latitude, Longitude; For points of interest The original category label, and the value of j ranges from 1,..., ,and Let be the number of times the i-th trajectory is checked in.

[0030] Original category labels often come from different sources and have inconsistent naming conventions. Therefore, the original point-of-interest categories are mapped to a unified set of activity categories. This embodiment sets It includes 12 categories of activities: dining, nightlife, shopping services, public work, medical care, education, residence, transportation, accommodation, cultural entertainment, outdoor sports, and religion. The number of categories is not fixed at 12; those skilled in the art can merge or subdivide them according to the granularity of the actual data source.

[0031] In this embodiment, known aliases are normalized, for example, aliases such as restaurant and eatery are uniformly mapped to the catering category.

[0032] After mapping is complete, a full label coverage check is performed to confirm that there are no unmapped labels, thus ensuring that all subsequent category-related calculations are performed under the same set of category definitions.

[0033] In this embodiment, the timestamp is parsed from UTC to time zone and sorted by time, while the local time is used in the large language model prompts.

[0034] In this embodiment, the K-means clustering algorithm is applied to the geographic coordinates of points of interest to obtain an initial geographic region. For points of interest... Record its geographical region as The day is divided into 72 consecutive 20-minute time slices at equal intervals. Then, an ordered sample clustering algorithm is used to aggregate adjacent time slices with similar activity patterns. Each adjacent time period, and for time Let its time period be denoted as .

[0035] This embodiment clusters all points of interest by latitude and longitude to obtain 300 initial regions. The final number of geographic regions can be directly set equal to the number of initial clusters. This number of regions is used in region transition maps, region embedding, and region prediction tasks. All refer to the final number of geographical regions. Even after time period adjustments, the number remains at 20. .

[0036] Construct a directed interest point transition graph based on users' continuous access relationships. The edge weights are the frequency of transitions between two points of interest. A region transition graph is constructed based on region adjacency and cross-region access relationships. Its edge weight is the frequency of inter-region transfers.

[0037] Initial embedding of interest points and region initial embedding A two-layer gated graph neural network (GGNN) is used for embedding learning to obtain interest point embeddings. With region embedding .

[0038] Construct a user-interest interaction graph based on user historical access records, and then... Indicates user Points of interest visited , border rights The normalized frequency of this user's visits to this point of interest satisfies The user stated This is obtained by aggregating the embeddings of all the points of interest visited, and is used to represent the user's long-term preferences: ,in, The weight matrix is ​​a learnable matrix. For learnable bias vectors, This is a linear rectified activation function with leakage, used to introduce nonlinearity; Indicates to the user Sum of all visited points of interest.

[0039] Use Time2Vec to define the time period Convert to time embedding By concatenating user representation, interest point embedding, region embedding, and time embedding, the check-in embedding is obtained: ,in, This represents a vector concatenation operation; , represents the learnable fusion weight matrix; , representing the learnable fusion bias vector. Therefore, the total dimension of the concatenated check-in embedding is . The dimension is consistent with the subsequent trajectory representation. A causal Transformer encoder is then used to process the check-in embedding sequence in chronological order, outputting the trajectory representation. .

[0040] Embedded Dimensions in this Embodiment The corresponding regional embedding and temporal embedding dimensions are both User representation dimension is The total dimension of the check-in embedding is The gated graph neural network has two layers, the Transformer has two layers and two attention heads, and the hidden dimension of the feedforward sub-network is [missing information]. The number of network layers and dimensions can be adjusted according to the actual dataset size without affecting the method itself.

[0041] Based on trajectory representation Four tasks were established: predicting the next point of interest, the next geographic region, the next time period, and the next activity category. Each task generated corresponding unnormalized scores (logits) and probability distributions using an independent Multi-Layer Perceptron (MLP). ,in, These correspond to four tasks: the next point of interest, the next region, the next time period, and the next category, respectively. For the task The output logits vector, This is the probability distribution after softmax normalization; This is a normalized exponential function. The output dimensions of the four tasks are as follows: (Total number of points of interest) (Final number of geographic regions) (Number of time periods) (Number of activity categories). All input and output dimensions remain consistent throughout the entire process.

[0042] In this embodiment, to ensure that spatial constraints, temporal constraints, and category constraints work together for interest point ranking, and to unify all subsequent calculations within the same probability space and the same logarithmic space, region correction, temporal correction, temporal prior, and uniform smoothing are performed sequentially, specifically as follows: Region correction: ,in, The branch predicts the softmax probability of interest point l for the next interest point. Predict the branch for the next region The output predicted probability, To prevent the logarithm from being undefined, a smoothing constant (in this embodiment, we take...) ).

[0043] Time correction: Let For users Training focuses on time cycles Visit points of interest The number of times, normalized frequency for: ,in, For users Training focuses on time cycles Visit points of interest The number of times; Time Priority: ,in, This indicates the target user corresponding to the current query sample i; This indicates that the model predicts the next visit will fall within the time period. The probability of; Indicates user Training focuses on time cycles Visit points of interest Normalized historical frequency; Represents a set of time periods. It represents a specific time period belonging to this set; Represents a set of points of interest. This represents a point of interest belonging to this set.

[0044] Uniform smoothness is: ,in, Normalization of time-corrected fractions; Uniform smoothing weights (values ​​are taken from) arrive between), To ensure a uniform distribution, smoothing guarantees that the probability of each point of interest is strictly greater than zero. The values ​​are obtained after uniform smoothing; Basic interest point score: ,in, For regional correction weights, For time-corrected weights, The base POI score after region and time correction. This represents the original prediction score of interest point l in the next POI prediction task, i.e., the logits of the POI prediction MLP output. Note that... Without undergoing regional or temporal corrections, and unaffected by external semantic information, it is entirely learned from historical check-in data.

[0045] In this embodiment, the generation of historical check-in data is not affected by external semantic information.

[0046] In this embodiment, the region correction weight Time correction weight Uniform smoothing weight Set up separately for each dataset (in the NYC dataset: In the dataset TKY: In the SGP dataset: All values ​​are selected through a grid search on the validation set; the actual values ​​can be adjusted according to the scenario. Constructing the basic POI score vector Follow-up .

[0047] In this embodiment, the category consistency loss is used to ensure that the category margins induced by the independent category prediction branches and the interest point branches remain consistent: ,in, Predict the class distribution induced by the branch for POI. Predict the class probability of the branch output for each independent class. This is the set of all training samples in the current training batch. JS( , ) represents the Jensen-Shannon divergence, which measures the difference (or similarity) between the two probability distributions mentioned above. The smaller the value, the more consistent the two distributions are. This loss aligns the two category sources in the first stage, providing a consistent starting point for semantic transfer in the second stage.

[0048] In this embodiment, based on the relationship between access category and time, scene types are categorized into transportation, work / study, residence, dining / social, outdoor activities, and general scenes. The categorization rules are as follows: continuous access to transportation-related points of interest during morning / evening rush hours is classified as a transportation scene; continuous access to work / public interest points during weekday daytime is classified as a work / study scene; continuous access to residence-related points of interest at night is classified as a residence scene; continuous access to dining-related points of interest during lunchtime or evening is classified as a dining / social scene; continuous access to outdoor sports-related points of interest during weekend daytime is classified as an outdoor activity scene; scenes not meeting the above conditions are classified as general scenes. If a sequence contains multiple types of interest points, the dominant scene is determined by the category of the most recently accessed point. Scene type is a high-level semantic feature used to distinguish situations where the category sequences are the same but the activities are essentially different. For example, even with two consecutive dining visits, the subsequent movement patterns of a work lunch during lunchtime and a social dinner at night are significantly different.

[0049] The strict move mode key is defined as a combination of four discrete features: ,in, Date type (weekday or weekend); This represents the current time interval and its corresponding time period number. Scene type; This is a sequence of the most recent original point of interest categories arranged chronologically. The sequence length is determined by the category of the most recent visit: if the most recent visit was in the transportation or residential category, then the two most recent visit categories are used; for other categories, the three most recent visit categories are used.

[0050] An index table of strict movement mode keys is created for all historical trajectories in the training data.

[0051] For the current trajectory First, temporarily remove its own pattern key from the reference index (if the key appears multiple times in the index, decrement the count of the current entry by one), then match it in the remaining index. If no match is found... If the historical trajectory is completely consistent, then define a zero-support indicator variable. The current trajectory has a strict zero supporting context; if at least one strictly matching trajectory exists, then The current trajectory has historical support. If there are still trajectories with the same key after decrementing the count, it should be considered as having support; only when the count reaches zero should it be considered as having zero support, to avoid deleting other trajectories with the same key and making a misjudgment.

[0052] In this embodiment, for training trajectories determined to have strict zero support, a general-purpose large language model is invoked offline (this embodiment uses Llama2-7B, but other open-source or self-hosted models with equivalent capabilities can also be used). The input prompt is in the form of: Given that the user has sequentially accessed a category sequence in local time, with adjacent access intervals listed as interval lists and movement distances listed as distance lists, please predict the user's most likely next activity category. Only the non-negative weights corresponding to the 12 categories are output, including the complete list of 12 categories. The large language model outputs only one set of non-negative values, without sampling temperature transformation, and directly performs first-norm normalization on them. , , For large language models as categories , The output non-negative weights The normalized category probabilities are summed over all categories to a value of 1. During the call, the actual next point of interest, time, or category information for the current trajectory is not provided to the large language model to prevent label leakage.

[0053] Strict zero support means that this category-time-scenario combination has never appeared in history, and there are no statistical samples for this pattern category prior at the user level. Therefore, a global empirical category prior is used as a general benchmark to measure the deviation of the large language model output from general movement patterns. To avoid the current trajectory itself being included in the benchmark and causing self-support, the contribution of the current trajectory itself is deducted during the statistical analysis. Where c is a specific activity category in the unified activity category set C; The true next point of interest for the current training sample i The unified activity category to which it belongs; The next point of interest in the target in the training data belongs to a category. The total number of samples; The next point of interest in the target in the training data belongs to a category. The total number of samples; This is an indicator function that takes the value 1 if the condition is true, and 0 otherwise. If the current category c is equal to the category of the current sample's true next POI, the value is 1; otherwise, the value is 0. If the current category This value equals the true next POI category of the current sample, taking a value of 1 otherwise taking a value of 0. (Molecular) This means subtracting the current sample's own value from the training count of category c; if the current sample's true next POI does not belong to category c, the subtraction is 0. Similarly, the denominator is summed after subtracting the current sample's own value from all categories. This avoids the current sample generating self-support through its own true label.

[0054] The logarithmic difference between the output of a large language model and the empirical prior is used as the bounded semantic residual. ,in, For truncation functions, restrict the input to... Inside; As the residual truncation threshold, this embodiment takes... probability ratio Restricted to That is, about .

[0055] Through the above processing, the semantic information provided by the large language model is manifested as a limited category-level correction relative to historical experience patterns, rather than completely replacing the movement patterns learned based on real historical check-in data.

[0056] In this embodiment, the candidate set ,in The number of candidates is taken in this embodiment. And the selection is made through a validation set. To ensure that the categories that should be promoted in the target category do indeed have points of interest that enter the candidate pool and thus participate in the ranking constraints, before taking the base score... In addition to the above, category coverage is also performed: for each category that is positively boosted under bounded semantic residuals (i.e. However, no points of interest entered this category. The categories are determined, and the highest-scoring interest points within each category are added to the candidate set. The number of supplementary items can be adjusted according to the number of categories and the density of points of interest, and is not the only limitation.

[0057] For a point of interest (POI) l in the candidate set, the semantic residual corresponding to its activity category is added to the base POI score to obtain the semantic enhancement score: ,in, For points of interest Category to which it belongs.

[0058] For POI pairs belonging to different activity categories in the candidate set If the base score satisfies And after adding semantic residuals, the following is satisfied: (Depending on the dataset) If the value is between 0.03 and 0.06, it is considered that the semantic information of the large language model has caused the POI pair to undergo a cross-category ranking reversal that reaches a preset magnitude, and the POI pair is added to the semantic ranking constraint set.

[0059] To ensure that semantic supervision truly impacts the model parameters, this invention employs both residual distillation terms and cross-class ranking constraints, which together constitute the semantic distillation loss. In this embodiment, the residual distillation term. ,in, This is the residual distillation loss. ,in, The class probability output by the class prediction branch. Based on offline experience priors, The log difference between the output of the category prediction branch and the empirical prior is the dynamic category correction amount in the semantic transfer during the training phase. In this embodiment, the cross-category sorting constraint is: ,in, For a fixed base difference, For cross-category semantic ranking loss; This is the set of all training samples in the current training batch; This represents the number of samples currently matched during training. For the current batch that meets the requirements and The set of samples that is strictly zero-supported and has valid inversion pairs; For the current sample, there is a set of candidate POI inversion pairs, where each element satisfy , and ; This represents the number of inversion pairs in the current sample. for A cross-category POI pair, where For POIs that should be extracted after semantic enhancement, These are the POIs that should be reduced after semantic enhancement.

[0060] This invention only imposes ranking constraints on cross-category interest point pairs, and not on interest point pairs within the same category. There are three reasons for this: First, the category correction is category-level; two interest points within the same category receive exactly the same correction, and their relative order remains unchanged after superposition. First, intra-class inversions will not be newly generated due to category modifications, so imposing constraints on intra-class POIs has no effect. Second, the differentiation of intra-class interest points should rely on personalized fine-grained preferences learned from historical check-ins. Imposing semantic ranking constraints on intra-class POIs will introduce unreliable judgments of anonymous interest points from the large language model into fine-grained ranking. Third, only cross-class inversions are constrained during the training phase, while the same offset is applied to the same class during the inference phase. Both are consistent in maintaining intra-class rank. In summary, only constraining cross-class inversions can effectively utilize the activity category semantic knowledge of the large language model while avoiding interference from external general knowledge in intra-class POI ranking.

[0061] In this embodiment, the first stage is the training of the base model. Using the full training samples, the cross-entropy losses of the four prediction tasks are weighted and a class consistency loss is added to train all parameters of the entire network: ,in, The cross-entropy loss is categorized into four tasks: next point of interest, next region, next time period, and next category. These are the loss weights for the four tasks, used to balance the magnitude of loss across different output dimensions; is the weight for class consistency loss, and is a non-negative hyperparameter. After the first stage, all branches are learned based on historical check-ins, without external semantic intervention. The base interest point score is a purely data-driven benchmark, and the class margin induced by the interest point branch is consistent with that of the independent class branch. The second stage is semantic transfer training, using only strictly zero-supported samples. All parameters of the shared network layers (gated graph neural network, Transformer encoder) and the three prediction branches of interest point, region, and time are frozen, and only the class prediction branch is updatable. The objective function is: ,in, This is the residual distillation term. For cross-category sorting constraints, To correspond to non-negative weights; retain a small amount of class cross-entropy. Used to maintain classification stability and prevent overfitting. This stage will no longer retain [this feature / function]. The second stage is precisely to make the category branch deviate from the edge of pure data-driven approaches on zero-support samples and move closer to the semantics of the large language model. Continuing to impose consistency constraints will cause gradient conflicts with the transfer objective.

[0062] In this embodiment, the task weight is taken as... It is used to balance the magnitude difference between high-dimensional output at the point of interest level and low-dimensional output at the region, time, and category levels; , , The dataset is selected based on the best data on the validation set, and this can be adjusted according to the actual scenario.

[0063] During the training phase, the category prediction branch learns to generate category-level corrections consistent with the large language model, relative to a data-driven category baseline. During the inference phase, the logarithmic difference between the category prediction branch and the current trajectory's category margin is used as the projection offset. The baselines used in both phases differ slightly in form: during training, offline global empirical priors are used. As a benchmark, the category margin obtained by aggregating the current trajectory during inference. .

[0064] Under strict zero-support conditions, the current pattern key has no matching history, the sequence model lacks personalized category evidence for this trajectory, and its interest point induces category margins. Without personalized information about the pattern, statistically it degenerates into a group-level category prior, while the leave-one-out method provides a global empirical prior. This is precisely the unbiased estimate of the group category prior. Therefore, under zero support conditions, both describe the same data benchmark: offline, it is represented by empirical priors, and online, it is represented by model aggregated marginals.

[0065] Specifically, the KL divergence of the two distributions is calculated on the zero-support samples of the training set as a calibration index. The average value is taken on the zero-support samples. If the value is small enough, it means that the online margin and the offline experience prior are indeed consistent under the zero-support condition, and the semantic transfer from training to inference is valid. If the value is too large, it indicates that a single global prior is insufficient to represent the online margin. In this case, the empirical prior should be refined from global statistics into scenario-specific priors based on date type × time period × scenario, or a cluster prior based on similar user groups should be adopted to make the offline benchmark more closely match the online margin. Then, the KL divergence should be re-verified until it converges to the preset range.

[0066] For new user trajectories, calculate the trajectory representation, basic interest point scores, and category margins using the same process, and construct the strict movement mode key for the current trajectory according to step seven. The key is then matched against the historical support table established during the training phase to obtain the zero support indicator variable. .

[0067] when When historical data is available, no semantic score adjustment is made; the base interest point score is used directly. Sort.

[0068] when (Strict zero support) The initial category margin is obtained by directly aggregating the probabilities of interest points. Building upon this, multi-dimensional topological calibration and confidence grading can (optionally) be used to further improve the quality of category margins; when this optional module is not enabled, the marginal distribution on which the projection is based is directly set. equal to the initial category margin The core system is operating normally.

[0069] In this embodiment, the class projection offset is obtained by subtracting the independent class prediction branch output (which has been learned into the semantics of the large language model in the second stage) from the final class marginal distribution in the natural logarithmic probability space and then truncating the result. Enable When not enabled , For the improved category margin; truncation threshold Consistent with the training phase ( ), ensuring that the upper limit of correction for training and inference is consistent, The activity category probabilities obtained by the model's independent predictions. This indicates that the category prediction branch is more biased towards the category than the current data margin. During inference, the bias increases the value of all interest points within a category, and decreases it if the value decreases. The bias only applies at the category level and does not distinguish between interest points within a category.

[0070] The category offset is uniformly added to the base score of all interest points under the corresponding category to obtain the final projected score. : ,in, The intensity was adjusted for the testing phase. Zero-support indicator variables, This is the offset of the category to which the next point of interest l belongs.

[0071] All POIs within the same category receive the same offset, therefore the relative order within the class remains unchanged before and after projection. Since the offsets between different categories are different, the order between categories can be adjusted according to category-level semantic information, thereby achieving rank-preserving category-level semantic projection.

[0072] Selection criteria: Degenerates to no adjustment; When the class shift is too large, it may dominate the ranking. Selection can be made using the mean reciprocal rank (MRR) of the validation set. The validation set sensitivity experiment for the NYC dataset is as follows: The MRR was 0.4183 at that time. The value was 0.4212. The value is 0.4214, which is the optimal value. The value was 0.4198. The value is 0.4177. Therefore, for NYC... Take 0.02 for TKY Take 0.01 for SGP Take 0.05.

[0073] Taking the NYC example above: Base score The category offset is , After projection The intra-class differences were 2.0 and 1.0, consistent with the values ​​before projection; Category 1 increased by approximately 0.029 overall, while Category 0 decreased by approximately 0.028 overall, indicating that the intra-class order remained unchanged, but the inter-class order was adjustable.

[0074] Before projection, the basic order was Interest Point 1, Interest Point 3, Interest Point 4, Interest Point 2; after projection, it became Interest Point 3, Interest Point 1, Interest Point 4, Interest Point 2. Within each class, the score difference between Interest Point 1 and Interest Point 2 within class zero was the same before and after projection. The difference in scores between interest point three and interest point four within category one, before and after projection, is... Within each class, the order remains completely unchanged. Between classes, before projection, interest point 1 (class zero) is in the first position; after projection, interest point 3 (class one) with a positive offset rises to the first position. Class one as a whole is elevated, while class zero as a whole is lowered, achieving the semantically desired cross-class order reversal. This example also illustrates that if a softmax is applied again to the base scores that already have log probabilities, or if the offset is multiplied by an excessively small coefficient (such as...), the order will be reversed. The offset will be compressed to be insufficient for reversal (in this example, the coefficient is taken as...). (If category one cannot overtake), both of these approaches would render semantic enhancement ineffective. Therefore, this invention makes the above-mentioned unified provisions on caliber and strength.

[0075] All points of interest are calculated based on the final projected score. Sort the data in descending order to obtain the next list of points of interest. For trajectories with historical support, the final ranking is consistent with the base prediction; for trajectories with strict zero support, the relative ranking between categories is adjusted only through category-level offsets, while maintaining the relative ranking of points of interest within each category.

[0076] Throughout the process, the large language model provides category-level semantic supervision offline only during the training phase for zero-support trajectories. Semantic capabilities are transferred to the category prediction branch through two-stage training. In the online recommendation phase, trajectories are no longer sent to the large language model, nor is its output obtained in real time. Recommendations can be completed solely by relying on the trained model, the historical pattern support table, and the category projection mechanism, thereby reducing the number of online calls, computational overhead, and response latency.

[0077] The training dataset uses publicly available location check-in datasets (in this example, the datasets for three cities on Foursquare: New York (NYC), Tokyo (TKY), and Singapore (SGP)). Each record includes a user identifier, point of interest identifier, category, latitude and longitude, and timestamp. The training, validation, and test sets are divided chronologically (approximately 8:1:1 in this example). The training set is used to construct the graph, pattern key index, empirical priors, and train the model. The validation set is used to determine hyperparameters and perform early stopping. The test set is used to report performance. For each city, the percentage of samples in the test set where the strict movement pattern key has no match in the training index is counted as the proportion of zero-support samples.

[0078] In terms of model structure, interest point and region embedding employ a two-layer gated graph neural network, sequence encoding uses a two-layer, two-headed, feedforward causal Transformer with a dimension of 1024, and each of the four prediction tasks uses an independent multilayer perceptron; the input and output dimensions of each module are shown in Table 1. Regarding the loss function, the first stage uses multi-task loss plus class consistency loss, and the second stage uses the sum of class cross-entropy, residual distillation, and cross-class ranking constraints. The training process uses the Adam optimizer: the initial learning rate in the first stage is... The batch size is 64, with a maximum of 50 training epochs. Early stopping is determined by the validation set's average regress ranking not improving for five consecutive epochs. The second stage involves fine-tuning the learning rate. It uses only zero support samples, trains for a maximum of twenty epochs, stops early three times, and freezes the shared layer and the other three prediction branches during training.

[0079] The core of this invention is strict moving mode key gating, offline category semantic distillation, and category-rank-preserving projection. Each step does not depend on a specific neural network structure or a specific large language model. There are multiple conventional alternatives that can achieve similar results without using a large language model.

[0080] First, regarding the alternative to large language model category probabilities. If a large language model is not deployed, what is the required category probability distribution? The category semantic priors can be completely replaced by statistics obtained from the training set, for example: constructing category-level classifications based on the most recent category sequence. The meta-transition model or Markov transition matrix directly calculates the conditional probability of the next class given a recent class sequence; association rule methods such as Apriori and FP-Growth are used to mine frequent patterns and confidence in the class sequence; or the conditional frequency of each scene can be calculated by binning according to date type, time period, or scene; alternatively, it can be provided by a manually summarized common sense rule base (such as catering after get off work hours on weekdays). The above methods only provide a class probability distribution; the subsequent empirical prior comparison, bounded truncation, residual distillation, and rank-preserving projection processes remain completely unchanged. In other words, even without using a large language model, the required class semantic results can be obtained through conventional statistical methods such as class transition conditional probability and association rules, and the remaining steps of this invention are unaffected.

[0081] Second, the calculation of basic interest point scores does not depend on a specific neural network and can also be generated by conventional recommendation methods such as Markov chains, matrix factorization, and gradient boosting trees, as long as it can output the predicted scores at the interest point level; graph embedding can be replaced by graph convolutional networks, graph attention networks, etc., and sequence encoding can be replaced by recurrent neural networks or other self-attention structures.

[0082] Third, prior knowledge of empirical categories can be replaced by user-group-level statistical results instead of global statistics. Prior distributions can be calculated for similar user groups to improve the relevance of residuals. Category margin calibration can also use other dimensional partitioning methods or clustering algorithms, as long as they can improve the category distribution in zero-support scenarios without destroying intra-class rank preservation.

[0083] Fourth, for the division of geographical regions and time periods, DBSCAN, hierarchical clustering, grid partitioning, etc. can be used instead of K-means and ordered sample clustering. The stratification of regular spectrum can also be achieved by hierarchical clustering or other unsupervised grouping methods.

[0084] The above are all equivalent embodiments of the present invention.

[0085] To verify the recommendation performance and effectiveness of each module of this method, experiments were conducted on three public sign-in datasets, comparing the proposed method with baseline methods and performing ablation and permutation tests. Evaluation metrics included Hit@1, Hit@5, Hit@10, mean reciprocal rank (MRR), NDCG@5, and NDCG@10. The large language model used was Llama2-7B, with half-precision offline inference.

[0086] Overall performance comparison. The comparison method includes four mainstream next point of interest recommendation methods: FPMC, GETNext, AgentMove, and iPCM. This method is denoted as ASE-RP, and the results are shown in Table 1.

[0087] Table 1 Comparison of recommendation performance of different methods on three datasets As shown in the table, our proposed method achieves the best results across all six metrics on NYC and TKY, and the best ranking quality metrics such as MRR, NDCG@5, and NDCG@10 on SGP. Compared to the strongest baselines for each metric, our method improves Hit@1, MRR, and NDCG@5 by 3.56%, 2.06%, and 1.45% respectively on NYC; by 1.10%, 1.19%, and 1.74% respectively on TKY; and by 3.60% on SGP. These results demonstrate that our method has a stable advantage in both top-rank accuracy and overall ranking quality. The slightly lower Hit@5 and Hit@10 scores on SGP are mainly due to the fact that the average trajectory length on SGP is only 3.26, meaning that most trajectories are insufficient to construct effective movement pattern keys, resulting in a higher proportion of zero support. Furthermore, short trajectories provide limited transition context for large language models, leading to a lower semantic residual signal-to-noise ratio. This result also indicates that our adaptive mechanism remains competitive on datasets with different trajectory structures.

[0088] Using MRR as the metric, ablation was performed on three parts: personalized mobile modeling, adaptive semantic enhancement, and test phase score adjustment. The results are shown in Table 2.

[0089] Table 2 Ablation Experiment Results (MRR) for Each Module As shown in the table, when using only personalized mobile modeling, the MRRs for NYC, TKY, and SGP are 0.3947, 0.4527, and 0.3830, respectively; while the MRRs for the complete method are 0.4011, 0.4575, and 0.3885, respectively. This indicates that adaptive semantic enhancement and test-phase score adjustment bring additional gains on top of mobile modeling. In the adaptive semantic enhancement module, removing zero-support activations, removing empirical priors, and replacing candidate-level semantic ranking with category-level KL matching all lead to a decrease in MRR. Among these, zero-support activations and candidate-level semantic ranking contribute the most significantly, indicating that selective activation and candidate-level ranking constraints are crucial to the semantic enhancement effect. In the test-phase score adjustment module, disabling category marginal offsets reduces the MRRs for NYC, TKY, and SGP by 0.0013, 0.0004, and 0.0038, respectively, indicating that rank-preserving category-level score projection can further optimize cross-category preferences without changing the intra-class POI ranking.

[0090] To verify that the performance improvement stems from semantic knowledge aligned with the trajectory context, rather than arbitrary category perturbations, our method is compared with a grouped permutation control method on strictly zero-supported instances. The grouped permutation control method randomly permutes semantic residuals within the matched context buckets, while preserving the residual set and marginal distribution. Experimental results are shown in Table 3.

[0091] Table 3 Results of the grouped substitution control experiment (Category-level MRR) As shown in the table, the class-level MRR of our proposed method on NYC, TKY, and SGP are 0.6194, 0.8122, and 0.6499, respectively, all higher than the 0.6128, 0.8005, and 0.6431 of the grouped permutation control method, with MRR improvements of 0.0066, 0.0117, and 0.0068, respectively. This result indicates that the performance improvement of our method does not come from random semantic signal injection, but from accurately aligning each semantic residual with its trajectory context. Disrupting the correspondence between residuals and context, even while preserving the residual set and marginal distribution, will significantly degrade performance. This further supports the effectiveness of strict movement mode keys, zero support decision, and bounded semantic residual construction.

[0092] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1.A next point of interest recommendation method based on a large language model, characterized in that, include: The system acquires users' historical check-in data and arranges it chronologically to form user trajectories. It maps the original point of interest categories to a unified set of activity categories, divides geographical regions and time periods, and constructs point of interest transfer maps, regional transfer maps, and user-point of interest interaction maps. The graph neural network is used to process the constructed interest point transition map, region transition map and user-interest point interaction map to obtain interest point embedding and region embedding. The user representation is calculated by combining the access frequency and the access time is time-encoded to obtain the time embedding. The user representation, interest point embedding, region embedding and time embedding are concatenated and input into the sequence encoder to obtain the trajectory representation and generate the basic interest point score based on historical data. Based on the recent access category sequence, date type, time interval and scene type corresponding to the current trajectory, a strict movement mode key is constructed and matched with the historical mode key index constructed from the training set to determine whether the current trajectory is a strict zero support context. During the training phase, the basic interest point score is directly applied to the current trajectory with historical support; For the current trajectory with strict zero support, the large language model is called offline to generate the category probability distribution, the global empirical category prior is statistically analyzed, the difference between the two is calculated in the log probability space and truncated to a preset range to obtain the bounded semantic residual. Interest points with high basic interest point scores are selected to form a candidate set, and two-stage training is conducted. During the inference phase, the historical support status of the trajectory to be predicted is determined. For the trajectory to be predicted with strict zero support, the category marginal distribution is obtained according to the category aggregation probability. The category marginal distribution is then subtracted from the category prediction branch output in the log probability space to obtain the category projection offset. Apply the same category projection offset to all points of interest within the same category, and generate a recommendation list of the next points of interest in descending order of their projected scores. 2.The next point of interest recommendation method of claim 1, wherein, The training consists of two phases, including: The first stage combines multi-task prediction loss and class consistency loss to train the entire network, resulting in a purely data-driven basic model. The second stage freezes the shared layer and the remaining prediction branches, updates only the category prediction branches, and learns the category semantic reasoning rules of the large language model through semantic distillation loss. 3.The next point of interest recommendation method of claim 1, wherein, The unified activity category set contains a preset number of activity categories; the original categories and the unified activity categories adopt a many-to-one mapping. Before mapping, the leading and trailing spaces of the original tags are removed and known aliases are normalized. Each original tag is uniquely mapped to a unified activity category. After the mapping is completed, a full tag coverage check is performed. 4.The next point of interest recommendation method of claim 1, wherein, During the training phase, when making historical support determinations, the strict movement mode key corresponding to the current trajectory is temporarily removed from the reference index table constructed from the historical mode key index before performing the matching operation. 5.The next point of interest recommendation method of claim 1, wherein, The large language model is only invoked offline for trajectories with strict zero support during the training phase. When invoking, the actual next point of interest, time, or category label of the current trajectory is not input into the large language model. The non-negative weights output by the large language model are normalized using the first norm to obtain the class probability distribution. 6.The next point of interest recommendation method of claim 1, wherein, The global experience category prior is obtained based on the statistics of the global training set. During the statistics, the contribution of the current trajectory itself is deducted from the total number of samples of each category before normalization. 7.The next point of interest recommendation method of claim 1, wherein, Cross-category sorting constraints are constructed only for interest pairs belonging to different activity categories, and constraints are not constructed for interest pairs within the same activity category. 8.The next point of interest recommendation method of claim 1, wherein, Apply the same category projection offset to all points of interest in the same category, and keep the score difference between any two points of interest in the same category constant before and after projection.