A spatiotemporal soft prompt fine-tuning point of interest recommendation method based on a large language model
Patent Information
- Application Number
- CN202610671324.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-15
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-05-15
AI Technical Summary
然而,若直接将用户ID、兴趣点ID以及时间、区域等离散信息扩展为大语言模型词表中的Token,会导致词表膨胀、训练成本大幅上升,并可能引发训练不稳定的问题;而如果仅以自然语言形式描述时空信息(如将时间戳、坐标或地址转化为文本),模型对结构化规律的学习效率较低,且在长尾时段、长尾区域及数据稀疏场景下的泛化能力较弱
[0013] This invention aims to provide an interest point recommendation method based on spatiotemporal soft cue fine-tuning. By incorporating time slots and region encoding into the input of a large language model in the form of soft cue, the model can achieve better "yes/no" preference judgment performance while maintaining training stability and controllable parameter scale.
Smart Images

Figure CN122489850B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information processing technology, and relates to recommendation systems and natural language processing. Specifically, it relates to a spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model. Background Technology
[0002] With the increasing prevalence of mobile internet and location-based services, the behavioral data generated by users in location-based social networks continues to grow, making point-of-interest (POI) recommendation a key technology in applications such as local services, navigation, and city services. The goal of POI recommendation is to predict a user's preferences for each candidate point of interest, given their historical browsing history and candidate POI information, and then output corresponding recommendations. Compared to traditional e-commerce or content recommendations, POI recommendation exhibits more significant spatiotemporal dependence: user behavior typically displays clear periodic characteristics (such as day-night differences, weekday-weekend differences, and holiday effects) and spatial regional patterns (such as different preferences for residential and office areas, distance constraints, and the clustering effect of commercial districts). Therefore, effectively modeling temporal and spatial factors has always been a key focus and challenge in the research and practical application of POI recommendation.
[0003] In existing technologies, traditional collaborative filtering methods learn implicit preferences through user-interest interaction matrices, which can capture certain group commonalities, but have limited ability to characterize sequence dependencies and spatiotemporal context. Sequence recommendation methods improve the ability to express short-term interests by modeling user access sequences, but if they rely solely on sequence information without structured spatiotemporal features, they often struggle to capture periodic patterns and regional migration patterns. Spatiotemporal recommendation methods typically input timestamps, latitude and longitude as additional features into the model, or use spatiotemporal graph structures for information dissemination; however, these methods still fall short in terms of textual information utilization, open-domain knowledge integration, and complex semantic reasoning.
[0004] In recent years, large language models, with their powerful text understanding and generation capabilities, have been introduced into recommendation tasks. Researchers often use cue learning to transform recommendation problems into "yes / no" judgments or generative ranking. However, directly expanding user IDs, interest point IDs, and discrete information such as time and region into tokens in the vocabulary of large language models leads to vocabulary expansion, a significant increase in training costs, and potential training instability. On the other hand, if spatiotemporal information is described only in natural language (such as converting timestamps, coordinates, or addresses into text), the model's learning efficiency for structured patterns is low, and its generalization ability is weak in long-tail time periods, long-tail regions, and sparse data scenarios. Therefore, there is an urgent need for a technology that can effectively integrate collaborative signals and spatiotemporal structured patterns and inject them into interest point recommendation in large language models without significantly expanding the vocabulary and maintaining training stability, in order to further improve the accuracy and robustness of recommendations. Summary of the Invention
[0005] To address the above problems, this invention provides a spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model, comprising the following steps:
[0006] S1. Obtain a dataset including multiple user historical visit sequences and a candidate point of interest set, and generate time slot identifiers and region identifiers for each location in each user's historical visit sequence, as well as short-term time bucket identifiers and short-term distance bucket identifiers for each user's historical visit sequence through spatiotemporal discretization processing; each user's historical visit sequence corresponds to a user ID, and each candidate point of interest in the candidate point of interest set corresponds to an point of interest ID.
[0007] S2. Based on time slot identifiers, short-term time bucket identifiers, region identifiers, and short-term distance bucket identifiers, and combined with the high-frequency independent and low-frequency merged embedding lookup strategy, user collaboration vectors for each user and interest point collaboration vectors for each candidate interest point are generated through a collaboration representation model.
[0008] S3. Through a projection network, user co-vectors and interest point co-vectors are mapped to feature spaces that match the word vector dimensions of the large language model, respectively, to obtain user soft tips and interest point soft tips;
[0009] S4. Based on time slot identifiers, short-term time bucket identifiers, region identifiers, and short-term distance bucket identifiers, obtain long-term time soft cues, short-term time soft cues, long-distance spatial soft cues, and short-distance spatial soft cues through a projection network;
[0010] S5. Construct an input embedding sequence based on user soft cues, point-of-interest soft cues, long-term time soft cues, short-term time soft cues, long-distance spatial soft cues, and short-distance spatial soft cues;
[0011] S6. Perform two-stage training based on the input embedding sequence to obtain a trained interest point recommendation model; use the trained interest point recommendation model to implement candidate interest point recommendation.
[0012] The beneficial effects of this invention are:
[0013] This invention aims to provide an interest point recommendation method based on spatiotemporal soft cue fine-tuning. By incorporating time slots and region encoding into the input of a large language model in the form of soft cue, the model can achieve better "yes / no" preference judgment performance while maintaining training stability and controllable parameter scale.
[0014] By injecting spatiotemporally discretized information into the model through soft prompts, the vocabulary does not need to be significantly expanded, thus effectively reducing training and storage costs. Structured time slots and region encodings are easier for the model to learn and help improve the modeling ability of time period preferences and region preferences. The strategy of independent representation of high-frequency slots / high-frequency regions and merging of low-frequency slots can alleviate the sparse noise problem and enhance the model's generalization ability in long-tail scenarios. The two-stage training mechanism improves training stability and reduces performance fluctuations that may be caused by direct mixed training. Attached Figure Description
[0015] Figure 1 This is a flowchart of the training process for the interest point recommendation model in this invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Please see Figure 1 This invention provides a spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model, comprising the following steps:
[0018] S1. Obtain a dataset that includes multiple user historical visit sequences and a set of candidate points of interest, and generate time slot identifiers and region identifiers for each location in each user's historical visit sequence, as well as short-term time bucket identifiers and short-term distance bucket identifiers for each user's historical visit sequence through spatiotemporal discretization processing.
[0019] Preferably, each user's historical visit sequence corresponds to a user ID, and each candidate point of interest in the candidate point of interest set corresponds to a point of interest ID.
[0020] Preferably, step S1 includes:
[0021] S11. For each location in each user's historical visit sequence, map its timestamp to the corresponding hour slot to obtain the time slot identifier; count the frequency of occurrence of each time slot identifier, take the top M time slot identifiers with the highest frequency as significant time slots, and take the remaining time slot identifiers as other time slots; the time slot identifier is a discrete integer value between 0 and 23;
[0022] S12. For each candidate point of interest, calculate the time interval between its target time and the timestamp corresponding to the latest location in each user's historical visit sequence, and perform logarithmic bucketing on the time interval to obtain short-term time bucket identifiers.
[0023] S13. For each location in each user's historical visit sequence, map its spatial location information to a region identifier; count the frequency of occurrence of each region identifier, take the top N region identifiers with the highest frequency as prominent regions, and the remaining region identifiers as other regions;
[0024] S14. For each candidate point of interest, calculate the distance between its spatial location and the spatial location information corresponding to the latest location in each user's historical visit sequence, and perform logarithmic bucketing on the distance to obtain short-term distance bucket identifiers.
[0025] Preferably, the area identifier is obtained by discretizing the spatial information of the location (point of interest) (such as latitude and longitude or the region to which it belongs). The discretization method used includes one or more of the following: grid coding, Geohash coding, S2 cell coding, city / business district / administrative division identifier, etc.
[0026] S2. Based on time slot identifiers, short-term time bucket identifiers, region identifiers, and short-term distance bucket identifiers, and combined with the embedding lookup strategy of high-frequency independence and low-frequency merging, a collaborative representation model is used to generate user collaborative vectors for each user and interest point collaborative vectors for each candidate interest point.
[0027] Preferably, step S2 includes:
[0028] S21. For user ID, point of interest ID, time slot identifier, short-term time bucket identifier, region identifier, and short-term distance bucket identifier, respectively, an embedding lookup mechanism is used to map them into continuous dense vectors, generating their corresponding embedding vectors. The embedding lookup mechanism can be regarded as a pre-stored vector dictionary that is updated as the model is trained. Specifically,
[0029] For each time slot identifier, if it belongs to a significant time slot, an independent embedding vector is obtained through embedding lookup table; if it belongs to other time slots, it is mapped to a shared global catch-all time vector.
[0030] For each region identifier, if it belongs to a salient region, an independent embedding vector is obtained through an embedding lookup table; if it belongs to other regions, it is mapped to a shared global catch-all region vector. This embodiment of the invention employs a "high-frequency independent, low-frequency merge" strategy, embedding features into time slot identifiers and region identifiers separately. This strategy effectively alleviates the data sparsity problem in long-tail scenarios and enhances the model's generalization performance.
[0031] S22. For each user's historical visit sequence, for each location, the embedding vectors of its time slot identifier and region identifier are concatenated with the embedding vector of the user ID to generate a user context feature vector representing the visit; the user context feature vectors of all locations in the user's historical visit sequence are arranged and combined according to the historical visit time order to form a user context feature matrix; the user context feature matrix is input into the collaborative representation model, and after feature interaction and convergence, the user collaborative vector is obtained.
[0032] S23. For each candidate point of interest, iterate through all user historical visit sequences. For any user historical visit sequence, concatenate the embedding vectors of the short-term time bucket identifier and the short-term distance bucket identifier with the embedding vector of the candidate point of interest ID to generate a point of interest context feature vector. Input the point of interest context feature vector into the collaborative representation model to obtain the point of interest collaborative vector.
[0033] Preferably, the collaborative representation model specifically employs existing neural network architectures, such as multilayer perceptrons or attention mechanisms.
[0034] In a preferred embodiment of the present invention, when the collaborative representation model employs an attention mechanism network, the specific process of generating user collaborative vectors and interest point collaborative vectors is as follows:
[0035] (1) For the generation of user collaboration vectors:
[0036] For users The first in the user's historical visit sequence For each location, its time slot identifier and area identifier are respectively... , ,in Indicates the length of the user's historical sequence.
[0037] After embedding the lookup table, we get the first... Embedded vectors of time slot identifiers for each location , and the embedding vector of its corresponding region identifier Connect the two with the user User ID embedding vector splice together to generate the first User context feature vectors corresponding to each location:
[0038]
[0039] users The user context feature vectors corresponding to each location are arranged in the order of historical visits, resulting in the user context feature matrix:
[0040]
[0041] Subsequently, using three trainable parameter matrices , , User context feature matrix Perform linear projection and query the matrix respectively. Key matrix Sum matrix :
[0042]
[0043] Calculate the fused feature representation using a self-attention mechanism:
[0044]
[0045] In the formula, Indicates the number of dimensions.
[0046] Finally, the output of the attention mechanism is processed through a convergence operation (such as average pooling) to obtain the final user collaboration vector.
[0047] (2) For the generation of interest point co-vectors:
[0048] Regarding the first Each candidate point of interest, together with each user's historical visit sequence, constitutes a recommendation sample; for each user... Extract users Compared to the first The short-term time bucket identifiers and short-term distance bucket identifiers of each candidate interest point are used to obtain the embedding vector of the short-term time bucket identifier through an embedding lookup table. Embedding vectors of short-range bucket identifiers Simultaneously obtain the first Embedded vectors of interest point IDs of candidate interest points .
[0049] embed vector Embedded vectors and embedding vector Combined into a single contextual feature representation for an interest point:
[0050]
[0051] Subsequently, using three trainable parameter matrices Contextual feature representation of candidate interest points Perform linear projection to obtain the query matrix. Key matrix Sum matrix :
[0052]
[0053] Calculate the fused feature representation using a self-attention mechanism:
[0054]
[0055] In the formula, For a learnable parameter matrix, This is the scaling factor corresponding to the key vector dimension. Finally, the output of the attention mechanism is converged to obtain candidate interest points. In users Collaborative vectors of points of interest in the current context.
[0056] S3. Through a projection network, user collaborative vectors and interest point collaborative vectors are mapped to feature spaces that match the word vector dimensions of the large language model, respectively, to obtain user soft tips and interest point soft tips.
[0057] S4. Based on time slot identifiers, short-term time bucket identifiers, region identifiers, and short-term distance bucket identifiers, obtain long-term time soft cues, short-term time soft cues, long-distance spatial soft cues, and short-distance spatial soft cues through a projection network.
[0058] Preferably, step S4 includes:
[0059] The time slot identifiers are embedded in a lookup table and then projected through a network to generate long-term soft tips.
[0060] Short-term time bucket identifiers are embedded in a lookup table and then used to generate short-term time soft cues through a projection network;
[0061] After embedding the area identifier into a lookup table, it is used to generate a long-distance spatial soft cue through a projection network;
[0062] Short-distance bucket markers are embedded in a lookup table and then projected through a network to generate short-distance spatial soft cues.
[0063] The embedded lookup mechanism can be viewed as a pre-stored vector dictionary, where different identifiers are converted into their corresponding vector representations through independent embedded lookup operations.
[0064] Preferably, user soft cues, point-of-interest soft cues, long-term soft cues, short-term soft cues, long-distance spatial soft cues, and short-distance spatial soft cues each correspond to an independent projection network.
[0065] S5. Construct an input embedding sequence based on user soft cues, point-of-interest soft cues, long-term time soft cues, short-term time soft cues, long-distance spatial soft cues, and short-distance spatial soft cues.
[0066] Preferably, in the data preparation and spatiotemporal discretization stage, the interaction records in actual business typically include at least the user identifier, candidate object (candidate point of interest) identifier, and timestamp of the interaction; spatial information can be derived from latitude and longitude coordinates, location area, grid code, or other location identifiers. Next, training samples are constructed using "yes / no" labels: actual user-object interactions are used as positive samples, while negative samples are constructed for candidate objects that did not interact. The construction method includes:
[0067] Constructing includes <user> 、 <ltime> 、 <stime> 、 <sspace> 、 <lspace> 、 <item>The natural language prompts for these 6 types of placeholders;
[0068] For each user, the corresponding user soft cues, long-term time soft cues, short-term time soft cues, short-distance spatial soft cues, long-distance spatial soft cues, and point-of-interest soft cues are embedded and replaced at the corresponding positions of various placeholders to obtain an input embedding sequence. Since the user's historical visit sequence contains multiple locations, an input embedding sequence can be constructed for each location.
[0069] Specifically, the injection order of soft tips is as follows: user soft tips, long-term soft tips, short-term soft tips, short-distance spatial soft tips, long-distance spatial soft tips, and point-of-interest soft tips.
[0070] S6. Perform two-stage training based on the input embedding sequence to obtain a trained interest point recommendation model; use the trained interest point recommendation model to implement candidate interest point recommendation.
[0071] Preferably, by feeding the input embedded sequence into a large language model, the "yes / no" preference judgment output of the corresponding candidate interest points can be obtained.
[0072] Preferably, step S6, which involves two-stage training based on the input embedding sequence, includes:
[0073] Phase 1: Freeze the parameters of the collaborative representation model and the projection network, and train only the lightweight adaptation parameters of the large language model to enable the large language model to learn the task instructions and output format;
[0074] The second stage involves freezing the lightweight adaptation parameters trained in the first stage, training the collaborative representation model and the projection network, and jointly optimizing the recommendation task loss and distance preservation regularization term during training. This enables the large language model to learn to make stable discriminations using collaborative soft prompts and spatiotemporal soft prompts.
[0075] In the second phase of training, the large language model itself is in a parameter-frozen state. The gradient generated by the loss function passes through the frozen large model layers via the chain rule and is backpropagated to the underlying collaborative representation model and projection network. In this process, the large model acts as a nonlinear feature converter, enabling the underlying modules to learn how to align collaborative and spatiotemporal signals to the semantic space of the large model.
[0076] In the training strategy and loss function design, a binary classification supervised training method is adopted. For each candidate interest point, the model outputs the probability that it belongs to the positive class (i.e., user preference), with training labels mapped to 0 (no) or 1 (yes), and a binary cross-entropy loss function is used as the loss for the recommendation task. , is represented as:
[0077]
[0078] In the formula, N represents the total number of training samples. This represents the true label of the nth sample. This represents the probability that the nth sample is a positive sample.
[0079] As a supervised loss for the recommendation task, it is used to train the collaborative representation model and the projection network (mainly including the non-distance-preserving regularized soft cue projection network other than the distance-preserving regularization term), and serves as the main optimization objective other than the distance-preserving regularization term.
[0080] Preferably, to ensure that spatiotemporal soft cues retain effective distance semantics in the latent space, distance-preserving regularization is introduced in the second-stage training. Specifically, in each training batch, nearest-far neighbor triples are constructed based on real spatial distance or real time interval, such that samples that are closer in real space should have smaller representation distances for their spatiotemporal soft cues in the latent space; conversely, samples that are farther in real space should have larger representation distances. Based on this, spatial distance-preserving regularization terms and temporal distance-preserving regularization terms are constructed separately, and these are weighted and summed with the recommendation task loss to obtain the final total loss function. This design helps enhance the interpretability of the model for spatiotemporal semantics and improves its generalization ability on unseen spatiotemporal patterns.
[0081] Spatial distance preservation triplet loss for:
[0082]
[0083] In the formula, Denotes the set of triples. Describe a triple that satisfies ; Indicates the first Spatial location information of each sample With the Spatial location information of each sample The actual spatial distance between them; This represents the interval hyperparameter. Indicates the first Spatial location information of each sample With the Spatial location information of each sample The hidden spatial distance between them.
[0084] To ensure that spatiotemporal soft cues preserve distance semantics in the latent space, the following definition is made:
[0085]
[0086] In the formula, This indicates a long-distance spatial soft prompt acquisition operation.
[0087] Similarly, the time distance preserves the triplet loss. for:
[0088]
[0089] In the formula, Denotes the set of triples. Describe a triple that satisfies , Indicates the first The time interval corresponding to each sample This represents the interval hyperparameter. express and The implicit spatial distance between them. Wherein:
[0090]
[0091] In the formula, This indicates a short-term soft notification operation.
[0092] The final total loss is:
[0093]
[0094] in This is the regularization weighting coefficient.
[0095] Preferably, during the inference and business deployment phase, for a given target user and a set of candidate interest points, the model can calculate the preference probability for each candidate interest point and output a "yes / no" judgment accordingly; alternatively, the candidate interest points can be sorted in descending order of preference probability to generate a ranked recommendation list. This method is applicable to the actual deployment of online recommendation services: spatiotemporal discretization and feature extraction can be completed on the request end or the feature server end, while soft prompt generation, projection network calculation, and large language model inference are executed on the inference server end, thereby realizing an end-to-end process from feature input to recommendation result.
[0096] The interest-point recommendation model proposed in this invention uses "soft cue fine-tuning" as its core mechanism. It maps collaborative representation and structured spatiotemporal information into a unified continuous vector representation that can be directly processed by a large language model. This representation is then fused with text cue through placeholder replacement or insertion. This allows the large language model to effectively perceive and integrate structured recommendation signals while maintaining its original language understanding and reasoning capabilities. The model as a whole adopts a modular design.
[0097] The extraction of each identifier in step S1 is achieved through the spatiotemporal discretization module, which supports flexible adjustment of positioning accuracy and regional division requirements according to actual business needs.
[0098] The collaborative representation module uses a collaborative representation model to extract collaborative vectors, where the collaborative representation model can be replaced as needed.
[0099] The soft cue mapping module extracts each soft cue in steps S3-S4. Its lightweight structure enables stable training and efficient deployment without significantly expanding the model vocabulary.
[0100] The two-stage training strategy improves the stability of the model training process and the controllability of online iteration; the distance-preserving regularization term further constrains the latent space of the spatiotemporal soft cue, making the representation vectors under similar spatiotemporal conditions closer, thereby enhancing the generalization stability of the model in the long-tail period and long-tail region.
[0101] In practical applications, the model of this invention can effectively characterize users' time-of-day and region preferences, making the recommendation results more consistent with the spatiotemporal context of specific scenarios. It is particularly suitable for business scenarios with significant day-night patterns, weekday-weekend differences, regional clustering effects, or travel radius constraints. Furthermore, by employing a strategy of "independent representation of high-frequency time slots / high-frequency regions and merged representation of low-frequency parts," it can alleviate long-tail sparsity and data noise while improving the model's generalization stability in less popular time periods and niche regions. In summary, this invention achieves a good balance between model performance, training cost, and engineering deployability, demonstrating feasibility for practical application in recommendation systems.
[0102] Traditional recommender systems typically rely on large language models to generate recommendations. Their core lies in using user and candidate object vector representations generated by collaborative models and mapping these representations to the word vector space of the large language model. In these methods, user history and candidate object information are usually input as embedded vectors, while the processing of temporal and spatial features is relatively simple, often treated as static features or indirectly introduced through text descriptions. This fails to fully explore the crucial role of spatiotemporal information in recommendation decisions. Therefore, while traditional methods have certain advantages in text understanding and instruction following, their accuracy and robustness may be limited when facing recommendation scenarios with significant spatiotemporal dependencies, especially in tasks requiring differentiation of preferences across different time periods or regions, where they often struggle to capture complex spatiotemporal patterns.
[0103] In contrast, this invention transforms temporal and spatial information into independent soft cues through structured discretization and integrates them into the fine-tuning process of a large language model, enabling the model to collaboratively utilize cooperative signals and spatiotemporal signals during inference. Simultaneously, the introduction of distance-preserving regularization constraints promotes closer latent space representations corresponding to similar times or regions, thereby effectively enhancing the model's spatiotemporal awareness and generalization performance without significantly expanding the vocabulary size.
[0104] Overall, this invention has significant improvements over traditional methods in spatiotemporal information modeling and long-tail generalization, and is particularly suitable for real-world recommendation scenarios with significant spatiotemporal patterns, enabling it to respond more accurately to changes in user preferences under different time and space conditions.
[0105] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.< / item> < / lspace> < / sspace> < / stime> < / ltime> < / user>
Claims
1. A spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model, characterized in that, Includes the following steps: S1. Obtain a dataset comprising multiple user historical visit sequences and a candidate point of interest (POI) set. Generate time slot and region identifiers for each location in each user's historical visit sequence, as well as short-term time bucket and short-term distance bucket identifiers for each user's historical visit sequence, through spatiotemporal discretization. Each user's historical visit sequence corresponds to a user ID, and each candidate POI in the candidate POI set corresponds to an POI ID. Wherein: Count the frequency of occurrence of each time slot identifier, and take the top M most frequent time slot identifiers as significant time slots, and the remaining time slot identifiers as other time slots; count the frequency of occurrence of each region identifier, and take the top N most frequent region identifiers as significant regions, and the remaining region identifiers as other regions. S2. Based on time slot identifiers, short-term time bucket identifiers, region identifiers, and short-term distance bucket identifiers, and combined with a high-frequency independent and low-frequency merged embedding lookup strategy, a collaborative representation model is used to generate user collaborative vectors for each user and interest point collaborative vectors for each candidate interest point; the collaborative representation model adopts a multilayer perceptron or attention mechanism network. S3. Through a projection network, user co-vectors and interest point co-vectors are mapped to feature spaces that match the word vector dimensions of the large language model, respectively, to obtain user soft tips and interest point soft tips; S4. Based on time slot identifiers, short-term time bucket identifiers, region identifiers, and short-term distance bucket identifiers, obtain long-term time soft cues, short-term time soft cues, long-distance spatial soft cues, and short-distance spatial soft cues through a projection network; S5. Construct an input embedding sequence based on user soft cues, point-of-interest soft cues, long-term time soft cues, short-term time soft cues, long-distance spatial soft cues, and short-distance spatial soft cues; S6. Perform two-stage training based on the input embedding sequence to obtain a trained interest point recommendation model; use the trained interest point recommendation model to implement candidate interest point recommendation. Step S6 involves two-stage training based on the input embedding sequence, including: Phase 1: Freeze the parameters of the collaborative representation model and the projection network, and train only the lightweight adaptation parameters of the large language model to enable the large language model to learn the task instructions and output format; The second stage involves freezing the lightweight adaptation parameters trained in the first stage, training the collaborative representation model and the projection network, and jointly optimizing the recommendation task loss and distance preservation regularization term during training. This enables the large language model to learn to make stable discriminations using collaborative soft prompts and spatiotemporal soft prompts.
2. The spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model according to claim 1, characterized in that, Step S1 includes: S11. For each location in each user's historical visit sequence, map its timestamp to the corresponding hour slot to obtain the time slot identifier; the time slot identifier is a discrete integer value between 0 and 23. S12. For each candidate point of interest, calculate the time interval between its target time and the timestamp corresponding to the latest location in each user's historical visit sequence, and perform logarithmic bucketing on the time interval to obtain short-term time bucket identifiers. S13. For each location in each user's historical visit sequence, map its spatial location information to a region identifier; S14. For each candidate point of interest, calculate the distance between its spatial location and the spatial location information corresponding to the latest location in each user's historical visit sequence, and perform logarithmic bucketing on the distance to obtain short-term distance bucket identifiers.
3. The spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model according to claim 1, characterized in that, Step S2 specifically includes: S21. For user ID, point of interest ID, time slot identifier, short-term time bucket identifier, region identifier, and short-term distance bucket identifier, generate their respective embedding vectors through an embedding lookup table mechanism; wherein, for each time slot identifier, if it belongs to a significant time slot, an independent embedding representation is obtained through the embedding lookup table, and if it belongs to other time slots, it is mapped to a shared global fallback time vector. For each region identifier, if it belongs to a salient region, an independent embedding representation is obtained through embedding lookup; if it belongs to other regions, it is mapped to a shared global catch-all region vector. S22. For each user's historical visit sequence, for each location, the embedding vectors of its time slot identifier and region identifier are concatenated with the embedding vector of the user ID to generate a user context feature vector representing that visit. The user context feature vectors of all locations in the user's historical visit sequence are arranged and combined according to the historical visit time order to form a user context feature matrix. The user context feature matrix is input into the collaborative representation model, and after feature interaction and convergence, a user collaborative vector is obtained. S23. For each candidate point of interest, for any user's historical visit sequence, the embedding vectors of the short-term time bucket identifier and the short-term distance bucket identifier are concatenated with the embedding vector of the candidate point of interest ID to generate the point of interest context feature vector; the point of interest context feature vector is input into the collaborative representation model to obtain the point of interest collaborative vector.
4. The spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model according to claim 1, characterized in that, Step S4 includes: The time slot identifiers are embedded in a lookup table and then projected through a network to generate long-term soft tips. Short-term time bucket identifiers are embedded in a lookup table and then used to generate short-term time soft cues through a projection network; After embedding the area identifier into a lookup table, it is used to generate a long-distance spatial soft cue through a projection network; Short-distance bucket markers are embedded in a lookup table and then projected through a network to generate short-distance spatial soft cues.
5. The spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model according to claim 1, characterized in that, Step S5 includes: Constructing includes <user> 、 <ltime> 、 <stime> 、 <sspace> 、 <lspace> 、 <item> The natural language prompts for these 6 types of placeholders;< / item> < / lspace> < / sspace> < / stime> < / ltime> < / user> For each user, the corresponding user soft cues, long-term time soft cues, short-term time soft cues, short-distance spatial soft cues, long-distance spatial soft cues, and point-of-interest soft cues are embedded and replaced at the corresponding positions of various placeholders to obtain an input embedding sequence.
6. The spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model according to claim 1, characterized in that, In the second stage of training, a loss function is used. for: , , , , In the formula, Indicates the loss from the recommended task. This represents the spatial distance-preserving triplet loss. This indicates the time-distance-maintaining triplet loss. , This represents the regularization weight coefficient; N represents the total number of training samples. This represents the true label of the nth sample. This represents the probability that the nth sample is a positive sample; Denotes the set of triples. Describe a triple that satisfies ; Indicates the first Spatial location information of each sample With the Spatial location information of each sample The actual spatial distance between them; This represents the interval hyperparameter. Indicates the first Spatial location information of each sample With the Spatial location information of each sample The hidden spatial distance between them; Denotes the set of triples. Describe a triple that satisfies , Indicates the first The time interval corresponding to each sample This represents the interval hyperparameter. express and The hidden spatial distance between them.
7. The spatiotemporal soft-cue fine-tuning interest point recommendation method based on a large language model according to claim 6, characterized in that, definition: , , In the formula, This indicates a long-distance spatial soft prompt acquisition operation. This indicates a short-term soft notification operation.
Citation Information
Patent Citations
Interest point recommendation method combining periodic preference and short-term interest of user
CN115982468A
Collaborative feature perception-oriented large model fine tuning method and system
CN120067618A