A method and system for computing in collaboration with a large model and a recommended small model

By combining large and small models working together in the cloud and on the device, the high cost of deploying and training large language models on devices is solved, efficient and real-time personalized recommendations are achieved, and the performance of the recommendation system and user experience are improved.

CN119046538BActive Publication Date: 2025-10-21SHANGHAI INST FOR ADVANCED STUDY OF ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411120312.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2025-10-21
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

Large language models (LLMs) are expensive to deploy and train on devices and cannot access real-time user data in a timely manner, which limits the performance and real-time nature of recommendation systems.

Method used

By using a large language model in the cloud to generate candidate lists and initial rankings, using a small recommendation model on the device for dynamic re-ranking, and introducing an intelligent request mechanism to evaluate consistency, collaborative training and inference are used to optimize recommendation results.

Benefits of technology

It improves the performance and real-time performance of the recommendation system, reduces device resource consumption, enables flexible deployment and efficient recommendation tasks, and improves recommendation accuracy and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046538B_ABST
    Figure CN119046538B_ABST
Patent Text Reader

Abstract

The application discloses a method and system for collaborative calculation of large models and small recommendation models. The method of the application designs an end-cloud collaborative recommendation model framework, wherein a large model based on the cloud generates a candidate list and an initial ranking using historical data, and a small model on an end-side device dynamically rearranges the list using the latest user data. The collaborative decision request evaluates the need to call the large model by evaluating the consistency between the initial ranking of the large model and the subsequent rearrangement of the small model. The combination of the feature extraction capability of the large language model and the convenience of the small recommendation model enhances the practicability and accuracy of the large language model on the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of recommendation systems and machine learning, and in particular relates to a method and system for collaborative large model and recommendation small model calculation. Background Art

[0002] In today's recommendation systems, large language models (LLMs) such as GPT (Generative Pre-trained Transformer) have demonstrated outstanding performance, especially in natural language understanding and generation. However, deploying these large models on devices faces some challenges. Among them, the behavioral data generated by users on the device poses a significant challenge to model deployment. This data may involve users' browsing history, click behavior, purchase history, etc., which is crucial for personalized recommendations in recommendation systems. Since the data involves user privacy, it needs to be anonymized. At the same time, factors such as the communication burden between the device and the cloud and the limitations of cloud computing resources also restrict the large models' ability to access and process real-time data. In addition, since LLMs have more parameters and complex structures than traditional small models, their training and inference costs are higher, which is not conducive to frequent use on devices.

[0003] Sequential recommendation systems (SRSs) are an important subfield of recommendation systems. Their goal is to predict a user's next action based on their historical behavior sequences (such as clicks, purchases, and browsing), thereby enabling personalized recommendations. Currently, many mature SR models exist, such as DIN (Deep Interest Network), GRU4Rec (Gated Recurrent Unit for Recurrent Neural Network), and SASRec (Self-Attentive Sequential Recommendation). These models typically feature a small number of parameters and efficient computation.

[0004] In existing technologies, there are certain differences between large language models (LLMs) and small recommendation models (SRMs). LLMs generally have stronger reasoning and generalization capabilities, but face the problem of high deployment and training costs. SRMs, on the other hand, are more suitable for on-device deployment and frequent use, but may have certain limitations in recommendation accuracy.

[0005] Specifically, the shortcomings of the existing technology are:

[0006] (1) The deployment of LLMs on devices faces practical constraints, mainly because the behavioral data generated by users on devices makes it difficult to deploy large models. In addition, data anonymization, the communication burden between devices and the cloud, and cloud computing capacity limitations all hinder large models from accessing real-time data.

[0007] (2) LLMs are much more expensive to train and infer relative to smaller models, which makes frequent use of LLMs for training and inference on devices complex and expensive. Summary of the Invention

[0008] The purpose of the present invention is to solve the problems existing in the prior art and provide a method and system for collaborative large model and recommended small model calculation.

[0009] In order to achieve the above-mentioned object of the invention, the present invention specifically adopts the following technical solutions:

[0010] In a first aspect, the present invention provides a method for collaboratively calculating a large model and a small recommendation model, for making personalized product recommendations to users, comprising the following steps:

