Training method of recommendation model, recommendation method, device and computer readable medium
Patent Information
- Application Number
- CN202080103030.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2040-07-24
AI Technical Summary
[0004]然而,由于推荐模型通常是基于用户的历史数据训练得到的,因此用户的历史数据对推荐模型的预测效果具有较大的影响
Smart Images

Figure CN115917535B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more particularly to a method for training a recommendation model, a recommendation method, an apparatus, and a computer-readable medium. Background Technology
[0002] Recommendation systems recommend items to users by comprehensively considering multiple factors. Specifically, they predict the probability of a user selecting an item by considering various factors, rank the items according to their probability, and display some or all of the ranking results as recommendations.
[0003] Recommendation systems typically learn user preferences from historical data, such as user behavior logs, to improve prediction accuracy and provide more suitable recommendations.
[0004] However, since recommendation models are typically trained on users' historical data, this historical data has a significant impact on the model's predictive performance. When the user's historical data is inaccurate, the recommendation system's predictive performance will also be affected. For example, if the user's historical data is biased, the recommendation model trained on that data will also be biased, leading to a Matthew effect and negatively impacting the user experience.
[0005] Therefore, improving the accuracy of recommendation models has become an urgent problem to be solved. Summary of the Invention
[0006] This application provides a training method, recommendation method, apparatus, and computer-readable medium for a recommendation model to improve the accuracy of the recommendation model.
[0007] Firstly, a method for training a recommendation model is provided. This method includes: obtaining a first recommendation model, the model parameters of which are obtained by training n first training samples. Each first training sample includes information about a first user, information about a first recommended object, and sample labels for the first training samples. The sample labels of the first training samples indicate whether the first user has performed an action on the first recommended object, where n is an integer greater than 1; determining the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. Each second training sample includes information about a second user and information about a second recommended object, and sample labels for the second training samples. The sample labels of the second training samples indicate whether the second user has performed an action on the second recommended object, where m is an integer greater than 1; determining the weight corresponding to each first training sample based on the influence function value of the validation loss of each first training sample on the m second training samples on the first recommendation model; and training the first recommendation model according to the n first training samples and their corresponding weights to obtain a target recommendation model.
[0008] According to the scheme of this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the magnitude of the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample, reducing the impact of the inconsistency between the data distributions of the first and second training samples on the recommendation model, and improving the accuracy of the recommendation model in predicting the second training sample. This can improve user experience, enhance user stickiness, attract more suppliers to join, and increase the revenue of the recommendation system.
[0009] The recommended object refers to the object recommended by the recommendation system to the user. For example, the recommended object can be a recommended application in the application market of the terminal device; or, the recommended object can be a search term recommended by the search system. It should be understood that the specific content of the recommended object may be different in different recommendation scenarios, and the embodiments of this application do not limit the specific content of the recommended object.
[0010] For example, user information may include a user identifier, such as a user ID. User information may also include personalized attributes, such as the user's gender, age, occupation, income, interests, or education level. The information of the first user may include one or more of the aforementioned user information. The information of the second user may include one or more of the aforementioned user information.
[0011] For example, the information of a recommendation object may include a recommendation object identifier, such as a recommendation object ID. The information of a recommendation object may also include some attributes of the recommendation object, such as the name of the recommendation object, the type of the recommendation object, etc. The information of the first recommendation object may include one or more of the above-mentioned information. The information of the second recommendation object may include one or more of the above-mentioned information.
[0012] For example, the first training sample may also include first context information. The second training sample may also include second context information.
[0013] Contextual information can include state information related to the user's interaction with the recommended object. For example, the time of interaction between the user and the recommended object, the location of interaction, or the network used when the user interacts with the recommended object, such as 4G or Wi-Fi.
[0014] The first contextual information may include one or more of the aforementioned contextual information. The second contextual information may include one or more of the aforementioned contextual information. User actions on the recommended objects may include user clicks, downloads, purchases, browsing, and negative reviews, etc.
[0015] It should be noted that the n first users in the n first training samples can be the same or different. The n first recommendation objects in the n first training samples can be the same or different. The m second users in the m second training samples can be the same or different. The m second recommendation objects in the m second training samples can be the same or different. The first user and the second user can be the same or different. The first recommendation object and the second recommendation object can be the same or different.
[0016] The validation loss of m second training samples on the first recommendation model is used to represent the difference between the predicted labels of the m second training samples obtained by processing the m second training samples through the first recommendation model and the sample labels of the m second training samples.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: determining the weight corresponding to each first training sample based on the influence function value of the validation loss of each first training sample on the m second training samples in the first recommendation model, including: the weight corresponding to each first training sample is negatively correlated with the influence function value of the validation loss of each first training sample on the m second training samples.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, the influence function value of each first training sample on the prediction loss of m second training samples on the first recommendation model satisfies the following formula:
[0019]
[0020] Among them, z i Let φ(z) represent the i-th first training sample. i z represents the influence function value of the i-th first training sample on the prediction loss of m second training samples in the first recommendation model. j Let φ(z) represent the j-th second training sample. i ,z j () represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
[0021] The validation loss of the j-th second training sample on the first recommendation model is used to represent the difference between the predicted label of the j-th second training sample obtained by processing the j-th second training sample through the first recommendation model and the sample label of the j-th second training sample.
[0022] In conjunction with the first aspect, in some implementations of the first aspect, the weight corresponding to each first training sample is determined based on the influence function value of the validation loss of each first training sample on the m second training samples in the first recommendation model, including that the weight corresponding to each first training sample satisfies the following formula:
[0023]
[0024] Where, π i Let φ(z) represent the weights corresponding to the i-th first training sample, α represent the weighting coefficients, and {φ(z)} i Let} represent the set of function values that influence the validation loss of n first training samples on m second training samples on the first recommendation model.
[0025] According to the scheme of this application embodiment, the weight value is calculated by using the sigmoid function, which can satisfy both the convex optimization condition and the monotonic mapping. The weight obtained in this way can make the accuracy of the trained recommendation model higher.
[0026] In conjunction with the first aspect, in some implementations of the first aspect, the m second training samples are obtained when the probability of displaying the candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
[0027] According to the solution of this application embodiment, since the second training sample is an unbiased training sample, adjusting the weights of the first training sample based on the second training sample can enable the recommendation model to more accurately fit the unbiased data distribution, reduce the impact of bias on training, mitigate the Matthew effect, and improve the accuracy of the recommendation model. The solution of this application embodiment corrects the data distribution of the observed samples based on a counterfactual method, enhancing the diversity of recommendation results, breaking the cocoon effect, improving user experience, increasing user stickiness, allowing users to remain immersed in the recommendation system for longer periods, promoting a virtuous cycle for the recommendation system, increasing supplier revenue, attracting more suppliers to join, and ensuring the long-term stable development of the recommendation system.
[0028] Furthermore, during training, only a small number of second training samples are needed to mitigate the impact of the bias problem, improve the accuracy of the recommendation model, avoid the large-scale random display of recommended objects due to the large-scale collection of second training samples, which would lead to a decrease in the overall revenue of the system, and also avoid the need for a large number of features for training, which would reduce training efficiency.
[0029] The second training sample is a training sample without bias.
[0030] For example, the m second training samples can be obtained when the candidate recommendation objects in the candidate recommendation object set have the same probability of being displayed and are displayed in the same position.
[0031] In conjunction with the first aspect, in some implementations of the first aspect, the m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, including: the m second training samples are obtained when the candidate recommendation objects in the candidate recommendation object set are randomly displayed to the second user; or the m second training samples are obtained when the second user searches for the second recommendation object.
[0032] The m second training samples can be training samples obtained through a random delivery strategy. In the case of random display, each candidate recommendation object has the same probability of being recommended to the user, and the training samples obtained in this case are unbiased training samples.
[0033] The M second training samples can be training samples obtained when the user actively searches for candidate recommendations. In the case of an active user search, the user interacts not based on displayed recommendations, but actively engages with the platform. For the user, the probability of each candidate recommendation in the set being shown to them is the same regardless of whether it has already been displayed. In other words, the candidate recommendations in the set are shown to the user with equal probability. Therefore, the training samples obtained in this case are unbiased training samples.
[0034] In conjunction with the first aspect, in some implementations of the first aspect, m second training samples belong to the source domain data, and n first training samples belong to the target domain data.
[0035] According to the scheme of the embodiments of this application, the first training sample is data in the target domain, and the second training sample is data in the source domain. Adjusting the weight of the first training sample based on the second training sample can enable the recommendation model to more accurately fit the data distribution of the source domain, learn more accurate user preferences, and improve the accuracy of the recommendation model in the target domain.
[0036] Secondly, a recommendation method is provided, comprising: acquiring information about a target user and information about candidate recommendation objects; inputting the information about the target user and information about candidate recommendation objects into a recommendation model to predict the probability that the target user will perform an action on the candidate recommendation objects; wherein, the model parameters of the recommendation model are obtained by training a first recommendation model based on n first training samples and the weights corresponding to the n first training samples, the first recommendation model is trained based on the n first training samples, and the weight corresponding to each first training sample is determined based on the influence function value of the validation loss of each first training sample on m second training samples in the first recommendation model, the first training samples include information about the first user and information about the first recommendation object, as well as the sample labels of the first training samples, the sample labels of the first training samples are used to indicate whether the first user has performed an action on the first recommendation object, and n is an integer greater than 1, the second training samples include information about the second user and information about the second recommendation object, as well as the sample labels of the second training samples, the sample labels of the second training samples are used to indicate whether the second user has performed an action on the second recommendation object, and m is an integer greater than 1.
[0037] According to the scheme of this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the magnitude of the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample. The recommendation model trained in this way has higher accuracy in predicting the second training sample. This can improve user experience, enhance user stickiness, attract more suppliers to join, and increase the revenue of the recommendation system.
[0038] In conjunction with the second aspect, in some implementations of the second aspect, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including: the weight corresponding to each first training sample is negatively correlated with the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model.
[0039] In conjunction with the second aspect, in some implementations of the second aspect, the influence function value of the validation loss of each first training sample on the m second training samples on the first recommendation model satisfies the following formula:
[0040]
[0041] Among them, z i Let φ(z) represent the i-th first training sample. i z represents the influence function value of the i-th first training sample on the prediction loss of m second training samples in the first recommendation model. j Let φ(z) represent the j-th second training sample. i ,z j () represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
[0042] In conjunction with the second aspect, in some implementations of the second aspect, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including the weight corresponding to each first training sample satisfying the following formula:
[0043]
[0044] Where, π i Let φ(z) represent the weights corresponding to the i-th first training sample, α represent the weighting coefficients, and {φ(z)} i Let} represent the set of function values that influence the validation loss of n first training samples on m second training samples on the first recommendation model.
[0045] In conjunction with the second aspect, in some implementations of the second aspect, the m second training samples are obtained when the probability of displaying the candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
[0046] In conjunction with the second aspect, in some implementations of the second aspect, the m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, including: the m second training samples are obtained when the candidate recommendation objects in the candidate recommendation object set are randomly displayed to the second user; or the m second training samples are obtained when the second user searches for the second recommendation object.
[0047] In conjunction with the second aspect, in some implementations of the second aspect, m second training samples belong to the source domain data, and n first training samples belong to the target domain data.
[0048] Thirdly, a recommendation method is provided, comprising: displaying a first interface including a learning list of at least one application, the learning list of the first application including at least one option, each of the at least one option being associated with an application; sensing a first operation by a user on the first interface; and responding to the first operation by enabling or disabling cross-domain recommendation functionality of the first application in applications associated with some or all of the options in the learning list of the first application.
[0049] According to the scheme in the embodiments of this application, by transferring and sharing knowledge (e.g., user interests and preferences) between different domains, the user interaction history of both the source domain and the target domain is incorporated into the learning process. This enables the recommendation model to better learn user preferences and fit user interests and preferences well in the target domain, thus providing users with recommendations that match their interests. This achieves cross-domain recommendation and alleviates the cold start problem.
[0050] For example, each of the at least one option is associated with an application, and the option associated with the application is used to control the first application to obtain data from that application for cross-domain recommendations.
[0051] In other words, after the first operation, users can see from the interface whether the cross-domain recommendation function of the first application is on or off.
[0052] Optionally, the first operation can be a click operation, a double click operation, a long press operation, or a swipe operation, etc.
[0053] In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: a first operation acting on a first option, and in response to the first operation, opening or closing the cross-domain recommendation function of the first application in the applications associated with some or all options in the learning list of the first application, including: in response to the user's first operation on the first option, opening or closing the cross-domain recommendation function of the first application in the applications associated with the first option; wherein the first option is located in the learning list of the first application.
[0054] In conjunction with the third aspect, in some implementations of the third aspect, the first operation acts on the switch control corresponding to the learning list of the first application, and in response to the first operation, the cross-domain recommendation function of the first application in the applications associated with some or all of the options in the learning list of the first application is turned on or off, including: in response to the user's first operation on the switch control, turning on or off the cross-domain recommendation function of the first application in the applications associated with all the options in the learning list of the first application.
[0055] In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: displaying a second interface for presenting one or more recommended objects and prompts for one or more recommended objects, the prompts for one or more recommended objects indicating that the one or more recommended objects are determined based on user behavior data from at least one application.
[0056] In conjunction with the third aspect, in some implementations of the third aspect, one or more recommended objects are determined by inputting user information and candidate recommended object information into the recommendation model to predict the probability that the user will perform an action on the candidate recommended object.
[0057] In conjunction with the third aspect, in some implementations of the third aspect, the model parameters of the recommendation model are obtained by training a first recommendation model based on n first training samples and the weights corresponding to the n first training samples. The first recommendation model is trained based on the n first training samples. The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The first training samples include information about the first user, information about the first recommendation object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has an operation on the first recommendation object, and n is an integer greater than 1. The second training samples include information about the second user and information about the second recommendation object, and sample labels of the second training samples. The sample labels of the second training samples are used to indicate whether the second user has an operation on the second recommendation object, and m is an integer greater than 1. The m second training samples are determined based on user behavior data in applications associated with at least one option, and the n first training samples are determined based on user behavior data in the first application.
[0058] It should be understood that the extensions, limitations, explanations and clarifications of the relevant content in the first aspect above also apply to the same content in the second and third aspects.
[0059] Fourthly, a training apparatus for a recommendation model is provided, the apparatus comprising modules / units for performing the methods of the first aspect and any implementation thereof.
[0060] Fifthly, a recommended apparatus is provided, comprising modules / units for performing the methods of the second aspect and any implementation thereof.
[0061] Sixthly, an apparatus is provided, included in an electronic device, having the function of implementing the behavior of the electronic device in any possible implementation of the third aspect described above. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the described functions.
[0062] In a seventh aspect, a training apparatus for a recommendation model is provided, including an input / output interface, a processor, and a memory. The processor controls the input / output interface to send and receive information, the memory stores a computer program, and the processor retrieves and runs the computer program from the memory, causing the training apparatus to execute the methods described in the first aspect and any implementation thereof.
[0063] Optionally, the training device can be a terminal device / server or a chip within the terminal device / server.
[0064] Alternatively, the aforementioned memory can be located inside the processor, for example, it can be a cache memory within the processor. The aforementioned memory can also be located outside the processor, thus independent of the processor, for example, the internal memory of the training device.
[0065] Eighthly, a recommended apparatus is provided, including an input / output interface, a processor, and a memory. The processor controls the input / output interface to send and receive information, the memory stores a computer program, and the processor retrieves and runs the computer program from the memory, causing the apparatus to perform the methods of the second aspect and any implementation thereof.
[0066] Optionally, the aforementioned device may be a terminal device / server, or a chip within the terminal device / server.
[0067] Optionally, the aforementioned memory can be located inside the processor, for example, it can be a cache memory within the processor. Alternatively, the aforementioned memory can be located outside the processor, thus independent of the processor, for example, the device's internal memory.
[0068] A ninth aspect provides an electronic device including a processor and a memory. The memory is coupled to the processor and is used to store computer program code, including computer instructions, which, when executed by the processor, cause the electronic device to perform the methods described in the third aspect and any possible implementations of the third aspect.
[0069] In a tenth aspect, a computer program product is provided, the computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the methods described in the foregoing aspects.
[0070] It should be noted that the above-mentioned computer program code can be stored in whole or in part on the first storage medium. The first storage medium can be packaged together with the processor or packaged separately from the processor. This application embodiment does not make specific limitations on this.
[0071] Eleventhly, a computer-readable medium is provided that stores program code that, when run on a computer, causes the computer to perform the methods described in the preceding aspects. Attached Figure Description
[0072] Figure 1 This is a schematic diagram of an application scenario provided in the embodiments of this application.
[0073] Figure 2 This is an architecture diagram of a recommendation system provided in an embodiment of this application.
[0074] Figure 3 This is a schematic diagram of a system architecture provided in an embodiment of this application.
[0075] Figure 4 This is a schematic diagram of a system architecture provided in an embodiment of this application.
[0076] Figure 5 This is a schematic block diagram of a recommendation framework provided in an embodiment of this application.
[0077] Figure 6 This is a schematic flowchart illustrating a training method for a recommendation model provided in an embodiment of this application.
[0078] Figure 7 This is a schematic flowchart illustrating a recommended method provided in an embodiment of this application.
[0079] Figure 8 This is a schematic diagram of an application market provided in an embodiment of this application.
[0080] Figure 9 This is a schematic flowchart of a recommendation process.
[0081] Figure 10 This is a schematic block diagram illustrating lifelong learning provided in an embodiment of this application.
[0082] Figure 11 This is a schematic flowchart of a cross-domain recommendation method.
[0083] Figure 12 This is a schematic flowchart illustrating a cross-domain recommendation method provided in an embodiment of this application.
[0084] Figure 13 This is a schematic diagram of a set of graphical user interfaces provided in the embodiments of this application.
[0085] Figure 14 This is a schematic diagram of another set of graphical user interfaces provided in the embodiments of this application.
[0086] Figure 15 This is a schematic diagram of another set of graphical user interfaces provided in the embodiments of this application.
[0087] Figure 16 This is a schematic flowchart illustrating a recommended method provided in an embodiment of this application.
[0088] Figure 17 This is a schematic block diagram of the training device for the recommended model provided in the embodiments of this application.
[0089] Figure 18This is a schematic block diagram of the recommended apparatus provided in the embodiments of this application.
[0090] Figure 19 This is a schematic block diagram of the training device for the recommended model provided in the embodiments of this application.
[0091] Figure 20 This is a schematic block diagram of the recommended apparatus provided in the embodiments of this application.
[0092] Figure 21 This is a schematic block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0093] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0094] Figure 1 The examples illustrate some application scenarios of embodiments of this application. The recommendation method provided by embodiments of this application can be applied to all scenarios requiring recommendations. For example, as Figure 1 As shown in the embodiments of this application, the recommendation method can be applied to various scenarios requiring recommendations, such as app store recommendations, music application recommendations, video website recommendations, e-commerce recommendations, search term recommendations, and cross-domain recommendations. The following sections provide a brief introduction to three commonly used application scenarios.
[0095] Application Scenario 1: App Store Recommendation
[0096] App stores can display a subset of applications. Recommendation systems are used to determine which applications are displayed and their corresponding placement. When a user enters an app store, a recommendation request is triggered. Since placement space for applications is limited, when a recommendation system receives a request, it can sort all available applications by expected revenue and then select one or more of the most valuable applications to display in their respective positions. For example, in a cost-per-click (CPC) system, advertisers only pay when an application is clicked by a user. In a CPC system, an application's value is typically determined by its expected revenue. Each application's expected revenue is related to its estimated click-through rate (CTR). In this case, CTR can be understood as the probability that each application (app) will be clicked. To obtain the ranking based on expected revenue, the estimated CTR is needed.
[0097] Specifically, the estimated CTR of all applications to be displayed is determined, the expected revenue of each application is calculated based on the estimated CTR of each application and they are sorted, and the applications to be displayed and their corresponding display positions are determined based on the sorting results.
[0098] The method for determining the estimated CTR of all applications to be displayed can be performed by the recommended method in this application embodiment. Based on the obtained estimated CTR, all applications to be displayed can be sorted, and then the applications to be displayed and their corresponding display positions can be determined based on the sorting results.
[0099] Application Scenario 2: Search Term Recommendation
[0100] When a user conducts a search, search terms typically come from two sources: user-inputted search terms and system-recommended search terms. User-inputted search terms are a user behavior that the system cannot interfere with. System-recommended search terms refer to those generated when a user enters a search context, triggering a recommendation request. When the recommendation system receives this request, it calculates the scores of all search terms to be displayed and ranks them. For example, a search term's score can represent the probability of it being clicked. Based on the ranking results, the system can determine which search terms will be displayed and their corresponding display positions.
[0101] The calculation of scores for all search terms can be performed by the recommendation method in this application embodiment. Based on the obtained scores, all search terms to be displayed can be sorted, and then the search terms to be displayed and their corresponding display positions can be determined based on the sorting results.
[0102] Application Scenario 3: Cross-Domain Recommendation
[0103] Recommender systems typically employ a single-domain recommendation approach. Specifically, they learn a user's preferences within a given recommendation scenario (or domain) based on historical data, and then make recommendations accordingly. Both the training and application phases of the recommendation model consider data from only a single domain. However, in the initial stages of a new recommendation scenario, user interaction history is scarce. Using historical data from the current domain to learn user interests and preferences may result in low model accuracy, a phenomenon known as the cold start problem.
[0104] Cross-domain recommendation involves integrating historical data of users in the source domain, learning user preferences in that domain, and then using these learned preferences to guide recommendation results in the target domain.
[0105] Cross-domain recommendations can be applied to lifelong learning projects. Figure 10 A schematic diagram of a lifelong learning framework is shown. Figure 10The framework mainly includes an event acquisition module, a big data platform module, a cross-domain learning module, and a business verification module.
[0106] In multiple scenarios, such as Figure 10 The system acquires user interaction data from scenarios such as video apps, music apps, and browser apps. This data is then processed by the event acquisition module to obtain event logs, which are then stored in the big data platform module. For example, the event acquisition module processes user interaction data, including operations such as event generation, event collection, field concatenation, and field cleaning. The cross-domain learning module can export data from relevant domains (source and target domains) from the big data platform module for training. For example, through operations such as association analysis, causal reasoning, and knowledge transfer, a recommendation model is generated and pushed into the business verification module, such as an information flow recommendation engine, for online implementation. The recommendation model guides the platform in making recommendations to users. After the model is online, when a user initiates a recommendation request, the recommendation model, after processing candidate content through recall and ranking, recommends relevant content to the user in the information flow app for user interaction, thus achieving a system closed loop.
[0107] Cross-domain recommendation can be applied to cross-domain learning modules.
[0108] It should be understood that Figure 10 The lifelong learning framework in the image is for illustrative purposes only; a lifelong learning framework may also include more than just this. Figure 10 The modules shown can be more or fewer to perform the corresponding functions.
[0109] Cross-domain recommendation can be performed by the method in the embodiments of this application, which uses the user preferences learned in the source domain to guide the training process of the recommendation model in the target domain, so as to obtain a recommendation model that can be applied to the target domain, and then make recommendations for users in the target domain.
[0110] The method provided in this application is described below from the perspectives of model training and model application:
[0111] The training method for the recommendation model provided in this application can be specifically applied to data processing methods such as data training, machine learning, and deep learning. It involves symbolicating and formalizing intelligent information modeling, extraction, preprocessing, and training of training data (such as the first training sample in this application) to ultimately obtain a trained recommendation model. Furthermore, the recommendation method provided in this application can utilize the trained recommendation model, inputting input data (such as the target user information and candidate recommendation object information in this application) into the trained recommendation model to obtain output data (such as the probability of the target user performing an action on the candidate recommendation object in this application). It should be noted that the training method and recommendation method of the recommendation model provided in this application are inventions based on the same concept, and can also be understood as two parts of a system, or two stages of an overall process: such as the model training stage and the model application stage.
[0112] To facilitate understanding of the embodiments of this application, the relevant concepts of related terms involved in the embodiments of this application will be introduced below.
[0113] (1) Recommendation System
[0114] A recommendation system is a system that analyzes users' historical data, predicts new recommendation requests based on the analysis results, and obtains recommendation results.
[0115] The task of a recommendation system is to recommend items that users are most interested in by comprehensively considering factors such as users, items, and current context information. In actual modeling, the probability that a user is most likely to click or convert is often used to rank the items and display the recommendation results.
[0116] Figure 2 This document illustrates the architecture of a recommendation system provided in an embodiment of this application. When a user enters the system, a recommendation request is triggered. The recommendation system inputs this request and related information into the recommendation model to predict the user's selection rate for items within the system. Further, the system sorts the items based on the predicted selection rate or a function based on that selection rate. The recommendation system can determine the items to be displayed to the user and their display positions based on the sorting results, and then feeds this information back to the user as a recommendation result. Users may browse the displayed items and perform actions such as browsing or downloading. These actions can be stored in a user behavior log, which can be processed to obtain training data. This training data can be used to train the recommendation model, or to continuously update the model parameters to improve its predictive performance.
[0117] For example, when a user opens the app store on a smart device (e.g., a mobile phone), it triggers the app store's recommendation system, which then initiates a recommendation request. The recommendation system can predict the probability of the user downloading various candidate applications based on the user's historical behavior logs, such as their download history, and the app store's own characteristics, such as environmental features like time and location. The recommendation system can then display candidate applications in descending order of predicted download probability, thereby increasing the download probability of each candidate application.
[0118] For example, when there are p display positions in the app store, where p is a positive integer, the recommendation system can select the p candidate applications with the highest predicted download probability to display, and display the applications with higher predicted download probabilities among the p candidate applications in the first position, and the applications with lower predicted download probabilities among the p candidate applications in the last position.
[0119] The aforementioned recommendation model can be a neural network model. The following section introduces the relevant terms and concepts of neural networks that may be involved in the embodiments of this application.
[0120] (2) Neural Network
[0121] Neural networks can be composed of neural units, which can refer to units represented by x. s The arithmetic unit takes the intercept 1 as input, and its output can be as shown in formula (1):
[0122]
[0123] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s For x s The weights are denoted by b, where b is the bias of the neural unit. f is the activation function of the neural unit, which performs a non-linear transformation on the features in the neural network, converting the input signal of the neural unit into an output signal. The output signal of this activation function can be used as the input to the next convolutional layer. The activation function can be the sigmoid function. A neural network is a network formed by connecting many of the above-mentioned individual neural units together; that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.
[0124] (3) Deep Neural Networks
[0125] A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network with multiple hidden layers. Based on the position of the layers, the internal neural network of a DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer.
[0126] Although DNNs seem complex, the operation of each layer is actually not complicated. Simply put, it involves the following linear relationship expression: in, It is the input vector. It is the output vector. Here, W is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer simply performs this operation on the input vector to obtain the output vector. Because DNNs have many layers, the number of coefficients W and offset vectors is also relatively large. These parameters are defined in DNNs as follows: Taking the coefficient W as an example, assuming a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as... The superscript 3 represents the layer number where coefficient W is located, while the subscript corresponds to the third layer index 2 of the output and the second layer index 4 of the input.
[0127] In summary, the coefficient from the k-th neuron in layer L-1 to the j-th neuron in layer L is defined as...
[0128] It's important to note that the input layer does not have a W parameter. In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and "capacity," meaning it can perform more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrix of all layers in the trained deep neural network (a weight matrix formed by the vectors W from many layers).
[0129] (4) Loss Function
[0130] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.
[0131] (5) Backpropagation algorithm
[0132] Neural networks can employ backpropagation (BP) to correct the initial parameter values during training, thereby minimizing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the initial neural network model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the neural network model, such as the weight matrix.
[0133] The following is combined with Figure 3 The system architecture of the embodiments of this application will be described in detail.
[0134] Figure 3 This is a schematic diagram of the system architecture according to an embodiment of this application. Figure 3 As shown, the system architecture 100 includes an execution device 110, a training device 120, a database 130, a client device 140, a data storage system 150, and a data acquisition device 160.
[0135] Additionally, the execution device 110 includes a calculation module 111, an I / O interface 112, a preprocessing module 113, and a preprocessing module 114. The calculation module 111 may include a target model / rule 101, while the preprocessing modules 113 and 114 are optional.
[0136] The data acquisition device 160 is used to collect training data. Regarding the training method of the recommendation model in this embodiment, the recommendation model can be further trained using the training data.
[0137] For example, in this embodiment, the training data may include a first training sample and sample labels for the first training sample. The first training sample may include attribute information of the first user and information of the first recommended object. The sample label of the first training sample indicates whether the first user has performed an action on the first recommended object. Whether the first user has performed an action on the first recommended object can be understood as whether the first user has selected the first recommended object.
[0138] After collecting the training data, the data acquisition device 160 stores the training data in the database 130, and the training device 120 trains the target model / rule 101 based on the training data maintained in the database 130.
[0139] The following describes how the training device 120 obtains the target model / rule 101 based on the training data. The training device 120 processes the input training samples and compares the output predicted label with the sample label until the difference between the output predicted label of the training device 120 and the sample label is less than a certain threshold, thereby obtaining the trained recommendation model. That is, the trained recommendation model can be the target model / rule 101.
[0140] The aforementioned target model / rule 101 can be used to predict whether a user will select a recommended object or to predict the probability that a user will select a recommended object. Specifically, the target model / rule 101 in this application embodiment can be a neural network, logistic regression model, etc.
[0141] It should be noted that in practical applications, the training data maintained in database 130 may not all come from the data acquisition device 160; it may also be received from other devices. Furthermore, it should be noted that training device 120 may not necessarily train the target model / rule 101 entirely based on the training data maintained in database 130; it may also obtain training data from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.
[0142] The target model / rule 101 trained using training device 120 can be applied to different systems or devices, such as... Figure 3 The execution device 110 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) or vehicle terminal, or it can be a server or cloud, etc. Figure 3In the middle, the execution device 110 is configured with input / output
[0143] The input / output (I / O) interface 112 is used for data interaction with external devices. Users can input data into the I / O interface 112 through the client device 140. In this embodiment, the input data may include training data input by the client device or recommendation requests triggered by the user. Specifically, the client device 140 may be a terminal device.
[0144] Preprocessing modules 113 and 114 are used to preprocess the input data received from I / O interface 112. For example, preprocessing module 113 can be used to clean the input data, such as extracting key fields. For example, preprocessing module 114 can be used to extract features from the input data.
[0145] In this embodiment, preprocessing modules 113 and 114 may be absent, or only one preprocessing module may be used. When preprocessing modules 113 and 114 are absent, the calculation module 111 can be used directly to process the input data.
[0146] During the preprocessing of input data by the execution device 110, or during the calculation module 111 of the execution device 110 performing calculations and other related processes, the execution device 110 can call data, code, etc. in the data storage system 150 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 150.
[0147] Finally, the I / O interface 112 provides the processing results to the user. For example, the target model / rule 101 can be used in the recommendation system to predict whether the target user is a candidate recommendation object or the probability of selecting a candidate recommendation object. The recommendation results are obtained based on the probability of whether the target user is a candidate recommendation object or the probability of selecting a candidate recommendation object, and presented to the client device 140, thereby providing them to the user.
[0148] For example, in the embodiments of this application, the above recommendation result can be a recommendation ranking of candidate recommendation objects obtained based on the probability of the target user selecting candidate recommendation objects, or the above recommendation result can be a target recommendation object obtained based on the probability of the target user selecting candidate recommendation objects, and the target recommendation object can be one or more candidate recommendation objects with the highest probability.
[0149] It is worth noting that the training device 120 can generate corresponding target models / rules 101 based on different training samples for different goals or different tasks. The corresponding target models / rules 101 can be used to achieve the above goals or complete the above tasks, thereby providing the user with the required results.
[0150] exist Figure 3 In the scenario shown, in one case, the user can manually provide input data, which can be done through the interface provided by I / O interface 112.
[0151] In another scenario, client device 140 can automatically send input data to I / O interface 112. If user authorization is required for client device 140 to automatically send input data, the user can set the corresponding permissions in client device 140. The user can view the output results of execution device 110 on client device 140, which can be presented in various forms such as display, sound, or animation. Client device 140 can also act as a data acquisition terminal, collecting the input data and output results of input I / O interface 112 as shown in the figure, and storing them in database 130. Alternatively, data can be collected directly from I / O interface 112 as new sample data, without going through client device 140.
[0152] It is worth noting that, Figure 3 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 3 In this context, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed within the execution device 110.
[0153] Figure 4 This application illustrates a training method for a recommendation model based on an embodiment of this application, as well as a system architecture 200 for the recommendation method. The system architecture 200 may include a local device 220, a local device 230, an execution device 210, and a data storage system 250, wherein the local devices 220 and 230 are connected to the execution device 210 via a communication network.
[0154] The execution device 210 is implemented by one or more servers, and optionally, in conjunction with other computing devices, such as data storage, routers, load balancers, etc. The execution device 210 can be deployed on a single physical site or distributed across multiple physical sites. The execution device 210 can use data from the data storage system 250, or call program code from the data storage system 250, to implement the training method and recommendation method of the recommendation model in this application embodiment.
[0155] For example, the data storage system 250 can be deployed in local device 220 or local device 230. For instance, the data storage system 250 can be used to store training data.
[0156] It should be noted that the aforementioned execution device 210 can also be called a cloud device, in which case the execution device 210 can be deployed in the cloud.
[0157] Specifically, the execution device 210 can perform the following processes:
[0158] Obtain the first recommendation model. The model parameters of the first recommendation model are obtained by training n first training samples. The first training samples include information about the first user, information about the first recommendation object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has performed an action on the first recommendation object. n is an integer greater than 1. Determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The second training samples include information about the second user and the second recommendation object, and sample labels of the second training samples. The sample labels of the second training samples are used to indicate whether the second user has performed an action on the second recommendation object. m is an integer greater than 1. Determine the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. Train the first recommendation model according to the n first training samples and the weights corresponding to the n first training samples to obtain the target recommendation model.
[0159] The execution device 210 can train a recommendation model by performing the above process, and the recommendation model can more accurately predict the probability that the target user will perform an operation on the candidate recommendation object.
[0160] In one possible implementation, the training method executed by the aforementioned execution device 210 can be a training method executed in the cloud.
[0161] Users can interact with execution device 210 by operating their respective user devices (e.g., local device 220 and local device 230). Each local device can represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, game console, etc.
[0162] Each user's local device can interact with the execution device 210 through a communication network of any communication mechanism / standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.
[0163] In one implementation, local devices 220 and 230 can obtain relevant parameters of the recommendation model from execution device 210, and use the recommendation model on local devices 220 and 230 to predict the probability that the target user will perform an action on the candidate recommendation object.
[0164] In another implementation, the recommendation model can be directly deployed on the execution device 210. The execution device 210 obtains recommendation requests and related information, such as information about the target user and information about the candidate recommendation objects, from the local devices 220 and 230, and predicts the probability that the target user will perform an action on the candidate recommendation objects through the recommendation model.
[0165] For example, the data storage system 250 may be deployed in local device 220 or local device 230 for storing training data of the local device.
[0166] For example, the data storage system 250 can be deployed independently on the storage device, separate from the local device 220 or the local device 230. The storage device can interact with the local device to obtain user behavior logs from the local device and store them in the storage device.
[0167] Typically, recommendation models can learn user preferences from historical data, predict the probability of a user selecting a candidate recommendation based on those preferences, determine the recommendation result based on the predicted probability, and then display the recommendation result to the user.
[0168] Recommendation models are trained based on users' historical data; therefore, this historical data has a significant impact on the model's prediction results. When the distribution of the training data differs from the actual data distribution, the training data is biased relative to the actual data. Recommendation models trained on biased data are also biased, affecting the accuracy of predictions.
[0169] Therefore, improving the accuracy of recommendation models has become an urgent problem to be solved.
[0170] This application provides a method for training a recommendation model and a recommendation method, which can solve the problem of inconsistent data distribution and improve the accuracy of recommendation results.
[0171] Figure 5 This is a schematic diagram of the recommended framework 500 in an embodiment of this application. To better understand the method in the embodiments of this application, the following describes... Figure 5 The functions of each module in the document will be briefly described.
[0172] The recommendation framework 500 includes a feature engineering module 510, a model training module 520, an influence function module 530, and a weight adjustment module 540.
[0173] The feature engineering module 510 can be used to extract features from the raw data of the dataset to obtain training samples.
[0174] For example, the raw data could be user behavior logs.
[0175] Features extracted from the raw data of the dataset include user information and information about the recommended objects.
[0176] like Figure 5 As shown, inputting the first and second datasets into the feature engineering module 510 yields a first training set and a second training set. The first training set includes n first training samples, and the second training set includes m second training samples. n is an integer greater than 1, and m is an integer greater than 1.
[0177] The first training sample includes information about the first user, information about the first recommended object, and sample labels for the first training sample. The sample labels of the first training sample are used to indicate whether the first user has performed an action on the first recommended object.
[0178] The second training sample includes information about the second user and the second recommended object, as well as sample labels for the second training sample. The sample labels for the second training sample are used to indicate whether the second user has performed any action on the second recommended object.
[0179] Furthermore, the feature engineering module 510 can be used to process the data in the dataset to obtain training samples in a uniform format, such as training samples in the libSVM format.
[0180] It should be noted that the feature engineering module 510 is an optional module, and training samples can also be obtained in other ways. For example, features can be extracted from the raw data of the dataset using a neural network to obtain training samples. Alternatively, the training samples can be pre-stored; for example, the training samples can be stored in... Figure 2 The training samples are shown in database 130. Alternatively, the training samples can be received from other devices.
[0181] The model training module 520 can be used to train the recommendation model and obtain the model parameters of the recommendation model.
[0182] Recommendation models can be used to predict the probability that a user will perform an action on a candidate recommendation object in the input data.
[0183] Specifically, such as Figure 5As shown, the model training module 520 can be used to train the recommendation model based on the first training set to obtain the first recommendation model, or in other words, to obtain the model parameters of the first recommendation model. This first recommendation model is the recommendation model trained based on the first training set.
[0184] The model training module 520 can also be used to train the first recommendation model based on the first training set with weights to obtain the target recommendation model, or in other words, to obtain the model parameters of the target recommendation model.
[0185] The first training set with weights includes the first training samples with weights.
[0186] The influence function module 530 can be used to determine the influence function value of the validation loss of each first training sample on m second training samples on the first recommendation model.
[0187] The weight adjustment module 540 can be used to determine the weight corresponding to each first training sample based on the influence function value of each first training sample on the prediction loss of m second training samples on the first recommendation model.
[0188] The weighted first training sample can be obtained from the first training sample and the weights corresponding to the first training sample.
[0189] For example, the recommendation framework 500 can be used to execute a two-stage process: a training stage and a recommendation stage. The training stage and the recommendation stage are described below.
[0190] Training phase:
[0191] S1: Obtain the first training set and the second training set.
[0192] The first training set contains n first training samples. The second training set contains m second training samples.
[0193] For example, such as Figure 5 As shown, the first dataset and the second dataset are input into the feature engineering module 510 respectively to obtain the first training set and the second training set respectively.
[0194] It should be noted that step S1 is an optional step. For example, the first training set and the second training set can also be pre-stored data. For instance, the first training set and the second training set can be data stored in... Figure 2 Data in database 130.
[0195] S2: Train the recommendation model based on the first training set to obtain the model parameters of the first recommendation model.
[0196] For example, such as Figure 5As shown, n first training samples from the first training set are input into the model training module 520 for training to obtain the first recommendation model, or in other words, to obtain the model parameters of the first recommendation model.
[0197] It should be noted that step S2 is optional. For example, the first recommendation model can also be a recommendation model received from other devices. The model parameters of this first recommendation model are obtained by training based on n first training samples.
[0198] S3: Determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model.
[0199] like Figure 5 As shown, step S3 can be executed by the influence function module 530.
[0200] S4: Determine the weight corresponding to each first training sample based on the influence function value of each first training sample on the prediction loss of the second training set on the first recommendation model.
[0201] That is, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the prediction loss of m second training samples on the first recommendation model.
[0202] like Figure 5 As shown, step S4 can be executed by the weight adjustment module 540.
[0203] S5: Train the first recommendation model based on the first weighted training set to obtain the model parameters of the target recommendation model.
[0204] In other words, the first recommendation model is trained based on n first training samples and their weights to obtain the target recommendation model, or in other words, the model parameters of the target recommendation model are obtained.
[0205] like Figure 5 As shown, step S5 can be executed by the model training module 520.
[0206] For example, the recommendation model described above can be a low-rank model. For instance, the recommendation model can be a matrix factorization (MF) model, a factorization machine (FM), or an FFM model.
[0207] Recommendation phase:
[0208] During the recommendation phase, only the target recommendation model needs to be deployed. After receiving a recommendation request, the recommendation system inputs the target user's information and the information of the candidate recommendation objects into the target recommendation model. The target recommendation model then predicts the probability that the target user will perform an action on the candidate recommendation objects or whether the target user will perform an action on the candidate recommendation objects.
[0209] For example, the target user can be the user who triggered the recommendation request.
[0210] For example, a recommender system can construct an input vector based on feature information and use a target recommender model to predict the probability that a user will perform an action on a recommended object. The feature information includes information about the target user and information about the candidate recommended objects.
[0211] For a detailed description of the training phase described above, please refer to Method 600 below. For a detailed description of the recommendation phase described above, please refer to Method 700 below.
[0212] According to the method in this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the magnitude of the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample, thereby improving the accuracy of the recommendation model in predicting the second training sample. This can improve user experience, enhance user stickiness, attract more suppliers, and increase the revenue of the recommendation system.
[0213] The following is combined with Figures 6 to 12 The training method and recommendation method of the recommendation model in the embodiments of this application will be described.
[0214] Figure 6 This application illustrates a training method 600 for a recommendation model provided in an embodiment. Figure 6 The method shown can be executed by a training device for the recommendation model. This training device can be a cloud service device or a terminal device, such as a computer, server, or other device with sufficient computing power to execute the training method for the recommendation model. It can also be a system composed of a cloud service device and terminal devices. For example, method 600 can be executed by... Figure 3 Training equipment 120 or Figure 4 The execution device 210 or the local device executes the execution.
[0215] For example, method 600 can be specifically derived from, such as Figure 3 The training device 120 shown executes the method 600, and the first and second training samples in the method can be as follows: Figure 3The training data maintained in the database 130 shown.
[0216] Method 600 includes steps S610 to S640. Steps S610 to S640 are described in detail below.
[0217] S610, obtain the first recommendation model.
[0218] The parameters of the first recommendation model are obtained by training on n first training samples. The first training samples include information about the first user, information about the first recommended object, and sample labels for the first recommended samples. The sample labels of the first training samples are used to indicate whether the first user has performed an action on the first recommended object. n is an integer greater than 1.
[0219] It should be noted that the n first users in the n first training samples can be the same or different. Similarly, the n first recommendation objects in the n first training samples can be the same or different.
[0220] For example, in training sample 1# (an example from the first training sample), the first user is user A and the first recommended item is item A. In training sample 2# (an example from the first training sample), the first user is user B and the first recommended item is item A. Similarly, in training sample 1# (an example from the first training sample), the first user is user A and the first recommended item is item A. In training sample 2# (an example from the first training sample), the first user is user A and the first recommended item is item B.
[0221] User information can include user identifiers, such as user IDs. User information can also include personalized attributes such as gender, age, occupation, income, interests, and education level.
[0222] The information of the first user may include one or more of the information of the users mentioned above.
[0223] The recommended object refers to the object recommended by the recommendation system to the user. For example, the recommended object can be the recommended application in the application market of the terminal device in the aforementioned application scenario one; or, the recommended object can be the search term recommended by the system in the aforementioned application scenario two. It should be understood that the specific content of the recommended object may be different in different recommendation scenarios, and the embodiments of this application do not limit the specific content of the recommended object.
[0224] The first recommended object can be one of the recommended objects mentioned above.
[0225] The information about a recommendation object can include its identifier, such as its ID. It can also include attribute information, such as its name and type. These attribute information may differ depending on the recommendation scenario.
[0226] For example, in the aforementioned application scenario one, the recommended object can be an application in the app store, and the information of the recommended object can be the application's information. The application's information can include the application's identifier, such as the application's ID. The application's information can also include some attribute information of the application, such as the application's name, the application's developer, the application's type, the application's installation package size, the application's rating, or the application's reviews, etc.
[0227] For example, in content recommendation scenarios, the recommended object can be an article, and the information of the recommended object can be the type of article, the keywords of the article, the topic of the article, the comments of the article, or the presentation style of the article, etc.
[0228] For example, in an advertising recommendation scenario, the recommended object can be an advertisement, and the information of the recommended object can be the type of advertisement or the target audience of the advertisement, etc.
[0229] The information of the first recommended object may include one or more of the information of the recommended objects mentioned above.
[0230] The information of the first user and the information of the first recommended object can be used as the first feature information of the first training sample.
[0231] Furthermore, the first feature information also includes first contextual information. That is, the first training sample may also include first contextual information.
[0232] Contextual information can include state information related to the user's interaction with the recommended object. For example, the time of interaction between the user and the recommended object, the location of interaction, or the network used when the user interacts with the recommended object, such as 4G or Wi-Fi.
[0233] User interaction with recommended objects refers to whether the user performs any actions or not on the recommended objects.
[0234] The first context information may include one or more of the context information mentioned above.
[0235] Sample labels can be used to indicate whether a training sample is a positive or negative sample. For example, the label can be 0 or 1, with a positive sample labeled as 1 and a negative sample labeled as 0. Alternatively, the label can be a specific numerical value, representing the probability of a training sample being a positive or negative sample.
[0236] Sample labels can be obtained based on whether the user has taken any action on the recommended object.
[0237] User actions on recommended items can include clicking, downloading, purchasing, browsing, or leaving negative reviews.
[0238] Sample tags are used to indicate whether a user has performed an action on the recommended object. For example, determining sample tags based on whether a user has performed an action on the recommended object can include the following cases.
[0239] Scenario 1: If the user performs an action on the recommended object, the sample label is 1; if the user does not perform an action on the recommended object, the sample label is 0.
[0240] For example, in an app store recommendation scenario, this action can be a download. Specifically, when a user in training sample 1# (an example in the first training sample) downloads a recommended item from training sample 1#, then training sample 1# is a positive sample, and its sample label is 1; when a user in training sample 1# does not download a recommended item from training sample 1#, then training sample 1# is a negative sample, and its sample label is 0.
[0241] Scenario 2: If the user performs an action on the recommended object, the sample label is 0; if the user does not perform an action on the recommended object, the sample label is 1.
[0242] For example, in an app store recommendation scenario, this action can be a negative review. Specifically, when a user in training sample 1# (an example in the first training sample) gives a negative review to a recommended object in training sample 1#, then training sample 1# is a negative sample, and its sample label is 0; when a user in training sample 1# does not give a negative review to a recommended object in training sample 1#, then training sample 1# is a positive sample, and its sample label is 1.
[0243] Scenario 3: If the user performs a first type of action on the recommended object, the sample label is 1; if the user performs a second type of action on the recommended object, the sample label is 0.
[0244] For example, in the application scenario of paid music recommendation, the first type of operation action may include purchasing behavior, and the second type of operation action may include browsing behavior. Specifically, when a user in training sample 1# (an example in the first training sample) browses the recommended object in training sample 1#, then training sample 1# is a negative sample, and the sample label of training sample 1# is 0; when a user in training sample 1# purchases the recommended object in training sample 1#, then training sample 1# is a positive sample, and the sample label of training sample 1# is 1. It should be understood that the process of determining the sample label is only illustrated using purchasing behavior and browsing behavior as examples in this application embodiment, and should not be regarded as a limitation on the embodiment of this application. In practical applications, the sample label corresponding to the operation action can be determined according to the specific application scenario. For example, in some scenarios, the first type of operation action may include browsing behavior, and the second type of operation action may include negative review behavior, etc.
[0245] It should also be understood that the embodiments of this application only illustrate the process of determining sample tags using one type of operation (cases 1 and 2) and two types of operation (case 3) as examples, and should not be regarded as a limitation on the embodiments of this application. In practical applications, there may be more than two types of operation actions, and the sample tags corresponding to the operation actions can be determined according to the specific application scenario. For example, the first type of operation action is downloading, the second type of operation action is browsing, and the third type of operation action is giving a negative review. If a user only downloads the recommended object, the sample tag can be 1; if a user only browses the recommended object, the sample tag can be 0; if a user gives a negative review to the recommended object, the sample tag can be 0. For example, when a user both downloads and gives a negative review to the recommended object, the sample tag is 0.
[0246] The following example illustrates the training samples.
[0247] For example, in the application market scenario, the recommended object is the application. Training sample 1# (an example in the first training sample) can include four types of attribute data: user ID, user gender, user occupation, application ID, and application type. That is, the feature information of training sample 1# includes four features.
[0248] Taking training sample 1# as a positive sample as an example, this training sample 1# can be represented as z = [1, 28a85y62, male, teacher, 78ht1c9a, social]. The leading 1 indicates that the sample label of training sample 1# is 1. The sample label can indicate whether the user has downloaded the application; a sample label of 1 indicates that the user has downloaded the application.
[0249] For example, in the application scenario of ad recommendation, the recommendation object is an ad. Training sample 1# (an example in the first training sample) can include six types of attribute data from training sample 1#: user ID, ad ID, ad display category, ad provider, ad content category, and ad click-through rate. That is, the feature information of training sample 1# includes six features.
[0250] Taking training sample 1# as a positive sample as an example, the sample label of training sample 1# is 1. This training sample 1# can be represented as z = [1, 25c83c98, 68fd1e64, image, provider 1, news, 0.032]. The first 1 indicates that the sample label of training sample 1# is 1. The sample label can indicate whether the user has clicked on the advertisement. The sample label of 1 can indicate that the user clicked on the advertisement.
[0251] It should be understood that the above representation of training samples is only illustrative. In specific application scenarios, other forms of training samples may be used, or the above training samples may be further processed before being input into the recommendation model. This application does not limit this.
[0252] For example, the first training sample can be as follows: Figure 4 The data stored in the data storage system 250 shown or Figure 3 The data stored in database 130 shown.
[0253] For example, the first training sample may also be obtained in other ways. For example, the first training sample may be received from another device.
[0254] For example, the first training sample can also be obtained in the following ways.
[0255] The raw data is preprocessed and features are extracted to obtain training samples. These training samples can be the first training samples.
[0256] For example, this acquisition process can be performed by Figure 5 The feature engineering module 510 is executed. That is, the first dataset is input into the feature engineering module 510 for processing to obtain the first training set. This first training set includes n first training samples.
[0257] The first dataset includes raw data, such as user behavior logs. In this case, the first training set can be understood as being determined based on the user behavior logs; that is, the first training samples can be determined based on the user behavior logs.
[0258] Specifically, training samples can be obtained through the following steps.
[0259] Step (1): Perform data preprocessing on the raw data.
[0260] For example, data preprocessing can include data cleaning.
[0261] By filtering raw data (e.g., user behavior logs), only the necessary content can be retained or selected, such as selecting key fields.
[0262] Step (2): Extract features.
[0263] For example, features can be extracted through feature engineering.
[0264] Specifically, features from various dimensions in user behavior logs or preprocessed user behavior logs can be manually cross-referenced or selected to obtain the desired features.
[0265] For example, features can also be extracted using neural network models.
[0266] Specifically, features from various dimensions of user behavior logs or preprocessed user behavior logs can be input into a neural network model, which will then output the required features.
[0267] Step (3): Handle missing values.
[0268] Due to data splicing or lack of user feedback, some fields may be missing. Missing values can usually be filled by setting default values.
[0269] Step (4): Discretization.
[0270] Convert continuous features into discrete features, or group multiple categories into one category.
[0271] Discretization refers to the process of transforming or dividing continuous attributes, features, or variables into discrete or nominal attributes / features / variables / intervals. After feature discretization, the model becomes more stable, reducing the risk of overfitting.
[0272] For example, continuous features are transformed into discrete features through bucket discretization.
[0273] For example, in an ad recommendation scenario, ad click-through rate is a continuous feature, which can be transformed into a discrete feature through binning discretization.
[0274] For example, in an ad recommendation scenario, ad display categories include images, videos, or articles. Images and videos are categorized as visual, while articles are categorized as text.
[0275] Step (5): Assign a feature ID.
[0276] Assign a feature ID to each feature value.
[0277] For example, feature IDs can be assigned using either hash generation or auto-incrementing methods. See Method 900 below for a detailed description.
[0278] It should be understood that the order of the above steps is only a descriptive order and should not be regarded as the actual execution order. During the execution process, the steps can be executed in the above order or not. For example, step (3) can be executed first and then step (2), etc.
[0279] The first training sample can be obtained using the method described above.
[0280] For example, the first recommendation model can be a pre-stored or pre-trained model. For instance, the first recommendation model can be stored in a... Figure 4 The data storage system 250 shown is or Figure 3 In database 130 shown.
[0281] For example, the first recommendation model may also be obtained through other means. For instance, a first recommendation model received from another device.
[0282] For example, the first recommendation model can also be obtained in the following way. This acquisition process can also be understood as a training process. For instance, this training process can be performed by... Figure 5 The model training module 520 is executed. That is, the first training set is input into the model training module 520 to obtain the first recommendation model.
[0283] The recommendation model is trained based on n first training samples to obtain the first recommendation model, or in other words, the model parameters of the first recommendation model are obtained.
[0284] Specifically, the first recommendation model is trained by using the first feature information as input and the sample label of the first training sample as the target output value of the first recommendation model.
[0285] The first feature information includes information about the first user and information about the first recommended object. Furthermore, the first feature information may also include first contextual information.
[0286] Recommendation models can be used to predict whether a user will interact with a recommended item when it is suggested to them. The output value of the prediction model is the prediction label. This prediction label represents the prediction of whether the user will interact with the recommended item. For example, the prediction label can be 0 or 1, meaning 0 or 1 represents whether the user will interact with the recommended item. The prediction label can also be a probability value, representing the probability that the user will interact with the recommended item. In other words, the output of the recommendation model can be 0 or 1, or it can be a probability value. This application does not limit the specific form of the recommendation model's output value.
[0287] For example, the recommendation model in this application embodiment can be of various types. For instance, the recommendation model can be a relatively simple model such as the average CTR model for advertisements or the logistic regression (LR) model. Alternatively, the recommendation model can be a low-rank model such as a matrix factorization (MF) model, a factorization machine (FM), or field-aware factorization machines (FFM). Furthermore, the recommendation model can be a deep model such as deep FM or a deep neural network (DNN).
[0288] For example, the recommendation model can be built using a deep learning framework with automatic differentiation, such as TensorFlow or PyTorch.
[0289] The recommendation model includes a loss function, which indicates the difference between the predicted label of the first training sample and the sample label of the first training sample.
[0290] For example, the training process can involve continuously decreasing the value of the loss function until convergence, thereby obtaining the model parameters of the first recommendation model.
[0291] The first recommendation model can satisfy the following formula.
[0292]
[0293] Where w represents the model parameters, R(w) represents the regularization term, and λ represents the hyperparameter that determines the regularization term. i This represents the sample label of the i-th first training sample. Let represent the predicted label of the i-th first training sample, and n represent the number of first training samples. This represents the difference between the sample label of the i-th first training sample and the predicted label of the i-th first training sample.
[0294] S620, determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model.
[0295] The second training sample includes second feature information and sample labels. The second feature information includes: information about the second user and information about the second recommended object. The sample labels of the second training sample are used to indicate whether the second user has performed an action on the second recommended object. m is an integer greater than 1.
[0296] For example, step S620 can be performed by Figure 5 The influence function module 530 in the middle is executed.
[0297] It should be noted that the m second users in the m second training samples can be the same or different. Similarly, the m second recommendation objects in the m second training samples can be the same or different.
[0298] For example, in training sample 1# (an example from the second training sample), the second user is user A, and the second recommended item is item A. In training sample 2# (an example from the second training sample), the second user is user B, and the second recommended item is item A. Similarly, in training sample 1# (an example from the second training sample), the second user is user A, and the second recommended item is item A. In training sample 2# (an example from the second training sample), the second user is user A, and the second recommended item is item B.
[0299] It should also be understood that the first user and the second user can be the same or different. The first recommender and the second recommender can be the same or different.
[0300] The n first training samples may include some or all of the m second training samples, or they may not include the second training samples.
[0301] The information of the second user may include one or more of the user's attribute information described in step S610.
[0302] The second recommended object can be one of the recommended objects described in step S610.
[0303] The information of the second recommended object may include one or more of the information of the recommended object described in step S610.
[0304] The information of the second user and the information of the second recommended object can be used as the second feature information of the second training sample.
[0305] Furthermore, the second feature information also includes second contextual information. That is, the second training sample may also include second contextual information.
[0306] The second context information may include one or more of the context information described in step S610.
[0307] The description of the sample label for the second sample can be as described in step S610, and will not be repeated here.
[0308] For example, the second training sample can be as follows: Figure 4 The data stored in the data storage system 250 shown or Figure 3 The data stored in database 130 shown.
[0309] For example, the second training sample may also be obtained in other ways. For instance, a second training sample received from another device.
[0310] For example, a second training sample can also be obtained in the following ways.
[0311] The original data is preprocessed and features are extracted to obtain training samples. These training samples can be used as second training samples.
[0312] For example, this acquisition process can be performed by Figure 5 The feature engineering module 510 is executed. That is, the second dataset is input into the feature engineering module 510 for processing to obtain the second training set. This second training set includes m second training samples.
[0313] The second dataset includes the original data, for example, user behavior logs. In this case, the second training set can be understood as being determined based on the user behavior logs; that is, the second training samples can be determined based on the user behavior logs.
[0314] The specific method for obtaining the second training sample based on the original data can be found in the description of step S610, and will not be repeated here.
[0315] Optionally, the second training sample is an unbiased training sample. The first training sample can be a biased training sample. See Method 900 below for details.
[0316] Biased training samples can be understood as training samples obtained when recommended objects are displayed to users according to certain rules. For example, when a recommendation request is received, candidate recommended objects are sorted according to their expected income, and the recommended objects to be displayed to the user are determined according to the expected income. In other words, in this case, the probability of each recommended object being displayed to the user is different, with recommended objects with higher expected income having a higher probability of being displayed to the user. The training samples obtained in this case are biased training samples.
[0317] In unbiased training samples, recommended objects have equal exposure probabilities and are displayed in consistent locations. In other words, unbiased training samples are obtained when all candidate recommended objects in the set have the same probability of being displayed. When the recommendation system has more than one display location, unbiased training samples are obtained when all candidate recommended objects in the set have the same probability of being displayed and are displayed in the same location.
[0318] For example, unbiased training samples are obtained through a random distribution strategy.
[0319] Random delivery strategy refers to a delivery strategy that presents candidate recommendation objects from a set of candidate recommendation objects to the user in a random manner. In random delivery, each candidate recommendation object has an equal probability of being recommended to the user, resulting in unbiased training samples.
[0320] For example, unbiased training samples are obtained when users actively search for candidate recommendations. In this case, users interact not based on displayed recommendations, but by actively engaging with the platform. Therefore, for the user, all candidate recommendations in the set have the same probability of being shown to them, regardless of whether they are actually displayed. In other words, all candidate recommendations in the set are shown to the user with equal probability.
[0321] Optionally, the m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
[0322] Optionally, the m second training samples are obtained when candidate recommendation objects in the candidate recommendation object set are randomly shown to a second user.
[0323] Alternatively, the m second training samples are obtained when the second user searches for the second recommended object.
[0324] The following explanation uses the example of recommended applications in the app store to illustrate the difference between unbiased and biased training samples.
[0325] For a single recommendation request, an application can be displayed using a random delivery strategy. This means that one or more candidate applications from multiple options are randomly shown to the user corresponding to the recommendation request, with each candidate application having an equal probability of being shown to the user. In this case, the training samples obtained are unbiased. Alternatively, for a single recommendation request, multiple candidate applications can be sorted according to their expected revenue, and the application shown to the user can be determined based on this sorting. In this case, the training samples obtained are biased.
[0326] When a user actively searches for an application in an app store, the training samples obtained in this case are unbiased training samples. For example, this user can act as a second user, and the application actively searched by the user can serve as a second recommendation.
[0327] Optionally, the first training sample is acquired earlier than the second training sample. See Method 1000 below for details.
[0328] Optionally, the first training sample can be determined based on data from the target domain, and the second training sample can be determined based on data from the source domain. See Method 1100 below for details.
[0329] The validation loss of m second training samples on the first recommendation model refers to the difference between the predicted labels of the m second training samples obtained by processing them using the first recommendation model and the actual sample labels of the m second training samples. For ease of description, the validation loss of m second training samples on the first recommendation model is simply referred to as the validation loss, and the influence function value of the first training sample on the validation loss of m second training samples on the first recommendation model is simply referred to as the influence function value of the first training sample on the validation loss.
[0330] The influence function value is obtained by perturbing the first training sample and evaluating the impact of the perturbed first recommendation model on the validation loss.
[0331] This method allows us to determine the importance of the first training sample to the validation loss. The closer the data distribution of the first training sample is to the data distribution of the second training sample, the more important the first training sample is to the validation loss, and the smaller the influence function value of the first training sample.
[0332] Specifically, the influence on the function value satisfies the following formula.
[0333]
[0334] Among them, z i Let φ(z) represent the i-th first training sample. i) represents the influence function value of the i-th first training sample on the prediction loss of m second training samples in the first recommendation model, which is also the influence function value of the i-th first training sample on the validation loss of all second training samples in the first recommendation model. j Let φ(z) represent the j-th second training sample. i ,z j Let represent the influence function value of the i-th first training sample on the validation loss of the j-th second training sample in the first recommendation model. The validation loss of the j-th second training sample refers to the difference between the predicted label obtained by inputting the j-th second training sample into the first recommendation model and the sample label of the j-th second training sample. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on the given surface, where the superscript T indicates that the transpose of the matrix is being calculated. The Hessian matrix of all first training samples represents the inverse of the Hessian matrix of all first training samples in the first recommendation model. The average of the second derivatives on, specifically,
[0335] For example, the value of the influence function can be calculated through the following steps.
[0336] Step (1): Calculate all second training samples in the first recommendation model The gradient on the first recommendation model is used to obtain all the second training samples. The sum of gradients on
[0337] Step (2): Calculate the Hessian matrix for all first training samples.
[0338] The inverse of the Hessian matrix is usually approximated by the implicit Hessian-vector products (HVP), without the need to explicitly compute the Hessian matrix. For example, the inverse of the Hessian matrix can be solved using the conjugate gradients (CG) method or stochastic estimation.
[0339] Step (3): Multiply the inverse of the matrix obtained in step (1) with the inverse of the Hessian matrix obtained in step (2) to obtain the left half of the influence function IF. L The left half of the influence function value is the same for all the first training samples, so this part only needs to be calculated once.
[0340] Step (4): Calculate the influence function value for each first training sample. Specifically, the IF function value from step (3) is calculated. L Each of the first training samples is used in the first recommendation model. Multiplying the gradients on each sample yields the influence function value for each first training sample.
[0341] It should be understood that the above calculation process is only an example, and the influence function value of the first training sample can also be calculated in other ways. This application does not limit this.
[0342] S630, adjust the weights corresponding to each first training sample based on the influence function value of the validation loss of each first training sample on m second training samples in the first prediction model.
[0343] For example, step S630 can be performed by Figure 5 The weight adjustment module 540 in the middle is executed.
[0344] As mentioned earlier, the closer the distribution of the first training sample is to the distribution of the second training sample, the smaller the influence function value of the first training sample. Furthermore, the closer the distribution of the first training sample is to the distribution of the second training sample, the more important the first training sample is for predicting the loss. Therefore, assigning greater weights to important first training samples can cause the distribution of all first training samples to align with the distribution of the second training samples.
[0345] For example, the weights can satisfy the following formula.
[0346]
[0347] Where, π i π represents the weight corresponding to the i-th first training sample. i =1+nε i , π i ∈[0,B], where B represents the maximum value of the weight, ε i This represents the perturbation value for the i-th first training sample. Let n be the set of weights corresponding to the first training samples.
[0348] Theoretically, this method is the optimal weight calculation method. However, according to convex optimization theory, this method does not satisfy the convex optimization condition of Lipschitz continuousness, and using this method to determine weights is prone to overfitting during training.
[0349] Optionally, the weight corresponding to the first training sample is negatively correlated with the influence function value of the first training sample on the validation loss. That is, the larger the influence function value of the first training sample on the prediction loss, the smaller the weight corresponding to the first training sample.
[0350] Optionally, the weights satisfy the following formula.
[0351]
[0352] Where α represents the weighting coefficient, max() represents finding the maximum value of the operation object, and min() represents finding the minimum value of the operation object. The operation object {φ(z) i )} represents the set of influence function values of the n first training samples on the validation loss of the m second training samples on the first recommendation model, and this part can be used to unify the scale.
[0353] This weight calculation method uses the sigmoid function to calculate the weight value, which satisfies both the convex optimization condition and the monotonic mapping. The weights obtained by this method can make the trained recommendation model more accurate.
[0354] It should be noted that the above method for calculating weight values using the sigmoid function is only an example. Other methods that can satisfy the convex optimization condition and the monotonic mapping can also be used to calculate weight values, such as the linear mapping method.
[0355] S640, train the first recommendation model based on n first training samples and the weights corresponding to the n first training samples, and obtain the target recommendation model.
[0356] For example, step S640 can be performed by Figure 5 The model training module 520 in the middle is executed.
[0357] The training samples consisting of n first training samples and the weights corresponding to the n first training samples are the weighted n first training samples.
[0358] like Figure 5 As shown, the weights corresponding to the first training set and the first training samples are used to obtain the weighted first training set, which includes n weighted first training samples.
[0359] For specific training methods, please refer to the description in step S610 above.
[0360] The recommendation model includes a loss function, which indicates the difference between the predicted label of the first training sample and the sample label of the first training sample.
[0361] For example, the training process in step S640 can be to continuously reduce the sum of the loss function values corresponding to all weighted first training samples until convergence, thereby obtaining the model parameters of the target recommendation model. That is, by adjusting the weights corresponding to the first training samples, the proportion of the loss function value of the first training sample in the sum of all loss function values is adjusted.
[0362] The target recommendation model can satisfy the following formula.
[0363]
[0364] Where w represents the model parameters, R(w) represents the regularization term, and λ represents the hyperparameter that determines the regularization term. i This represents the sample label of the i-th first training sample. Let represent the predicted label of the i-th first training sample, and n represent the number of first training samples. π represents the difference between the sample label of the i-th first training sample and the predicted label of the i-th first training sample. i This represents the weight corresponding to the i-th first training sample.
[0365] According to the method in this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the magnitude of the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample, thereby improving the accuracy of the recommendation model in predicting the second training sample. This can improve user experience, enhance user stickiness, attract more suppliers, and increase the revenue of the recommendation system.
[0366] Figure 7 A schematic diagram of the recommended method 700 provided in an embodiment of this application is shown. Figure 7 The method shown can be executed by a recommended device, which can be a cloud service device or a terminal device, such as a computer, server, or other device with sufficient computing power to execute the recommended method, or a system composed of a cloud service device and a terminal device. For example, method 700 can be executed by... Figure 3 The execution device 110 or Figure 4 The execution device 210 or the local device executes the execution.
[0367] For example, method 700 can be specifically derived from, such as Figure 3 The execution device 110 shown executes the method 700, where the target user and candidate recommendation objects can be as follows: Figure 3 The data input to I / O interface 112 shown.
[0368] Method 700 includes steps S710 and S720. Steps S710 to S720 are described in detail below.
[0369] S710, obtains information about the target user and the candidate recommended objects.
[0370] For example, when a user enters the recommendation system, a recommendation request is triggered. The recommendation system can then designate the user who triggered the request as the target user and select potential recommendations from the system's available content for display.
[0371] For example, the target user's information may include the user's identifier, such as the target user ID. The target user's information may also include some personalized attribute information of the user, such as the target user's gender, age, occupation, income, hobbies, or education.
[0372] For example, the information of a candidate recommendation object may include its identifier, such as its ID. The information may also include some attribute information, such as its name or type.
[0373] S720: Input the target user's information and the information of the candidate recommended objects into the recommendation model to predict the probability that the target user will perform an action on the candidate recommended objects.
[0374] For example, candidate recommendation objects in a candidate recommendation set can be ranked by predicting the probability that the target user will perform an action on the candidate recommendation object, thereby obtaining the recommendation result. For instance, the candidate recommendation object with the highest probability can be selected and displayed to the user. For example, the candidate recommendation object could be a candidate recommendation application.
[0375] like Figure 8 As shown, Figure 8 The image shows the "Recommended" page in an app store. This page can display multiple lists, such as featured apps and featured games. Taking featured games as an example, the app store's recommendation system predicts the probability that a user will download (install) a candidate recommended app based on user information and information about the candidate recommended apps. It then ranks the candidate recommended apps in descending order based on this probability, placing the app most likely to be downloaded at the top.
[0376] For example, the recommended results in the featured apps section could be: App 5 in the first recommended position in the featured games section, App 6 in the second recommended position, App 7 in the third recommended position, and App 8 in the fourth recommended position. After seeing the recommended results in the app store, users can perform actions based on their interests, and these actions will be stored in the user behavior log.
[0377] Figure 8 The application market shown can obtain training data from user behavior logs to train recommendation models.
[0378] It should be understood that the above examples are provided to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of this application to the specific values or scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of this application.
[0379] The recommendation model can be the target recommendation model trained using method 600, which will not be elaborated here.
[0380] The model parameters of the recommendation model are obtained by training the first recommendation model based on n first training samples and the weights corresponding to the n first training samples. The first recommendation model is trained based on the above n first training samples. The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model.
[0381] The first training sample includes information about the first user, information about the first recommended object, and sample labels for the first training sample. The sample labels for the first training sample are used to indicate whether the first user has performed an action on the first recommended object, where n is an integer greater than 1.
[0382] The second training sample includes information about the second user and the second recommended object, as well as sample labels for the second training sample. The sample labels for the second training sample are used to indicate whether the second user has performed an action on the second recommended object, where m is an integer greater than 1.
[0383] Optionally, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including:
[0384] The weight corresponding to each first training sample is negatively correlated with the value of the function that influences the validation loss of each first training sample on the m second training samples in the first recommendation model.
[0385] Optionally, the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model satisfies the following formula:
[0386]
[0387] Among them, z i Let φ(z) represent the i-th first training sample. i z represents the influence function value of the i-th first training sample on the prediction loss of m second training samples in the first recommendation model. j Let φ(z) represent the j-th second training sample. i ,z j () represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
[0388] Optionally, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including that the weight corresponding to each first training sample satisfies the following formula:
[0389]
[0390] Where, π i Let φ(z) represent the weights corresponding to the i-th first training sample, α represent the weighting coefficients, and {φ(z)} i Let} represent the set of function values that influence the validation loss of n first training samples on m second training samples on the first recommendation model.
[0391] Optionally, the m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
[0392] Optionally, the m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, including:
[0393] The m second training samples are obtained when candidate recommendation objects in the candidate recommendation object set are randomly displayed to the second user; or the m second training samples are obtained when the second user searches for the second recommendation object.
[0394] Optionally, m second training samples belong to the source domain, and n first training samples belong to the target domain.
[0395] Method 600 can be understood as the training phase of this recommendation model (e.g.) Figure 3 The training device 120 shown is executing the phase where the specific training is performed using the recommendation model provided in method 600; while method 700 can be understood as the application phase of this recommendation model (e.g., ...). Figure 3 The execution phase of the execution device 110 shown can be specifically manifested as using the recommendation model trained by method 600, and obtaining the output result based on the information of the target user and the information of the candidate recommendation objects, that is, the probability that the target user has an operation on the candidate recommendation objects.
[0396] The following three examples (Example 1, Example 2, and Example 3) illustrate the application of the solutions of the embodiments of this application to different scenarios. It should be understood that the training method of the recommendation model described below can be regarded as a specific implementation of method 600, and the recommendation method described below can be regarded as a specific implementation of method 700. In order to avoid unnecessary repetition, repeated descriptions will be appropriately omitted when introducing the three examples of the embodiments of this application.
[0397] Example 1:
[0398] like Figure 9 As shown, for each recommendation request, the recommendation system typically needs to perform multiple processes based on the user profile, such as recall, fine-tuning, or manual rules, on all items in the full database to generate the final recommendation result, which is then displayed to the user. The number of items recommended to the user is far less than the total number of items, introducing various bias problems in this process, such as position bias and selection bias.
[0399] A user profile is a set of tags representing a user's personalized preferences. For example, a user profile can be generated from a user's interaction history.
[0400] Selection bias refers to the bias in the collected data caused by the different probabilities of items being displayed. Ideally, training data would be obtained by showing items to users with equal display probabilities. In reality, due to the limited number of display slots, it is impossible to display all items. Recommendation systems typically recommend items to users based on predicted user selection rates. Users can only interact with displayed items; items that are not displayed cannot be selected, meaning they cannot participate in interaction. This results in unequal display opportunities for items. Throughout the recommendation process, including stages such as recall and ranking, truncation operations occur, where a subset of recommended items is selected for display from the candidate pool.
[0401] Position bias refers to the skewness of data collection caused by the different display positions of items. Recommendation systems typically display recommendations in order from top to bottom or left to right. According to people's browsing habits, items at the top are more easily seen and have a higher selection rate. For example, in an app store ranking list, the same application (APP) can be displayed either first or last. Random placement strategies can verify that the download rate of the APP displayed first is significantly higher than that displayed last. Figure 9 As shown, the execution of the fine sorting process causes differences in the display positions of items, thus introducing positional bias.
[0402] Due to the bias problem, items with more display opportunities are more likely to be selected by users. The higher the probability of selection, the more likely the item is to be recommended to the user in subsequent recommendations, thus gaining more display opportunities and being clicked by other users. This exacerbates the bias problem, creating a Matthew effect and intensifying the long-tail problem. The long-tail problem means that the vast majority of niche personalized needs cannot be met, impacting user experience. Furthermore, many items in the recommendation system, lacking exposure, fail to generate actual commercial value, wasting storage and computing resources.
[0403] This application proposes a training method for a recommendation model and a recommendation method, which can reduce the impact of bias problems on recommendation results and improve the accuracy of the recommendation model.
[0404] This training method 900 can be considered a specific implementation of method 600. To avoid unnecessary repetition, repeated descriptions will be omitted when introducing this training method 900 below. This training method 900 includes steps S910 to S950. Steps S910 to S950 will be described below.
[0405] S910, obtain n first training samples and m second training samples.
[0406] The first training sample includes information about the first user, information about the first recommended object, and sample labels for the first training sample. The sample labels of the first training sample are used to indicate whether the first user has performed an action on the first recommended object. n is an integer greater than 1.
[0407] The second training sample includes information about the second user and the second recommended object, as well as sample labels for the second training sample. The sample labels of the second training sample are used to indicate whether the second user has performed an action on the second recommended object. m is an integer greater than 1.
[0408] Furthermore, the first training sample may also include first contextual information. The second training sample may also include second contextual information.
[0409] The second training sample is a training sample without bias.
[0410] Specifically, the second training sample can be obtained when candidate recommended objects in the candidate recommended object set are shown to the second user with the same probability.
[0411] For example, the second training sample could be obtained using a random distribution strategy.
[0412] Random delivery strategy refers to a delivery strategy that presents candidate recommendation objects from a set of candidate recommendation objects to the user in a random manner. In this case, each recommendation object has an equal probability of being recommended to the user, and the training samples obtained according to the random delivery strategy are unbiased training samples.
[0413] For example, the second training sample can be obtained when the user actively searches for it.
[0414] When a user initiates a search, all candidate recommended objects in the candidate recommendation set have the same probability of being shown to the user, regardless of whether they are actually displayed. In other words, they are shown to the user with the same probability.
[0415] It should be noted that step S910 is an optional step. For a detailed description of this step, please refer to step S610 in method 600. It will not be repeated here.
[0416] The following example, using an advertising recommendation scenario, illustrates one way to obtain training samples in step S910.
[0417] Table 1 shows the data obtained based on user interaction history (e.g., user behavior logs) in the advertising recommendation scenario.
[0418] Table 1
[0419] 1 25c83c98 68fd1e64 picture Provider No. 1 news 0.032 0 efea433b 0b153874 video Provider No. 2 entertainment 0.017 … … … … … … …
[0420] Each row in Table 1 represents a training sample. Taking this training sample as the first training sample as an example, the first training sample includes information about the first user and the first recommended object. The first user's information includes the user's ID, and the first recommended object is an advertisement. The information of the first recommended object includes the first recommended object's ID, the first recommended object's display category, the first recommended object's advertisement provider, the first recommended object's advertisement content category, and the first recommended object's advertisement click-through rate. In other words, the first training sample includes a total of 6 types of features.
[0421] It should be understood that Table 1 is for illustrative purposes only, and the information of users and recommended objects may include more or fewer items than those in Table 1, or more or fewer class feature information.
[0422] As mentioned earlier, the second training sample is an unbiased training sample. For example, if the second training sample is obtained based on user behavior logs, these user behavior logs could be obtained through a random delivery strategy or by users actively searching.
[0423] For example, the specific process of obtaining training samples includes steps S911 to S912. Both the first training sample and the second training sample can be obtained in this manner.
[0424] The original data is formatted to obtain data in a uniform format, which is then used as training samples.
[0425] S911 discretizes continuous features.
[0426] For example, feature discretization can be performed using a bucket discretization method.
[0427] Taking the ad click-through rate in Table 1 as an example, the ad click-through rate is a continuous feature. After discretizing it by binning, we get the discretized features, as shown in Table 2.
[0428] Table 2
[0429] 18 7 …
[0430] S912 assigns a feature ID to each feature.
[0431] For example, feature IDs can be assigned by generating hash values or by using an auto-incrementing method.
[0432] For example, the feature ID of the ad display category can be assigned in an auto-incrementing manner. In Table 1, the feature ID of the ad display category in the first training sample is 10, and the feature ID of the ad display category in the second training sample is 20.
[0433] Assigning feature IDs by generating hashes means mapping each feature to a hash value, as shown in Table 3.
[0434] Table 3
[0435] 1 91687 6150 60736 19822 70404 93221 0 71431 57276 31344 32068 34632 47800 … … … … … … …
[0436] Furthermore, the data obtained in step S912 can be stored in a uniform format.
[0437] For example, the data obtained in step S912 is stored in libSVM format. This allows the fields encoded by the feature ID to be stored in a more compact manner.
[0438] For example, it can be stored in the following format. 1 91687:1 6150:1 60736:1 19822:1 70404:1 93221:1 0 71431:1 57276:1 31344:1 32068:1 34632:1 47800:1
[0441] …;
[0442] In this context, a 1 following the feature ID indicates that the value exists, or that the feature value is determined based on the user's interaction history. If the feature ID is followed by 0, it indicates that the feature value is missing. For example, during data collection, some feature values may be missing. In this case, the feature ID can be a default value.
[0443] The training samples are obtained by dividing the above data into two parts: the feature part and the label part.
[0444] For example, as shown in Table 4. The feature part represents user information and recommendation object information. The label part consists of the sample labels for the training samples.
[0445] Table 4
[0446]
[0447] For example, a portion of the data obtained in step S911 can be sampled to obtain data for n first training samples, that is, the amount of data obtained in step S911 is greater than n.
[0448] Alternatively, all the data obtained in step S911 can be used as the data for obtaining n first training samples, that is, the amount of data obtained in step S911 is n.
[0449] It should be understood that the above representation of training samples is only illustrative. In specific application scenarios, other forms of training samples may be used, or the above training samples may be further processed before being input into the recommendation model. This application does not limit this.
[0450] S920, based on n first training samples, is used to train and obtain the first recommendation model.
[0451] Specifically, the first feature information is used as the input to the first recommendation model, and the sample label of the first training sample is used as the target output value of the first recommendation model for training, so as to obtain the model parameters of the first recommendation model.
[0452] It should be noted that step S920 is an optional step. For a detailed description, please refer to step S610 in method 600. It will not be repeated here.
[0453] The following uses an advertising recommendation scenario as an example to illustrate one implementation method of step S920.
[0454] The first feature information is the feature part in the aforementioned advertising recommendation scenario, and the sample label of the first training sample is the label part in the aforementioned advertising recommendation scenario.
[0455] For example, the specific process of step S920 includes steps S921 to S923.
[0456] S921, the first feature information is input into the first recommendation model to obtain the predicted label through forward derivation.
[0457] For example, the first recommendation model is a logistic regression model, and the forward derivation yields predicted labels that satisfy the following formula.
[0458] P ctr =w 91687 +w 6150 +w 60736 +w 19822 +w 70404 +w 93221 +b;
[0459] Among them, P ctr Indicates the predicted label, for example, P ctr w represents the click probability predicted by the logistic regression model. x This represents the weights corresponding to feature x, for example, w. 91687 represents the weight corresponding to the feature with feature ID 91687, and b represents the bias term of the logistic regression model.
[0460] S922, calculate the loss function value between the predicted label of the first training sample and the sample label of the first training sample, and update the parameters of the recommendation model based on the back gradient of the loss function value.
[0461] For example, the loss function can be logloss.
[0462] For example, the first recommendation model is a logistic regression model, and the loss function value (loss) satisfies the following formula.
[0463] loss = logP ctr +log(1-Pctr );
[0464] S923, verify the prediction accuracy of the updated recommendation model on the validation set, and repeat steps S921 to S923 until the first iteration termination condition is met.
[0465] For example, the termination condition for the first iteration can be that the improvement rate of the prediction accuracy of the recommendation model is less than a set threshold. That is, repeat steps 21) to 23) until the accuracy of the recommendation model no longer improves or no longer improves significantly, and obtain the model parameters of the first recommendation model.
[0466] For example, prediction accuracy can be evaluated using the area under the ROC curve (AUC).
[0467] For example, the validation set may include m second training samples. That is, the prediction accuracy of the recommendation model can be evaluated based on the m second training samples.
[0468] In this case, the n first training samples can be understood as the data in the training set, and the m second training samples can be understood as the data in the validation set.
[0469] S930, determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The validation loss of m second training samples on the first recommendation model refers to the difference between the predicted labels of the m second training samples obtained by processing the m second training samples through the first recommendation model and the sample labels of the m second training samples.
[0470] Step S930 corresponds to step S620 in the aforementioned method 600. For a detailed description, please refer to step S620, which will not be repeated here.
[0471] S940, determine the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss.
[0472] Step S940 corresponds to step S630 in the aforementioned method 600. For a detailed description, please refer to step S630, which will not be repeated here.
[0473] For example, the weights corresponding to the n first training samples are determined based on the sigmoid function. Taking the aforementioned ad recommendation scenario as an example, the weights of the first training samples can be concatenated with the weights of the first training samples to obtain the weighted first training samples. The weights corresponding to the two training samples in Table 4 are shown in Table 5.
[0474] Table 5
[0475]
[0476] S950, the first recommendation model is trained based on n first training samples and the weights corresponding to the n first training samples to obtain the model parameters of the target recommendation model.
[0477] That is, the first recommendation model is trained based on the first training sample with weights to obtain the model parameters of the target recommendation model.
[0478] Step S950 corresponds to step S640 in the aforementioned method 600. For a detailed description, please refer to step S640, which will not be repeated here.
[0479] Taking the aforementioned advertising recommendation scenario as an example, the first recommendation model is trained using the training samples in Table 5. For instance, the first recommendation model is a logistic regression model, and its loss function is a weighted loss function.
[0480] For the first training sample in Table 5, the loss function value (loss) satisfies the following formula.
[0481] loss = 0.49 * (logP) ctr +log(1-P ctr ));
[0482] The parameters of the recommendation model are updated using the backpropagation gradient based on the loss function value until the second iteration termination condition is met. For example, the second iteration termination condition can be that the improvement rate of the recommendation model's prediction accuracy is less than a set threshold. For specific training methods, please refer to step S920.
[0483] According to the scheme of this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the magnitude of the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample. Since the second training sample is an unbiased training sample, adjusting the weight of the first training sample based on the second training sample can make the recommendation model more accurately fit the unbiased data distribution, reduce the impact of bias on training, mitigate the Matthew effect, and improve the accuracy of the recommendation model. The scheme of this application embodiment corrects the data distribution of the observed samples based on a counterfactual method, enhancing the diversity of recommendation results, breaking the cocoon effect, improving user experience, increasing user stickiness, allowing users to immerse themselves in the recommendation system for a longer period, promoting a virtuous cycle of the recommendation system, increasing supplier revenue, attracting more suppliers to join, and ensuring the long-term stable development of the recommendation system.
[0484] Furthermore, during training, only a small number of second training samples are needed to mitigate the impact of the bias problem, improve the accuracy of the recommendation model, avoid the large-scale random display of recommended objects due to the large-scale collection of second training samples, which would lead to a decrease in the overall revenue of the system, and also avoid the need for a large number of features for training, which would reduce training efficiency.
[0485] The target recommendation model obtained by method 600 can be used to predict the probability that a user will perform an action on a recommended object, that is, to predict the probability that a user will select that recommended object. The recommendation system can then determine the recommendation results to be displayed to the user based on the output of this target recommendation model.
[0486] This application proposes a recommendation method, wherein the recommendation model used in the recommendation method can be the target recommendation model trained by method 900.
[0487] The recommended method includes the following steps.
[0488] Step S1: Obtain information about the target user and the candidate recommended objects.
[0489] This step corresponds to step S710 in the aforementioned method 700. For a detailed description, please refer to step S710, which will not be repeated here.
[0490] Taking the aforementioned advertising recommendation scenario as an example, the raw data can be processed in the manner described in step S910 to obtain features that can be input into the recommendation model, namely, the information of the target user and the information of the candidate recommendation objects.
[0491] For example, the feature ID can be obtained by looking up the feature table. 24387:1 3215:1 9736:1 38274:1 28304:1 92472:1;
[0493] Step S2: Input the target user's information and the information of the candidate recommended objects into the recommendation model for processing, and predict the probability that the target user will select the candidate recommended object.
[0494] This step corresponds to step S720 in the aforementioned method 700. For a detailed description, please refer to step S720, which will not be repeated here.
[0495] Taking the aforementioned advertising recommendation scenario as an example, the feature ID can be input into the recommendation model for forward inference to obtain the predicted probability. For example, the recommendation model is the target recommendation model obtained in step S950 above. The predicted probability P... ctr Satisfy the following formula:
[0496] P ctr =w 24387 +w 3215 +w 9376 +w 38274 +w 28304 +w 92472 +b;
[0497] The recommendation models trained using existing methods and those proposed in this application were tested on public datasets and native advertising datasets using two metrics: negative logarithmic loss (NLL) and the area under the ROC curve (AUC). The accuracy of the recommendation model in this application is improved by more than 0.3% in AUC compared to existing methods. Based on practical experience, this improvement can increase click-through rate / conversion rate by more than 10%.
[0498] Example 2:
[0499] Recommendation models learn user preferences from their interaction history, predict the probability of a user selecting a recommended item, and then recommend relevant content. To improve prediction accuracy, a large amount of historical user interaction data is needed to train the model. However, because human habits and preferences can change over time, past user interaction history data is biased relative to current data, meaning there is a data distribution shift. Recommendation models trained on past interaction history data cannot learn current user preferences, leading to reduced prediction accuracy. Conversely, current historical user interaction data is limited and insufficient to meet the training requirements of recommendation models. For example, a recommendation model trained on a large amount of offline data might be used for online predictions. Since offline data is biased relative to online data, the recommendation model is also biased, resulting in poor online prediction results.
[0500] Therefore, improving the prediction accuracy of recommendation models has become an urgent problem to be solved.
[0501] This application proposes a training method for a recommendation model that can reduce the impact of data distribution drift on the training results of the recommendation model and improve the accuracy of the recommendation model.
[0502] This training method 1000 can be considered a specific implementation of method 600. To avoid unnecessary repetition, repeated descriptions will be omitted when introducing this training method 1000 below. This training method 1000 includes steps S1010 to S1050. Steps S1010 to S1050 will be described below.
[0503] It should be understood that the specific implementation process of Method 1000 can also refer to the aforementioned Method 900. The difference between Method 1000 and Method 900 lies in the difference between the first training sample and the second training sample. In Method 1000, the acquisition time of the first training sample is earlier than the acquisition time of the second training sample. For example, the first training sample is determined based on the first user interaction history data, and the second training sample is determined based on the second user interaction history data. The acquisition time of the first user interaction history data is earlier than the acquisition time of the second user interaction history data.
[0504] S1010, obtain the first recommendation model.
[0505] The parameters of the first recommendation model are obtained by training on n first training samples. The first training samples include information about the first user, information about the first recommended object, and sample labels for the first recommended samples. The sample labels of the first training samples are used to indicate whether the first user has performed an action on the first recommended object. n is an integer greater than 1.
[0506] Step S1010 corresponds to step S610 in the aforementioned method 600. For a detailed description, please refer to step S610 above. It will not be repeated here.
[0507] For example, a recommendation model can typically be trained on a large amount of offline data to learn user preferences, and then the trained recommendation model can be used for online prediction.
[0508] For example, the n first training samples could be obtained based on a large amount of offline data. This offline data could be user behavior logs.
[0509] S1020, obtain m second training samples.
[0510] The second training sample includes second feature information and sample labels. The second feature information includes: information about the second user and information about the second recommended object. The sample labels of the second training sample are used to indicate whether the second user has performed an action on the second recommended object. m is an integer greater than 1.
[0511] For example, the second training sample could be obtained based on recently acquired data. That is, the data used to determine the second training sample was collected later than the data used to determine the first training sample.
[0512] For example, a trained recommendation model can be used for online prediction, and the second training sample can be obtained from user behavior logs in the period most recently before the time when the recommendation model was put into online testing.
[0513] For a detailed description of step S1020, please refer to the description of step S620 above, which will not be repeated here.
[0514] S1030, determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model.
[0515] Step S930 corresponds to step S620 in the aforementioned method 600. For a detailed description, please refer to step S620, which will not be repeated here.
[0516] S1040, determine the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss.
[0517] Step S1040 corresponds to step S630 in the aforementioned method 600. For a detailed description, please refer to step S630, which will not be repeated here.
[0518] For example, the sigmoid function is used to determine the weights corresponding to each first training sample.
[0519] S1050, the first recommendation model is trained based on n first training samples and the weights corresponding to the n first training samples to obtain the model parameters of the target recommendation model.
[0520] Step S1050 corresponds to step S640 in the aforementioned method 600. For a detailed description, please refer to step S640, which will not be repeated here.
[0521] According to the scheme of this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample. Since the second training sample is acquired later than the first training sample, it better reflects the user's recent preferences. Adjusting the weight of the first training sample based on the second training sample allows the recommendation model to more accurately learn the user's current preferences, reducing the impact of data drift caused by changes in user preferences on training and improving the accuracy of the recommendation model. The scheme of this application embodiment enhances the diversity of recommendation results, breaks the cocoon effect, adapts to the user's interests at different stages, improves the user experience, enhances user stickiness, allows users to immerse themselves in the recommendation system for a longer period, promotes a virtuous cycle of the recommendation system, increases supplier revenue, attracts more suppliers to join, and ensures the long-term stable development of the recommendation system.
[0522] Furthermore, during training, only a small number of second training samples are needed to mitigate the impact of the bias problem, allowing for continuous adjustment of the recommendation model and improvement of its accuracy.
[0523] Example 3:
[0524] Lifelong learning projects refer to projects that, based on users' historical data in multiple fields such as video, music, and news, use various models and algorithms to mimic the mechanisms of the human brain, build a cognitive brain, and achieve the goal of lifelong learning.
[0525] Figure 10 The diagram illustrates a lifelong learning framework. This framework includes multiple recommendation scenarios such as video apps, reading apps, and browser apps. Traditional recommendation learning schemes learn the hidden patterns in users' historical behavior within each recommendation scenario or domain, and then make recommendations based on these learned patterns. The entire learning and implementation process completely disregards knowledge transfer and sharing between domains.
[0526] However, in the early stages of launching a new recommendation scenario, users' interaction history is scarce. If the recommendation model is learned solely from the interaction history of the local domain, it is difficult to discover the hidden patterns in the user's historical behavior, which leads to inaccurate prediction results. In other words, there is a cold start problem in the new recommendation scenario.
[0527] Cross-domain recommendation is a recommendation method that learns user preferences in the source domain and applies them to the target domain. It leverages patterns learned in the source domain to guide recommendation results in the target domain, achieving knowledge transfer and sharing between domains and solving the cold start problem.
[0528] For example, by predicting a user's preferences for music and videos based on their reading habits in a reading app's recommendation context, the cold start problem for that user in a music app's recommendation context can be solved.
[0529] like Figure 11 As shown, in the recommendation scenario of a reading app, books are recommended to user A. Based on user A's interaction history data, user A's interests and preferences in the reading app's recommendation scenario can be learned. Based on user A's interests and preferences in the reading app's recommendation scenario, neighboring users with the same interests as user A can be identified. In the recommendation scenario of a music app, music is recommended to user A. Based on the interaction history data of neighboring users in the music app's recommendation scenario, the interests and preferences of neighboring users in the music app's recommendation scenario can be learned. Then, based on the learned interests and preferences, recommendations are provided to user A in the music app's recommendation scenario. The recommendation scenario of the reading app is the source domain, and the recommendation scenario of the music app is the target domain. However, the data distribution of the source domain and the target domain are often inconsistent. Therefore, the data distribution of the source domain is biased relative to the data distribution of the target domain. Directly using the above association rules and other methods to achieve cross-domain recommendation will introduce bias during the learning process. The model will consider the user's interests and preferences in the source domain more when making recommendations. In other words, the trained model is biased. This causes the model learned on the data in the source domain to fail to generalize effectively in the target domain, and the model is at risk of distortion.
[0530] This application proposes a training method 1100 for a recommendation model, which can reduce the impact of inconsistent distributions of source domain data and target domain data on the training results of the recommendation model and improve the accuracy of the recommendation model.
[0531] Method 1100 can be considered a specific implementation of method 600. To avoid unnecessary repetition, repeated descriptions will be omitted when introducing method 1100 below. Method 1100 includes steps S1110 to S1150. Steps S1110 to S1150 will be described below.
[0532] It should be understood that the specific implementation process of method 1100 can also refer to the aforementioned method 900. The difference between method 1100 and method 900 lies in the difference between the first training sample and the second training sample. In method 1100, the first training sample is determined based on user interaction data of the target domain, and the second training sample is determined based on user interaction data of the source domain.
[0533] S1110, obtain n first training samples and m second training samples.
[0534] The first training sample includes information about the first user, information about the first recommended object, and sample labels for the first training sample. The sample labels of the first training sample are used to indicate whether the first user has performed an action on the first recommended object. n is an integer greater than 1.
[0535] The second training sample includes information about the second user and the second recommended object, as well as sample labels for the second training sample. The sample labels of the second training sample are used to indicate whether the second user has performed an action on the second recommended object. m is an integer greater than 1.
[0536] Furthermore, the first training sample may also include first contextual information. The second training sample may also include second contextual information.
[0537] The first training sample is data belonging to the target domain, and the second training sample is data belonging to the source domain.
[0538] It should be noted that step S1110 is an optional step. For a detailed description of this step, please refer to step S610 in method 600. It will not be repeated here.
[0539] The following example illustrates one implementation method of step S1110, using the recommendation scenario of a reading app as the source domain and the recommendation scenario of a video app as the target domain.
[0540] The recommendation scenario for reading apps refers to recommending books to users, while the recommendation scenario for video apps refers to recommending videos to users.
[0541] like Figure 12 As shown, the first training sample is obtained based on the user's interaction history in the recommendation scenario (target domain) of the video app. The first training sample is used to train the first recommendation model and obtain the model parameters of the first recommendation model. Therefore, the first training sample can also be understood as the data in the training set of the first recommendation model.
[0542] Table 6 shows the data obtained based on user interaction history (e.g., user behavior logs) in the recommendation scenario of video apps.
[0543] Table 6
[0544] 1 13718bbd 5316a17f Thriller Producer No. 1 Zhang San 6.8 0 0b153874 93bad2c0 Literature and Art Producer No. 2 Li Si 7.1 … … … … … … …
[0545] Each row in Table 6 represents a training sample. Taking this training sample as the first training sample as an example, the first training sample includes information about the first user and the first recommended object. The first user's information includes the user's ID, and the first recommended object is a video. The information of the first recommended object includes the video's ID, tags, producer, actors, and rating. In other words, the first training sample includes a total of 6 types of features.
[0546] It should be understood that Table 6 is for illustrative purposes only, and the information of users and the information corresponding to recommendations may include more or fewer items than those in Table 6, or more or fewer class feature information.
[0547] Furthermore, the data can be processed according to the method in step S910, and the processed data can be stored in libSVM format. For example, the data in Table 6 can be stored in the following format: 1 25173:1 38553:1 50053:1 50216:1 59109:1 98079:1 0 19468:1 19850:1 79800:1 81901:1 85533:1 13010:1
[0550] …;
[0551] Based on the above data, n first training samples can be obtained.
[0552] like Figure 12 As shown, the second training sample was obtained based on the user's interaction history in the recommendation scenario (source domain) of the reading app. It should be noted that... Figure 12 The data in the source domain is for illustrative purposes only. The data in the source domain may also include data from other recommendation scenarios, or data from multiple recommendation scenarios. For example, the data in the source domain may include user history data from the recommendation scenarios of reading apps and user history data from the recommendation scenarios of music apps.
[0553] The second training samples can be used to validate the prediction performance of the first recommendation model; therefore, the second training samples can also be used as data in the validation set of the first recommendation model. It should be understood that... Figure 12 The example shown is for illustrative purposes only; the second training sample may not be used as data in the validation set.
[0554] Table 7 shows the data obtained based on the user's interaction history (e.g., user behavior logs) in the recommendation scenario of the reading app.
[0555] Table 7
[0556] 1 25c83c98 68fd1e64 Suspense No. 1 Publishing House Zhang San 6.8 0 efea433b 0b153874 Art No. 2 Publishing House Li Si 7.1 … … … … … … …
[0557] One row in Table 7 represents a training sample. This training sample is the second training sample, which includes information about the second user and the second recommended object. The second user's information includes the user's ID, and the second recommended object is a book. The second recommended object's information includes the object's ID, tags, publisher, author, and rating. In other words, the second training sample includes a total of 6 types of features.
[0558] It should be understood that Table 7 is for illustrative purposes only, and the information of users and the information corresponding to recommendations may include more or fewer items than those in Table 7, or more or fewer class feature information.
[0559] Furthermore, the data can be processed according to the method in step S910, and the processed data can be stored in libSVM format. For example, the data in Table 7 can be stored in the following format: 1 77891:1 81901:1 82101:1 83267:1 83896:1 91899:1 0 55060:1 59115:1 60857:1 75847:1 97576:1 42803:1
[0562] …;
[0563] Based on the above data, m second training samples can be obtained.
[0564] S1120, the first recommendation model is obtained by training based on n first training samples.
[0565] Specifically, the first feature information is used as the input to the first recommendation model, and the sample label of the first training sample is used as the target output value of the first recommendation model for training, so as to obtain the model parameters of the first recommendation model.
[0566] It should be noted that step S1120 is an optional step. For a detailed description, please refer to step S610 in method 600. It will not be repeated here.
[0567] For example, such as Figure 12 As shown, the first recommendation model is trained using data from the target domain as the training set, and the prediction performance of the first recommendation model is verified using data from the source domain as the validation set.
[0568] S1130, determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The validation loss of m second training samples on the first recommendation model refers to the difference between the predicted labels of the m second training samples obtained by processing the m second training samples through the first recommendation model and the sample labels of the m second training samples.
[0569] Step S1130 corresponds to step S620 in the aforementioned method 600. For a detailed description, please refer to step S620, which will not be repeated here.
[0570] S1140, determine the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss.
[0571] Step S1140 corresponds to step S630 in the aforementioned method 600. For a detailed description, please refer to step S630, which will not be repeated here.
[0572] For example, the weights corresponding to the n first training samples are determined based on the sigmoid function. Concatenating the weights of the first training samples with the first training samples themselves yields weighted first training samples. For instance, the weighted first training samples obtained based on the weights corresponding to the first training samples in step S1110 are as follows: 1 0.83 25173:1 38553:1 50053:1 50216:1 59109:1 98079:1 0 0.45 19468:1 19850:1 79800:1 81901:1 85533:1 13010:1
[0575] …;
[0576] S1150, the first recommendation model is trained based on n first training samples and the weights corresponding to the n first training samples to obtain the model parameters of the target recommendation model.
[0577] That is, the first recommendation model is trained based on the first training sample with weights to obtain the model parameters of the target recommendation model.
[0578] Step S1150 corresponds to step S640 in the aforementioned method 600. For a detailed description, please refer to step S640, which will not be repeated here.
[0579] like Figure 12 As shown, a weighted training set can be obtained from the training set and the weights of the training samples. The target recommendation model can then be trained based on this weighted training set.
[0580] This target recommendation model can be applied to target domains, for example, Figure 12 In the recommendation scenarios of video apps.
[0581] Compared to recommendation scenarios in video apps, recommendation scenarios in reading apps have richer user interaction data, and the data distribution more accurately reflects user preferences. Based on intuitive reasoning and the interconnectedness of user interests in reading and video scenarios, the solution in this application embodiment enables the recommendation model to better grasp users' personalized preferences in reading scenarios, thereby guiding recommendation results in video scenarios and improving the accuracy of recommendation results.
[0582] According to the scheme of this application embodiment, the importance of the first training sample to the validation loss is evaluated by the influence function value. That is, the importance of the first training sample is determined by measuring the magnitude of the impact of data perturbation on the validation loss of the first recommendation model on the second training sample. Based on this importance, the weight corresponding to the first training sample is determined. The recommendation model retrained based on the weighted first training sample can better fit the data distribution of the second training sample. The first training sample is data in the target domain, and the second training sample is data in the source domain. Adjusting the weight of the first training sample based on the second training sample can make the recommendation model fit the data distribution of the source domain more accurately, learn more accurate user preferences, and improve the accuracy of the recommendation model in the target domain.
[0583] By transferring and sharing knowledge (e.g., user interests and preferences) across different domains, the user interaction history records of both the source domain (e.g., recommendation scenarios in reading apps) and the target domain (e.g., recommendation scenarios in video apps) are incorporated into the learning process. The impact of perturbing the target domain data on the validation effect of the source domain data is assessed, and the weights of the target domain data are adjusted based on this impact. The model is then trained using the weighted data. The resulting model exhibits good evaluation performance in the source domain, effectively capturing user interests and preferences. Furthermore, in similar recommendation scenarios, user interests and preferences are also similar, allowing the recommendation model to effectively fit user interests and preferences in the target domain, providing recommendations that align with user interests. This achieves cross-domain recommendation and alleviates the cold start problem.
[0584] The target recommendation model obtained by method 1100 can predict the probability that a user will perform an action on a recommended object in the target domain, that is, the probability that a user will select that recommended object. By deploying the target recommendation model in the target domain (e.g., in a video app recommendation scenario), the recommendation system can determine the recommendation results to be displayed to the user based on the output of the target recommendation model.
[0585] As mentioned earlier, traditional recommendation learning schemes learn the hidden patterns in users' historical behavior in each recommendation scenario or domain, and then make recommendations based on the learned patterns. The entire learning and implementation process does not consider knowledge transfer and sharing between domains at all.
[0586] Currently, many electronic devices, such as mobile phones and tablets, have multiple applications, each of which can be considered an application scenario. When making recommendations to users, these applications typically learn user preferences based solely on user interaction data within that application, without considering user interaction data from other applications.
[0587] However, in newly downloaded applications, user interaction data is scarce. If the recommendation model is learned solely from the interaction history of the local domain, it is difficult to discover the hidden patterns in the user's historical behavior, which leads to inaccurate prediction results and affects the user experience. In other words, there is a cold start problem in new recommendation scenarios.
[0588] This application provides a recommendation method and electronic device that can learn the preferences of users in other domains to make recommendations for users, thereby improving the accuracy of prediction results and enhancing user experience.
[0589] It should be understood that in the embodiments of this application, "user behavior data", "user interaction data", "interaction data", "behavior data", etc. can be considered to express the same meaning, and can all be understood as data related to the user's operation behavior when the recommended object is displayed to the user.
[0590] For ease of understanding, this application will use a mobile phone as an electronic device, and will first introduce some human-computer interaction embodiments of this application. Figure 13 These are schematic diagrams of a set of graphical user interfaces (GUIs) provided in the embodiments of this application.
[0591] Users can tap the settings application on their phones. In response to this tap, the phone displays the main interface 301 of the settings application. The main interface of the settings application can display, for example,... Figure 13The content shown in Figure (a) is as follows. The main interface 301 may include batch management controls, cross-domain recommendation management controls for various applications, and a sidebar alphabetical sorting index control. The main interface 301 may also display whether the cross-domain recommendation function of each application (e.g., a music app, reading app, browser app, news app, video app, or shopping app) is "enabled" or "disabled". In some embodiments, the cross-domain recommendation management controls for each application displayed on the main interface 301 may be displayed in alphabetical order from "A" to "Z" according to the first letter of the application name, with each application corresponding to its own cross-domain recommendation management control. It should be understood that the main interface 301 may also include other, more, less, or similar display content, which is not limited in this application.
[0592] When a user clicks on a cross-domain recommendation management control for an application, the phone can display the corresponding cross-domain recommendation management interface for that application. For example, the user executes... Figure 13 In Figure (a), a click on the cross-domain recommendation management control of the browser app triggers the mobile phone to enter the browser app's cross-domain recommendation management interface 302. The cross-domain recommendation management interface 302 can display, as shown in Figure (a). Figure 13 The content shown in Figure (b) is as follows. The cross-domain recommendation management interface 302 may include a control that allows cross-domain recommendations. It should be understood that the cross-domain recommendation management interface 302 may also include other, more or fewer, similar display content, and the cross-domain recommendation management interface 302 may also include different display content depending on the application; this embodiment does not limit this.
[0593] Optionally, the cross-domain recommendation management control can be set to off by default.
[0594] For example, such as Figure 13As shown in Figure (b), when the cross-domain recommendation control is enabled, the browser app's cross-domain recommendation function is activated. Correspondingly, the browser app can obtain user interaction data from multiple apps and learn from it to recommend relevant videos to the user. Furthermore, when the cross-domain recommendation control is enabled, the cross-domain recommendation management interface 302 can also display the browser app's learning list, which includes multiple options. An option on the cross-domain recommendation management interface 302 can be understood as the name of an application and its corresponding on / off control. Therefore, it can also be said that the cross-domain recommendation management interface 302 includes the cross-domain recommendation control and multiple options, each of which is associated with an application. The option associated with that application controls the enabling and disabling of the browser app's permission to obtain user behavior data from that application. Alternatively, it can be understood that the option associated with a specific application controls the browser app to perform cross-domain recommendation based on the user behavior data from that application. For ease of understanding, the following embodiments still use on / off controls to illustrate the meaning of the options.
[0595] As mentioned earlier, the learning list includes multiple options, meaning that the cross-domain recommendation management interface 302 displays the names of multiple applications and their corresponding toggle controls. For example... Figure 13 As shown in (b), when the switch control corresponding to an application is turned on, the video app can obtain user behavior data from that app and learn from it to make recommendations to the user. The cross-domain recommendation interface 302 can also display whether the cross-domain recommendation function is enabled or disabled, allowing applications to obtain user data from various applications (such as music apps, reading apps, browser apps, news apps, video apps, or shopping apps). Figure 13 As shown in Figure (b), when the cross-domain recommendation control is enabled, multiple toggle controls are displayed on the first interface. These toggle controls correspond to applications such as music apps, reading apps, shopping apps, video apps, news apps, and chat apps. Taking the control corresponding to the music app as an example, when the control corresponding to the music app is enabled, that is, when the music app is in the "Allowed" state below it, the browser app can obtain user behavior data from the music app, learn from it, and make recommendations for the user.
[0596] If a user closes the corresponding control in the music app, the phone will display the following in response to the closing action: Figure 13As shown in (c), the browser app no longer obtains user behavior data from the music app; that is, it is not allowed to obtain user behavior data from the music app. If the user performs a "close" operation on the "Allow cross-domain recommendations" control, in response to this operation, the browser app will disable the cross-domain recommendation function, meaning it will not allow the browser app to obtain user interaction data from other apps. For example, if the user performs a... Figure 13 As shown in Figure (b), clicking the "Allow Cross-Domain Recommendations" control triggers a click on the phone, which in turn disables the browser app's cross-domain recommendation function. The cross-domain recommendation management interface can display something like... Figure 13 As shown in Figure (d), the browser app's cross-domain recommendation function is disabled across all applications in this learning list. This improves management efficiency and enhances user experience.
[0597] The content recommended by an application to a user is called the recommendation object, which can be displayed within the application. When a user enters the application, a recommendation request is triggered, and the recommendation model recommends relevant content to the user based on that request.
[0598] For example, the information feed recommended by the browser app to the user can be displayed on the main interface of the browser app.
[0599] For example, when a user clicks on a browser app, the phone displays the following in response to the click: Figure 14 The main interface 303 of the browser app shown in (a) can display a recommendation list of one or more recommended contents, which are the recommended objects in the browser app. It should be understood that the main interface 303 of the browser app may also include other more or fewer display contents, and this application does not limit this.
[0600] Users can perform actions on the recommended list displayed on the browser app's main interface (303 error message) to view, delete (or ignore) recommended content, or view related information. For example, clicking on a recommended item will open the recommended content on the phone. Similarly, swiping quickly to the left (or right) on a recommended item will remove it from the recommended list. Long-pressing a recommended item will display its related information on the phone. Figure 14 As shown in Figure (a), the user performs the following... Figure 14The long press operation shown in (a) triggers a prompt box on the phone, as shown in the image. The prompt box displays a message informing the user that the recommended content is based on user interaction data from other applications. Figure 14 As shown in (a), this prompt message is used to inform the user that the recommended content is based on the user's data in the video app.
[0601] It should be understood that in some other embodiments, users can open the video or delete the recommended content in other ways, or they can bring up the relevant information of the recommended content in other ways, such as by slowly swiping left and right. This application embodiment does not limit this.
[0602] For example, when a user clicks on a browser app, the phone can also display something like this in response to the click. Figure 14 The main interface 304 of the browser app shown in (b) can display a recommendation list of one or more recommended items and corresponding prompts for those recommended items. These one or more recommended items are the recommended objects within the browser app. It should be understood that the main interface 304 may also include other, more or less displayed content, and this application does not limit this. The prompts are used to inform the user that the recommended content is based on user interaction data from other applications.
[0603] Users can perform certain operations on the videos displayed in the recommendation list on the main interface (304) to view, delete (or ignore) recommended content, etc. For example, if a user clicks on a recommended video, the phone can open that recommended video in response to the click. Similarly, if a user quickly swipes left (or right) on a recommended video, the phone can remove that recommended video from the recommendation list in response to the action. It should be understood that in some other embodiments, users can open or delete recommended content in other ways, or delete related information of the recommended content in other ways, such as slowly swiping left or right. This application embodiment does not limit this.
[0604] It should be understood that the prompt information is mainly to provide reference information for users so that they know that the current recommended object is obtained based on the cross-domain recommendation function. The content of the prompt information may also take other forms, which are not limited in the embodiments of this application.
[0605] It should be noted that in this embodiment, when a user deletes recommended content on the main interface, it can be understood as the user simply deleting a specific recommended item from the recommendation list on the main interface, meaning the user is not interested in that recommended item. This behavior can be recorded in the user behavior log and used as training data for the recommendation model. For example, it can be used as the first training sample in the aforementioned method.
[0606] When a phone has a large number of apps, for some apps that require cross-domain recommendations, the cross-domain recommendation feature can be enabled. For example, the cross-domain recommendation feature can be enabled or disabled in the following two ways.
[0607] One type is enabling or disabling a cross-domain recommendation feature for a specific application at a single point. For example, ... Figure 13 As shown, in the cross-domain recommendation management interface corresponding to the application, enabling or disabling the cross-domain recommendation control allows you to turn the application's cross-domain recommendation function on or off with a single click.
[0608] Another approach is to batch disable or enable cross-domain recommendation features for all applications. For example, ... Figure 15 Figure (a) shows the relationship with Figure 13 The same interface as diagram (a). The user executes... Figure 15 Clicking the batch management control shown in Figure (a) activates the batch management interface 305, which includes a search application control, a cross-domain recommendation master switch control, cross-domain recommendation switch controls for individual applications, or a sidebar alphabetical sorting index control. Users can enable or disable the cross-domain learning function for all applications by turning the cross-domain recommendation master switch control (the switch after "All" in the figure) on and off. The batch management interface 305 also includes cross-domain recommendation switch controls for individual applications, allowing users to enable or disable the cross-domain recommendation function for a single application. In some embodiments, the cross-domain recommendation switch controls for each application displayed in the batch management interface 305 can be arranged alphabetically by the first letter of the application name from "A" to "Z," with each application's cross-domain recommendation function controlled by its own switch control.
[0609] It should be understood that in the embodiments of this application, "disable cross-domain recommendation," "disable application's cross-domain recommendation," "disable cross-domain recommendation function," and "disable application's cross-domain recommendation function" can be considered to express the same meaning, all of which can be understood as disabling the application's cross-domain recommendation function, and the application no longer performs cross-domain recommendations. Similarly, "enable cross-domain recommendation," "enable application's cross-domain recommendation," "enable cross-domain recommendation function," and "enable application's cross-domain recommendation function" can be considered to express the same meaning, all of which can be understood as enabling the application's cross-domain recommendation function, and the application can perform cross-domain recommendations.
[0610] Based on the above embodiments and related figures, this application provides a recommended method that can be implemented in electronic devices (such as mobile phones, tablets, etc.). Figure 16This is a schematic flowchart of the recommended method provided in the embodiments of this application, such as... Figure 16 As shown, the method 1200 may include the following steps. (Figure)
[0611] S1210, displaying the first interface.
[0612] The first interface may include a learning list of at least one application, the learning list of the first application in the learning list of at least one application includes at least one option, each of the at least one option being associated with an application.
[0613] For example, such as Figure 13 As shown in Figure (b), the first interface can be the cross-domain recommendation management interface 302 of the browser app. This cross-domain recommendation management interface 302 is used to control the enabling and disabling of the cross-domain recommendation function of the browser app.
[0614] For example, such as Figure 13 As shown in Figure (b), the learning list of the first application can be the learning list of the browser APP.
[0615] For example, such as Figure 13 As shown in Figure (b), the at least one option can have the same name as the application, such as a "Shopping" option, a "Map" option, a "Health" option, a "Video" option, etc. Each of the at least one option is associated with an application, and the option associated with the application controls whether the function of learning user behavior within that application is enabled or disabled. In other words, the option associated with the application controls whether the first application is allowed to access the application's data for cross-domain recommendations.
[0616] S1220 senses the user's first action on the first interface.
[0617] The first action can be a click, double-click, long press, or swipe.
[0618] S1230, in response to the first operation, turn on or off the cross-domain recommendation function of the first application in the application associated with some or all of the options in the learning list of the first application.
[0619] In other words, the first application is allowed to obtain user behavior data from some or all of the applications associated with the options, learn the user's preferences in that application, and make recommendations for the user in the first application.
[0620] After the first operation, users can see from the interface whether the cross-domain recommendation function of the first application is on or off.
[0621] In one embodiment, a first operation is applied to a first option, and in response to a user's first operation on the first option, the cross-domain recommendation function of the first application in the application associated with the first option is turned on or off; wherein, the first option is located in the learning list of the first application.
[0622] For example, such as Figure 13 As shown in Figure (c), the first option can be the "Music" option on the first interface. It should be understood that the first option can be any application-related option in the learning list of the first application on the first interface, such as the "Music" option, the "Shopping" option, the "Browser" option, etc.
[0623] For example, such as Figure 13 As shown in Figure (c), the first operation can be an on / off operation of the switch control corresponding to the first option. For example, when the switch control corresponding to the first option is in the on state, the first operation can be used to close the switch control corresponding to the first option, thereby disabling the function of the first application in cross-domain recommendation within the application associated with the first option. Conversely, when the switch control corresponding to the first option is in the off state, the first operation can be used to open the switch control corresponding to the first option, thereby enabling the function of the first application in cross-domain recommendation within the application associated with the first option. In this way, the user can individually control the on / off state of the cross-domain recommendation function of the first application in each of the other applications.
[0624] In one embodiment, the first operation is applied to a switch control corresponding to the learning list of the first application. In response to the user's first operation on the switch control, the cross-domain recommendation function of the first application in the applications associated with all options in the learning list of the first application is turned on or off.
[0625] For example, such as Figure 13 As shown in Figure (b), the first operation can be a closing operation on the cross-domain recommendation control. Optionally, if the cross-domain recommendation control is closed before the first operation, the first operation can be a closing operation on the cross-domain recommendation control. In this way, the user can have overall control over the cross-domain recommendation function of the first application, improving management efficiency and enhancing the user experience.
[0626] In one embodiment, method 1200 further includes: displaying a second interface for presenting one or more recommended objects and prompts for the one or more recommended objects, the prompts for the one or more recommended objects indicating that the one or more recommended objects are determined based on user behavior data in the at least one application.
[0627] For example, such as Figure 14 As shown in Figure (a), the second interface can be the main interface 303 of the browser APP.
[0628] For example, such as Figure 14 As shown in Figure (b), the second interface can be the main interface 304 of the browser APP.
[0629] For example, such as Figure 14 As shown, this prompt can be used to inform users that the currently recommended content is based on data from the video app.
[0630] In one embodiment, one or more recommended objects are determined by inputting user information and candidate recommended object information into a recommendation model to predict the probability that the user will perform an action on the candidate recommended object.
[0631] For example, by using user behavior data from the video app as the source domain and user behavior data from the browser app as the target domain, the aforementioned method 1100 can be executed to obtain a recommendation model. This model can then predict the probability that a user will interact with candidate recommended objects. Based on this probability value, recommended content is determined and then displayed, such as... Figure 14 The content shown.
[0632] In one embodiment, the model parameters of the recommendation model are obtained by training a first recommendation model based on n first training samples and the weights corresponding to the n first training samples. The first recommendation model is trained based on the n first training samples. The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The first training samples include information about the first user, information about the first recommendation object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has performed an operation on the first recommendation object, and n is an integer greater than 1. The second training samples include information about the second user and information about the second recommendation object, and sample labels of the second training samples. The sample labels of the second training samples are used to indicate whether the second user has performed an operation on the second recommendation object, and m is an integer greater than 1. The m second training samples are determined based on user behavior data in applications associated with at least one option, and the n first training samples are determined based on user behavior data in the first application.
[0633] For example, when a user allows the first application to enable cross-domain recommendation functionality, the first application can obtain user behavior data from the applications associated with the first option, and use the user behavior data from the applications associated with the first option as the source domain data. It should be understood that the source domain data can also include user behavior data from other applications. For example, when a user allows the first application to perform cross-domain learning across all applications associated with all options in the first application's learning list, the first application can obtain user behavior data from all applications associated with all options, and use all the obtained user behavior data as the source domain data.
[0634] For example, the recommendation model can be the recommendation model trained using the aforementioned method 1100. For a detailed description, please refer to the aforementioned method 1100, which will not be repeated here.
[0635] In one embodiment, before displaying the first interface, method 1200 further includes: displaying a third interface, the third interface including at least one application-related switch control; detecting on the third interface a third operation by a user on the switch control of a first application among the switch controls corresponding to the at least one application; and displaying the first interface in response to the third operation.
[0636] For example, such as Figure 13 As shown in Figure (a), the third interface can be the main interface 301 of the settings application.
[0637] For example, such as Figure 13 As shown in Figure (a), the switch control of the first application can be a cross-domain recommendation management control for a browser app.
[0638] For example, such as Figure 13 As shown in Figure (a), the third operation can be a click operation on the switch control corresponding to the first application, and in response to the click operation, the following is displayed: Figure 13 The interface shown in (b) is shown in the image.
[0639] According to the scheme in the embodiments of this application, by transferring and sharing knowledge (e.g., user interests and preferences) between different domains, the user interaction history of both the source domain and the target domain is incorporated into the learning process. This enables the recommendation model to better learn user preferences and fit user interests and preferences well in the target domain, thus providing users with recommendations that match their interests. This achieves cross-domain recommendation and alleviates the cold start problem.
[0640] The training device and recommendation device of the present application embodiments will be described in detail below with reference to the accompanying drawings. It should be understood that the recommendation device described below can execute the training method of the recommendation model of the aforementioned embodiments of the present application, and the recommendation device can execute the recommendation method of the aforementioned embodiments of the present application. In order to avoid unnecessary repetition, repeated descriptions will be appropriately omitted when introducing the recommendation device of the present application embodiments below.
[0641] Figure 17 This is a schematic block diagram of the training apparatus for the recommended model in an embodiment of this application. Figure 17 The training device 3000 for the recommended model shown includes an acquisition unit 3010 and a processing unit 3020.
[0642] The acquisition unit 3010 and the processing unit 3020 can be used to execute the training method of the recommended model of the present application embodiment. Specifically, they can be used to execute method 600, method 900, method 1000 or method 1100.
[0643] The acquisition unit 3010 is used to acquire a first recommendation model. The model parameters of the first recommendation model are obtained by training based on n first training samples. The first training samples include information about a first user, information about a first recommendation object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has performed an operation on the first recommendation object, and n is an integer greater than 1. The processing unit 3020 is used to determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The second training samples include information about a second user, information about a second recommendation object, and sample labels of the second training samples. The sample labels of the second training samples are used to indicate whether the second user has performed an operation on the second recommendation object, and m is an integer greater than 1. Based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model, the weight corresponding to each first training sample is determined. The first recommendation model is trained according to the n first training samples and the weights corresponding to the n first training samples to obtain a target recommendation model.
[0644] Optionally, as an embodiment, determining the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model includes:
[0645] The weight corresponding to each first training sample is negatively correlated with the function value of the influence of each first training sample on the validation loss of the m second training samples.
[0646] Optionally, as an embodiment, the influence function value of each first training sample on the prediction loss of the m second training samples on the first recommendation model satisfies the following formula:
[0647]
[0648] Among them, z i Let φ(z) represent the i-th first training sample. i z represents the influence function value of the i-th first training sample on the prediction loss of m second training samples in the first recommendation model. j Let φ(z) represent the j-th second training sample. i ,z j () represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
[0649] Optionally, as an embodiment, the processing unit 3020 is specifically used for:
[0650] The weights corresponding to each first training sample satisfy the following formula:
[0651]
[0652] Where, π i Let φ(z) represent the weights corresponding to the i-th first training sample, α represent the weighting coefficients, and {φ(z)} i Let} represent the set of function values that influence the validation loss of n first training samples on m second training samples on the first recommendation model.
[0653] Optionally, as an embodiment, the m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
[0654] Optionally, as an embodiment, the m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, including: the m second training samples are obtained when the candidate recommendation objects in the candidate recommendation object set are randomly displayed to the second user; or the m second training samples are obtained when the second user searches for the second recommendation object.
[0655] Optionally, as an embodiment, the m second training samples belong to the source domain data, and the n first training samples belong to the target domain data.
[0656] Figure 18 This is a schematic block diagram of the recommended device 4000 provided in the embodiments of this application. Figure 18 The recommended device 4000 shown includes an acquisition unit 4010 and a processing unit 4020.
[0657] The acquisition unit 4010 and the processing unit 4020 can be used to execute the recommended methods of the embodiments of this application, for example, they can be used to execute method 700.
[0658] The acquisition unit 4010 is used to acquire information about the target user and information about the candidate recommended objects. The processing unit 4020 is used to input the information about the target user and the information about the candidate recommended objects into the recommendation model to predict the probability that the target user will perform an action on the candidate recommended objects. The model parameters of the recommendation model are obtained by training a first recommendation model based on n first training samples and the weights corresponding to the n first training samples. The first recommendation model is trained based on the n first training samples. The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The first training samples include information about the first user, information about the first recommended object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has performed an action on the first recommended object, where n is an integer greater than 1. The second training samples include information about the second user and information about the second recommended object, and sample labels of the second training samples. The sample labels of the second training samples are used to indicate whether the second user has performed an action on the second recommended object, where m is an integer greater than 1.
[0659] Optionally, as an embodiment, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including: the weight corresponding to each first training sample is negatively correlated with the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model.
[0660] Optionally, as an embodiment, the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model satisfies the following formula:
[0661]
[0662] Among them, z i Let φ(z) represent the i-th first training sample. i z represents the influence function value of the i-th first training sample on the prediction loss of m second training samples in the first recommendation model. j Let φ(z) represent the j-th second training sample. i ,z j () represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
[0663] Optionally, as an embodiment, the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including that the weight corresponding to each first training sample satisfies the following formula:
[0664]
[0665] Where, π i Let φ(z) represent the weights corresponding to the i-th first training sample, α represent the weighting coefficients, and {φ(z)} i Let} represent the set of function values that influence the validation loss of n first training samples on m second training samples on the first recommendation model.
[0666] Optionally, as an embodiment, the m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
[0667] Optionally, as an embodiment, the m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, including: the m second training samples are obtained when the candidate recommendation objects in the candidate recommendation object set are randomly displayed to the second user; or the m second training samples are obtained when the second user searches for the second recommendation object.
[0668] Optionally, as an embodiment, the m second training samples belong to the source domain data, and the n first training samples belong to the target domain data.
[0669] It should be noted that the aforementioned training device 3000 and recommendation device 4000 are embodied in the form of functional units. The term "unit" here can be implemented in software and / or hardware, without specific limitations.
[0670] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.
[0671] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0672] Figure 19 This is a schematic diagram of the hardware structure of a training device for a recommendation model provided in an embodiment of this application. Figure 19 The training device 5000 shown (which may specifically be a computer device) includes a memory 5010, a processor 5020, a communication interface 5030, and a bus 5040. The memory 5010, processor 5020, and communication interface 5030 are interconnected via the bus 5040.
[0673] The memory 5010 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 5010 may store a program. When the program stored in the memory 5010 is executed by the processor 5020, the processor 5020 executes various steps of the training method of the recommended model in this embodiment, for example, executing... Figure 6 The steps shown.
[0674] It should be understood that the training device shown in the embodiments of this application can be a server, for example, a server in the cloud, or a chip configured in a server in the cloud.
[0675] The processor 5020 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to implement the training method of the recommended model in the method embodiment of this application.
[0676] The processor 5020 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the training method for the recommended model of this application can be completed through the integrated logic circuitry in the processor 5020 or through software instructions.
[0677] The processor 5020 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 5010. The processor 5020 reads the information in memory 5010 and, in conjunction with its hardware, completes the implementation of this application. Figure 17 The training apparatus shown includes units that are required to perform functions, or to perform the methods described in this application. Figure 6 The training method for the recommendation model is shown.
[0678] The communication interface 5030 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the training device 5000 and other devices or communication networks.
[0679] Bus 5040 may include a pathway for transmitting information between various components of training device 5000 (e.g., memory 5010, processor 5020, communication interface 5030).
[0680] Figure 20 This is a schematic diagram of the hardware structure of the recommended device provided in the embodiments of this application. Figure 20 The recommended device 6000 shown (which may specifically be a computer device) includes a memory 6010, a processor 6020, a communication interface 6030, and a bus 6040. The memory 6010, processor 6020, and communication interface 6030 are interconnected via the bus 6040.
[0681] The memory 6010 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 6010 may store a program. When the program stored in the memory 6010 is executed by the processor 6020, the processor 6020 performs various steps of the recommended method of this application embodiment, for example, executing... Figure 7 The steps shown.
[0682] It should be understood that the device shown in the embodiments of this application may be a smart terminal, or it may be a chip configured in a smart terminal.
[0683] The processor 6020 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to implement the method of predicting selection probabilities in the embodiments of this application.
[0684] The processor 6020 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the method for predicting selection probabilities in this application can be accomplished through integrated logic circuits in the processor 6020 or through software instructions.
[0685] The processor 6020 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 6010. The processor 6020 reads the information in memory 6010 and, in conjunction with its hardware, completes the implementation of this application. Figure 18 The apparatus shown includes units that are required to perform functions, or to perform the methods described in this application. Figure 7 The recommended method is shown.
[0686] The communication interface 6030 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 6000 and other devices or communication networks.
[0687] Bus 6040 may include a pathway for transmitting information between various components of device 6000 (e.g., memory 6010, processor 6020, communication interface 6030).
[0688] It should be noted that although the training devices 5000 and 6000 described above only show a memory, processor, and communication interface, those skilled in the art should understand that in specific implementations, training devices 5000 and 6000 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the training devices 5000 and 6000 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the training devices 5000 and 6000 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 19 or Figure 20 All the devices shown.
[0689] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0690] When dividing each function into modules according to its corresponding function. Figure 21 A schematic diagram of a possible composition of the electronic device 7000 involved in the above embodiments is shown, such as... Figure 21 As shown, the electronic device 7000 may include: a display unit 7001 and a processing unit 7002.
[0691] The display unit 7001 can be used to support the electronic device 7000 in performing the above-described steps S1210, etc., and / or other processes used in the technology described herein.
[0692] The processing unit 7002 can be used to support the electronic device 7000 in performing the above-described steps S1220, etc., and / or other processes used in the technology described herein.
[0693] The display unit 7001 can also be used to support the electronic device 7000 in performing the above steps S1230, etc., and / or other processes used in the technology described herein.
[0694] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0695] The electronic device provided in this embodiment is used to execute the recommended method described above, and therefore can achieve the same effect as the implementation method described above.
[0696] When using integrated units, the electronic device may include a processing module, a storage module, and a communication module. The processing module can be used to control and manage the actions of the electronic device; for example, it can support the electronic device in performing the operations to be performed by the display unit 7001 and the processing unit 7002. The storage module can support the electronic device in executing stored program code and data. The communication module can support communication between the electronic device and other devices.
[0697] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
[0698] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed, the electronic device performs the aforementioned method steps to implement the recommended method in the above embodiment.
[0699] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement the recommended method in the above embodiment.
[0700] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to perform the recommended methods in the above-described method embodiments.
[0701] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0702] It should also be understood that, in embodiments of this application, the memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the processor may also include non-volatile random access memory. For example, the processor may also store device type information.
[0703] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0704] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0705] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0706] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0707] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0708] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0709] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0710] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: a Universal Serial Bus flash disk (USB flash disk, UFD), which can also be simply referred to as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, and other media capable of storing program code.
[0711] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for training a recommendation model, characterized in that, include: Obtain a first recommendation model. The model parameters of the first recommendation model are obtained by training based on n first training samples. The first training samples include information of the first user, information of the first recommendation object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has an operation on the first recommendation object. n is an integer greater than 1. Determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The second training sample includes information about the second user and the second recommendation object, as well as the sample label of the second training sample. The sample label of the second training sample is used to indicate whether the second user has an operation on the second recommendation object, and m is an integer greater than 1. The weights corresponding to each first training sample are determined based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model. The first recommendation model is trained based on the n first training samples and their corresponding weights to obtain a target recommendation model. This target recommendation model is used for recommendations in at least one of the following scenarios: app store recommendation, music application recommendation, video website recommendation, e-commerce recommendation, search term recommendation, cross-domain recommendation, advertising recommendation, content recommendation, and reading application recommendation. The n first training samples are obtained when the probability of displaying a candidate recommendation object in the candidate recommendation object set is different, and the first recommendation object is one of the candidate recommendation objects in the candidate recommendation object set. The m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
2. The method as described in claim 1, characterized in that, The step of determining the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model includes: The weight corresponding to each first training sample is negatively correlated with the influence function value of each first training sample on the validation loss of the m second training samples.
3. The method as described in claim 1 or 2, characterized in that, The influence function value of each first training sample on the prediction loss of the m second training samples on the first recommendation model satisfies the following formula: ; Among them, z i This represents the i-th first training sample. z represents the influence function value of the i-th first training sample on the prediction loss of the m second training samples in the first recommendation model. j Let j represent the j-th second training sample. This represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
4. The method as described in claim 3, characterized in that, The step of determining the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model includes, wherein the weight corresponding to each first training sample satisfies the following formula: ; in, Let α represent the weight corresponding to the i-th first training sample, and let α represent the weighting coefficient. This represents the set of function values representing the influence of the n first training samples on the validation loss of the m second training samples on the first recommendation model.
5. The method as described in claim 1 or 2, characterized in that, The m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, including: The m second training samples are obtained when candidate recommendation objects in the candidate recommendation object set are randomly shown to the second user; Alternatively, the m second training samples are obtained when the second user searches for the second recommended object.
6. The method as described in claim 1 or 2, characterized in that, The m second training samples belong to the source domain, and the n first training samples belong to the target domain.
7. A recommendation method, characterized in that, include: Obtain information about the target user and the candidate recommendation objects; The target user's information and the candidate recommendation object's information are input into the recommendation model to predict the probability that the target user will perform an action on the candidate recommendation object. The recommendation model is used to make recommendations in at least one of the following scenarios: app store recommendation, music application recommendation, video website recommendation, e-commerce recommendation, search term recommendation, cross-domain recommendation, advertising recommendation, content recommendation, and reading application recommendation. The recommendation model's parameters are obtained by training a first recommendation model using n first training samples and their corresponding weights. The first recommendation model is trained on these n first training samples. The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The first training samples include information about a first user, information about a first recommended object, and sample labels for the first training samples. The sample labels of the first training samples indicate whether the first user has performed an action on the first recommended object, where n is an integer greater than 1. The second training samples include information about a second user and information about a second recommended object, as well as sample labels for the second training samples. The sample labels of the second training samples indicate whether the second user has performed an action on the second recommended object, where m is an integer greater than 1. The n first training samples are obtained when the probability of displaying a candidate recommendation object in the candidate recommendation object set is different, and the first recommendation object is one of the candidate recommendation objects in the candidate recommendation object set. The m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
8. The method as described in claim 7, characterized in that, The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples in the first recommendation model, including: The weight corresponding to each first training sample is negatively correlated with the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model.
9. The method as described in claim 7 or 8, characterized in that, The influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model satisfies the following formula: ; Among them, z i This represents the i-th first training sample. z represents the influence function value of the i-th first training sample on the prediction loss of the m second training samples in the first recommendation model. j Let j represent the j-th second training sample. This represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
10. The method as described in claim 9, characterized in that, The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including the weight corresponding to each first training sample satisfying the following formula: ; in, Let α represent the weight corresponding to the i-th first training sample, and let α represent the weighting coefficient. This represents the set of function values representing the influence of the n first training samples on the validation loss of the m second training samples on the first recommendation model.
11. The method as described in claim 7 or 8, characterized in that, The m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, including: The m second training samples are obtained when candidate recommendation objects in the candidate recommendation object set are randomly shown to the second user; Alternatively, the m second training samples are obtained when the second user searches for the second recommended object.
12. The method as described in claim 7 or 8, characterized in that, The m second training samples belong to the source domain, and the n first training samples belong to the target domain.
13. A recommendation method, characterized in that, include: The first interface is displayed, which includes a learning list of at least one application. The learning list of the first application in the learning list of the at least one application includes at least one option, and each option is associated with an application. Sensing the user's first action on the first interface; In response to the first operation, the cross-domain recommendation function of the first application in the applications associated with some or all of the options in the learning list of the first application is turned on or off; The second interface displays one or more recommended objects. These objects are determined by inputting the user's information and the information of the candidate recommended objects into a recommendation model, predicting the probability that the user will perform an action on the candidate recommended objects. The model parameters of the recommendation model are obtained by training a first recommendation model based on n first training samples and the weights corresponding to the n first training samples. The first recommendation model is trained based on the n first training samples, and the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The first training samples include the information of the first user, the information of the first recommended object, and the sample label of the first training sample. The sample label of the first training sample is used to indicate whether the first user has performed an action on the first recommended object, where n is an integer greater than 1. The second training samples include the information of the second user and the information of the second recommended object, and the sample label of the second training sample. The sample label of the second training sample is used to indicate whether the second user has performed an action on the second recommended object, where m is an integer greater than 1. The m second training samples are determined based on user behavior data in the application associated with the at least one option, and the n first training samples are determined based on user behavior data in the first application.
14. The method as described in claim 13, characterized in that, The first operation acts on the first option, and the step of responding to the first operation by turning on or off the cross-domain recommendation function of the first application in applications associated with some or all options in the learning list of the first application includes: In response to the user's first operation on the first option, the cross-domain recommendation function of the first application in the application associated with the first option is turned on or off; The first option is located in the learning list of the first application.
15. The method as described in claim 13, characterized in that, The first operation acts on the switch control corresponding to the learning list of the first application. The step of responding to the first operation by turning on or off the cross-domain recommendation function in applications associated with some or all options in the learning list of the first application includes: In response to the user's first operation on the switch control, the cross-domain recommendation function of the first application in the applications associated with all options in the learning list of the first application is turned on or off.
16. A training device for a recommendation model, characterized in that, include: The acquisition unit is used to acquire a first recommendation model. The model parameters of the first recommendation model are obtained by training based on n first training samples. The first training samples include information of the first user, information of the first recommendation object, and sample labels of the first training samples. The sample labels of the first training samples are used to indicate whether the first user has an operation on the first recommendation object. n is an integer greater than 1. Processing unit, used for: Determine the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The second training sample includes information about the second user and the second recommendation object, as well as the sample label of the second training sample. The sample label of the second training sample is used to indicate whether the second user has an operation on the second recommendation object, and m is an integer greater than 1. The weights corresponding to each first training sample are determined based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model. The first recommendation model is trained based on the n first training samples and their corresponding weights to obtain a target recommendation model. This target recommendation model is used for recommendations in at least one of the following scenarios: app store recommendation, music application recommendation, video website recommendation, e-commerce recommendation, search term recommendation, cross-domain recommendation, advertising recommendation, content recommendation, and reading application recommendation. The n first training samples are obtained when the probability of displaying a candidate recommendation object in the candidate recommendation object set is different, and the first recommendation object is one of the candidate recommendation objects in the candidate recommendation object set. The m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
17. The training apparatus as described in claim 16, characterized in that, The step of determining the weight corresponding to each first training sample based on the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model includes: The weight corresponding to each first training sample is negatively correlated with the influence function value of each first training sample on the validation loss of the m second training samples.
18. The training apparatus as described in claim 16 or 17, characterized in that, The influence function value of each first training sample on the prediction loss of the m second training samples on the first recommendation model satisfies the following formula: ; Among them, z i This represents the i-th first training sample. z represents the influence function value of the i-th first training sample on the prediction loss of the m second training samples in the first recommendation model. j Let j represent the j-th second training sample. This represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
19. The training apparatus as described in claim 18, characterized in that, The processing unit is specifically used for: The weights corresponding to each first training sample satisfy the following formula: ; in, Let α represent the weight corresponding to the i-th first training sample, and let α represent the weighting coefficient. This represents the set of function values representing the influence of the n first training samples on the validation loss of the m second training samples on the first recommendation model.
20. The training apparatus as described in claim 16 or 17, characterized in that, The m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, including: The m second training samples are obtained when candidate recommendation objects in the candidate recommendation object set are randomly shown to the second user; Alternatively, the m second training samples are obtained when the second user searches for the second recommended object.
21. The training apparatus as described in claim 16 or 17, characterized in that, The m second training samples belong to the source domain, and the n first training samples belong to the target domain.
22. A recommendation device, characterized in that, include: The acquisition unit is used to acquire information about the target user and the candidate recommendation objects. The processing unit is used to input the information of the target user and the information of the candidate recommendation objects into the recommendation model, and predict the probability that the target user will perform an operation on the candidate recommendation objects. The recommendation model is used to make recommendations in at least one of the following scenarios: app store recommendation, music application recommendation, video website recommendation, e-commerce recommendation, search term recommendation, cross-domain recommendation, advertising recommendation, content recommendation, and reading application recommendation. The recommendation model's parameters are obtained by training a first recommendation model using n first training samples and their corresponding weights. The first recommendation model is trained on these n first training samples. The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The first training samples include information about a first user, information about a first recommended object, and sample labels for the first training samples. The sample labels of the first training samples indicate whether the first user has performed an action on the first recommended object, where n is an integer greater than 1. The second training samples include information about a second user and information about a second recommended object, as well as sample labels for the second training samples. The sample labels of the second training samples indicate whether the second user has performed an action on the second recommended object, where m is an integer greater than 1. The n first training samples are obtained when the probability of displaying a candidate recommendation object in the candidate recommendation object set is different, and the first recommendation object is one of the candidate recommendation objects in the candidate recommendation object set. The m second training samples are obtained when the probability of displaying candidate recommendation objects in the candidate recommendation object set is the same, and the second recommendation object is one of the candidate recommendation objects in the candidate recommendation object set.
23. The recommended device as described in claim 22, characterized in that, The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples in the first recommendation model, including: The weight corresponding to each first training sample is negatively correlated with the influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model.
24. The recommended apparatus as described in claim 22 or 23, characterized in that, The influence function value of each first training sample on the validation loss of the m second training samples on the first recommendation model satisfies the following formula: ; Among them, z i This represents the i-th first training sample. z represents the influence function value of the i-th first training sample on the prediction loss of the m second training samples in the first recommendation model. j Let j represent the j-th second training sample. This represents the influence function value of the i-th first training sample on the validation loss of the j-th second training sample on the first recommendation model. Indicate z i First recommendation model gradient on, This indicates that m second training samples are used in the first recommendation model. The sum of gradients on, This represents the inverse of the Hessian matrix for all first training samples.
25. The recommended device as claimed in claim 24, characterized in that, The weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model, including the weight corresponding to each first training sample satisfying the following formula: ; in, Let α represent the weight corresponding to the i-th first training sample, and let α represent the weighting coefficient. This represents the set of function values representing the influence of the n first training samples on the validation loss of the m second training samples on the first recommendation model.
26. The recommended apparatus as described in claim 22 or 23, characterized in that, The m second training samples are obtained under the condition that the probability of each candidate recommendation object in the candidate recommendation object set being displayed is the same, including: The m second training samples are obtained when candidate recommendation objects in the candidate recommendation object set are randomly shown to the second user; Alternatively, the m second training samples are obtained when the second user searches for the second recommended object.
27. The recommended apparatus as claimed in claim 22 or 23, characterized in that, The m second training samples belong to the source domain, and the n first training samples belong to the target domain.
28. An electronic device, characterized in that, include: The display unit is used to display a first interface, the first interface including a learning list of at least one application, the learning list of the first application in the learning list of at least one application including at least one option, each of the at least one option being associated with an application; A processing unit, the processing unit being used to sense the user's first operation on the first interface; The display unit is also configured to, in response to the first operation, turn on or off the cross-domain recommendation function of the first application in the applications associated with some or all of the options in the learning list of the first application; The display unit is further configured to display a second interface, which presents one or more recommended objects. These one or more recommended objects are determined by inputting the user's information and the information of the candidate recommended objects into a recommendation model, predicting the probability that the user will perform an action on the candidate recommended objects. The model parameters of the recommendation model are obtained by training a first recommendation model based on n first training samples and the weights corresponding to those n first training samples. The first recommendation model is trained based on the n first training samples, and the weight corresponding to each first training sample is determined based on the influence function value of each first training sample on the validation loss of m second training samples on the first recommendation model. The training samples include information about a first user and information about a first recommended object, as well as sample labels for the first training samples. The sample labels for the first training samples indicate whether the first user has performed an action on the first recommended object. n is an integer greater than 1. The second training samples include information about a second user and information about a second recommended object, as well as sample labels for the second training samples. The sample labels for the second training samples indicate whether the second user has performed an action on the second recommended object. m is an integer greater than 1. The m second training samples are determined based on user behavior data in the application associated with the at least one option, and the n first training samples are determined based on user behavior data in the first application.
29. The electronic device as claimed in claim 28, characterized in that, The first operation applies to the first option, and the display unit is specifically used for: In response to the user's first operation on the first option, the cross-domain recommendation function of the first application in the application associated with the first option is turned on or off; The first option is located in the learning list of the first application.
30. The electronic device as claimed in claim 28, characterized in that, The first operation acts on the switch control corresponding to the learning list of the first application, and the display unit is specifically used for: In response to the user's first operation on the switch control, the cross-domain recommendation function of the first application in the applications associated with all options in the learning list of the first application is turned on or off.
31. A training device for a recommendation model, characterized in that, It includes at least one processor and a memory, the at least one processor being coupled to the memory for reading and executing instructions in the memory to perform the training method as described in any one of claims 1 to 6.
32. A recommended device, characterized in that, It includes at least one processor and a memory, the at least one processor being coupled to the memory for reading and executing instructions in the memory to perform the recommended method as described in any one of claims 7 to 12.
33. An electronic device, characterized in that, include: processor; Memory; The memory stores one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 13 to 15.
34. A computer-readable medium, characterized in that, The computer-readable medium stores program code that, when executed on a computer, causes the computer to perform the method as claimed in any one of claims 1 to 6, or any one of claims 7 to 12, or any one of claims 13 to 15.
Citation Information
Patent Citations
System and method for cross-domain recommendations
US20200142935A1