A recommendation model training method and device
By combining the similarity between candidates that have not been presented to the user and those that have been presented, as well as the differences in recommendation results, the error is calculated and the model is updated. This solves the performance degradation problem caused by position bias in the recommendation system and improves the prediction performance of the recommendation model for random traffic.
Patent Information
- Application Number
- CN202180102753.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2041-09-29
AI Technical Summary
Existing recommendation systems suffer from positional bias, which prevents user feedback data from accurately reflecting user preferences, leading to a decline in recommendation performance.
By acquiring an initial or minimally trained recommendation model and a recommendation model trained based on target user action data, and combining the similarity between candidate objects not presented to the user and presented objects with the differences in recommendation results, the error is calculated and the model is updated to improve recommendation performance.
By combining the similarity of candidate objects and the difference in recommendation results, a more accurate error is calculated, a target loss function is constructed, and the model is trained to improve the prediction performance of random traffic and reduce bias error.
Smart Images

Figure CN118043802B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a method and apparatus for training a recommendation model. Background Technology
[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0003] Selection rate prediction refers to predicting the probability of a user selecting a particular item under specific circumstances. For example, selection rate prediction plays a crucial role in recommendation systems for applications such as app stores and online advertising. By predicting selection rate, businesses can maximize profits and improve user satisfaction. Recommendation systems need to consider both the user's selection rate and the item's bid price. The selection rate is predicted by the recommendation system based on the user's historical behavior, while the item's bid price represents the system's revenue after the item is selected / downloaded. For instance, a function can be constructed that calculates a value based on the predicted user selection rate and the item's bid price. The recommendation system then sorts items in descending order according to this function value.
[0004] As a feedback loop system, recommender systems encounter various biases during user interaction, such as location bias. This location bias means that the user feedback data collected by the recommender system may not accurately reflect the user's true preferences. However, most classic algorithms implicitly assume that observed user preferences are the true preferences and focus on better fitting the observed feedback data distribution. This can cause the recommender system to converge to a biased, suboptimal solution, thus reducing its recommendation performance. Summary of the Invention
[0005] This application provides a recommendation model training method and apparatus, which can improve the prediction performance of a first prediction model for random traffic.
[0006] Firstly, this application provides a method for training a recommendation model, the method comprising:
[0007] Obtain the first recommendation model and multiple first candidate objects;
[0008] In one possible implementation, the first recommendation model can be an initialized model, where the so-called initialized model can be understood as the model whose parameters are randomly initialized. It should be understood that the first recommendation model can also be a model that has been trained a few times and does not have high recommendation performance. Alternatively, the first recommendation model can also be a model trained on log data, which is not accurate for the recommendation results of the full set of data (e.g., non-exposure data) (inaccuracy can be understood as a large difference from the user's actual selection results).
[0009] Optionally, the multiple first-choice objects can be data that the recommendation system has not yet presented to the target user;
[0010] Optionally, the multiple first candidate objects can be objects selected from data that has not yet been presented to the target user;
[0011] Optionally, the multiple first candidate objects can be objects randomly selected from data that has not yet been presented to the target user;
[0012] The term "presentation" can be described as display, showing, etc.
[0013] The phrase "not yet presented to the target users" can be understood as not yet being presented in a single recommendation result.
[0014] In one possible implementation, the first recommendation model can be a machine learning model, which can consist of, for example, a single-layer linear or non-linear operation (e.g., a support vector machine (SVM)) or a deep network, i.e., a machine learning model consisting of multiple layers of non-linear operations. An example of a deep network is a neural network with one or more hidden layers, and such a machine learning model can be trained, for example, by adjusting the weights of the neural network according to a backpropagation learning algorithm, etc.
[0015] The first recommendation model processes the multiple first candidate objects to obtain a first recommendation result;
[0016] In one possible implementation, the multiple first candidate objects can be processed by the first recommendation model, that is, the multiple first candidate objects are used as input to the first recommendation model and a feedforward process of the first recommendation model is performed.
[0017] The multiple first candidate objects are processed by a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the target user's operation data, the operation data includes multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects, the second candidate objects are different from the first candidate objects, and the result obtained by the second recommendation model in processing the multiple second candidate objects is a third recommendation result;
[0018] The second recommendation model can be a model trained based on random traffic. Since the amount of random traffic is small, the recommendation accuracy of the second recommendation model is low (e.g., the variance of the recommendation results is large).
[0019] Among them, the multiple second candidate objects can be the aforementioned random traffic, that is, the multiple second candidate objects can be data that has been presented to the target user, and the target user has already performed operations on the multiple second candidate objects. The operation data can include the multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects.
[0020] In one possible implementation, the true selection result can indicate whether the second candidate object is a positive or negative sample, i.e., the sample type label (label feature). Whether a sample is positive or negative can be determined by identifying the sample type label in the sample. For example, if the sample type label of a sample is 1, it indicates that the sample is a positive sample; if the sample type label of a sample is 0, it indicates that the sample is a negative sample. The sample type label of a sample is determined by the user's operation information on the object described by the features in that sample.
[0021] Based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the actual selection result, the error of the second recommendation result is predicted, wherein the error is negatively correlated with the similarity and positively correlated with the first difference;
[0022] In one possible implementation, when the second recommendation model processes multiple first candidate objects, it can obtain a second recommendation result. However, since the recommendation accuracy of the second recommendation model is low, the second recommendation result cannot be considered to represent the user's true intention (that is, there is an error between the second recommendation result and the user's true intention).
[0023] In order to predict the error between the second recommendation result and the user's true intention, in this embodiment of the application, the error of the second recommendation result can be predicted based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the true selection result.
[0024] In one possible implementation, the second recommendation model can obtain a third recommendation result when processing multiple second candidate objects. Since the recommendation accuracy of the second recommendation model is low, the third recommendation result cannot be considered to represent the user's true intention (that is, there is an error between the third recommendation result and the true selection result).
[0025] It should be understood that the multiple second candidate objects processed by the second recommendation model when obtaining the third recommendation result do not necessarily have to be completely identical when training the second recommendation model. For example, they may have overlap or no overlap.
[0026] On the one hand, the first difference between the third recommendation result and the true selection result can, to some extent, express the model error of the second recommendation model, that is, the error of the second recommendation result. Optionally, the error of the second recommendation result is positively correlated with the first difference. The so-called positive correlation can be understood as the greater the first difference between the third recommendation result and the true selection result, the greater the error of the second recommendation result (assuming other information remains unchanged).
[0027] It should be understood that the first difference here can be measured based on Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Pearson correlation coefficient, etc., and is not limited here;
[0028] On the other hand, when the similarity between multiple first-candidate objects and multiple second-candidate objects is large, the error of the second recommendation result can be considered large (the reason is that when the similarity between multiple first-candidate objects and multiple second-candidate objects is small, it is equivalent to multiple first-candidate objects being training samples not used when training the second prediction model. For the data features of multiple first-candidate objects, the data processing accuracy of the second prediction model is lower than that when processing multiple second-candidate objects, which means the error of the second recommendation result is larger). In other words, the error of the second recommendation result is negatively correlated with the similarity between multiple first-candidate objects and multiple second-candidate objects. The so-called negative correlation can be understood as the greater the similarity between multiple first-candidate objects and multiple second-candidate objects, the smaller the error of the second recommendation result (assuming other information remains unchanged).
[0029] It should be understood that the similarity here can be measured based on Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Pearson correlation coefficient, etc., and is not limited here;
[0030] Based on the third difference between the first recommendation result and the second recommendation result, and the error, a target loss is determined, and the first recommendation model is updated according to the target loss.
[0031] This application provides a method for training a recommendation model, the method comprising: acquiring a first recommendation model and a plurality of first candidate objects; processing the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result; processing the plurality of first candidate objects through a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the operation data of a target user, the operation data including a plurality of second candidate objects and the target user's actual selection results for the plurality of second candidate objects, the second candidate objects being different from the first candidate objects, and the result obtained by the second recommendation model in processing the plurality of second candidate objects being a third recommendation result; predicting an error of the second recommendation result based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and a first difference between the third recommendation result and the actual selection result, the error being negatively correlated with the similarity and positively correlated with the first difference; determining a target loss based on the third difference between the first recommendation result and the second recommendation result, and the error, and updating the first recommendation model based on the target loss. In the above manner, the third difference between the first recommendation result and the second recommendation result can characterize the difference between the first prediction model and the second prediction model. Although the prediction performance of the second prediction model itself is not high (because the number of training samples for the second prediction model, i.e., the number of multiple second candidate objects, is low), the error calculated above can characterize the processing error of the second prediction model. The result of combining the third difference between the first recommendation result and the second recommendation result and the error (e.g., direct addition or other fusion operations) can more accurately characterize the difference between the prediction result and the accurate result of the first recommendation result. The target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
[0032] In one possible implementation, the plurality of first candidate objects are objects that have not been presented to the target user, and the plurality of second candidate objects are objects that have been presented to the target user.
[0033] Among them, the multiple second candidate objects can be the aforementioned random traffic, that is, the multiple second candidate objects can be data that has been presented to the target user, and the target user has already performed operations on the multiple second candidate objects. The operation data can include the multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects.
[0034] In one possible implementation, the plurality of second candidate objects are randomly selected from a plurality of objects already presented to the target user, while the plurality of first candidate objects are randomly selected from a plurality of objects not yet presented to the target user. Using randomly selected objects as training samples can reduce the error in the recommendation model due to bias.
[0035] In one possible implementation, the error is also negatively correlated with the number of second candidate objects among the plurality of second candidate objects. Although the number of second candidate objects among the plurality of second candidate objects is not high, the larger the number of second candidate objects among the plurality of second candidate objects, the higher the recommendation accuracy of the second recommendation model can be considered. Therefore, the error can also be negatively correlated with the number of second candidate objects among the plurality of second candidate objects. The so-called negative correlation can be understood as the larger the number of second candidate objects among the plurality of second candidate objects, the smaller the error of the second recommendation result (assuming other information remains unchanged).
[0036] In one possible implementation, the error includes a bias term corresponding to the second recommendation result, a variance term corresponding to the second recommendation result, and the first difference summation, wherein the bias term is negatively correlated with the similarity and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0037] In one possible implementation, the first recommendation result and the second recommendation result each include a recommendation score for each of the first candidate objects; or, the first recommendation result and the second recommendation result each include a target recommendation object selected from the plurality of first candidate objects.
[0038] The recommendation score represents the predicted score of the first recommendation model for each first candidate object. The target recommendation object can be determined according to the specific settings of the first recommendation model, such as recommending according to a preset number and sorting by score. For example, if the model is set to recommend the top ten candidates by their scores, then the top ten candidates by their scores will be determined as the target recommendation objects.
[0039] In one possible implementation, the method further includes: processing the plurality of second candidate objects through the first recommendation model to obtain a fourth recommendation result; determining the target loss based on the third difference between the first recommendation result and the second recommendation result, and the error, includes: determining the target loss based on the third difference between the first recommendation result and the second recommendation result, the fourth difference between the fourth recommendation result and the true selection result, and the error. Log data and labeled random traffic can also be used to train the first prediction model. When using log data to train the first prediction model, the log data can be processed based on the first prediction model, and the difference between the processed result and the true label of the log data can be used as part of the target loss. When using labeled random traffic to train the first prediction model, the plurality of second candidate objects can be processed through the first recommendation model to obtain a fourth recommendation result, and the fourth difference between the fourth recommendation result and the true selection result can be used as part of the target loss. Using the fourth difference as part of the target loss can more accurately express the difference between the output of the first recommendation model and the accurate label, and thus updating the first recommendation model based on the target loss can improve the recommendation accuracy of the first recommendation model.
[0040] In one possible implementation, the method further includes: obtaining user attributes of the target user, the user attributes including at least one of the following: gender, age, occupation, income, hobbies, and education level; processing the plurality of first recommendation objects through the first recommendation model includes: processing the plurality of first recommendation objects and the user attributes through the first recommendation model; processing the plurality of first recommendation objects through the second recommendation model includes: processing the plurality of first recommendation objects and the user attributes through the second recommendation model.
[0041] In one possible implementation, the input data of the feedforward process of the first recommendation model may include, in addition to multiple first candidate objects, user attributes of the target user, wherein the user attributes may include at least one of the following: gender, age, occupation, income, hobbies, and education level.
[0042] The target user's attribute information can be attributes related to user preferences, such as at least one of gender, age, occupation, income, hobbies, and education level. Gender can be male or female, age can be a number between 0 and 100, occupation can be teacher, programmer, chef, etc., hobbies can be basketball, tennis, running, etc., and education level can be primary school, junior high school, high school, university, etc. This application does not limit the specific type of the target user's attribute information.
[0043] In one possible implementation, obtaining multiple first candidate objects can be understood as obtaining the feature information of each first candidate object among multiple first candidate objects. This feature information can be one or more, such as including one or more of the following: the name of the candidate object (or object identifier (ID)), the identifier (ID) of the APP recommendation result to which the object belongs (e.g., utility tools, audio and video entertainment, etc.), a brief introduction of the candidate object, the size of the candidate object (e.g., when the candidate object is an APP, the size of the candidate object can be the size of the candidate object's installation package), the developer of the candidate object, the tags of the object (e.g., tags can indicate the category of the candidate object), and the reviews of the candidate object (e.g., the positive review rate of the candidate object), etc. Of course, it may also include other attribute information of the object instead of the information listed here.
[0044] In one possible implementation, the method further includes: acquiring the operation data, wherein the operation data is obtained by the terminal device based on the target user's operation on the target interface, the target interface including a first interface and a second interface, the first interface including a control, the control being used to indicate whether to enable random traffic collection, the operation including a first operation by the target user on the first control, the second interface being an interface displayed in response to the first operation, the first operation being used to indicate enabling the random traffic collection, the second interface including the plurality of second candidate objects, the operation further including a second operation by the target user on the plurality of second candidate objects, the second operation being used to determine the actual selection result.
[0045] Secondly, this application provides a recommendation model training device, the device comprising:
[0046] The acquisition module is used to acquire the first recommendation model and multiple first candidate objects;
[0047] The feedforward module is used to process the multiple first candidate objects through the first recommendation model to obtain a first recommendation result;
[0048] The multiple first candidate objects are processed by a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the target user's operation data, the operation data includes multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects, the second candidate objects are different from the first candidate objects, and the result obtained by the second recommendation model in processing the multiple second candidate objects is a third recommendation result;
[0049] An error determination module is used to predict the error of the second recommendation result based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the actual selection result, wherein the error is negatively correlated with the similarity and positively correlated with the first difference;
[0050] An update module is used to determine a target loss based on a third difference between the first recommendation result and the second recommendation result, and the error, and to update the first recommendation model according to the target loss.
[0051] In this application, the third difference between the first recommendation result and the second recommendation result can characterize the difference between the first prediction model and the second prediction model. Although the prediction performance of the second prediction model itself is not high (because the number of training samples for the second prediction model, i.e., the number of multiple second candidate objects, is low), the error calculated above can characterize the processing error of the second prediction model. The result of combining the third difference between the first recommendation result and the second recommendation result and the error (e.g., direct addition or other fusion operations) can more accurately characterize the difference between the prediction result and the accurate result of the first recommendation result. The target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
[0052] In one possible implementation, the first recommendation model is the initialized model.
[0053] In one possible implementation, the plurality of first candidate objects are objects that have not been presented to the target user, and the plurality of second candidate objects are objects that have been presented to the target user.
[0054] In one possible implementation, the plurality of second candidate objects are randomly selected from a plurality of objects that have been presented to the target user, and the plurality of first candidate objects are randomly selected from a plurality of objects that have not been presented to the target user.
[0055] In one possible implementation, the error is also negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0056] In one possible implementation, the error includes a bias term corresponding to the second recommendation result, a variance term corresponding to the second recommendation result, and the first difference summation, wherein the bias term is negatively correlated with the similarity and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0057] In one possible implementation, the first recommendation result and the second recommendation result each include a recommendation score for each of the first candidate objects; or,
[0058] The first recommendation result and the second recommendation result each include a target recommendation object selected from the plurality of first candidate objects.
[0059] In one possible implementation, the feedforward module is further configured to:
[0060] The first recommendation model is used to process the multiple second candidate objects to obtain a fourth recommendation result;
[0061] The update module is specifically used for:
[0062] Based on the third difference between the first recommendation result and the second recommendation result, the fourth difference between the fourth recommendation result and the actual selection result, and the error, the target loss is determined.
[0063] In one possible implementation, the acquisition module is further configured to:
[0064] Obtain the user attributes of the target user, wherein the user attributes include at least one of the following: gender, age, occupation, income, hobbies, and education level;
[0065] The feedforward module is specifically used for:
[0066] The first recommendation model processes the plurality of first recommendation objects and the user attributes;
[0067] The second recommendation model processes the multiple first recommendation objects and the user attributes.
[0068] In one possible implementation, the first candidate object and the second candidate object include at least one of the following information:
[0069] The candidate's name, the candidate's developer, the candidate's installation package size, the candidate's category, and the candidate's approval rating.
[0070] In one possible implementation, the acquisition module is further configured to:
[0071] The operation data is obtained by the terminal device based on the target user's operation on the target interface. The target interface includes a first interface and a second interface. The first interface includes a control for indicating whether to enable random traffic collection. The operation includes a first operation by the target user on the first control. The second interface is an interface displayed in response to the first operation. The first operation is used to indicate enabling the random traffic collection. The second interface includes the plurality of second candidate objects. The operation also includes a second operation by the target user on the plurality of second candidate objects. The second operation is used to determine the actual selection result.
[0072] Thirdly, embodiments of this application provide a computing device that may include a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform any of the optional methods described in the first aspect above.
[0073] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the first aspect and any optional method described above, as well as the second aspect and any optional method described above.
[0074] Fifthly, embodiments of this application provide a computer program product, including code, which, when executed, is used to implement the first aspect and any optional method described above.
[0075] Sixthly, this application provides a chip system including a processor for supporting an execution device or training device in implementing the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the execution device or training device. This chip system may be composed of chips or may include chips and other discrete devices.
[0076] This application provides a method for training a recommendation model, the method comprising: acquiring a first recommendation model and a plurality of first candidate objects; processing the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result; processing the plurality of first candidate objects through a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the operation data of a target user, the operation data including a plurality of second candidate objects and the target user's actual selection results for the plurality of second candidate objects, the second candidate objects being different from the first candidate objects, and the result obtained by the second recommendation model in processing the plurality of second candidate objects being a third recommendation result; predicting an error of the second recommendation result based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and a first difference between the third recommendation result and the actual selection result, the error being negatively correlated with the similarity and positively correlated with the first difference; determining a target loss based on the third difference between the first recommendation result and the second recommendation result, and the error, and updating the first recommendation model based on the target loss. In the above manner, the third difference between the first recommendation result and the second recommendation result can characterize the difference between the first prediction model and the second prediction model. Although the prediction performance of the second prediction model itself is not high (because the number of training samples for the second prediction model, i.e., the number of multiple second candidate objects, is low), the error calculated above can characterize the processing error of the second prediction model. The result of combining the third difference between the first recommendation result and the second recommendation result and the error (e.g., direct addition or other fusion operations) can more accurately characterize the difference between the prediction result and the accurate result of the first recommendation result. The target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic. Attached Figure Description
[0077] Figure 1 A structural diagram illustrating the main framework of artificial intelligence;
[0078] Figure 2 A schematic diagram of a system architecture provided for an embodiment of this application;
[0079] Figure 3 A schematic diagram of a system architecture provided for an embodiment of this application;
[0080] Figure 4 A schematic diagram illustrating a recommendation flow scenario provided in an embodiment of this application;
[0081] Figure 5 A flowchart illustrating a recommendation model training method provided in an embodiment of this application;
[0082] Figure 6a This is a schematic diagram of a first interface;
[0083] Figure 6b This is a schematic diagram of a second interface;
[0084] Figure 6c A flowchart illustrating a recommendation model training method provided in an embodiment of this application;
[0085] Figure 7 A flowchart illustrating a recommendation model training method provided in an embodiment of this application;
[0086] Figure 8 A flowchart illustrating a training apparatus for a recommendation model provided in an embodiment of this application;
[0087] Figure 9 A schematic diagram of an execution device provided in an embodiment of this application;
[0088] Figure 10 A schematic diagram of a training device provided in an embodiment of this application;
[0089] Figure 11 This is a schematic diagram of a chip provided in an embodiment of this application. Detailed Implementation
[0090] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the invention.
[0091] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0092] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0093] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1 , Figure 1 The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.
[0094] (1) Infrastructure
[0095] Infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. This communication occurs through sensors; computing power is provided by intelligent chips (hardware acceleration chips such as CPUs, NPUs, GPUs, ASICs, and FPGAs); and the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.
[0096] (2) Data
[0097] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.
[0098] (3) Data processing
[0099] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.
[0100] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training of data by symbolizing and formalizing it.
[0101] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.
[0102] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.
[0103] (4) General ability
[0104] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0105] (5) Smart Products and Industry Applications
[0106] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.
[0107] This application's embodiments can be applied to the field of information recommendation, including but not limited to e-commerce product recommendations, search engine result recommendations, app store recommendations, music recommendations, and video recommendations. The recommended items in various application scenarios are hereinafter referred to as "objects" for ease of subsequent description. That is, in different recommendation scenarios, the recommended object can be an app, a video, music, or a product (such as the presentation interface of an online shopping platform, which displays different products based on different users; this can essentially be presented through the recommendation results of a recommendation model). These recommendation scenarios typically involve user behavior log collection, log data preprocessing (e.g., quantization, sampling), sample set training to obtain a recommendation model, and analysis and processing of the objects (such as apps, music, etc.) involved in the scenarios corresponding to the training sample items based on the recommendation model. For example, if the samples selected in the recommendation model training stage come from the user's operational behavior towards the recommended app in a mobile app store, then the recommendation model trained in this way is applicable to the aforementioned mobile app app store, or can be used for recommending terminal apps in other types of terminal app app stores. The recommendation model will eventually calculate the recommendation probability or score of each object to be recommended. The recommendation system selects the recommendation results according to certain selection rules, such as sorting them according to the recommendation probability or score. The results are then presented to the user through the corresponding application or terminal device. The user interacts with the objects in the recommendation results to generate user behavior logs, etc.
[0108] Reference Figure 4In the recommendation process, when a user interacts with the recommendation system, a recommendation request is triggered. The system inputs this request and its related feature information into the deployed recommendation model, then predicts the click-through rate (CTR) of the user for all candidate items. Subsequently, the candidate items are sorted in descending order based on the predicted CTR and displayed sequentially in different positions as the recommendation result for the user. Users browse the displayed items and perform user actions, such as browsing, clicking, and downloading. These user actions are stored in logs as training data, and the parameters of the recommendation model are periodically updated through an offline training module to improve the model's recommendation performance.
[0109] For example, when a user opens the app store, the recommendation module is triggered. This module predicts the likelihood of the user downloading a given set of candidate apps based on the user's download history, click history, app characteristics, and environmental factors such as time and location. Based on the predictions, the app store displays apps in descending order of probability, thus increasing the likelihood of app downloads. Specifically, apps more likely to be downloaded are listed first, while those less likely are listed last. User behavior is also logged and used to train and update the prediction model's parameters through an offline training module.
[0110] For example, in applications related to lifelong partners, historical data from users across domains such as video, music, and news can be used to construct a cognitive brain, mimicking the mechanisms of the human brain, and build a framework for a lifelong learning system. Lifelong partners can record past events based on system and application data, understand current intentions, predict future actions or behaviors, and ultimately provide intelligent services. In the current first phase, user behavior data (including information such as SMS messages, photos, and email events) obtained from music apps, video apps, and browser apps is used to build a user profile system and implement learning and memory modules based on user information filtering, association analysis, cross-domain recommendation, and causal reasoning to construct a personal knowledge graph for each user.
[0111] The application architecture of this application embodiment will be described next.
[0112] See appendix Figure 2This invention provides a recommendation system architecture 200. A data acquisition device 260 is used to collect samples. A training sample can consist of multiple feature information, which can be of various types, specifically including user feature information, object feature information, and tag features. User feature information is used to characterize user characteristics, such as gender, age, occupation, hobbies, etc. Object feature information is used to characterize the features of the objects pushed to the user. Different recommendation systems correspond to different objects, and the types of features extracted for different objects are also different. For example, the object features extracted from the training samples of an APP market can be the APP's name (identifier), type, size, etc.; while the training samples of e-commerce APPs... The object features mentioned here can include the name of the product, its category, price range, etc.; the tag features are used to indicate whether the sample is a positive or negative example. Typically, the tag features of a sample can be obtained from the user's actions on the recommended object. Samples where the user has performed an action on the recommended object are positive examples, while samples where the user has not performed an action or has only browsed the recommended object are negative examples. For example, if a user clicks on, downloads, or purchases a recommended object, the tag feature is 1, indicating that the sample is a positive example; if the user has not performed any action on the recommended object, the tag feature is 0, indicating that the sample is a negative example. After collection, samples can be stored in database 230. Some or all of the feature information of the samples in database 230 can also be directly obtained from the client device 240, such as user feature information, user action information on objects (used to determine type identification), and object feature information (such as object identification). Training device 220 trains and obtains the model parameter matrix based on the samples in database 230 to generate recommendation model 201. The following describes in more detail how the training device 220 trains to obtain the model parameter matrix used to generate the recommendation model 201. The recommendation model 201 can be used to evaluate a large number of objects to obtain the score of each object to be recommended. Furthermore, it can recommend a specified or preset number of objects from the evaluation results of a large number of objects. The calculation module 211 obtains the recommendation results based on the evaluation results of the recommendation model 201 and recommends them to the client device through the I / O interface 212.
[0113] In this embodiment, the training device 220 can select positive and negative samples from the sample set in the database 230 and add them to the training set. Then, it uses a recommendation model (such as the first recommendation model in this embodiment) to train the samples in the training set to obtain the trained recommendation model. The implementation details of the calculation module 211 can be found in [reference needed]. Figure 5 A detailed description of the method embodiments shown.
[0114] After training the model parameter matrix based on the samples, the training device 220 uses it to construct the recommendation model 201 and then sends the recommendation model 201 to the execution device 210. Alternatively, the model parameter matrix can be directly sent to the execution device 210, where the recommendation model is constructed for use in the corresponding system. For example, a recommendation model trained based on video-related samples can be used to recommend videos to users on video websites or apps, while a recommendation model trained based on app-related samples can be used to recommend apps to users in app stores.
[0115] The execution device 210 is equipped with an I / O interface 212 for data interaction with external devices. The execution device 210 can obtain user characteristic information from the client device 240 through the I / O interface 212, such as user identifier, user identity, gender, occupation, and hobbies. This information can also be obtained from the system database. The recommendation model 201 recommends target objects to the user based on the user characteristic information and the characteristic information of the objects to be recommended. The execution device 210 can be located on a cloud server or on the user client.
[0116] The execution device 210 can access data, code, etc., in the data storage system 250, and can also store output data into the data storage system 250. The data storage system 250 can be located within the execution device 210, can be set up independently, or can be located in other network entities; there can be one or multiple such systems.
[0117] The calculation module 211 uses the recommendation model 201 to process the user feature information and the feature information of the object to be recommended. For example, the calculation module 211 uses the recommendation model 201 to analyze and process the user feature information and the feature information of the object to be recommended, thereby obtaining the score of the object to be recommended. The objects to be recommended are sorted according to the score, and the objects ranked higher will be recommended to the client device 240.
[0118] Finally, I / O interface 212 returns the recommendation results to client device 240 and presents them to the user.
[0119] At a deeper level, the training device 220 can generate corresponding recommendation models 201 based on different sample feature information for different targets, so as to provide users with better results.
[0120] It is worth noting that, attached Figure 2 This is merely a schematic diagram of a system architecture provided by an embodiment of the present invention. The positional relationships between the devices, components, modules, etc. shown in the diagram do not constitute any limitation. For example, in the attached diagram... Figure 2In this context, the data storage system 250 is an external memory relative to the execution device 210. In other cases, the data storage system 250 may also be placed within the execution device 210.
[0121] In this embodiment, the training device 220, the execution device 210, and the client device 240 may be three different physical devices. Alternatively, the training device 220 and the execution device 210 may be on the same physical device or a cluster, or the execution device 210 and the client device 240 may be on the same physical device or a cluster.
[0122] See appendix Figure 3 This is a system architecture 300 proposed in an embodiment of the present invention. In this architecture, the execution device 210 is implemented by one or more servers, 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 in the data storage system 250 or call program code in the data storage system 250 to implement the object recommendation function. Specifically, the information of the object to be recommended is input into the recommendation model. The recommendation model generates an estimated score for each object to be recommended, and then sorts them in descending order of the estimated scores. The object to be recommended is then recommended to the user according to the sorting result. For example, the top 10 objects in the sorting result are recommended to the user.
[0123] The data storage system 250 is used to receive and store the parameters of the recommendation model sent by the training device, as well as the data for storing the recommendation results obtained through the recommendation model. It may also include the program code (or instructions) required for the normal operation of the storage system 250. The data storage system 250 can be a distributed storage cluster consisting of one or more devices deployed outside the execution device 210. In this case, when the execution device 210 needs to use data on the storage system 250, the storage system 250 can send the required data to the execution device 210, and the execution device 210 receives and stores (or caches) the data. Alternatively, the data storage system 250 can be deployed within the execution device 210. When deployed within the execution device 210, the distributed storage system can include one or more storage devices. Optionally, when multiple storage devices exist, different storage devices are used to store different types of data. For example, the model parameters of the recommendation model generated by the training device and the recommendation results obtained through the recommendation model can be stored on two different storage devices.
[0124] Users can interact with execution device 210 by operating their respective user devices (e.g., local device 301 and local device 302). 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.
[0125] 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.
[0126] In another implementation, execution device 210 can be implemented by a local device. For example, local device 301 can implement the recommendation function of execution device 210 based on the recommendation model to obtain user feature information and provide recommendation results to the user, or provide services to the user of local device 302.
[0127] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts such as neural networks involved in the embodiments of this application will be introduced below.
[0128] 1. Click-through rate (CTR)
[0129] Click probability, also known as click-through rate, refers to the ratio of the number of clicks to the number of impressions of recommended information (e.g., recommended items) on a website or application. Click-through rate is usually an important metric for evaluating recommendation systems.
[0130] 2. Personalized Recommendation System
[0131] A personalized recommendation system refers to a system that analyzes a user's historical data (such as the operation information in the embodiments of this application) using machine learning algorithms, and uses this data to predict new requests and provide personalized recommendation results.
[0132] 3. Offline training
[0133] Offline training refers to a module in a personalized recommendation system that iteratively updates the parameters of the recommendation model according to the algorithm learned by the machine learning, based on the user's historical data (such as the operation information in the embodiments of this application), until the set requirements are met.
[0134] 4. Online Inference
[0135] Online prediction refers to using a model trained offline to predict a user's preference for recommended items in the current context, based on the characteristics of the user, the item, and the context, and to predict the probability that the user will choose the recommended item.
[0136] 5. Counterfactual techniques: Utilizing counterfactual reasoning to learn about the unobserved world, expanding the space for imagination, breaking free from the constraints of the real world, and creating new things.
[0137] 6. Random Traffic: For user requests, we intervene in the recommendation system. Instead of using recommendation strategies to assign items, we randomly sample some items from all candidate sets, sort them randomly, and then display them to the user and collect corresponding feedback.
[0138] 7. Log data: From the perspective of counterfactual learning, the current collection of user log data has various bias problems (position bias, selection bias, etc.) and is considered to be biased data.
[0139] 8. Exposure data: Data displayed to users by the recommendation system.
[0140] 9. Undisclosed data: Data that the recommendation system has not yet shown to users.
[0141] 10. Full Data: Suppose that the recommendation system can show all items to the user and collect the user's feedback on all items. This collected data is called full data.
[0142] 11. Location bias: describes a user’s tendency to choose to interact with items in a better location, regardless of whether the item meets the user’s actual needs.
[0143] 12. Selection bias: This occurs when the “study group” cannot represent the “target group”, so that the risk / reward measurement of the “study group” cannot accurately represent the “target group”, resulting in the conclusions not being effectively generalized.
[0144] 13. Positive Examples: Also known as positive samples, these are samples that have received positive feedback from users, such as samples with download or purchase behavior.
[0145] 15. Negative examples: also known as negative samples, these are samples that have received negative feedback from users, such as negative reviews or samples with only browsing behavior.
[0146] 16. Training set: The set of samples used to train the model.
[0147] 17. Labels: Mark whether a sample is a positive or negative example, for example, 1 for a positive example and 0 for a negative example.
[0148] 18. Lifelong Learning: Based on users' historical data in areas such as video, music, and news, various models and algorithms are used to mimic the human brain's mechanisms, constructing a cognitive brain and building a framework for a lifelong learning system. Through personalized learning and reasoning, the system understands users' true intentions, enabling precise service recommendations and enhancing user engagement.
[0149] 19. Neural Networks
[0150] A neural network can be composed of neural units, which can be defined as a computational unit that takes xs (i.e., input data) and an intercept of 1 as input. The output of this computational unit can be:
[0151]
[0152] Where s = 1, 2, ..., n, where n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer, and the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple 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.
[0153] 20. Deep Neural Networks
[0154] Deep Neural Networks (DNNs), also known as multilayer neural networks, can be understood as neural networks with many hidden layers, though there's no specific metric for "many." DNNs can be categorized into three layers based on their position: input layers, hidden layers, and output layers. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. All layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer. Although DNNs appear complex, the operation of each layer is actually quite simple, resembling a linear relationship as follows: in, It is the input vector. It is the output vector. α is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is simply an adjustment of the input vector. The output vector is obtained through such a simple operation. Because DNNs have many layers, the coefficients W and the offset vector... The number of these parameters is therefore quite large. The definitions of these parameters in a DNN are 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 resides, while the subscript corresponds to the output third layer index 2 and the input second layer index 4. In summary, the coefficients from the k-th neuron in layer L-1 to the j-th neuron in layer L are defined as follows: 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).
[0155] 21. Loss Function
[0156] 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.
[0157] 22. Backpropagation Algorithm
[0158] Backpropagation (BP) can be used during training to correct the parameters in the initial model, thereby reducing the model's 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 in the initial model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining optimal model parameters, such as the weight matrix.
[0159] The following section uses the model training phase as an example to illustrate the recommended model training method provided in this application.
[0160] Reference Figure 5 , Figure 5 An embodiment of a recommendation model training method provided in this application is illustrated below. Figure 5 As shown, a recommended method provided in this application embodiment includes:
[0161] 501. Obtain the first recommendation model and multiple first candidate objects.
[0162] In this embodiment, the execution entity of step 501 can be a cloud-side server or an edge device with model training capabilities. This is not limited here. The specific structure can be referred to, but not limited to, the description of the training device 220 in the above embodiment.
[0163] In one possible implementation, the first recommendation model can be an initialized model, where the so-called initialized model can be understood as the model whose parameters are randomly initialized. It should be understood that the first recommendation model can also be a model that has been trained a few times and does not have high recommendation performance. Alternatively, the first recommendation model can also be a model trained on log data, which is not accurate for the recommendation results of the full set of data (e.g., non-exposure data) (inaccuracy can be understood as a large difference from the user's actual selection results).
[0164] In one possible implementation, the first recommendation model can be a machine learning model, which can consist of, for example, a single-layer linear or non-linear operation (e.g., a support vector machine (SVM)) or a deep network, i.e., a machine learning model consisting of multiple layers of non-linear operations. An example of a deep network is a neural network with one or more hidden layers, and such a machine learning model can be trained, for example, by adjusting the weights of the neural network according to a backpropagation learning algorithm.
[0165] To mitigate the impact of location bias on recommendation models, random traffic data can be used for training. This random traffic data can be understood as presenting recommended items to the target user by randomly selecting items from a candidate set, allowing the user to interact with the recommended items (e.g., select or not select). This approach can be called unbiased optimization with random traffic, aiming to introduce random traffic collected by a random strategy to provide unbiased information, thereby guiding existing log-based recommendation models to alleviate bias problems during training. The random strategy does not rely on any recommendation model but randomly selects items from the candidate set and displays them in a random order. Since the source of bias is avoided as much as possible, the random traffic collected under this strategy can be considered a proxy for an unbiased distribution; that is, the recommendation model trained on random traffic is also relatively unbiased.
[0166] However, collecting random traffic is costly because it can harm platform revenue and user experience. Therefore, random traffic collection is typically limited to a small percentage of recommendations, resulting in a sparse amount of random traffic relative to log data. Random traffic at this scale may not be a good substitute for an ideal distribution.
[0167] To address the issue of insufficient random traffic, some objects can be randomly selected from unexposed data (i.e., objects not presented to the target user), and the target user's choices for these objects can be predicted. This allows for the construction of a larger dataset equivalent to random traffic, which can then be used as training samples. How to accurately predict the target user's choices for these objects will be described in subsequent embodiments.
[0168] Optionally, the multiple first-choice objects can be data that the recommendation system has not yet presented to the target user;
[0169] Optionally, the multiple first candidate objects can be objects selected from data that has not yet been presented to the target user;
[0170] Optionally, the multiple first candidate objects can be objects randomly selected from data that has not yet been presented to the target user;
[0171] The term "presentation" can be described as display, showing, etc.
[0172] The phrase "not yet presented to the target users" can be understood as not yet being presented in a single recommendation result.
[0173] Optionally, multiple first candidate objects can be objects presented in the same recommendation result at the same time, and the recommendation result can be all or part of the recommendation system from which the samples are sourced. For example, a sample set includes sample 1, sample 2, and sample 3. Sample 1 contains features describing object 1, sample 2 contains features describing object 2, and sample 3 contains features describing object 3; here, object 1, object 2, and object 3 are three objects displayed in the same recommendation result at the same time. To facilitate understanding, let's illustrate "objects displayed in the same recommendation result" with another example. When we open the main page of the app store, the app store will display recommendations for "utility tools" apps, "audio-visual entertainment" apps, etc. Among them, the recommendations for "utility tools" apps and "audio-visual entertainment" apps do not belong to the same recommendation result; these recommendations will be displayed when the user uses the app store one day and the same day the user uses the app store the next day. The recommendation result displayed one day and the recommendation result displayed the next day do not belong to the same display.
[0174] Optionally, obtaining multiple first candidate objects can be understood as obtaining the feature information of each first candidate object among multiple first candidate objects. This feature information can be one or more, such as the name of the candidate object (or object identifier (ID)), the identifier (ID) of the APP recommendation result to which the object belongs (e.g., utility tools, audio and video entertainment, etc.), the description of the candidate object, the size of the candidate object (e.g., when the candidate object is an APP, the size of the candidate object can be the size of the candidate object's installation package), the developer of the candidate object, the tags of the object (e.g., tags can indicate the category of the candidate object), the reviews of the candidate object (e.g., the positive review rate of the candidate object), etc. Of course, it may not include the information listed here but include other attribute information of the object.
[0175] 502. Process the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result;
[0176] In one possible implementation, the multiple first candidate objects can be processed by the first recommendation model, that is, the multiple first candidate objects are used as input to the first recommendation model and a feedforward process of the first recommendation model is performed.
[0177] In one possible implementation, the input data of the feedforward process of the first recommendation model may include, in addition to multiple first candidate objects, user attributes of the target user, wherein the user attributes may include at least one of the following: gender, age, occupation, income, hobbies, and education level.
[0178] The target user's attribute information can be attributes related to user preferences, such as at least one of gender, age, occupation, income, hobbies, and education level. Gender can be male or female, age can be a number between 0 and 100, occupation can be teacher, programmer, chef, etc., hobbies can be basketball, tennis, running, etc., and education level can be primary school, junior high school, high school, university, etc. This application does not limit the specific type of the target user's attribute information.
[0179] In one possible implementation, the output of the feedforward process of the first recommendation model can be a first recommendation result. Optionally, the first recommendation result can include the recommendation score of each of the first candidate objects; or, a target recommendation object selected from the plurality of first candidate objects, wherein the target recommendation object can be a subset of the plurality of first candidate objects (e.g., the plurality of objects with the highest recommendation scores).
[0180] The recommendation score represents the predicted score of the first recommendation model for each first candidate object. The target recommendation object can be determined according to the specific settings of the first recommendation model, such as recommending according to a preset number and sorting by score. For example, if the model is set to recommend the top ten candidates by their scores, then the top ten candidates by their scores will be determined as the target recommendation objects.
[0181] For example, if multiple first candidate objects include APP1, APP2, APP3, APP4, APP5, APP6, APP7, APP8, APP9, and APP10, the user characteristics information of user U1 (e.g., male, age 25, occupation: software engineer, etc.) and the object characteristics information of each of these ten APPs (e.g., APP identifier, APP description, etc.) are input into the first recommendation model. Optionally, the first recommendation model can calculate a predicted score for each of these ten APPs. If the scores calculated for these ten APPs are: APP1 = 3.7, APP2 = 2.2, APP3 = 4.5, APP4 = 4.3, APP5 = 4.8, APP6 = 1, APP7 = 2.5, APP8 = 3.0, APP9 = 3.2, and APP10 = 1.1, then the order results (or list) are obtained by sorting them from high to low according to the predicted scores. Finally, the top 5 objects (if M is pre-configured to equal 5) can be used as the target recommendation objects.
[0182] 503. The plurality of first candidate objects are processed by a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the target user's operation data, the operation data includes a plurality of second candidate objects and the target user's actual selection results for the plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the result obtained by the second recommendation model in processing the plurality of second candidate objects is a third recommendation result.
[0183] The second recommendation model can be a model trained based on random traffic. Since the amount of random traffic is relatively small, the recommendation accuracy of the second recommendation model is low (e.g., the variance of the recommendation results is large).
[0184] Among them, the multiple second candidate objects can be the aforementioned random traffic, that is, the multiple second candidate objects can be data that has been presented to the target user, and the target user has already performed operations on the multiple second candidate objects. The operation data can include the multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects.
[0185] In one possible implementation, operation data can be obtained based on the interface on the terminal. The operation data is obtained by the terminal device based on the target user's operation on the target interface. The target interface includes a first interface and a second interface. The first interface includes controls for indicating whether to enable random traffic collection. The operation includes a first operation by the target user on the first control. The second interface is an interface displayed in response to the first operation. The first operation is used to indicate enabling the random traffic collection. The second interface includes a plurality of second candidate objects. The operation also includes a second operation by the target user on the plurality of second candidate objects, the second operation being used to determine the actual selection result.
[0186] Reference Figure 6a and Figure 6b , Figure 6a This is a schematic diagram of a first-level interface. Figure 6b This is a diagram of a second interface.
[0187] In one possible implementation, the true selection result can indicate whether the second candidate object is a positive or negative sample, i.e., the sample type label (label feature). Whether a sample is positive or negative can be determined by identifying the sample type label in the sample. For example, if the sample type label of a sample is 1, it indicates that the sample is a positive sample; if the sample type label of a sample is 0, it indicates that the sample is a negative sample. The sample type label of a sample is determined by the user's operation information on the object described by the feature in the sample. For example, this operation information is used to represent operations such as "browse," "download," "comment," and "purchase." The operation information means different sample type labels. For example, if the operation is predefined as "browse," the sample type label is used to mark a negative sample; if the operation is predefined as "download," the sample type label is used to mark a positive sample. In practical applications, which operation corresponds to a positive sample and which operation corresponds to a negative sample can be predefined.
[0188] For details on how to train the second prediction model based on the operational data, please refer to the relevant descriptions of model training in the existing technology, which will not be repeated here.
[0189] The descriptions of the model structure, feedforward process, and results of the second recommendation model can be found in the descriptions of the model structure, feedforward process, and results of the first recommendation model in the above embodiments. The similarities will not be repeated here.
[0190] 504. Based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the actual selection result, predict the error of the second recommendation result, wherein the error is negatively correlated with the similarity and positively correlated with the first difference;
[0191] In one possible implementation, when the second recommendation model processes multiple first candidate objects, it can obtain a second recommendation result. However, since the recommendation accuracy of the second recommendation model is low, the second recommendation result cannot be considered to represent the user's true intention (that is, there is an error between the second recommendation result and the user's true intention).
[0192] In order to predict the error between the second recommendation result and the user's true intention, in this embodiment of the application, the error of the second recommendation result can be predicted based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the true selection result.
[0193] In one possible implementation, the second recommendation model can obtain a third recommendation result when processing multiple second candidate objects. Since the recommendation accuracy of the second recommendation model is low, the third recommendation result cannot be considered to represent the user's true intention (that is, there is an error between the third recommendation result and the true selection result).
[0194] It should be understood that the multiple second candidate objects processed by the second recommendation model when obtaining the third recommendation result do not necessarily have to be completely identical when training the second recommendation model. For example, they may have overlap or no overlap.
[0195] On the one hand, the first difference between the third recommendation result and the true selection result can, to some extent, express the model error of the second recommendation model, that is, the error of the second recommendation result. Optionally, the error of the second recommendation result is positively correlated with the first difference. The so-called positive correlation can be understood as the greater the first difference between the third recommendation result and the true selection result, the greater the error of the second recommendation result (assuming other information remains unchanged).
[0196] It should be understood that the first difference here can be measured based on Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Pearson correlation coefficient, etc., and is not limited here.
[0197] On the other hand, when the similarity between multiple first-candidate objects and multiple second-candidate objects is large, the error of the second recommendation result can be considered large (because when the similarity between multiple first-candidate objects and multiple second-candidate objects is small, it is equivalent to multiple first-candidate objects being training samples not used when training the second prediction model. For the data features of multiple first-candidate objects, the data processing accuracy of the second prediction model is lower than that when processing multiple second-candidate objects, which means the error of the second recommendation result is larger). In other words, the error of the second recommendation result is negatively correlated with the similarity between multiple first-candidate objects and multiple second-candidate objects. The so-called negative correlation can be understood as the greater the similarity between multiple first-candidate objects and multiple second-candidate objects, the smaller the error of the second recommendation result (assuming other information remains unchanged).
[0198] It should be understood that the similarity here can be measured based on Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Pearson correlation coefficient, etc., and is not limited here.
[0199] On the other hand, although the number of second candidates among multiple second candidates is not high, the larger the number of second candidates among multiple second candidates, the higher the recommendation accuracy of the second recommendation model can be considered. Therefore, the error can also be negatively correlated with the number of second candidates among multiple second candidates. The so-called negative correlation can be understood as the larger the number of second candidates among multiple second candidates, the smaller the error of the second recommendation result (under the condition that other information remains unchanged).
[0200] In one possible implementation, the error includes a bias term corresponding to the second recommendation result, a variance term corresponding to the second recommendation result, and the first difference summation, wherein the bias term is negatively correlated with the similarity and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0201] In one possible implementation, although the recommendation accuracy of the second recommendation model is lower, it is also based on random flow (i.e., the operation data mentioned above), so it has a certain recommendation accuracy (at least compared to the first recommendation model, the data processing accuracy for random flow is higher). Therefore, the third difference between the first recommendation result and the second recommendation result can be used as part of the loss for updating the first recommendation model, and the aforementioned error can also be used as part of the loss.
[0202] 505. Based on the third difference between the first recommendation result and the second recommendation result, and the error, determine the target loss, and update the first recommendation model according to the target loss.
[0203] In this embodiment, the third difference between the first recommendation result and the second recommendation result can characterize the difference between the first prediction model and the second prediction model. Although the prediction performance of the second prediction model itself is not high (because the number of training samples for the second prediction model, i.e., the number of multiple second candidate objects, is low), the error calculated above can characterize the processing error of the second prediction model. The result of combining the third difference between the first recommendation result and the second recommendation result and the error (e.g., direct addition or other fusion operations) can more accurately characterize the difference between the prediction result and the accurate result of the first recommendation result. The target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
[0204] In addition, log data and labeled random traffic can be used to train the first prediction model.
[0205] When using log data to train the first prediction model, the log data can be processed based on the first prediction model, and the difference between the processed result and the true label of the log data can be used as part of the target loss.
[0206] When training the first prediction model using labeled random flow, the first recommendation model can process the multiple second candidate objects to obtain a fourth recommendation result, and the fourth difference between the fourth recommendation result and the true selection result is used as part of the target loss.
[0207] Specifically, when random traffic acquisition is activated, the system can switch to a training mode based on an unbiased optimization paradigm using random traffic. This training mode aims to make the model trained on log data approximate the full data distribution under a random strategy as closely as possible. The optimization objective is as follows:
[0208]
[0209] Among them, R t The true label representing random traffic, This represents the model's prediction error for random flow.
[0210] Optionally, the error may include a bias term corresponding to the second recommendation result, a variance term corresponding to the second recommendation result, and the first difference summation, wherein the bias term is negatively correlated with the similarity, and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0211] For example, the expression for this error can be illustrated as follows:
[0212]
[0213] Among them, item a This represents the prediction error of the first recommendation model for labeled random traffic (i.e., multiple second candidates); since it is difficult to obtain the corresponding labels of user interactions under the random strategy based on log data, option b is incorrect. It is not optimizable; option c This represents the prediction error of the first recommendation model for log data; term d This indicates the difference in predictions between the first and second recommendation models on unexposed data (i.e., multiple first candidate objects); item e The bias and variance terms represent the prediction error of the second recommendation model on unexposed data (i.e., multiple first candidates), with the last two terms being the bias and variance terms, respectively.
[0214] It should be understood that the expression for the error can be:
[0215]
[0216] Based on not equal to We can obtain:
[0217]
[0218] After obtaining the error, a counterfactual recommendation method based on the upper bound of the generalization error can be executed to obtain the recommendation model. The optimization function (i.e., the target loss) of this recommendation method can be expressed as follows:
[0219]
[0220] The overall process architecture can be referenced from [reference needed]. Figure 6c The process is shown below.
[0221] like Figure 7 As shown, the input data in the framework includes random traffic data (uniform data (S)). t Biased data (non-uniform data) c ) and unobserved data (S uThe output is a recommendation model. After collecting random traffic data, a pre-trained random model is first obtained. Subsequently, the random model and all data sources are input into an unbiased optimization paradigm based on random traffic. Based on different error terms, relevant data is called and the optimization process is performed, ultimately obtaining a more ideal recommendation model. Through the above method, an unbiased optimization paradigm based on random traffic is designed, providing theoretical completeness for the use of random traffic. This paradigm, combined with the unbiased property of random traffic, allows the model to more fully approximate an unbiased distribution. Furthermore, a counterfactual recommendation method based on an upper bound of the generalization error is designed to practically optimize the proposed unbiased optimization paradigm. Direct optimization of the unbiased optimization paradigm is difficult. By deriving an upper bound of the generalization error of this paradigm, the proposed counterfactual recommendation method aims to fully optimize this upper bound, which is statistically equivalent to progressively optimizing the unbiased optimization paradigm.
[0222] Taking lifelong learning projects as an example, these projects may involve video apps, music apps, browser apps, and app store apps. User behavior data obtained from these client-side apps can be used to build a user profile system. User log data also needs to be imported into the learning and memory module to mine more valuable user features from multi-domain data, build a user's personal knowledge base, and combine it with the user profile system to jointly build a user's personal knowledge graph.
[0223] The single-domain recommendation involved in this project requires the use of algorithms in recommendation systems. Inevitably, it suffers from the problem that the data bias in recommendation systems cannot reflect the true behavior of users. Since the lifelong learning project serves users, if the log data collected from each domain has a bias problem, it will not be able to reflect the true behavior of users, and the constructed user personal knowledge graph will also be inaccurate.
[0224] Take app store recommendations as an example. After launching the app store app, you'll see a "Recommended" homepage, which contains multiple lists. Taking featured apps as an example, the app store's recommendation system predicts the probability of a user clicking on a candidate app based on user, candidate product, and contextual features. It then sorts the candidate apps in descending order based on this probability, placing the most likely-to-be-downloaded apps at the top. After seeing the app store's recommendations, users can choose to browse, click, or download based on their interests; these user actions are all recorded in a log.
[0225] The application market uses these accumulated user behavior logs as training data to train the click-through rate (CTR) prediction model offline. However, the collected user behavior logs suffer from issues such as location bias and selection bias. To eliminate the impact of these biases on the CTR prediction model, an unbiased recommendation model is trained using the prediction model training method proposed in this application. This model can effectively avoid the influence of spurious relevance on user preference estimation and helps to uncover users' causal interests.
[0226] Compared with existing technical solutions, to verify the accuracy of the model trained in this application embodiment, two weeks of application market business data were obtained, and a complete offline experiment was conducted to compare the results of current technologies on the AUC metric. Through experimental testing, the following conclusions were drawn: a 4.86% improvement in AUC compared to the baseline. Similar experimental tests were also performed on public datasets using the model trained in this application embodiment, yielding the following conclusions: a 3.25% improvement in AUC and a 170% improvement in nDCG compared to the baseline. Furthermore, the model trained in this application embodiment can effectively improve the recommendation hit rate for long-tail items. In addition, experiments were conducted on the model trained in this application embodiment for interest mining and user profiling systems based on causal inference. The offline experimental results are as follows: in the user profiling system, the gender prediction algorithm improved accuracy by over 3% compared to the baseline, the age multi-classification task improved accuracy by nearly 8% compared to the baseline, and the introduction of counterfactual causal learning reduced the variance of accuracy for each age group by 50%. User interest mining based on counterfactual recommendation replaces the algorithm based on association rule learning, effectively reducing the effective action set of users and providing interpretability for user preference tags.
[0227] This application provides a method for training a recommendation model, the method comprising: acquiring a first recommendation model and a plurality of first candidate objects; processing the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result; processing the plurality of first candidate objects through a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the operation data of a target user, the operation data including a plurality of second candidate objects and the target user's actual selection results for the plurality of second candidate objects, the second candidate objects being different from the first candidate objects, and the result obtained by the second recommendation model in processing the plurality of second candidate objects being a third recommendation result; predicting an error of the second recommendation result based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and a first difference between the third recommendation result and the actual selection result, the error being negatively correlated with the similarity and positively correlated with the first difference; determining a target loss based on the third difference between the first recommendation result and the second recommendation result, and the error, and updating the first recommendation model based on the target loss. In the above manner, the third difference between the first recommendation result and the second recommendation result can characterize the difference between the first prediction model and the second prediction model. Although the prediction performance of the second prediction model itself is not high (because the number of training samples for the second prediction model, i.e., the number of multiple second candidate objects, is low), the error calculated above can characterize the processing error of the second prediction model. The result of combining the third difference between the first recommendation result and the second recommendation result and the error (e.g., direct addition or other fusion operations) can more accurately characterize the difference between the prediction result and the accurate result of the first recommendation result. The target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
[0228] Reference Figure 8 , Figure 8 This is a schematic diagram of the structure of a recommendation model training device provided in an embodiment of this application, referring to... Figure 8 The device 800 may include:
[0229] Module 801 is used to acquire the first recommendation model and multiple first candidate objects;
[0230] For a detailed description of the acquisition module 801, please refer to the description of step 501 in the above embodiments, which will not be repeated here.
[0231] The feedforward module 802 is used to process the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result;
[0232] The multiple first candidate objects are processed by a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the target user's operation data, the operation data includes multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects, the second candidate objects are different from the first candidate objects, and the result obtained by the second recommendation model in processing the multiple second candidate objects is a third recommendation result;
[0233] For a detailed description of the feedforward module 802, please refer to the descriptions of steps 502 and 503 in the above embodiments, which will not be repeated here.
[0234] Error determination module 803 is used to predict the error of the second recommendation result based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the actual selection result, wherein the error is negatively correlated with the similarity and positively correlated with the first difference;
[0235] The specific description of the error determination module 803 can be found in the description of step 504 in the above embodiment, and will not be repeated here.
[0236] The update module 804 is used to determine the target loss based on the third difference between the first recommendation result and the second recommendation result, and the error, and update the first recommendation model according to the target loss.
[0237] The specific description of the update module 804 can be found in the description of step 505 in the above embodiments, and will not be repeated here.
[0238] In one possible implementation, the first recommendation model is the initialized model.
[0239] In one possible implementation, the plurality of first candidate objects are objects that have not been presented to the target user, and the plurality of second candidate objects are objects that have been presented to the target user.
[0240] In one possible implementation, the plurality of second candidate objects are randomly selected from a plurality of objects that have been presented to the target user, and the plurality of first candidate objects are randomly selected from a plurality of objects that have not been presented to the target user.
[0241] In one possible implementation, the error is also negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0242] In one possible implementation, the error includes a bias term corresponding to the second recommendation result, a variance term corresponding to the second recommendation result, and the first difference summation, wherein the bias term is negatively correlated with the similarity and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
[0243] In one possible implementation, the first recommendation result and the second recommendation result each include a recommendation score for each of the first candidate objects; or,
[0244] The first recommendation result and the second recommendation result each include a target recommendation object selected from the plurality of first candidate objects.
[0245] In one possible implementation, the feedforward module is further configured to:
[0246] The first recommendation model is used to process the multiple second candidate objects to obtain a fourth recommendation result;
[0247] The update module is specifically used for:
[0248] Based on the third difference between the first recommendation result and the second recommendation result, the fourth difference between the fourth recommendation result and the actual selection result, and the error, the target loss is determined.
[0249] In one possible implementation, the acquisition module is further configured to:
[0250] Obtain the user attributes of the target user, wherein the user attributes include at least one of the following: gender, age, occupation, income, hobbies, and education level;
[0251] The feedforward module is specifically used for:
[0252] The first recommendation model processes the plurality of first recommendation objects and the user attributes;
[0253] The second recommendation model processes the multiple first recommendation objects and the user attributes.
[0254] In one possible implementation, the first candidate object and the second candidate object include at least one of the following information:
[0255] The candidate's name, the candidate's developer, the candidate's installation package size, the candidate's category, and the candidate's approval rating.
[0256] In one possible implementation, the acquisition module is further configured to:
[0257] The operation data is obtained by the terminal device based on the target user's operation on the target interface. The target interface includes a first interface and a second interface. The first interface includes a control for indicating whether to enable random traffic collection. The operation includes a first operation by the target user on the first control. The second interface is an interface displayed in response to the first operation. The first operation is used to indicate enabling the random traffic collection. The second interface includes the plurality of second candidate objects. The operation also includes a second operation by the target user on the plurality of second candidate objects. The second operation is used to determine the actual selection result.
[0258] In this application, the third difference between the first recommendation result and the second recommendation result can characterize the difference between the first prediction model and the second prediction model. Although the prediction performance of the second prediction model itself is not high (because the number of training samples for the second prediction model, i.e., the number of multiple second candidate objects, is low), the error calculated above can characterize the processing error of the second prediction model. The result of combining the third difference between the first recommendation result and the second recommendation result and the error (e.g., direct addition or other fusion operations) can more accurately characterize the difference between the prediction result and the accurate result of the first recommendation result. The target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
[0259] The following describes an execution device provided in an embodiment of this application. Please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of an execution device provided in an embodiment of this application. The execution device 900 can specifically be a mobile phone, tablet, laptop, smart wearable device, server, etc., and is not limited thereto. The execution device 900 may be equipped with... Figure 10 The data processing apparatus described in the corresponding embodiment is used to implement Figure 10 The corresponding embodiment describes the data processing function. Specifically, the execution device 900 includes: a receiver 901, a transmitter 902, a processor 903, and a memory 904 (wherein the execution device 900 may have one or more processors 903), wherein the processor 903 may include an application processor 9031 and a communication processor 9032. In some embodiments of this application, the receiver 901, transmitter 902, processor 903, and memory 904 may be connected via a bus or other means.
[0260] Memory 904 may include read-only memory and random access memory, and provides instructions and data to processor 903. A portion of memory 904 may also include non-volatile random access memory (NVRAM). Memory 904 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0261] Processor 903 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.
[0262] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 903. Processor 903 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the hardware of processor 903 or by instructions in software form. Processor 903 can be a general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, and processors suitable for AI operations such as vision processing unit (VPU) and tensor processing unit (TPU). It may further include application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 903 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 method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside 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 904, and processor 903 reads information from memory 904 and executes the method in conjunction with its hardware. Figure 5 The model trained in the corresponding embodiment.
[0263] Receiver 901 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 902 can be used to output digital or character information through the first interface; transmitter 902 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 902 may also include a display device such as a display screen.
[0264] This application also provides a training device; please refer to [link / reference]. Figure 10 , Figure 10 This is a schematic diagram of a training device provided in an embodiment of this application. Specifically, the training device 1000 is implemented by one or more servers. The training device 1000 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1010 (e.g., one or more processors) and memory 1032, and one or more storage media 1030 (e.g., one or more mass storage devices) for storing application programs 1042 or data 1044. The memory 1032 and storage media 1030 can be temporary or persistent storage. The program stored in the storage media 1030 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the training device. Furthermore, the CPU 1010 may be configured to communicate with the storage media 1030 and execute the series of instruction operations in the storage media 1030 on the training device 1000.
[0265] The training device 1000 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input / output interfaces 1058; or one or more operating systems 1041, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0266] Specifically, the training device can perform steps 501 to 505 in the above embodiments.
[0267] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.
[0268] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.
[0269] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).
[0270] For details, please refer to Figure 11 , Figure 11 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1100. The NPU 1100 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1103, which is controlled by the controller 1104 to extract matrix data from the memory and perform multiplication operations.
[0271] The NPU 1100 achieves this through the cooperation of its various internal components. Figure 5 The recommended model training method is provided in the described embodiments.
[0272] More specifically, in some implementations, the arithmetic circuitry 1103 within the NPU 1100 includes multiple processing engines (PEs). In some implementations, the arithmetic circuitry 1103 is a two-dimensional pulsating array. The arithmetic circuitry 1103 can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuitry 1103 is a general-purpose matrix processor.
[0273] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1102 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1101 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is stored in the accumulator 1108.
[0274] Unified memory 1106 is used to store input and output data. Weight data is directly transferred to weight memory 1102 via Direct Memory Access Controller (DMAC) 1105. Input data is also transferred to unified memory 1106 via DMAC.
[0275] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1109.
[0276] The Bus Interface Unit (BIU) 1110 is used by the instruction fetch memory 1109 to fetch instructions from external memory, and also by the memory access controller 1105 to fetch the original data of the input matrix A or the weight matrix B from external memory.
[0277] The DMAC is mainly used to move input data from external memory DDR to unified memory 1106, or to weight data to weight memory 1102, or to input data to input memory 1101.
[0278] The vector computation unit 1107 includes multiple processing units that, when needed, further process the output of the computation circuit 1103, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.
[0279] In some implementations, vector computation unit 1107 can store the processed output vector in unified memory 1106. For example, vector computation unit 1107 can apply a linear function, or a nonlinear function, to the output of computation circuit 1103, such as linear interpolation of feature planes extracted by convolutional layers, or, for example, a vector of accumulated values, to generate activation values. In some implementations, vector computation unit 1107 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as activation input to computation circuit 1103, for example, for use in subsequent layers of the neural network.
[0280] The instruction fetch buffer 1109 connected to the controller 1104 is used to store the instructions used by the controller 1104;
[0281] Unified memory 1106, input memory 1101, weight memory 1102, and instruction fetch memory 1109 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.
[0282] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.
[0283] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0284] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0285] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0286] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for training a recommendation model, characterized in that, The method includes: Obtain the first recommendation model and multiple first candidate objects; The first recommendation model processes the multiple first candidate objects to obtain a first recommendation result; The multiple first candidate objects are processed by a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the target user's operation data, the operation data includes multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects, the second candidate objects are different from the first candidate objects, and the result obtained by the second recommendation model in processing the multiple second candidate objects is a third recommendation result; Based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the actual selection result, the error of the second recommendation result is predicted, wherein the error is negatively correlated with the similarity and positively correlated with the first difference; Based on the third difference between the first recommendation result and the second recommendation result, and the error, a target loss is determined, and the first recommendation model is updated according to the target loss.
2. The method according to claim 1, characterized in that, The first recommended model is the initialized model.
3. The method according to claim 1, characterized in that, The plurality of first candidate objects are objects that have not been presented to the target user, and the plurality of second candidate objects are objects that have been presented to the target user.
4. The method according to any one of claims 1 to 3, characterized in that, The plurality of second candidate objects are randomly selected from a plurality of objects that have been presented to the target user, while the plurality of first candidate objects are randomly selected from a plurality of objects that have not been presented to the target user.
5. The method according to any one of claims 1 to 3, characterized in that, The error is also negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
6. The method according to any one of claims 1 to 3, characterized in that, The error includes the bias term corresponding to the second recommendation result, the variance term corresponding to the second recommendation result, and the first difference summation. The bias term is negatively correlated with the similarity, and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
7. The method according to any one of claims 1 to 3, characterized in that, The first recommendation result and the second recommendation result each include a recommendation score for each of the first candidate objects; or, The first recommendation result and the second recommendation result each include a target recommendation object selected from the plurality of first candidate objects.
8. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The first recommendation model is used to process the multiple second candidate objects to obtain a fourth recommendation result; The step of determining the target loss based on the third difference between the first recommendation result and the second recommendation result, and the error, includes: Based on the third difference between the first recommendation result and the second recommendation result, the fourth difference between the fourth recommendation result and the actual selection result, and the error, the target loss is determined.
9. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain the user attributes of the target user, wherein the user attributes include at least one of the following: gender, age, occupation, income, hobbies, and education level; The process of processing the plurality of first recommendation objects through the first recommendation model includes: The first recommendation model processes the plurality of first recommendation objects and the user attributes; The process of processing the plurality of first recommended objects through the second recommendation model includes: The second recommendation model processes the multiple first recommendation objects and the user attributes.
10. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The operation data is obtained by the terminal device based on the target user's operation on the target interface. The target interface includes a first interface and a second interface. The first interface includes a control for indicating whether to enable random traffic collection. The operation includes a first operation by the target user on the control. The second interface is an interface displayed in response to the first operation. The first operation is used to indicate enabling the random traffic collection. The second interface includes the plurality of second candidate objects. The operation also includes a second operation by the target user on the plurality of second candidate objects. The second operation is used to determine the actual selection result.
11. A recommendation model training device, characterized in that, The device includes: The acquisition module is used to acquire the first recommendation model and multiple first candidate objects; The feedforward module is used to process the multiple first candidate objects through the first recommendation model to obtain a first recommendation result; The multiple first candidate objects are processed by a second recommendation model to obtain a second recommendation result; wherein the second recommendation model is trained based on the target user's operation data, the operation data includes multiple second candidate objects and the target user's actual selection results for the multiple second candidate objects, the second candidate objects are different from the first candidate objects, and the result obtained by the second recommendation model in processing the multiple second candidate objects is a third recommendation result; An error determination module is used to predict the error of the second recommendation result based on the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the first difference between the third recommendation result and the actual selection result, wherein the error is negatively correlated with the similarity and positively correlated with the first difference; An update module is used to determine a target loss based on a third difference between the first recommendation result and the second recommendation result, and the error, and to update the first recommendation model according to the target loss.
12. The apparatus according to claim 11, characterized in that, The first recommended model is the initialized model.
13. The apparatus according to claim 11, characterized in that, The plurality of first candidate objects are objects that have not been presented to the target user, and the plurality of second candidate objects are objects that have been presented to the target user.
14. The apparatus according to any one of claims 11 to 13, characterized in that, The plurality of second candidate objects are randomly selected from a plurality of objects that have been presented to the target user, while the plurality of first candidate objects are randomly selected from a plurality of objects that have not been presented to the target user.
15. The apparatus according to any one of claims 11 to 13, characterized in that, The error is also negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
16. The apparatus according to any one of claims 11 to 13, characterized in that, The error includes the bias term corresponding to the second recommendation result, the variance term corresponding to the second recommendation result, and the first difference summation. The bias term is negatively correlated with the similarity, and the variance term is negatively correlated with the number of second candidate objects among the plurality of second candidate objects.
17. The apparatus according to any one of claims 11 to 13, characterized in that, The first recommendation result and the second recommendation result each include a recommendation score for each of the first candidate objects; or, The first recommendation result and the second recommendation result each include a target recommendation object selected from the plurality of first candidate objects.
18. The apparatus according to any one of claims 11 to 13, characterized in that, The feedforward module is also used for: The first recommendation model is used to process the multiple second candidate objects to obtain a fourth recommendation result; The update module is specifically used for: Based on the third difference between the first recommendation result and the second recommendation result, the fourth difference between the fourth recommendation result and the actual selection result, and the error, the target loss is determined.
19. The apparatus according to any one of claims 11 to 13, characterized in that, The acquisition module is also used for: Obtain the user attributes of the target user, wherein the user attributes include at least one of the following: gender, age, occupation, income, hobbies, and education level; The feedforward module is specifically used for: The first recommendation model processes the plurality of first recommendation objects and the user attributes; The second recommendation model processes the multiple first recommendation objects and the user attributes.
20. The apparatus according to any one of claims 11 to 13, characterized in that, The acquisition module is also used for: The operation data is obtained by the terminal device based on the target user's operation on the target interface. The target interface includes a first interface and a second interface. The first interface includes a control for indicating whether to enable random traffic collection. The operation includes a first operation by the target user on the control. The second interface is an interface displayed in response to the first operation. The first operation is used to indicate enabling the random traffic collection. The second interface includes the plurality of second candidate objects. The operation also includes a second operation by the target user on the plurality of second candidate objects. The second operation is used to determine the actual selection result.
21. A computing device, characterized in that, The computing device includes a memory and a processor; the memory stores code, and the processor is configured to retrieve the code and execute the method as described in any one of claims 1 to 10.
22. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions that, when executed by one or more computers, cause the one or more computers to perform the method of any one of claims 1 to 10.
23. A computer program product, comprising code, characterized in that, When the code is executed, it is used to implement the method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Commodity recommendation data generation method, device and system
CN111582973A
Model training and information providing method and device
CN112966577A