[0011] S1. Pre-train a large language model and a sequence recommendation model using a user history behavior dataset on the cloud side, obtaining pre-trained large language models and pre-trained sequence recommendation models with independent recommendation capabilities. The user history behavior dataset consists of user history behavior data and true labels for the user history behavior data. Each user history behavior data contains a user ID, a product ID, and the user's historical click sequence.

[0012] S2. On the cloud side, the pre-trained large language model and the pre-trained sequence recommendation model obtained in S1 are collaboratively trained. During the collaborative training, the parameters of the pre-trained large language model are fixed. After collaborative training on the cloud side, the optimized sequence recommendation model is obtained.

[0013] S3. Deploy the pre-trained large language model on the cloud-side device, deploy the optimized sequence recommendation model on the client-side device, and retrain the optimized sequence recommendation model on the client-side device on the user's real-time behavior dataset to obtain a retrained sequence recommendation model.

[0014] S4. The cloud side inputs the real-time user behavior data to be predicted into the pre-trained large language model and outputs an initial ranking result and an initial candidate list. The cloud side sends the initial ranking result and the initial candidate list to the client side. The client side inputs the initial candidate list into the retrained sequence recommendation model and re-ranks the initial candidate list according to the probability of user interaction. The client side obtains the re-ranking result and a sorted list of product IDs corresponding to the re-ranking result. The client side merges the normalized initial ranking result and the normalized re-ranking result to obtain the final ranking result.

[0015] S5. The client subtracts the initial candidate list from the sorted product ID list according to the index number, and calculates the inconsistency score based on the absolute value of the subtraction result. If the inconsistency score is greater than the preset inconsistency threshold, the client uploads the latest real-time user behavior data to the cloud. The cloud uses a pre-trained large language model to process the latest real-time user behavior data. The cloud outputs a new initial ranking result and a new initial candidate list and sends them to the client. The client then uses a retrained sequence recommendation model to output a new final ranking result. If the inconsistency score is less than or equal to the preset inconsistency threshold, the client directly outputs the final ranking result.

[0016] Based on the above solution, each step can be implemented in the following preferred specific manner.

[0017] Preferably, in step S1, the large language model and the sequence recommendation model use the same loss function when they are pre-trained.

[0018] Preferably, in step S2, in each iterative round of collaborative training, the user historical behavior data set is input into the pre-trained large language model, and each user historical behavior data obtains a candidate list, which is split into a preset number of tokens, and the generated tokens are randomly combined to form a token list. The token list and the candidate list constitute a token-enhanced product ID candidate list, and the product ID candidate list is input into the pre-trained sequence recommendation model. The product ID candidate list is re-ranked according to the size of the user interaction probability to obtain a re-ranked list; wherein, the candidate list is composed of a preset number of items selected from the predicted labels generated by the large language model.

[0019] As a preference, in step S4, when merging the normalized initial ranking result and the normalized re-ranking result, first merge the normalized re-ranking result. Filter and get the filtered ranking results

[0020]

[0021] After normalization and filtering, the normalized initial ranking results are merged by adjusting the hyperparameter α And the filtered ranking results To get the final ranking results

[0022]

[0023] Among them, p represents the probability of the normalized re-ranking result; τ a With τ b Both indicate preset thresholds.

[0024] Preferably, in step S5, the inconsistency score c is calculated as follows:

[0025]

[0026] in, Represents the initial candidate list and a sorted list of product IDs The elements in are exactly the same, only the order is different; pos k (q) represents the function of the position of element q in list k, Indicates that element o is in the initial candidate list The position in Indicates that element o is in the sorted list of product IDs Position in; n represents the initial candidate list Or a sorted list of product IDs The number of elements in .

[0027] In the second aspect, the present invention provides a system for collaborative large model and recommended small model calculation, characterized in that it includes an end-side device and a cloud-side device, and a communication connection between the end-side device and the cloud-side device, for implementing a method for collaborative large model and recommended small model calculation as described in any scheme of the first aspect above.

[0028] Preferably, the terminal side device includes a computer.

[0029] Preferably, the cloud-side device includes a server.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] (1) The method LSC4Rec of the present invention improves the performance of the recommendation system in a synergistic manner by integrating a large language model and a small recommendation model, which may be difficult to achieve in traditional small recommendation models or large language models.

