Recommended information prediction method, device and electronic equipment
By generating prompt words and using a large language model to predict labels, the problem of inaccurate prediction of recommendation information is solved, achieving more accurate selection of target recommendation information and enhancing the adaptability and flexibility of the model.
Patent Information
- Application Number
- CN202311750134.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-12-18
AI Technical Summary
Existing methods for predicting recommendation information are not accurate enough, especially when the application scope of multi-classification models expands, making it difficult to accurately predict target recommendation information from a large number of different types of recommendation information.
By acquiring user information, including user profiles, candidate recommendation information, and current reference information, prompt words are generated and input into a large language model to obtain predicted labels. These labels are then matched with the labels in the candidate recommendation information. If a match is successful, the predicted label is used as the target recommendation information.
It reduces the difficulty of predicting recommendation information, improves the accuracy of the model, provides recommendation information that is more in line with user habits, and enhances the adaptability and flexibility of the model.
Smart Images

Figure CN117708428B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, and electronic device for predicting recommendation information. Background Technology
[0002] With the advancement of technology, people's daily lives are becoming increasingly rich and diverse, resulting in different behaviors every moment and various types of data. This data can contain and reflect users' personalities, preferences, and tendencies. In correlation analysis, this data and multi-classification models can be used to predict recommended information that users may be interested in. However, correlation analysis still suffers from the problem of inaccurate predicted recommended information. Summary of the Invention
[0003] In view of the above problems, this application proposes a recommendation information prediction method, apparatus, and electronic device to improve the above problems.
[0004] In a first aspect, this application provides a method for predicting recommendation information, the method comprising: acquiring user information, the user information including user profile information, multiple candidate recommendation information and current reference information, the multiple candidate recommendation information corresponding to tags, and the multiple candidate recommendation information being obtained based on the user's historical behavior; obtaining prompt words based on the user profile information, the candidate recommendation information and the current reference information; inputting the prompt words into a large language model to obtain predicted tags corresponding to the user information; matching the predicted tags with the tags corresponding to each of the multiple candidate recommendation information, and if a match is successful, using the candidate recommendation information corresponding to the successfully matched tag as the target recommendation information corresponding to the user information.
[0005] Secondly, this application provides a recommendation information prediction device, the device comprising: a user information acquisition unit, configured to acquire user information, the user information including user profile information, multiple candidate recommendation information and current reference information, the multiple candidate recommendation information corresponding to tags, and the multiple candidate recommendation information being obtained based on user historical behavior; a prompt word acquisition unit, configured to obtain prompt words based on the user profile information, the candidate recommendation information and the current reference information; and a target recommendation information acquisition unit, configured to input the prompt words into a large language model to obtain predicted tags corresponding to the user information; and to match the predicted tags with the tags corresponding to the multiple candidate recommendation information, and if a match is successful, to use the candidate recommendation information corresponding to the successfully matched tags as the target recommendation information corresponding to the user information.
[0006] Thirdly, this application provides an electronic device including one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the methods described above.
[0007] Fourthly, this application provides a computer-readable storage medium storing program code, wherein the above-described method is executed when the program code is run.
[0008] This application provides a method, apparatus, electronic device, and storage medium for predicting recommendation information. After acquiring user information including user profile information, multiple candidate recommendation information, and current reference information, a prompt word is obtained based on the user profile information, the candidate recommendation information, and the current reference information. The prompt word is input into a large language model to obtain a predicted tag corresponding to the user information. The predicted tag is matched with the tags corresponding to the multiple candidate recommendation information. If a match is successful, the candidate recommendation information corresponding to the successfully matched tag is taken as the target recommendation information corresponding to the user information. This method allows for the generation of prompt words based on user profile information, multiple candidate recommendation information, and current reference information. The prompt words are then input into a large language model to obtain predicted tags. The model then determines whether the predicted tags match the candidate recommendation information and obtains the corresponding target recommendation information based on the matching result. This limits the target recommendation information to multiple candidate recommendation information or a single recommendation information other than multiple candidate recommendation information, thereby reducing the prediction difficulty of the model. Furthermore, the candidate recommendation information is related to the user's historical behavior, providing information that is more in line with user habits for model prediction, thus improving the accuracy of model prediction and obtaining more accurate target recommendation information. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This illustration shows a schematic diagram of an application scenario for the interest determination method proposed in an embodiment of this application;
[0011] Figure 2 A schematic diagram illustrating another application scenario of the interest determination method proposed in the embodiments of this application is shown;
[0012] Figure 3 A flowchart of a recommendation information prediction method proposed in an embodiment of this application is shown;
[0013] Figure 4 A schematic diagram of a prompt word proposed in an embodiment of this application is shown;
[0014] Figure 5 This illustration shows a schematic diagram of obtaining predicted labels using a large language model according to an embodiment of this application;
[0015] Figure 6 A flowchart of a recommendation information prediction method according to another embodiment of this application is shown;
[0016] Figure 7 A flowchart of a recommendation information prediction method according to another embodiment of this application is shown;
[0017] Figure 8 This illustration shows a schematic diagram of constructing multiple sample sequences according to an embodiment of this application;
[0018] Figure 9 This application shows Figure 7 A flowchart of an implementation method proposed in the paper;
[0019] Figure 10 This paper shows a structural block diagram of a recommendation information prediction device according to an embodiment of this application;
[0020] Figure 11 A structural block diagram of an electronic device proposed in this application is shown;
[0021] Figure 12 This is a storage unit in this application embodiment for storing or carrying program code that implements the recommendation information prediction method according to this application embodiment. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0023] With the advancement of technology and the improvement of people's living standards, daily life has become increasingly richer, including activities such as online shopping, travel, and browsing short videos. This generates a large amount of data based on these daily behaviors, which can contain and reflect users' personalities, preferences, and tendencies. In relevant approaches, this data and multi-classification models can be used to predict recommended information that users may be interested in.
[0024] The inventors discovered in their research that existing recommendation information prediction methods still suffer from inaccurate predictions. For example, when predicting target recommendation information using a multi-classification model, the output target recommendation information is related to the actual number and types of recommendations that the model can distinguish. As the application scope of the multi-classification model increases, the types and number of recommendation information may also increase. In this case, it becomes more difficult for the multi-classification model to predict the target recommendation information from more and different types of recommendation information, thus reducing the accuracy of the multi-classification model's predictions.
[0025] Therefore, the inventors have proposed a method, apparatus, and electronic device for predicting recommendation information. After acquiring user information including user profile information, multiple candidate recommendation information, and current reference information, a prompt word is obtained based on the user profile information, the candidate recommendation information, and the current reference information. The prompt word is input into a large language model to obtain a predicted tag corresponding to the user information. The predicted tag is matched with the tags corresponding to the multiple candidate recommendation information. If a match is successful, the candidate recommendation information corresponding to the successfully matched tag is taken as the target recommendation information corresponding to the user information. This method allows for the generation of prompt words based on user profile information, multiple candidate recommendation information, and current reference information. The prompt words are then input into a large language model to obtain predicted tags. The model then determines whether the predicted tags match the candidate recommendation information and obtains the corresponding target recommendation information based on the matching result. This limits the target recommendation information to multiple candidate recommendation information or a single recommendation information other than multiple candidate recommendation information, thereby reducing the prediction difficulty of the model. Furthermore, the candidate recommendation information is related to the user's historical behavior, providing information that is more in line with user habits for model prediction, thus improving the accuracy of model prediction and obtaining more accurate target recommendation information.
[0026] To better understand the solutions of the embodiments of this application, the technical terms used in the embodiments of this application will be explained below.
[0027] LLM (Large Language Model): This refers to a deep learning model trained on a large amount of text data. LLMs can generate natural language text or understand the meaning of language text, and are typically used to handle various natural language tasks, such as text classification, question answering, and dialogue. For example, a large language model could be the ChatGPT (Chat Generative Pre-trained Transformer) model.
[0028] A prompt can refer to an input format based on natural language, typically where the task and data are constructed as language text and used as input to a language model. A prompt can be used to instruct the model what action to take or what output to produce when performing a specific task.
[0029] Token: can refer to the smallest unit of text segmentation, usually a character, a word, or a phrase.
[0030] Point of Interest (POI): A POI can refer to a location in geographic space. POIs can reflect users' interests to a certain extent. A POI can be understood as a "point of interest" related to people's lives, work, and entertainment (e.g., a specific restaurant, shop, school, hospital, tourist attraction, etc.). A POI can have both geographic and interest category attributes. In addition to location information such as location name, geographic coordinates (latitude and longitude), administrative region, and postal code, a POI can also reflect interest category information such as venue type and operating hours to describe the production and business activities occurring at that POI.
[0031] Before providing a more detailed description of the embodiments of this application, an application environment related to the embodiments of this application will be introduced.
[0032] The application scenarios involved in the embodiments of this application will be introduced below.
[0033] In this application embodiment, the main focus is on two stages: recommendation information prediction and large language model training. The recommendation information prediction method or large language model training method provided for each stage can be executed by an electronic device. In this method of execution by an electronic device, all steps in the recommendation information prediction method or large language model training method provided in this application embodiment can be executed by an electronic device. For example, as... Figure 1 As shown, in the case where all steps in the recommendation information prediction method or large language model training method provided in the embodiments of this application can be executed by an electronic device, all steps can be executed by the processor of the electronic device 100.
[0034] Furthermore, the recommendation information prediction method or large language model training method provided in this application embodiment can also be executed by a server. Correspondingly, in this server-executed method, the server can respond to a trigger command to begin executing the steps in the recommendation information prediction method or large language model training method provided in this application embodiment. This trigger command can be sent by an electronic device used by the user, or it can be triggered locally by the server in response to some automated event.
[0035] In addition, such as Figure 2As shown, the recommendation information prediction method or large language model training method provided in this application embodiment can also be executed collaboratively by an electronic device and a server. In this collaborative execution method, some steps of the recommendation information prediction method or large language model training method provided in this application embodiment are executed by the electronic device, while other steps are executed by the server. For example, the electronic device 100 can execute the recommendation information prediction method including: obtaining user information, then transmitting the user information to the server 200, then the server 200 performing subsequent steps to obtain target recommendation information, and then returning the target recommendation information to the electronic device 100, so that the electronic device 100 can recommend items related to the target recommendation information to the user based on the target recommendation information. Alternatively, the server 200 can determine the recommended items based on the target recommendation information and then return the recommended items to the electronic device 100 for display.
[0036] It should be noted that in this method where electronic devices and servers work together, the steps performed by the electronic devices and servers are not limited to those described in the examples above. In practical applications, the steps performed by the electronic devices and servers can be dynamically adjusted according to the actual situation.
[0037] It should be noted that the electronic equipment 100, in addition to being for Figure 1 and Figure 2 Besides smartphones, the device can also be a tablet, smartwatch, smart voice assistant, etc. Server 200 can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers. Specifically, when the recommendation information prediction method or large language model training method provided in this application embodiment is executed by a server cluster or distributed system composed of multiple physical servers, different steps in the recommendation information prediction method or large language model training method can be executed by different physical servers, or can be executed in a distributed manner by servers built on a distributed system.
[0038] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0039] Please see Figure 3 This application provides a method for predicting recommendation information, the method comprising:
[0040] S110: Obtain user information, which includes user profile information, multiple candidate recommendation information and current reference information. The multiple candidate recommendation information corresponds to tags and is obtained based on the user's historical behavior.
[0041] User profile information refers to information that provides an overall overview of a user based on their social attributes, lifestyle habits, and consumption behavior. Candidate recommendation information refers to information that may become the target recommendation. Current reference information refers to information used to assist in obtaining the target recommendation at the current moment. User information may also include supplementary candidate recommendation information, which refers to information other than the candidate recommendation information that may become the target recommendation.
[0042] In the embodiments of this application, different recommendation scenarios can have different candidate recommendation information, current reference information, and / or supplementary candidate recommendation information. For example, when the recommendation scenario is POI recommendation, the candidate recommendation information can be candidate POIs obtained based on the user's historical POI trajectory, the current reference information can be the current time, the user's current latitude and longitude, etc., and the supplementary candidate recommendation information can refer to POIs near the user's current latitude and longitude. As another example, when the recommendation scenario is product recommendation, the candidate recommendation information can be candidate products obtained based on the user's historical browsing records, the current reference information can be the current time, the user's current latitude and longitude, the recent weather at the user's current latitude and longitude, etc., and the supplementary candidate recommendation information can refer to the top K (K is a positive integer) best-selling products near the user's current latitude and longitude.
[0043] In this embodiment, the tags corresponding to candidate recommendation information can be represented by numbers, and these tags can be related to the chronological order in which users accessed the candidate recommendation information; smaller numbers indicate earlier access. For example, when there are three candidate recommendation information entries, the tag for the first candidate recommendation information in chronological order can be 0, the tag for the third candidate recommendation information can be 1, and the tag for the supplementary candidate recommendation information can be 2. Supplementary candidate recommendation information also has corresponding tags, which can also be represented by numbers, and these tags can be determined based on the corresponding candidate recommendation information. For example, if the tag for the last candidate recommendation information in chronological order is 2, then the tag for the first supplementary candidate recommendation information can be 3.
[0044] Furthermore, when multiple supplementary candidate recommendations exist, the labels corresponding to each of these recommendations can be independent of their chronological order. For example, if the supplementary candidate recommendations are POIs near the current user's location, the labels corresponding to each recommendation can be related to the distance from the corresponding POI to the current user's location; the closer the distance, the smaller the numerical value of the label.
[0045] In one approach, in response to receiving a prediction task, user profile information, multiple candidate recommendation information, current reference information, and / or supplementary candidate recommendation information can be obtained.
[0046] Among them, the prediction task can refer to the task used to predict target recommendation information in the target recommendation scenario.
[0047] Optionally, user profile information can be obtained from a specified storage location. This user profile information can be obtained and stored by the electronic device itself based on log information, or it can be obtained and stored by a server or cloud platform based on log information.
[0048] Optionally, multiple candidate recommendation information can be obtained based on user historical behavior and a preset recall strategy. Historical behavior trajectories related to the target recommendation information can be obtained based on user historical behavior. Multiple candidate recommendation information can be obtained based on these historical behavior trajectories and the preset recall strategy. User historical behavior can be obtained based on user usage records of applications on electronic devices, log information, etc.
[0049] The preset recall strategy can be either LRU (Least Recently Used) or MRU (Most Recently Used). The LRU strategy can be used to filter out historical behavior trajectories that have not been used or have been used the least within a preset time period from the current time, thereby generating multiple candidate recommendation information based on the filtered historical behavior trajectories. The MRU strategy can be used to filter out historical behavior trajectories that have been used the most frequently or have been used the most times within a preset time period from the current time, thereby generating multiple candidate recommendation information based on the filtered historical behavior trajectories.
[0050] In this embodiment, a preset recall strategy can be determined based on actual needs. When considering that the user's historical behavior pattern with the most usages within a preset time period from the current moment is most likely to be the recommendation information for the next moment, the LRU strategy can be selected as the preset recall strategy. When considering that the user's historical behavior pattern with the fewest usages within a preset time period from the current moment is most likely to be the recommendation information for the next moment, the RMU strategy can be selected as the preset recall strategy.
[0051] Optionally, current reference information can be obtained from the target scenario of the prediction task and applications of electronic devices (such as navigation applications, weather forecast applications, etc.).
[0052] Optionally, supplementary candidate recommendation information can be determined based on the target recommendation scenario of the prediction task and the current moment.
[0053] Optionally, the addition of supplementary candidate recommendation information to the user information can be determined based on the user's satisfaction with the target recommendation information obtained from the previous prediction task. If the satisfaction level is greater than or equal to a preset value, the supplementary candidate recommendation information may not be added; if the satisfaction level is less than the preset value, the supplementary candidate recommendation information may be added.
[0054] In this embodiment, since prompt words are used, when adding, deleting, modifying or replacing preset recall strategies based on one's own needs to obtain different candidate recommendation information for target recommendation information prediction, the network structure of the large language model can be changed without changing it, thereby improving the flexibility and variability of candidate recommendation information.
[0055] S120: Based on the user profile information, the candidate recommendation information, and the current reference information, obtain the prompt word.
[0056] One approach is to obtain a pre-configured task prompt description, which can include a task prompt module and a detailed task description module. The task prompt module can be used to inform the large language model of an overview of the task to be performed, an overview of the content of the remaining modules in the prompt words, and the order in which the remaining modules appear. The detailed task description module can be used to summarize the prompt words in their entirety and to inform the large model of the detailed information of the task to be performed. Based on user profile information, a user profile module is obtained; based on multiple candidate recommendation information and their respective tags, a candidate list module is obtained; based on current reference information, a current time information module is obtained; and based on the task prompt module, detailed task description module, user profile module, candidate list module, and current time information module, prompt words are obtained.
[0057] Among them, the task prompt module, detailed task description module, user profile module, candidate list module, and current time information module can each refer to a part of the text content in the prompt words.
[0058] For example, such as Figure 4 As shown, the task prompt module can be the prompt word "Based on the provided <user profile>, <historical POI trajectory>, <user's current POI information>, <POIs near the user's current location> (optional), predict the next most likely POI to visit."; the user profile module can be the prompt word "There is a male user 4 who is over 50 years old. His income level is 0 (income levels range from 0 to 2, with 0 being the lowest and 2 being the highest), he works in a catering company, he uses a 2799.0 yuan mobile phone, his mobile phone behavior is in decline, his mobile phone brand is RENO5 K, he has bought a car, he does not have children yet, he slightly enjoys playing games, he slightly enjoys shopping, and he is a big fan of travel."
[0059] Optionally, user profile information can be populated into the first preset prompt template to obtain the user profile module.
[0060] The first preset prompt template can refer to a pre-set template used to express noun-type features and adjective-type features in user profile information. There can also be multiple templates corresponding to different types of features.
[0061] In this embodiment of the application, the noun category feature template can be:
[0062] Template 名词特征1 ="The {feature name} of {pronoun} is the {feature value}."
[0063] Template 名词特征2 = "{feature name} of {pronoun} with {feature value}".
[0064] The adjective class feature template can be:
[0065] Template 形容词特征1 = "{adjective}'s {feature name}."
[0066] For example, Figure 4 The prompt word "male users over 50 years old 4" can be obtained based on the template corresponding to adjective feature 1; Figure 4 The prompt phrase "His phone is an OPPO Find 9" can be obtained from the template corresponding to noun feature 1.
[0067] In this embodiment of the application, by setting different templates and obtaining user profile modules based on different templates, the large language model can learn the diversity of text, thereby improving the large language model's understanding of text and thus improving the robustness of the large language model.
[0068] Optionally, multiple candidate recommendation information and their corresponding tags can be added to the second preset prompt template to obtain the candidate list module.
[0069] The second preset prompt template refers to a pre-set template used to express candidate recommendation information. The second preset prompt template can convert the feature description and attribute information of each candidate recommendation into a single line of comma-separated text (CSV format). The second preset prompt template can be:
[0070]
[0071] Within this framework, each candidate recommendation description can be preceded by an index arranged chronologically. For example, to retrieve a list of N candidate POIs, the index of the first POI accessed can be set to 0, the index of the i-th POI accessed is i-1, and the index of the last POI accessed is N-1. All candidate POI descriptions can be concatenated line by line according to their index order to form the candidate list module. Furthermore, for each candidate POI (denoted as POI...),... i The latitude and longitude information corresponding to the location is represented by a tuple of {longitude i, latitude i}, and the information of the latitude and longitude tuple is displayed in the corresponding column in the prompt text. Other POI features (such as location category) can occupy a separate column in the CSV format.
[0072] Optionally, in the candidate list module, to further emphasize the chronological order of multiple candidate recommendations, time-emphasis information can be added to the candidate list module section. For example, such as... Figure 4 As shown, the time emphasis information can be "among which, 29, December 6, 2022, Tuesday, 03:57, (116.37492, 39.85206), Fengtai District, Fast Food Restaurant is the POI recently visited by the user".
[0073] As another approach, when user information also includes supplementary candidate recommendation information, a pre-configured task prompt description can be obtained. This task prompt description can include a task prompt module and a detailed task description module. The task prompt module can be used to provide an overview of the task the large language model needs to perform, an overview of the remaining modules in the prompt words, and the order in which the remaining modules appear. The detailed task description module can be used to provide a full summary of the prompt words and to provide detailed information about the task the large model needs to perform. Based on user profile information, a user profile module is obtained. Based on multiple candidate recommendation information and their corresponding tags, a candidate list module is obtained. Based on current reference information, a current time information module is obtained. Based on supplementary candidate recommendation information and their corresponding tags, a supplementary candidate list module is obtained. Based on the task prompt module, detailed task description module, user profile module, candidate list module, current time information module, and supplementary candidate list module, prompt words are obtained.
[0074] For example, Figure 4 The text content corresponding to <POIs near the user's current location> can be used as a supplementary candidate list module.
[0075] S130: Input the prompt word into the large language model to obtain the predicted label corresponding to the user information.
[0076] The predicted label can be used to represent the target recommendation information. The range of the predicted label value can be related to the total number of multiple candidate recommendation information and supplementary candidate recommendation information. For example, when there are N (N is an integer greater than 1) candidate recommendation information and P (P is a non-negative integer) supplementary candidate recommendation information, the range of the predicted label value can be [-1, N+P-1], where the label of the first candidate recommendation information can be 0, and the label of the Nth candidate recommendation information can be N-1.
[0077] One approach is to input the prompt word into a large language model to obtain multiple reference predicted labels and their probability values, and then use the reference predicted label with the highest probability value as the predicted label corresponding to the user information.
[0078] For example, such as Figure 5 As shown, in the POI prediction task, prompt words can be obtained based on user profile information, candidate POI data, and the POI information of the user at the current time. The prompt words are then input into a large language model to obtain the corresponding predicted labels.
[0079] In this embodiment, prompt words are directly composed based on the text content corresponding to user information. This is equivalent to not performing feature transformation on user information and directly using the corresponding text content as features. This fully utilizes the text understanding and feature selection capabilities of large language models, greatly reducing the amount of feature engineering. Simultaneously, the text format allows for adaptation to various feature inputs, enhancing feature scalability and reducing the engineering development work for adding new features. Therefore, the recommendation information prediction method provided in this application has better adaptability in adding features and model transfer, thereby alleviating the sparsity and cold start problems of recommendation information.
[0080] S140: Match the predicted label with the labels corresponding to each of the plurality of candidate recommendation information. If the match is successful, use the candidate recommendation information corresponding to the successfully matched label as the target recommendation information corresponding to the user information.
[0081] One approach is to match the predicted label with the labels corresponding to multiple candidate recommendation information. If a match is successful, the candidate recommendation information corresponding to the successfully matched label can be used as the target recommendation information corresponding to the user information.
[0082] For example, the labels corresponding to multiple candidate recommendations can be 0 to 29, and the predicted label can be 2, so that a match can be successful. Among the multiple candidate recommendations, the POI location with label 2 can be "(116.38251,39.85021), Fengtai District, Business Office Building", and then "(116.38251,39.85021), Fengtai District, Business Office Building" can be used as the target recommendation information.
[0083] Optionally, since the labels corresponding to multiple candidate recommendation information are only related to the chronological order, there may be cases where the content of candidate recommendation information corresponding to different labels is the same. In this case, any label among the candidate recommendation information with the same predicted label can obtain the corresponding target recommendation information.
[0084] For example, the POI locations labeled 2 and 8 can be: "(116.38251,39.85021), Fengtai District, Business Office Building". When the predicted label is 2 or 8, the target recommendation information can be "(116.38251,39.85021), Fengtai District, Business Office Building".
[0085] This embodiment provides a method for predicting recommendation information. After acquiring user information including user profile information, multiple candidate recommendation information, and current reference information, a prompt word is obtained based on the user profile information, the candidate recommendation information, and the current reference information. The prompt word is input into a large language model to obtain a predicted label corresponding to the user information. The predicted label is matched with the labels corresponding to the multiple candidate recommendation information. If a match is successful, the candidate recommendation information corresponding to the successfully matched label is taken as the target recommendation information corresponding to the user information. This method allows for the generation of prompt words based on user profile information, multiple candidate recommendation information, and current reference information. The prompt words are then input into a large language model to obtain predicted labels. The method further determines whether the predicted labels match the candidate recommendation information and obtains the corresponding target recommendation information based on the matching results. This limits the target recommendation information to multiple candidate recommendation information or a single recommendation information other than multiple candidate recommendation information, thereby reducing the prediction difficulty of the model. Furthermore, the candidate recommendation information is related to the user's historical behavior, providing the model with information that is more in line with user habits, thus improving the accuracy of the model's prediction and obtaining more accurate target recommendation information.
[0086] Please see Figure 6 This application provides a method for predicting recommendation information, the method comprising:
[0087] S210: Obtain user information, which includes user profile information, multiple candidate recommendation information and current reference information. The multiple candidate recommendation information corresponds to tags and is obtained based on the user's historical behavior.
[0088] S220: Based on the user profile information, the candidate recommendation information, and the current reference information, obtain the prompt word.
[0089] S230: Input the prompt word into the large language model to obtain the predicted label corresponding to the user information.
[0090] S240: Match the predicted label with the labels corresponding to each of the plurality of candidate recommendation information. If the match is successful, use the candidate recommendation information corresponding to the successfully matched label as the target recommendation information corresponding to the user information.
[0091] S250: If the matching fails, the target recommendation information is obtained based on the preset mapping relationship.
[0092] Among them, the preset mapping relationship can represent the matching between the predicted label and the preset recommendation information.
[0093] As one approach, if a match fails, preset recommendation information can be obtained based on a preset mapping relationship, and this preset recommendation information can be used as the target recommendation information. The preset recommendation information can be the recommendation information with the most visits obtained based on the user's historical behavior.
[0094] Optionally, if the predicted label is -1, it can be determined that the match has failed.
[0095] As another approach, if a match fails, preset recommendation information can be obtained based on a preset mapping relationship, and this preset recommendation information can be used as the target recommendation information. The preset recommendation information can be the most frequently mentioned recommendation information in the user's social circle obtained based on big data.
[0096] In the embodiments of this application, when the large language model determines that the target recommendation information is not among the multiple candidate recommendation information, the target recommendation information can be obtained based on the preset mapping relationship, thereby improving the flexibility of target recommendation information prediction. At the same time, this method is also equivalent to a fallback strategy for target recommendation information prediction, which can improve the robustness of the recommendation information prediction method provided in this application.
[0097] S260: In response to receiving the prediction task corresponding to the user information, input information is obtained based on the target recommendation information and the prompt words.
[0098] In one approach, in response to receiving a prediction task corresponding to the user information in step S210, the target recommendation information and prompt words can be concatenated to obtain the input information.
[0099] Optionally, it can be determined whether two consecutive prediction tasks belong to the same user based on the user ID.
[0100] S270: Input the input information into the large language model to obtain the target recommendation information corresponding to the prediction task.
[0101] One approach is to input the information into a large language model to obtain the target recommendation information corresponding to the prediction task.
[0102] Optionally, when predicting target recommendation information for the same user, the target recommendation information for the current prediction can be obtained each time based on the prompt words and all previously predicted target recommendation information. The corresponding expression can be:
[0103] T i+1 =LLM(T input +T0+T1+T2+...+T i )
[0104] Among them, T input T0 can represent the prompt word, and T0 can represent the target recommendation information received for the first time. i It can represent the target recommendation information obtained in the (i+1)th iteration.
[0105] Optionally, after recommending the predicted target recommendation information to the user, the user's access to or usage of the target recommendation information can be obtained, and the large language model can be updated based on the access to or usage of the target recommendation information, so that the large language model can keep up with the user's behavior in real time.
[0106] This embodiment provides a recommendation information prediction method. Through the aforementioned approach, prompt words are obtained based on user profile information, multiple candidate recommendation information, and current reference information. These prompt words are then input into a large language model to obtain predicted labels. The method further determines whether the predicted labels match the candidate recommendation information and, based on the matching results, obtains the corresponding target recommendation information. This limits the target recommendation information to multiple candidate recommendation information or a single recommendation information other than multiple candidate recommendation information, thereby reducing the prediction difficulty of the model. Furthermore, since candidate recommendation information is related to the user's historical behavior, it provides information more aligned with user habits, thus improving the accuracy of the model's prediction and obtaining more accurate target recommendation information. In this embodiment, by concatenating the prompt words and target recommendation information and inputting them again into the large language model to obtain new target recommendation information, continuous tracking of the user's corresponding recommendation information and close following the user's behavior can be achieved, thereby improving the accuracy of the target recommendation information.
[0107] Please see Figure 7 This application provides a method for predicting recommendation information, the method comprising:
[0108] S310: Obtain the training dataset.
[0109] The training dataset can include multiple sample sequences, their respective ground truth labels, user profile information, and candidate recommendation information. Each sample sequence can contain multiple samples, each with its own predicted and ground truth labels. The ground truth label for each sample represents the next sample in the corresponding sample sequence.
[0110] For example, when the sample sequence is {(candidate recommendation information 1, label 0), (candidate recommendation information 2, label 1), (candidate recommendation information 3, label 2), (candidate recommendation information 4, label 3)}, the true label of the target recommendation information corresponding to the sample candidate recommendation information 1 can be 1, that is, candidate recommendation information 2.
[0111] One approach is to obtain historical sample sequences based on users' historical recommendation information or usage patterns, and construct multiple sample sequences based on a sliding time window and historical sample sequences. Simultaneously, based on the method in step S110, the real labels, user profile information, and candidate recommendation information corresponding to each of the multiple sample sequences are obtained.
[0112] Optional, such as Figure 8 As shown, multiple sample sequences can be generated based on the length of the historical sample sequence, the length of the sliding time window, and the stride. Then, the multiple sample sequences can be divided into training set, validation set, and test set according to the chronological order and a preset ratio.
[0113] Optionally, the number of historical sample subsequences can be:
[0114]
[0115] Where L can represent the length of the historical sample sequence; W can represent the length of the sliding time window, which is the length of each sample sequence; and S can represent the step size of the sliding time window.
[0116] For example, the preset ratio can be {0.6:0.2:02}, then the first 60% of the sample sequences in chronological order can be used as the training set, the first 60% to 80% of the sample sequences can be used as the validation set, and the last 20% of the sample sequences can be used as the test set.
[0117] Optionally, if the length of a user's historical sample sequence is less than the length of the sliding time window, the user's historical sample sequence can be directly used as a sample sequence.
[0118] Optionally, after obtaining the training set, validation set, and test set, the training set and validation set can be used as training datasets to train the large language model to be trained. The prediction accuracy of the trained large language model can be evaluated using the test set. The model parameters, such as the initial learning rate, optimizer, and batch size, can be adjusted based on the evaluation results. The trained large language model with the best evaluation results can then be used as the large language model for generating target recommendation information.
[0119] Optionally, the addition of supplementary candidate recommendation information to the training dataset can be determined based on the accuracy of the model prediction. If the accuracy is greater than or equal to a preset value, supplementary candidate recommendation information may not be added; if the accuracy is less than a preset value, supplementary candidate recommendation information may be added.
[0120] S320: Train the large language model to be trained based on the training dataset to obtain the large language model.
[0121] One approach is to obtain multiple training subsets based on the training dataset. During the current training round, the large language model to be trained for the current round is trained based on the training subset and loss function corresponding to the current round, resulting in the large language model for the current round. If the large language model for the current round meets the target conditions, it is used as the large language model for the current round, and training ends. If the large language model for the current round does not meet the target conditions, training continues based on the training subset corresponding to the next round, and the large language model for the current round is used as the large language model to be trained for the next round.
[0122] The target conditions can be, for example, reaching a preset number of training rounds, minimizing the loss function, or achieving a target prediction accuracy.
[0123] Optionally, the training set in the training dataset can be divided into multiple training subsets according to batchSize.
[0124] Each training subset can include multiple sample sequences, their corresponding ground truth labels, user profile information, and candidate recommendation information. Each sample sequence can contain multiple samples, each with its own predicted and ground truth labels. The ground truth label for each sample represents the next sample in the corresponding sample sequence. The current training round can include training processes for multiple sample sequences.
[0125] Optional, such as Figure 9 As shown, during the current training round, the large language model to be trained for the current round is trained based on the training subset and loss function corresponding to the current round, resulting in the large language model for the current round, including:
[0126] S321: Based on the multiple sample sequences, the user profile information and candidate recommendation information corresponding to each of the multiple sample sequences, obtain the prompt words corresponding to each of the multiple sample sequences.
[0127] In one approach, prompt words corresponding to each of the multiple sample sequences can be obtained based on step S120.
[0128] S322: During the current training round, the prompt words corresponding to each of the multiple sample sequences are input into the large language model to be trained for the current round to obtain the predicted labels corresponding to each of the multiple sample sequences.
[0129] As one approach, during the training of the current sample sequence, the prompt word corresponding to the current sample sequence can be input into the large language model to be trained in the current round to obtain the predicted label corresponding to the first sample in the current sample sequence. Then, the predicted label corresponding to the first sample in the current sample sequence is concatenated with the prompt word corresponding to the current sample sequence to obtain the input information of the next sample in the current sample sequence. The input information of the next sample is then input into the large language model to be trained in the current round to obtain the predicted label corresponding to the next sample in the current sample sequence. This process continues until the predicted labels of all samples in the current sample sequence are obtained, and the training of the next sample sequence continues until the predicted labels corresponding to each of the multiple sample sequences are obtained.
[0130] Optionally, the expression for training a sample sequence can be:
[0131] T i+1 =train_LLM(T input +T0+T1+T2+...+T i )
[0132] Among them, T input T can represent the cue word of the sample sequence, and T0 can represent the predicted label of the first sample in the sample sequence (first time step). i It can represent the predicted label of the (i-1)th sample in the sample sequence (the (i-1)th time step).
[0133] S323: Based on the predicted labels, true labels, and loss functions corresponding to the multiple sample sequences, train the large language model to be trained for the current round to obtain the large language model corresponding to the current round.
[0134] One approach is to obtain a first loss function based on the predicted and true labels corresponding to multiple sample sequences. The first loss function can be used to narrow the gap between the predicted and true labels of the sample sequences. A second loss function is obtained based on the predicted labels corresponding to multiple sample sequences. The second loss function can be used to reduce the noise of the predicted labels. A loss function is obtained based on the first and second loss functions. The large language model to be trained for the current round is trained based on the loss function to obtain the large language model for the current round.
[0135] Optionally, a label loss function can be obtained for each sample based on the predicted and true labels corresponding to multiple samples in each sample sequence, resulting in multiple label loss functions. The label loss function can characterize the difference between the true label and the predicted label of the sample; based on the multiple label loss functions, a first loss function is obtained.
[0136] The formula for calculating the label loss function can be:
[0137]
[0138] Where vocabSise can represent the total number of tokens in the prompt, j can represent the j-th token in the prompt; n can represent the n-th sample sequence in a training round, and i can represent the i-th sample in a sample sequence; This can refer to whether the true label of the i-th sample in the n-th sample sequence during a training epoch is the j-th token in the prompt words; if so, then... It can be 1, otherwise... It can be 0; It can refer to the probability value that the predicted label of the i-th sample in the n-th sample sequence in a training round is the j-th token in the prompt words.
[0139] The first loss function can be the cross-entropy loss function, and the calculation formula is as follows:
[0140]
[0141] Where batchSize represents the total number of sample sequences in a training epoch, n represents the nth sample sequence in a training epoch, stepSize represents the length of a sample sequence, i represents the i-th sample in a sample sequence, and loss... ni It can represent the label loss function of the i-th sample in the n-th sample sequence during a training epoch.
[0142] The second loss function can be the label smoothing loss (AvgLoss) function, and the calculation formula is as follows:
[0143]
[0144] The formula for calculating the loss function can be:
[0145] LabelSmootherLoss=(1-ε)CELoss+εAvgLoss
[0146] Here, ε can represent the weight parameter of the second loss function, and the value of ε can be set manually.
[0147] S330: Obtain user information, which includes user profile information, multiple candidate recommendation information and current reference information. The multiple candidate recommendation information corresponds to tags and is obtained based on the user's historical behavior.
[0148] S340: Based on the user profile information, the candidate recommendation information, and the current reference information, obtain the prompt word.
[0149] S350: Input the prompt word into the large language model to obtain the predicted label corresponding to the user information.
[0150] S360: Match the predicted label with the labels corresponding to each of the multiple candidate recommendation information. If the match is successful, use the candidate recommendation information corresponding to the successfully matched label as the target recommendation information corresponding to the user information.
[0151] This embodiment provides a recommendation information prediction method. Through the aforementioned approach, prompt words are obtained based on user profile information, multiple candidate recommendation information, and current reference information. These prompt words are then input into a large language model to obtain predicted labels. The method then determines whether the predicted labels match the candidate recommendation information and obtains the corresponding target recommendation information based on the matching results. This limits the target recommendation information to multiple candidate recommendation information or a single recommendation information other than multiple candidate recommendation information, thereby reducing the prediction difficulty of the model. Furthermore, the candidate recommendation information is related to the user's historical behavior, providing the model with information that is more in line with user habits, thus improving the accuracy of the model prediction and obtaining more accurate target recommendation information. In this embodiment, the loss function obtained through the first and second loss functions can weaken the impact of the extreme values of the predicted labels obtained from the samples on the entire model training process, thereby mitigating noise, reducing the influence of noise during gradient updates, and increasing the influence of the correct predicted labels during gradient updates, thus improving the model training accuracy.
[0152] Please see Figure 10 This application provides a recommendation information prediction device 600, the device 600 comprising:
[0153] User information acquisition unit 610 is used to acquire user information, which includes user profile information, multiple candidate recommendation information and current reference information. The multiple candidate recommendation information corresponds to tags and is obtained based on the user's historical behavior.
[0154] The prompt word acquisition unit 620 is used to obtain prompt words based on the user profile information, the candidate recommendation information, and the current reference information;
[0155] The target recommendation information acquisition unit 630 is used to input the prompt word into a large language model to obtain the predicted label corresponding to the user information; match the predicted label with the labels corresponding to the multiple candidate recommendation information; if the match is successful, the candidate recommendation information corresponding to the successfully matched label is used as the target recommendation information corresponding to the user information.
[0156] In one approach, the prompt word acquisition unit 620 is specifically used to acquire a pre-configured task prompt description, which includes a task prompt module and a detailed task description module. The task prompt module is used to inform the large language model of an overview of the task to be performed, an overview of the content of the remaining modules in the prompt word, and the order in which the remaining modules appear. The detailed task description module is used to summarize the prompt word in its entirety and to inform the large model of the detailed information of the task to be performed. Based on the user profile information, a user profile module is obtained. Based on the multiple candidate recommendation information and the tags corresponding to each of the multiple candidate recommendation information, a candidate list module is obtained. Based on the current reference information, a current time information module is obtained. Based on the task prompt module, the detailed task description module, the user profile module, the candidate list module, and the current time information module, the prompt word is obtained.
[0157] As another approach, the user information also includes supplementary candidate recommendation information, which corresponds to tags. The prompt word acquisition unit 620 is specifically used to acquire a pre-configured task prompt description. The task prompt description includes a task prompt module and a detailed task description module. The task prompt module is used to inform the large language model of an overview of the task to be performed, an overview of the content of the remaining modules in the prompt word, and the order in which the remaining modules appear. The detailed task description module is used to summarize the prompt word in its entirety and to inform the large model of the detailed information of the task to be performed. Based on the user profile information, a user profile module is obtained. Based on the multiple candidate recommendation information and the tags corresponding to each of the multiple candidate recommendation information, a candidate list module is obtained. Based on the current reference information, a current time information module is obtained. Based on the supplementary candidate recommendation information and the tags corresponding to the supplementary candidate recommendation information, a supplementary candidate list module is obtained. Based on the task prompt module, the detailed task description module, the user profile module, the candidate list module, the current time information module, and the supplementary candidate list module, the prompt word is obtained.
[0158] In one approach, the target recommendation information acquisition unit 630 is specifically used to obtain the target recommendation information based on a preset mapping relationship if the matching fails.
[0159] In one approach, the target recommendation information acquisition unit 630 is specifically used to, in response to receiving a prediction task corresponding to the user information, obtain input information based on the target recommendation information and the prompt words; input the input information into the large language model to obtain the target recommendation information corresponding to the prediction task.
[0160] Optionally, the candidate recommendation information is obtained based on the user's historical behavior and a preset recall strategy.
[0161] The device 600 further includes:
[0162] The model training unit 640 is used to acquire a training dataset; and to train the large language model to be trained based on the training dataset to obtain the large language model.
[0163] In one approach, the model training unit 640 is specifically used to obtain multiple training subsets based on the training dataset; during the current training round, the large language model to be trained in the current round is trained based on the training subset and loss function corresponding to the current round to obtain the large language model corresponding to the current round; if the large language model corresponding to the current round meets the target condition, the large language model corresponding to the current round is used as the large language model, and the training ends; if the large language model corresponding to the current round does not meet the target condition, the next round of training continues based on the training subset corresponding to the next round, and the large language model corresponding to the current round is used as the large language model to be trained in the next round.
[0164] Optionally, the training subset includes multiple sample sequences, corresponding real labels, user profile information, and candidate recommendation information for each of the multiple sample sequences. The model training unit 640 is specifically used to obtain prompt words corresponding to each of the multiple sample sequences based on the multiple sample sequences, the corresponding user profile information, and the candidate recommendation information; during the current round of training, the prompt words corresponding to each of the multiple sample sequences are input into the large language model to be trained for the current round to obtain the predicted labels corresponding to each of the multiple sample sequences; based on the predicted labels, real labels, and loss function corresponding to each of the multiple sample sequences, the large language model to be trained for the current round is trained to obtain the large language model corresponding to the current round.
[0165] Optionally, the model training unit 640 is specifically used to obtain a first loss function based on the predicted labels and true labels corresponding to each of the plurality of sample sequences, the first loss function being used to narrow the gap between the predicted labels and true labels of the sample sequences; to obtain a second loss function based on the predicted labels corresponding to each of the plurality of sample sequences, the second loss function being used to reduce the noise of the predicted labels; to obtain the loss function based on the first loss function and the second loss function; and to train the large language model to be trained corresponding to the current round based on the loss function, thereby obtaining the large language model corresponding to the current round.
[0166] Optionally, each sample sequence contains multiple samples, each of which has a predicted label and a true label. The true label of each sample represents the next sample in the corresponding sample sequence. The model training unit 640 is specifically used to obtain a label loss function for each sample based on the predicted label and true label corresponding to each of the multiple samples in each sample sequence, so as to obtain multiple label loss functions. The label loss function represents the difference between the true label and the predicted label of the sample. Based on the multiple label loss functions, the first loss function is obtained.
[0167] Optionally, each sample sequence contains multiple samples, each of which has a predicted label and a true label. The true label of each sample represents the next sample in the corresponding sample sequence. Specifically, the model training unit 640 is used to input the prompt word corresponding to the current sample sequence into the large language model to be trained in the current round during the training process of the current sample sequence to obtain the predicted label corresponding to the first sample in the current sample sequence; continue to concatenate the predicted label corresponding to the first sample in the current sample sequence with the prompt word corresponding to the current sample sequence to obtain the input information of the next sample in the current sample sequence; input the input information of the next sample into the large language model to be trained in the current round to obtain the predicted label corresponding to the next sample in the current sample sequence, until the predicted labels of all samples in the current sample sequence are obtained, and continue to train the next sample sequence until the predicted labels corresponding to each of the multiple sample sequences are obtained.
[0168] The following will combine Figure 11 This application describes an electronic device.
[0169] Please see Figure 11Based on the aforementioned recommendation information prediction method and apparatus, this application embodiment also provides another electronic device 100 capable of executing the aforementioned recommendation information prediction method. The electronic device 100 includes a processor 102, a memory 104, and a network module 106. The memory 104 stores a program capable of executing the contents of the aforementioned embodiments, and the processor 102 can execute the program stored in the memory 104.
[0170] The processor 102 may include one or more processing cores. The processor 102 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and by calling data stored in the memory 104. Optionally, the processor 102 may be implemented using at least one of the following hardware forms: a Neural Network Processing Unit (NPU), a Digital Signal Processing Unit (DSP), a Field-Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA). The processor 102 may integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural Network Processing Unit (NPU), and a modem. Specifically, the CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; the NPU handles multimedia data such as video and images; and the modem handles wireless communication. It is understandable that the aforementioned modem may not be integrated into the processor 102, but may be implemented using a separate communication chip.
[0171] The memory 104 may include random access memory (RAM), read-only memory (ROM), and double data rate synchronous dynamic random access memory (DDR). The memory 104 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 104 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 100 during use (such as phonebook data, audio and video data, chat log data, etc.).
[0172] The network module 106 is used to receive and transmit electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, thereby communicating with communication networks or other devices, such as audio playback devices. The network module 106 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM cards), memory, etc. The network module 106 can communicate with various networks such as the Internet, corporate intranets, and wireless networks, or communicate with other devices through wireless networks. The aforementioned wireless networks may include cellular telephone networks, wireless local area networks (WLANs), or metropolitan area networks (MANs). For example, the network module 106 can interact with base stations.
[0173] Please refer to Figure 12 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable storage medium 800 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0174] The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 810 may, for example, be compressed in a suitable form.
[0175] In summary, the recommendation information prediction method, apparatus, and electronic device provided in this application, after acquiring user information including user profile information, multiple candidate recommendation information, and current reference information, obtains prompt words based on the user profile information, the candidate recommendation information, and the current reference information; inputs the prompt words into a large language model to obtain predicted tags corresponding to the user information; matches the predicted tags with the tags corresponding to the multiple candidate recommendation information; if a match is successful, the candidate recommendation information corresponding to the successfully matched tag is taken as the target recommendation information corresponding to the user information. Through the above method, prompt words can be obtained based on user profile information, multiple candidate recommendation information, and current reference information; the prompt words can be input into a large language model to obtain predicted tags; then, it can be determined whether the predicted tags match the candidate recommendation information; and the corresponding target recommendation information can be obtained based on the matching result. This allows the target recommendation information to be limited to multiple candidate recommendation information or a single recommendation information other than multiple candidate recommendation information, thereby reducing the prediction difficulty of the model. Furthermore, the candidate recommendation information is related to the user's historical behavior, thus providing the model with information that is more in line with user habits, thereby improving the accuracy of the model prediction and obtaining more accurate target recommendation information.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for predicting recommendation information, characterized in that, The method includes: Obtain user information, which includes user profile information, multiple candidate recommendation information and current reference information. The multiple candidate recommendation information corresponds to tags and is obtained based on the user's historical behavior. Based on the user profile information, the candidate recommendation information, and the current reference information, prompt words are obtained; The prompt words are input into a large language model to obtain predicted labels corresponding to the user information. The large language model is trained using multiple training subsets, each including multiple sample sequences, their corresponding ground truth labels, user profile information, and candidate recommendation information. The training process for the large language model includes: in the current training round, training the large language model to be trained for the current round based on the training subset and loss function to obtain the large language model for the current round; if the large language model for the current round meets the target conditions, it is used as the large language model for obtaining predicted labels based on the prompt words, and training ends; if the large language model for the current round does not meet the target conditions, training continues based on the training subset of the next round, and the large language model for the current round is used as the large language model to be trained in the next round. The predicted label is matched with the labels corresponding to the multiple candidate recommendation information. If the match is successful, the candidate recommendation information corresponding to the successfully matched label is used as the target recommendation information corresponding to the user information.
2. The method according to claim 1, characterized in that, The method further includes: If a match fails, the target recommendation information is obtained based on a preset mapping relationship.
3. The method according to claim 2, characterized in that, The preset mapping relationship represents the matching between the predicted label and the preset recommendation information. If the matching fails, the target recommendation information is obtained based on the preset mapping relationship, including: If the matching fails, the preset recommendation information is obtained based on the preset mapping relationship, and the preset recommendation information is used as the target recommendation information. The preset recommendation information is the recommendation information with the most visits obtained based on the user's historical behavior.
4. The method according to claim 1, characterized in that, The step of obtaining prompt words based on the user profile information, the candidate recommendation information, and the current reference information includes: Obtain a pre-configured task prompt description, which includes a task prompt module and a detailed task description module. The task prompt module is used to inform the large language model of an overview of the task to be performed, an overview of the content of the remaining modules in the prompt words, and the order in which the remaining modules appear. The detailed task description module is used to summarize the prompt words in full and inform the large language model of the detailed information of the task to be performed. Based on the user profile information, a user profile module is obtained; Based on the multiple candidate recommendation information and the tags corresponding to each of the multiple candidate recommendation information, a candidate list module is obtained; Based on the current reference information, the current time information module is obtained; The prompt word is obtained based on the task prompt module, the detailed task description module, the user profile module, the candidate list module, and the current time information module.
5. The method according to claim 1, characterized in that, The user information also includes supplementary candidate recommendation information, which corresponds to tags. The step of obtaining prompt words based on the user profile information, the multiple candidate recommendation information, and the current reference information includes: Obtain a pre-configured task prompt description, which includes a task prompt module and a detailed task description module. The task prompt module is used to inform the large language model of an overview of the task to be performed, an overview of the content of the remaining modules in the prompt words, and the order in which the remaining modules appear. The detailed task description module is used to summarize the prompt words in full and inform the large language model of the detailed information of the task to be performed. Based on the user profile information, a user profile module is obtained; Based on the multiple candidate recommendation information and the tags corresponding to each of the multiple candidate recommendation information, a candidate list module is obtained; Based on the current reference information, the current time information module is obtained; Based on the supplementary candidate recommendation information and the tags corresponding to the supplementary candidate recommendation information, a supplementary candidate list module is obtained; The prompt word is obtained based on the task prompt module, the detailed task description module, the user profile module, the candidate list module, the current time information module, and the supplementary candidate list module.
6. The method according to any one of claims 1-5, characterized in that, If the matching fails, after obtaining the target recommendation information based on the preset mapping relationship, the method further includes: In response to receiving the prediction task corresponding to the user information, input information is obtained based on the target recommendation information and the prompt words; The input information is fed into the large language model to obtain the target recommendation information corresponding to the prediction task.
7. The method according to any one of claims 1-5, characterized in that, The multiple candidate recommendation information is obtained based on the user's historical behavior and a preset recall strategy.
8. The method according to claim 1, characterized in that, The process of training in the current round, training the large language model to be trained in the current round based on the training subset and loss function corresponding to the current round, to obtain the large language model corresponding to the current round, includes: Based on the multiple sample sequences, the user profile information and candidate recommendation information corresponding to each of the multiple sample sequences, the prompt words corresponding to each of the multiple sample sequences are obtained; During the current training round, the prompt words corresponding to each of the multiple sample sequences are input into the large language model to be trained for the current round to obtain the predicted labels corresponding to each of the multiple sample sequences. Based on the predicted labels, true labels, and loss functions corresponding to the multiple sample sequences, the large language model to be trained for the current round is trained to obtain the large language model corresponding to the current round.
9. The method according to claim 8, characterized in that, The step of training the large language model corresponding to the current round based on the predicted labels, true labels, and loss functions corresponding to the multiple sample sequences to obtain the large language model corresponding to the current round includes: Based on the predicted labels and true labels corresponding to each of the multiple sample sequences, a first loss function is obtained. The first loss function is used to narrow the gap between the predicted labels and true labels of the sample sequences. Based on the predicted labels corresponding to each of the multiple sample sequences, a second loss function is obtained, which is used to reduce the noise of the predicted labels; The loss function is obtained based on the first loss function and the second loss function; The large language model to be trained for the current round is trained based on the loss function to obtain the large language model corresponding to the current round.
10. The method according to claim 9, characterized in that, Each of the sample sequences contains multiple samples, each of which has a predicted label and a true label. The true label of each sample represents the next sample in the corresponding sample sequence. The first loss function is obtained based on the predicted labels and true labels of the multiple sample sequences, including: Based on the predicted and true labels corresponding to multiple samples in each sample sequence, a label loss function is obtained for each sample, resulting in multiple label loss functions. The label loss function characterizes the difference between the true label and the predicted label of the sample. The first loss function is obtained based on the multiple label loss functions.
11. The method according to claim 9, characterized in that, Each sample sequence contains multiple samples, each sample corresponding to a predicted label and a true label. The true label of each sample represents the next sample in the corresponding sample sequence. The current training round includes a training process for multiple sample sequences. In the current training round, the prompt words corresponding to each of the multiple sample sequences are input into the large language model to be trained for the current round to obtain the predicted labels corresponding to each of the multiple sample sequences, including: During the training process of the current sample sequence, the prompt word corresponding to the current sample sequence is input into the large language model to be trained in the current round to obtain the predicted label corresponding to the first sample in the current sample sequence; Continue to concatenate the predicted label corresponding to the first sample in the current sample sequence with the prompt word corresponding to the current sample sequence to obtain the input information of the next sample in the current sample sequence. Input the input information of the next sample into the large language model to be trained corresponding to the current round to obtain the predicted label corresponding to the next sample in the current sample sequence. Continue to obtain the predicted labels of all samples in the current sample sequence, and continue to train the next sample sequence until the predicted labels corresponding to each of the multiple sample sequences are obtained.
12. A recommendation information prediction device, characterized in that, The device includes: The user information acquisition unit is used to acquire user information, which includes user profile information, multiple candidate recommendation information and current reference information. The multiple candidate recommendation information corresponds to tags and is obtained based on the user's historical behavior. The prompt word acquisition unit is used to obtain prompt words based on the user profile information, the candidate recommendation information, and the current reference information; The target recommendation information acquisition unit is used to input the prompt words into a large language model to obtain the predicted label corresponding to the user information; match the predicted label with the labels corresponding to the multiple candidate recommendation information; if the match is successful, the candidate recommendation information corresponding to the successfully matched label is used as the target recommendation information corresponding to the user information. The large language model is trained using multiple training subsets, each including multiple sample sequences, their corresponding ground truth labels, user profile information, and candidate recommendation information. The training process involves: in the current training round, training the large language model corresponding to the current round based on the training subset and loss function to obtain the large language model for that round; if the large language model for the current round meets the target conditions, it is used as the large language model for obtaining predicted labels based on the prompt words, and training ends; if the large language model for the current round does not meet the target conditions, training continues based on the training subset of the next round, and the large language model for the next round is used as the large language model to be trained in the next round.
13. An electronic device, characterized in that, Includes one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method of any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code, wherein the method described in any one of claims 1-11 is executed when the program code is run.
Citation Information
Patent Citations
Information recommendation method and device, electronic equipment and computer readable storage medium
CN116089745A
Identifying digital attributes from multiple attribute groups within target digital images utilizing a deep cognitive attribution neural network
US20210073267A1