[0032] (2) By using a large language model in the cloud to generate a candidate list and then using a small recommendation model on the device for optimization, the method LSC4Rec of the present invention effectively utilizes the advantages of both while avoiding excessive consumption of device resources by large-scale parameters.

[0033] (3) By working collaboratively on the cloud side and the end side, the method LSC4Rec of the present invention maintains the real-time nature of the recommendation system while providing advanced capabilities, enabling it to adapt more flexibly to the real-time behavior of users.

[0034] (4) In order to solve the challenges faced by large language models in deployment, the method of the present invention achieves a more feasible and efficient deployment by allocating the recall and re-ranking tasks to the cloud side and the end side. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 Flowchart of the LSC4Rec method of the present invention, wherein (a) is a schematic diagram of collaborative training; (b) is a schematic diagram of collaborative reasoning; (c) is a schematic diagram of intelligent request;

[0036] Figure 2 3. The figure compares the LSC4Rec method of the present invention with the existing recommendation paradigm; wherein, (a) is a schematic diagram of the existing recommendation system paradigm; (b) is a schematic diagram of the method of the present invention; and (c) is a schematic diagram of a specific example of the method of the present invention. DETAILED DESCRIPTION

[0037] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the various embodiments of the present invention can be combined accordingly without conflicting with each other.

[0038] In view of the above-mentioned shortcomings, the technical problems to be solved by the present invention are:

[0039] (1) The method of the present invention combines a large cloud-based model with a small on-device model through collaborative training and collaborative inference. The large cloud-based model generates a candidate list and initial ranking, while the small on-device model dynamically re-ranks based on real-time data, thus overcoming the problem of the large model's inability to access data in a timely manner.

[0040] (2) The method of the present invention introduces intelligent requests to evaluate the consistency between the initial ranking of the large model and the re-ranking of the small model. If a discrepancy is found, the candidate list and ranking are regenerated from the cloud through a request to compensate for the large model's inability to access data in a timely manner.

[0041] The main function of the method of the present invention is to focus on the application of contemporary large-scale language models in recommendation systems, coordinate the cooperation of large and small models, improve the recommendation performance through collaborative training, collaborative inference and intelligent request, and realize end-cloud collaboration in recommendation tasks.

[0042] In the actual application of LLM4Rec, due to the heavy end-cloud communication load and high training and inference consumption, it is impossible to perform training and fine-tuning based on full real-time data. Figure 1 As shown, in a preferred implementation of the present invention, a method for collaborative large model and small recommendation model calculation LSC4Rec (Device-Cloud Large and Small ModelCollaborative Recommendation Framework) is proposed for making personalized product recommendations to users. The method aims to design a device-cloud collaborative recommendation model framework by working collaboratively between the device and the cloud, giving full play to the advantages of large and small models, thereby improving the performance and practicality of the recommendation system. Specifically, the method of the present invention includes three key parts: collaborative training, collaborative reasoning, and collaborative decision requests (intelligent requests). Through collaborative training and reasoning, the cloud-based large model generates a candidate list and an initial ranking, while the small model on the device dynamically re-ranks these lists based on the latest real-time user data. The intelligent request evaluates the consistency between the initial ranking of the large model and the re-ranking of the small model to determine whether it is necessary to further request the large model to generate a new candidate list. In this way, the method LSC4Rec of the present invention combines the feature extraction capabilities of the large language model and the convenience of the small recommendation model, improving the practicality of deploying large models on devices.

[0043] The above-mentioned method for collaborative large model and recommended small model calculation includes the following steps S1 to S5, and the specific implementation process thereof is described in detail below.

[0044] 1. Collaborative Training

[0045] 1) Separately train the large language model and sequence recommendation model

[0046] S1. Using the user historical behavior dataset on the cloud side The large language model (LLM) and the sequential recommendation model (SRM) are pre-trained to obtain the pre-trained large language model LLM4Rec and pre-trained sequential recommendation model SRM4Rec, each with independent recommendation capabilities. The user history behavior dataset consists of user history behavior data and the true labels of the user history behavior data. Each user history behavior data contains the user ID, product ID, and the user's historical click sequence.

[0047] It should be noted that, in this invention, we first introduce the complexity review of the existing sequential recommendation graph: the paradigm of sequential recommendation is to ignore the data textualization process required by the large language model LLM during the training phase. When the large language model LLM and the sequence recommendation model SRM are pre-trained separately, the loss function L of the large language model LLM and the sequence recommendation model SRM is ind The form is the same as follows:

[0048]

[0049] Among them, u represents the user ID; v represents the product ID; s represents the user's historical click sequence; y represents the true label of the user's historical behavior data; Represents the predicted label generated by the large language model LLM or the sequence recommendation model SRM; Represents the large language model LLM or sequence recommendation model SRM, Represents the output of the large language model LLM or sequence recommendation model SRM when · is used as input; Represents the loss function for independent training of a single user's historical behavior data.

[0050] like Figure 1 As shown in (a), during the gradient backpropagation, the large language model LLM and the sequential recommendation model SRM are slightly different. The large language model LLM can choose to update the instructions, prompts, and the large language model itself, while the sequential recommendation model SRM usually focuses on updating itself. The gradient backpropagation of the sequential recommendation model SRM can be formalized as Among them, θ S Represents a sequential recommendation model Based on the prior knowledge, the present invention keeps the instructions and prompt words of the large language model LLM unchanged, and then fine-tunes the parameters of the large language model. Similarly, the gradient back propagation of the large language model LLM can also be formalized as Among them, θ L Representing a large language model Parameters.

[0051] In the prior art, the pre-trained large language model LLM4Rec and the pre-trained sequence recommendation model SRM4Rec can be used for inference. In the inference stage, if the data textualization process required by the pre-trained large language model LLM4Rec is ignored, the inference process of the two is basically the same.

[0052] 2) Collaborative training of large language models and sequence recommendation models

[0053] S2. On the cloud side, the pre-trained large language model LLM4Rec and the pre-trained sequence recommendation model SRM4Rec obtained in S1 are collaboratively trained. During the collaborative training, the parameters of the pre-trained large language model LLM4Rec are fixed. After collaborative training on the cloud side, the optimized sequence recommendation model SRM4Rec is obtained.

[0054] like Figure 1 As shown in (a), in each iteration of collaborative training, the user historical behavior dataset is The data is input into the pre-trained large language model, and a candidate list is obtained for each user's historical behavior data. The candidate list is split into a preset number of tokens, and the generated tokens are randomly combined to form a token list. The token list and the candidate list constitute a token-enhanced product ID candidate list. The product ID candidate list is input into the pre-trained sequence recommendation model SRM4Rec, and the product ID candidate list is re-ranked according to the size of the user interaction probability to obtain a re-ranked list S Rerank . The candidate list is composed of a preset number of items selected from the predicted labels generated by the large language model.

[0055] It should be noted that after the large language model LLM and the sequence recommendation model SRM are trained separately, in order to make up for the difference between the candidate list generated by the large language model LLM and the user historical behavior data set, collaborative training is required. In collaborative training, the user historical behavior data is input into the pre-trained large language model LLM4Rec to obtain the inference result (the prediction label generated by the large language model). For each user historical behavior data x = (u, v, s), the present invention takes N from the prediction label generated by the large language model. candidate Items, forming a candidate list S candidate :

[0056]

[0057] Among them, Sort represents a sorting operation. In addition, the items that are difficult to distinguish by the pre-trained large language model, that is, items with similar tags, are randomly combined to obtain a token list S token :

[0058] Stoken =Augment(S candidate )

[0059] Among them, Augment represents the data enhancement operation. Then, the token enhanced product ID candidate list S is composed of the token list and the candidate list. Aug :

[0060] S Aug ={S candidate ,S token}

[0061] After that, the above product ID candidate list S Aug Input into the pre-trained sequence recommendation model SRM4Rec, so that the pre-trained sequence recommendation model SRM4Rec is in the above product ID candidate list S Aug The predicted labels generated by the sequence recommendation model are expressed as Then we get the rearranged list S Rerank :

[0062]

[0063] At this point, in collaborative training, the loss function of the sequence recommendation model SRM is:

[0064]

[0065] in, Represents the loss function of a single user's historical behavior data for collaborative training of the sequence recommendation model SRM. This paper fixes the model parameters of the pre-trained large language model LLM4Rec so that the gradient generated by the loss is only back-propagated to the pre-trained sequence recommendation model SRM4Rec, so the optimization function is Finally got L col Large language model LLM4Rec and optimized sequence recommendation model SRM4Rec.

[0066] 3) Real-time training of sequence recommendation model SRM4Rec

[0067] S3. Deploy the pre-trained large language model LLM4Rec on the cloud-side device, and deploy the optimized sequence recommendation model SRM4Rec on the end-side device. The optimized sequence recommendation model is retrained to obtain the retrained sequence recommendation model SRM4Rec.

[0068] It should be noted that after the large language model (LLM) and the sequence recommendation model (SRM) are trained, the pre-trained large language model (LLM4Rec) and the re-trained sequence recommendation model (SRM4Rec) are obtained. The pre-trained large language model (LLM4Rec) is deployed in the cloud, and the re-trained sequence recommendation model (SRM4Rec) is deployed on the device. However, as mentioned earlier, due to network bandwidth limitations and device-side data processing delays, it is difficult for the pre-trained large language model (LLM4Rec) to obtain real-time data. Even if it can access this data, its large number of parameters makes rapid training and model deployment difficult.

[0069] Therefore, the sequential recommendation model SRM4Rec needs to be trained based on the real-time user behavior dataset on the end device, and the optimization goal is The loss function L used by the sequence recommendation model during retraining retrain as follows:

[0070]

[0071] in, Represents the predicted label generated by the retrained sequence recommendation model; Represents the retraining loss of a single user's real-time behavior data.

[0072] 2. Collaborative Reasoning

[0073] S4. The cloud side inputs the real-time user behavior data to be predicted into the pre-trained large language model and outputs the initial ranking result and the initial candidate list The cloud side will initially rank the results and the initial candidate list Send it to the client side, and the client side will list the initial candidate Input into the retrained sequence recommendation model, and sort the initial candidate list according to the size of the user interaction probability Re-ranking is performed, and the client side obtains the re-ranking results And the sorted list of product IDs corresponding to the re-ranking results The client side will normalize the initial ranking results And the normalized re-ranking results Merge to get the final ranking results

[0074] It should be noted that if Figure 1 As shown in (b), when the normalized initial ranking result and the normalized re-ranking result are merged, the normalized re-ranking result is first merged. Filter and get the filtered ranking results

[0075] And (p>τ a or p<τ b )}

[0076] Among them, p represents the probability of the normalized re-ranking result; τ a With τ b After normalization and screening, the initial ranking results after normalization are merged by adjusting the hyperparameter α. And the filtered ranking results To get the final ranking results

[0077]

[0078] It should be noted that after the collaborative training is completed, the pre-trained large language model and the retrained sequence recommendation model are deployed on the cloud and the end device respectively. The following describes how the end side uses the normalized initial ranking results in the inference phase. And the normalized re-ranking results Merge to get the final ranking results Because the pre-trained large language model and the retrained sequence recommendation model have different ranking principles, the pre-trained large language model is generative, while the retrained sequence recommendation model is non-generative. Therefore, their ranking scales are different, resulting in different ranking scales. Therefore, it is necessary to normalize the initial ranking results and the re-ranking results on the client side. Putting the initial ranking results and the re-ranking results on the same scale can better merge the ranking results. The normalization process can be formalized as follows:

[0079]

[0080] in, Indicates the minimum value in the initial ranking results; Indicates the maximum value in the initial ranking results; Represents the minimum value in the re-ranking results; Indicates the maximum value in the re-ranking results.

[0081] In addition, the normalized re-ranking results of the sequence recommendation model SRM4Rec are First filter it and set the threshold τ a and τ b To filter out the most certain positive and negative samples identified by the sequence recommendation model, and obtain the filtered ranking results

[0082] And (p>τ a or p<τ b )}

[0083] It should be noted that after collaborative training and collaborative reasoning, a complete framework is formed, and the retrained sequence recommendation model is deployed on the end-side device. The retrained sequence recommendation model can compensate as much as possible for the performance degradation caused by the difficulty of the pre-trained large language model to obtain real-time data, making the retrained sequence recommendation model more effective in the end-cloud system than using the large language model or the sequence recommendation model alone. However, it should be noted that when the retrained sequence recommendation model should call the pre-trained large language model LLM4Rec to provide new reasoning results based on real-time data has not yet been solved. To fill this gap, the present invention designs a collaborative decision request function for the retrained sequence recommendation model. The collaborative decision request can be used to determine the timing of calling the pre-trained large language model LLM4Rec, and when necessary, call the pre-trained large language model LLM4Rec on the cloud-side device for reasoning, and repeat step S4 to obtain the final ranking result and output it.

[0084] 3. Collaborative decision-making request (smart request)

[0085] S5. Figure 1 As shown in (c), the client side lists the initial candidate list according to the index number. and a sorted list of product IDs Subtract the two, and calculate the inconsistency score based on the absolute value of the subtraction result. If the inconsistency score is greater than the preset inconsistency threshold, the client uploads the latest real-time user behavior data to the cloud. The cloud uses the pre-trained large language model to process the latest real-time user behavior data. The cloud outputs a new initial ranking result and a new initial candidate list and sends them to the client. The client retrains the sequence recommendation model that has been trained well to output a new final ranking result. If the inconsistency score is less than or equal to the preset inconsistency threshold, the client directly outputs the final ranking result.

[0086] It should be noted that the present invention uses the same element in the initial candidate list and a sorted list of product IDs The inconsistency score c is calculated based on the ranking position difference, that is, the client side sorts the initial candidate list according to the index number. and a sorted list of product IDs Subtract, and calculate the inconsistency score by the absolute value of the subtraction result. The calculation method of the inconsistency score c can be formalized as follows:

[0087]

[0088] in, Represents the initial candidate list and a sorted list of product IDs The elements in are exactly the same, only the order is different; pos k (q) represents the function of the position of element q in list k, Indicates that element o is in the initial candidate list The position in Indicates that element o is in the sorted list of product IDs Position in; n represents the initial candidate list Or a sorted list of product IDs The number of elements in .

[0089] It should be noted that, in the present invention, when the inconsistency score is greater than the preset inconsistency threshold, the client side will request the cloud side for a new initial ranking result and a new initial candidate list from the cloud side:

[0090]

[0091] in, is an indicator function; Threshold represents the preset inconsistency threshold; Request represents the request sent by the end side to the cloud side.

[0092] It should be noted that in this embodiment, in order to obtain the inconsistency threshold, this embodiment collects real-time user behavior data for a period of time, then obtains the inconsistency score c corresponding to this data in the cloud and sorts it, and then sets the inconsistency threshold based on the load of the cloud server. That is, the inconsistency threshold can be obtained during training. For example, if the load of the cloud server needs to be reduced by 90%, that is, when the load is only 10% of the previous value, only the minimum 10% position value needs to be sent to each device as the inconsistency threshold. During the inference process, each device determines whether it needs to upload the user's real-time behavior data to the large language model for inference based on the above two formulas. This is to ensure that the optimal large language model call strategy is achieved under any device-cloud communication resources and large language model call resources.

[0093] The present invention will now use a specific example to demonstrate the application effect of the method for calculating a collaborative large model and a recommended small model described in S1 to S5 in the above embodiments on a specific data set, so as to facilitate understanding of the essence of the present invention.

[0094] Example

[0095] The specific implementation process of the method for calculating a collaborative large model and a small recommendation model used in this embodiment is as described above and will not be repeated here. The following Tables 1, 2, and 3 show the performance comparison of the method of the present invention with the SRM on the device and the LLM on the cloud in three datasets corresponding to the personalized product recommendation scenario. Since the SRM is directly deployed on the device, they can use real-time data for reasoning. In contrast, due to the limitations mentioned above, the LLM on the cloud cannot process real-time data. In order to establish a relatively ideal situation for the baseline model, this embodiment allows the LLM to receive data that is only two clicks delayed from the real-time data. According to Table 1, the following points can be observed: (1) Compared with the SRM, although the LLM cannot access real-time data, its performance is still stronger, which highlights the necessity of calling the LLM on the cloud. (2) The performance of the method of the present invention on the three datasets is significantly improved. Specifically, when the LLM is set to P5 and the SRM is set to SASRec, LSC4Rec improves by an average of 16.18% on the Beauty dataset, 10.62% on the Toys dataset, and 9.38% on the Yelp dataset. When LLM is set to POD and SRM is set to SASRec, LSC4Rec achieves an average improvement of 16.75% on the Beauty dataset, 15.85% on the Toys dataset, and 12.63% on the Yelp dataset.

[0096] Tables 1, 2, and 3 below compare the performance of different methods, with the best performance indicated in bold. In the experimental results for each dataset, the last row shows the improvement (Improve) of our method LSC4Rec over the best baseline model.

[0097] Table 1 Performance comparison of different methods on NDCG indicators

[0098]

[0099]

[0100]

[0101] Table 2 Performance comparison of different methods on HR indicators

[0102]

[0103]

[0104]

[0105] Table 3 Performance comparison of different methods on the Precision index

[0106]

[0107]

[0108] Compared with the closest prior art, the advantages of the present invention are:

[0109] 1. Our method, LSC4Rec, employs a device-cloud collaborative recommendation framework for large and small models, effectively addressing the challenges faced by large language models (LLMs) and small recommendation models (SRMs) in practical applications. By using a large model in the cloud to generate candidate lists and initial rankings, and a small model on the device to dynamically re-rank, LSC4Rec leverages the strengths of both models, improving the performance and practicality of recommendation systems.

[0110] 2. Our method introduces an intelligent request protocol that determines whether to re-retrieve data from the cloud by evaluating the consistency of ranking results between large and small models. This mechanism ensures the accuracy and real-time nature of recommendation results, improving the user experience.

[0111] 3. Compared to using a large model for training and inference alone, the small model in the LSC4Rec method of the present invention has lower training and inference costs and can be operated more frequently. This allows the recommendation system to be continuously optimized with the assistance of the small model, even if the large model cannot access data in real time.

[0112] 4. Comprehensive experimental validation demonstrates the effectiveness of each module of our LSC4Rec method. Experimental results show that, even when limited by LLMs' inability to access data in a timely manner, our LSC4Rec method can achieve performance improvements exceeding 10%, further validating its effectiveness in addressing existing challenges.

[0113] like Figure 2 The figure shows a comparison between the method LSC4Rec of the present invention and the existing recommended paradigm; wherein, Figure 2 (a) Describes the traditional SRM4Rec and LLM4Rec diagrams respectively. Figure 2 (b) is an overview of the method LSC4Rec proposed in this paper, which is a device-cloud collaboration framework including collaborative training, collaborative reasoning strategy and collaborative decision request. Figure 2 (c) is a specific example of the method LSC4Rec of the present invention, demonstrating effective collaborative reasoning and collaborative decision-making requests.

[0114] In summary, for the recommendation problem, this paper proposes a method, LSC4Rec, for collaborative computation of large and small recommendation models. This method comprises three key components: collaborative training, collaborative reasoning, and collaborative decision requests. LSC4Rec aims to improve the performance of recommendation systems by leveraging the synergy of large and small models, particularly when the large model lacks access to real-time data. A comprehensive experimental analysis of LSC4Rec validates the effectiveness of each module. Notably, in scenarios where LLMs struggle to access timely data, LSC4Rec achieves performance improvements exceeding 10%, further demonstrating the practicality and effectiveness of the method. During the collaborative training phase, the results of the large language model and the small recommendation model are merged. To set the inconsistency threshold for collaborative decision requests, the method collects user data over a period of time, calculates the consistency corresponding to this data, and sets the threshold based on the cloud server load during training. This ensures an optimal LLM invocation strategy regardless of device-cloud communication resources and LLM invocation resources.

[0115] It should also be noted that the method for calculating a collaborative large model and a recommended small model in the above embodiment can essentially be executed by a computer program or module. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a system for calculating a collaborative large model and a recommended small model corresponding to the method for calculating a collaborative large model and a recommended small model provided in the above embodiment, which includes an end-side device and a cloud-side device, and the end-side device and the cloud-side device are communicatively connected to implement a method for calculating a collaborative large model and a recommended small model as described in the above embodiment. The end-side device includes a computer. The cloud-side device includes a server.

[0116] The embodiment described above is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.

Claims

1. A method for collaborative large model and recommended small model calculation, characterized in that: It is used to make personalized product recommendations to users, including the following steps: S1. Pre-train a large language model and a sequence recommendation model using a user history behavior dataset on the cloud side, obtaining pre-trained large language models and pre-trained sequence recommendation models with independent recommendation capabilities. The user history behavior dataset consists of user history behavior data and true labels for the user history behavior data. Each user history behavior data contains a user ID, a product ID, and the user's historical click sequence. S2. On the cloud side, the pre-trained large language model and the pre-trained sequence recommendation model obtained in S1 are collaboratively trained. During the collaborative training, the parameters of the pre-trained large language model are fixed. After collaborative training on the cloud side, the optimized sequence recommendation model is obtained. S3. Deploy the pre-trained large language model on the cloud-side device, deploy the optimized sequence recommendation model on the client-side device, and retrain the optimized sequence recommendation model on the client-side device on the user's real-time behavior dataset to obtain a retrained sequence recommendation model. S4. The cloud side inputs the real-time user behavior data to be predicted into the pre-trained large language model and outputs an initial ranking result and an initial candidate list. The cloud side sends the initial ranking result and the initial candidate list to the client side. The client side inputs the initial candidate list into the retrained sequence recommendation model and re-ranks the initial candidate list according to the probability of user interaction. The client side obtains the re-ranking result and a sorted list of product IDs corresponding to the re-ranking result. The client side merges the normalized initial ranking result and the normalized re-ranking result to obtain the final ranking result. S5. The client subtracts the initial candidate list from the sorted product ID list according to the index number, and calculates the inconsistency score based on the absolute value of the subtraction result. If the inconsistency score is greater than the preset inconsistency threshold, the client uploads the latest real-time user behavior data to the cloud. The cloud uses a pre-trained large language model to process the latest real-time user behavior data. The cloud outputs a new initial ranking result and a new initial candidate list and sends them to the client. The client then uses a retrained sequence recommendation model to output a new final ranking result. If the inconsistency score is less than or equal to the preset inconsistency threshold, the client directly outputs the final ranking result.

2. The method for collaborative large model and recommended small model calculation according to claim 1, characterized in that: In step S1, the large language model and the sequence recommendation model use the same loss function when they are pre-trained.

3. The method for collaborative large model and recommended small model calculation according to claim 1, characterized in that: In step S2, in each iterative round of collaborative training, the user historical behavior dataset is input into the pre-trained large language model, and a candidate list is obtained for each user historical behavior data. The candidate list is split into a preset number of tokens, and the generated tokens are randomly combined to form a token list. The token list and the candidate list constitute a token-enhanced product ID candidate list, and the product ID candidate list is input into the pre-trained sequence recommendation model. The product ID candidate list is re-ranked according to the size of the user interaction probability to obtain a re-ranked list; wherein, the candidate list is composed of a preset number of items selected from the predicted labels generated by the large language model.

4. The method for collaborative large model and recommended small model calculation according to claim 1, characterized in that: In step S4, when merging the normalized initial ranking result and the normalized re-ranking result, the normalized re-ranking result is first Filter and get the filtered ranking results After normalization and filtering, the normalized initial ranking results are merged by adjusting the hyperparameter α And the filtered ranking results To get the final ranking results Among them, p represents the probability of the normalized re-ranking result; τ a With τ b Both indicate preset thresholds.

5. The method for collaborative large model and recommended small model calculation according to claim 1, characterized in that: In step S5, the inconsistency score c is calculated as follows: in, Represents the initial candidate list and a sorted list of product IDs The elements in are exactly the same, only the order is different; pos k (q) represents the function of the position of element q in list k, Indicates that element o is in the initial candidate list The position in Indicates that element o is in the sorted list of product IDs Position in; n represents the initial candidate list Or a sorted list of product IDs The number of elements in .

6. A system for collaborative large model and recommended small model calculation, characterized in that: It includes an end-side device and a cloud-side device, and a communication connection between the end-side device and the cloud-side device is used to implement a method for collaborative large model and recommended small model calculation as described in any one of claims 1 to 5.

7. A system for collaborative large model and recommended small model calculation according to claim 6, characterized in that: The terminal side device includes a computer.

8. The system for collaborative large model and recommended small model calculation according to claim 6, characterized in that: The cloud-side device includes a server.

Citation Information

Patent Citations

  • End-cloud collaborative recommendation system and method and electronic equipment

    CN114662006A

  • Sequence recommendation method and system based on multilayer perceptron and self-attention mechanism

    CN117708433A