WO2023050143A1 - 一种推荐模型训练方法及装置 - Google Patents

一种推荐模型训练方法及装置 Download PDF

Info

Publication number
WO2023050143A1
WO2023050143A1 PCT/CN2021/121690 CN2021121690W WO2023050143A1 WO 2023050143 A1 WO2023050143 A1 WO 2023050143A1 CN 2021121690 W CN2021121690 W CN 2021121690W WO 2023050143 A1 WO2023050143 A1 WO 2023050143A1
Authority
WO
WIPO (PCT)
Prior art keywords
recommendation
candidate objects
result
objects
model
Prior art date
Application number
PCT/CN2021/121690
Other languages
English (en)
French (fr)
Inventor
张小莲
刘杜钢
程朋祥
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2021/121690 priority Critical patent/WO2023050143A1/zh
Publication of WO2023050143A1 publication Critical patent/WO2023050143A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising

Definitions

  • the present application relates to the field of artificial intelligence, in particular to a method and device for training a recommendation model.
  • Artificial intelligence is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • artificial intelligence is the branch of computer science that attempts to understand the nature of intelligence and produce a new class of intelligent machines that respond in ways similar to human intelligence.
  • Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
  • Selection rate prediction refers to predicting the probability of a user's selection of an item in a specific environment. For example, in the recommendation system of application stores, online advertisements and other applications, the selection rate prediction plays a key role; through the selection rate prediction, the enterprise's revenue can be maximized and user satisfaction can be improved.
  • the recommendation system needs to consider the user's selection rate of items at the same time And item bidding, where the selection rate is predicted by the recommendation system based on the user's historical behavior, and the item bidding represents the revenue of the system after the item is selected/downloaded. For example, by constructing a function, the function can calculate a function value based on the predicted user selection rate and item bidding, and the recommendation system sorts the items in descending order according to the function value.
  • the recommendation system is a feedback loop (feedback loop) system, and users will generate various bias problems during the interaction with the system, such as position bias.
  • position bias makes the user feedback data collected by the recommendation system not reflect the user's real preference.
  • most classical algorithms assume that the observed user preference is the user's real preference by default, and work on how to better fit the observed feedback data distribution. This will cause the recommender system to converge to a biased sub-optimal solution, degrading the recommendation performance of the recommender system.
  • the present application provides a recommendation model training method and device, which can improve the prediction performance of the first prediction model for random traffic.
  • the present application provides a method for training a recommendation model, the method comprising:
  • the first recommendation model can be an initialized model, where the so-called initialized model can be understood as the parameters in the model are randomly initialized, it should be understood that the first recommendation model can also be obtained after less The model with the number of training times does not have high recommendation performance, or the first recommendation model can also be a model obtained through log data training, and the recommendation results of this model for the full amount of data (such as non-exposure data) are not accurate (Inaccuracy can be understood as a big difference from the user's real selection result);
  • the plurality of first candidate objects may be data that the recommendation system has not yet presented to the target user
  • the plurality of first candidate objects may be objects selected from data that has not yet been presented to the target user;
  • the plurality of first candidate objects may be objects randomly selected from data that has not yet been presented to the target user;
  • the first recommendation model may be a machine learning model
  • the machine learning model may be composed of single-level linear or nonlinear operations (for example, support vector machines (support vector machines, SVM) or may be Deep network, that is, a machine learning model composed of multiple levels of nonlinear 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 or the like;
  • the first recommendation model can be used to process the multiple first candidate objects, that is, the multiple first candidate objects are used as the input of the first recommendation model, and the first recommendation model feedforward process;
  • the plurality of first candidate objects are processed through the second recommendation model to obtain the second recommendation result; wherein, the second recommendation model is trained based on the operation data of the target user, and the operation data includes a plurality of second Candidate objects and the target user's real selection results for a plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the second recommendation model processes the plurality of second candidates
  • the result obtained by the subject is the third recommended result
  • the second recommendation model may be a model obtained based on random traffic training, since the quantity of random traffic is small, the recommendation accuracy of the second recommendation model is low (for example, the variance of the recommendation result is relatively large);
  • the plurality of second candidate objects may be the above-mentioned random traffic, that is to say, the plurality of second candidate objects may be data presented to the target user, and the target user has already performed operations on the plurality of second candidate objects, and the operation data may include a plurality of second candidate objects and the actual selection results of the target user for the plurality of second candidate objects;
  • the real selection result can indicate whether the second candidate is a positive sample or a negative sample, that is, the sample type label (label feature), and whether a sample belongs to a positive sample or a negative sample can be determined by analyzing the For example, when the sample type label of a certain sample is 1, it indicates that the certain sample is a positive sample, and when the sample type label of a certain sample is 0, it indicates that the certain sample type samples are negative samples.
  • 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;
  • the second recommendation model can obtain a second recommendation result when processing multiple first candidate objects. Since the recommendation accuracy of the second recommendation model is low, the second recommendation result cannot be considered to represent the user The true intention of (that is to say, there is an error between the second recommendation result and the user's true intention).
  • the embodiment of the present application based on the similarities between the multiple first candidate objects and the multiple second candidate objects, and the The first difference between the third recommendation result and the real selection result is used to predict the error of the second recommendation result.
  • the third recommendation result can be obtained. Since the recommendation accuracy of the second recommendation model is low, the third recommendation result cannot be considered to represent the user The real intention of (that is to say, there is an error between the third recommendation result and the real selection result).
  • the multiple second candidate objects processed by the second recommendation model when obtaining the third recommendation result may not be strictly the same as the multiple second candidate objects used when training the second recommendation model, for example, there may be an intersection or no intersection.
  • the first difference between the third recommendation result and the real selection result can express the model error of the second recommendation model to a certain extent, that is, the error of the second recommendation result.
  • 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 real selection result, the greater the error of the second recommendation result ( other information unchanged);
  • the first difference here can be based on Euclidian distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Peel Sen correlation coefficient (pearson correlation coefficient) and other methods to measure, here is not limited;
  • the second predictive model For the data characteristics of the multiple first candidate objects, the second predictive model
  • the data processing accuracy of the data is lower than the data processing accuracy when processing multiple second candidate objects, that is, the error of the second recommendation result is larger), that is to say, the error of the second recommendation result is the same as that of multiple first candidate objects
  • Negative correlation with the similarity between 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 greater the error of the second recommendation result Small (with other information unchanged);
  • similarity can be based on Euclidian distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Pearson Correlation coefficient (pearson correlation coefficient) and other methods to measure, here is not limited;
  • a target loss is determined, and the first recommendation model is updated according to the target loss.
  • An embodiment of the present 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 The first recommendation result; the plurality of first candidate objects are processed through the second recommendation model to obtain the second recommendation result; wherein, the second recommendation model is obtained based on the operation data training of the target user, and the operation data Including a plurality of second candidate objects and the target user's real selection results for the plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the second recommendation model processes the The result obtained by the plurality of second candidate objects is the third recommendation result; according to the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the third recommendation result and the real selecting the first difference between the results, predicting the error of the second recommended result, the error is negatively correlated with the similarity, and the error is positively correlated with the first difference; based on the first recommended result and A third difference between the second
  • the third difference between the first recommendation result and the second recommendation result can represent 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 as the training samples of the second predictive model, that is, the number of multiple second candidate objects is low), but the above-mentioned calculated error can characterize the processing error of the second predictive model, and the first recommendation result and the described
  • the result of combining the third difference between the second recommendation results and the error (such as direct addition or other fusion operations) can more accurately characterize the difference between the predicted result and the accurate result of the first recommendation result, Training the first prediction model with the target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
  • the multiple first candidate objects are objects that have not been presented to the target user
  • the multiple second candidate objects are objects that have been presented to the target user.
  • the plurality of second candidate objects may be the above-mentioned random traffic, that is to say, the plurality of second candidate objects may be data presented to the target user, and the target user has already performed operations on the plurality of second candidate objects, and the operation data It may include a plurality of second candidate objects and the actual selection results of the target user for the plurality of second candidate objects.
  • the multiple second candidate objects are randomly selected from multiple objects that have been presented to the target user, and the multiple first candidate objects are Randomly selected from among the multiple objects presented. Using randomly selected objects as training samples can reduce the error of the recommendation model due to bias.
  • the error is further negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the number of second candidate objects in the plurality of second candidate objects is not high, when the number of second candidate objects in the plurality of second candidate objects is larger, it can be considered that the recommendation accuracy of the second recommendation model is higher, so , the error may also be negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the so-called negative correlation can be understood as the larger the number of second candidate objects in the plurality of second candidate objects, the second The smaller the error of the recommendation result (with other information unchanged).
  • the error includes a corresponding bias item of the second recommendation result, a corresponding variance item of the second recommendation result and the sum of the first difference, the bias item Negatively correlated with the similarity, the variance item is negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the first recommendation result and the second recommendation result respectively include a recommendation score of each of the first candidate objects; or, the first recommendation result and the second recommendation result Target recommendation objects selected from the plurality of first candidate objects are respectively included.
  • the recommendation score may represent the prediction score of each first candidate object by the first recommendation model.
  • Target recommendation objects can be determined according to specific settings of the first recommendation model, for example, recommendations are made according to a preset number and sorted by score. For example, if the model is set to recommend the top ten first candidate objects, then the top ten first candidate objects are determined as target recommendation objects.
  • the method further includes: processing the plurality of second candidate objects through the first recommendation model to obtain a fourth recommendation result; based on the first recommendation result and the The third difference between the second recommendation result, and the error, determining the target loss includes: based on the third difference between the first recommendation result and the second recommendation result, the fourth recommendation result and A fourth difference between said true selection results and said error determines a target loss.
  • the first predictive model can also be trained using log data and labeled random traffic. When the log data is used to train the first prediction model, the log data may be processed based on the first prediction model, and the difference between the processing result and the true label of the log data is used as a part of the target loss.
  • the plurality of second candidate objects may be processed by the first recommendation model to obtain a fourth recommendation result, and the fourth recommendation result is combined with the The fourth difference between the above-mentioned true selection outcomes is used as part of the target loss. Taking the fourth difference as a part of the target loss can more accurately express the difference between the output of the first recommendation model and the accurate label, and then updating the first recommendation model based on the target loss can improve the recommendation accuracy of the first recommendation model.
  • the method further includes: acquiring user attributes of the target user, where the user attributes include at least one of the following: gender, age, occupation, income, hobbies, and education level;
  • the processing of the plurality of first recommendation objects by the first recommendation model includes: processing the plurality of first recommendation objects and the user attributes by the first recommendation model; processing the first recommendation objects by the second recommendation model
  • the plurality of first recommended objects includes: processing the plurality of first recommended objects and the user attributes through the second recommendation model.
  • the input data of the feedforward process of the first recommendation model may also include user attributes of the target user, wherein the user attributes may include at least one of the following: Gender, age, occupation, income, hobbies, education level;
  • the attribute information of the target user can be attributes related to user preferences, at least one of gender, age, occupation, income, hobbies, and education level, where the gender can be male or female, and the age can be 0- Number between 100, occupation can be teacher, programmer, chef, etc., hobbies can be basketball, tennis, running, etc., education level can be elementary school, junior high school, high school, university, etc.; this application does not limit the target The specific type of user attribute information.
  • acquiring a plurality of first candidate objects may be understood as acquiring feature information of each first candidate object in the plurality of first candidate objects, and the feature information may have one or more, for example, including candidate The name of the object (or object identification (ID)), the identification (ID) of the APP recommendation result to which the object belongs (such as utility tools, audio-visual entertainment, etc.), the brief introduction of the candidate object, the size of the candidate object (for example, when the candidate object When it is an APP, the size of the candidate object can be the size of the installation package of the candidate object), the developer of the candidate object, the label of the object (for example, the label can indicate the category of the candidate object), the comments of the candidate object (such as the favorable rating of the candidate object), etc.
  • One or more items in may not include the information listed here but include other attribute information of the object.
  • the method further includes: acquiring the operation data, wherein the operation data is acquired by the terminal device based on the target user's operation on the target interface, and the target interface includes the first interface and a second interface, the first interface includes a control, the control is used to indicate whether to enable the collection of random traffic, the operation includes a first operation of the target user on the first control, and the second The second interface is an interface displayed in response to the first operation, the first operation is used to indicate to start the collection of the random traffic, the second interface includes the plurality of second candidate objects, and the operation further includes It includes a second operation of the target user on multiple second candidate objects, and the second operation is used to determine the real selection result.
  • the present application provides a recommended model training device, the device comprising:
  • An acquisition module configured to acquire a first recommendation model and a plurality of first candidate objects
  • a feed-forward module configured to process the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result
  • the plurality of first candidate objects are processed through the second recommendation model to obtain the second recommendation result; wherein, the second recommendation model is trained based on the operation data of the target user, and the operation data includes a plurality of second Candidate objects and the target user's real selection results for a plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the second recommendation model processes the plurality of second candidates
  • the result obtained by the subject is the third recommended result
  • An error determination module configured to, according to 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 real selection result, predicting an error of the second recommendation result, the error is negatively correlated with the similarity, and the error is positively correlated with the first difference;
  • An updating module configured to determine a target loss based on a 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.
  • the third difference between the first recommendation result and the second recommendation result can represent 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 as the training samples of the second predictive model, that is, the number of multiple second candidate objects is low), but the above-mentioned calculated error can characterize the processing error of the second predictive model, and the first recommendation result and the described
  • the result of combining the third difference between the second recommendation results and the error (such as direct addition or other fusion operations) can more accurately characterize the difference between the predicted result and the accurate result of the first recommendation result, Training the first prediction model with the target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
  • the first recommendation model is an initialized model.
  • the multiple first candidate objects are objects that have not been presented to the target user
  • the multiple second candidate objects are objects that have been presented to the target user.
  • the multiple second candidate objects are randomly selected from multiple objects that have been presented to the target user, and the multiple first candidate objects are Randomly selected from among the multiple objects presented.
  • the error is further negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the error includes a corresponding bias item of the second recommendation result, a corresponding variance item of the second recommendation result and the sum of the first difference, the bias item Negatively correlated with the similarity, the variance item is negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the first recommendation result and the second recommendation result respectively include a recommendation score of each of the first candidate objects; or,
  • the first recommendation result and the second recommendation result respectively include target recommendation objects selected from the plurality of first candidate objects.
  • the feedforward module is also used for:
  • the update module is specifically used for:
  • a target loss is determined based on a third difference between the first recommendation result and the second recommendation result, a fourth difference between the fourth recommendation result and the true selection result, and the error.
  • the acquisition module is also used to:
  • the user attributes include at least one of the following: gender, age, occupation, income, hobbies, education level;
  • the feedforward module is specifically used for:
  • the plurality of first recommendation objects and the user attributes are processed by the second recommendation model.
  • the first candidate object and the second candidate object include at least one of the following information:
  • the name of the candidate object The name of the candidate object, the developer of the candidate object, the size of the installation package of the candidate object, the category of the candidate object, and the favorable rating of the candidate object.
  • the acquisition module is also used to:
  • the target interface includes a first interface and a second interface
  • the first interface includes controls
  • the control is used to indicate whether to enable the collection of random traffic
  • the operation includes a first operation of 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 instruct to start the collection of the random traffic
  • the second interface includes the plurality of second candidate objects
  • the operation further includes the target user's actions on the plurality of second candidate objects
  • a second operation the second operation is used to determine the real selection result.
  • an embodiment of the present application provides a computing device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute the programs in the memory to perform any of the above-mentioned first aspects. an optional method.
  • an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when it is run on a computer, the computer executes the above-mentioned first aspect and any possible program.
  • an embodiment of the present application provides a computer program product, including codes, used to implement the above first aspect and any optional method when the codes are executed.
  • the present application provides a chip system, which includes a processor, configured to support an execution device or a training device to implement the functions involved in the above aspect, for example, send or process the data involved in the above method; or, information.
  • the chip system further includes a memory, and the memory is used for storing necessary program instructions and data of the execution device or the training device.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • An embodiment of the present 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 The first recommendation result; the plurality of first candidate objects are processed through the second recommendation model to obtain the second recommendation result; wherein, the second recommendation model is obtained based on the operation data training of the target user, and the operation data Including a plurality of second candidate objects and the target user's real selection results for the plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the second recommendation model processes the The result obtained by the plurality of second candidate objects is the third recommendation result; according to the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the third recommendation result and the real selecting the first difference between the results, predicting the error of the second recommended result, the error is negatively correlated with the similarity, and the error is positively correlated with the first difference; based on the first recommended result and A third difference between the second
  • the third difference between the first recommendation result and the second recommendation result can represent 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 as the training samples of the second predictive model, that is, the number of multiple second candidate objects is low), but the above-mentioned calculated error can characterize the processing error of the second predictive model, and the first recommendation result and the described
  • the result of combining the third difference between the second recommendation results and the error (such as direct addition or other fusion operations) can more accurately characterize the difference between the predicted result and the accurate result of the first recommendation result, Training the first prediction model with the target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
  • Fig. 1 is a kind of structural schematic diagram of main frame of artificial intelligence
  • FIG. 2 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a recommendation flow scenario provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a recommended model training method provided in an embodiment of the present application.
  • Figure 6a is a schematic diagram of a first interface
  • Fig. 6b is a schematic diagram of a second interface
  • FIG. 6c is a schematic flowchart of a recommended model training method provided in the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a recommended model training method provided in an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a training device for a recommendation model provided in an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an execution device provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a training device provided in an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a chip provided by an embodiment of the present application.
  • Figure 1 shows a schematic structural diagram of the main framework of artificial intelligence.
  • the following is from the “intelligent information chain” (horizontal axis) and “IT value chain” ( Vertical axis) to illustrate the above artificial intelligence theme framework in two dimensions.
  • the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has undergone a condensed process of "data-information-knowledge-wisdom".
  • IT value chain reflects the value brought by artificial intelligence to the information technology industry from the underlying infrastructure of artificial intelligence, information (provided and processed by technology) to the systematic industrial ecological process.
  • the infrastructure provides computing power support for the artificial intelligence system, realizes communication with the outside world, and realizes support through the basic platform.
  • the basic platform includes distributed computing framework and network and other related platform guarantees and supports, which can include cloud storage and Computing, interconnection network, etc.
  • sensors communicate with the outside to obtain data, and these data are provided to the smart chips in the distributed computing system provided by the basic platform for calculation.
  • Data from the upper layer of the infrastructure is used to represent data sources in the field of artificial intelligence.
  • the data involves graphics, images, voice, text, and IoT data of traditional equipment, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
  • machine learning and deep learning can symbolize and formalize intelligent information modeling, extraction, preprocessing, training, etc. of data.
  • Reasoning refers to the process of simulating human intelligent reasoning in a computer or intelligent system, and using formalized information to carry out machine thinking and solve problems according to reasoning control strategies.
  • the typical functions are search and matching.
  • Decision-making refers to the process of decision-making after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
  • some general capabilities can be formed based on the results of data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing, speech recognition, image processing identification, etc.
  • Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. It is the packaging of the overall solution of artificial intelligence, which commercializes intelligent information decision-making and realizes landing applications. Its application fields mainly include: intelligent terminals, intelligent transportation, Smart healthcare, autonomous driving, smart cities, etc.
  • the embodiments of the present application can be applied to the field of information recommendation, which includes but is not limited to scenarios involving e-commerce product recommendation, search engine result recommendation, application market recommendation, music recommendation, video recommendation, etc., items recommended in various application scenarios
  • objects for the convenience of subsequent descriptions, that is, in different recommendation scenarios, the recommended object can be APP, or video, or music, or a certain product (such as the presentation interface of an online shopping platform, which will be based on the user's Different commodities are displayed for presentation, which can also be presented in essence through the recommendation results of the recommendation model).
  • These recommendation scenarios usually involve user behavior log collection, log data preprocessing (for example, quantization, sampling, etc.), sample set training to obtain a recommendation model, and objects involved in the scene corresponding to the training sample items according to the recommendation model (such as APP, Music, etc.) for analysis and processing.
  • the samples selected in the recommendation model training link come from the mobile application market users' operation behaviors for the recommended APP, and the recommended model trained thus is suitable for the above mobile APP application market.
  • the APP application market for other types of terminals may be used to recommend terminal APPs.
  • the recommendation model will finally 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, and presents them to users through corresponding applications or terminal devices. 1.
  • the user operates on the objects in the recommendation results to generate user behavior logs and other links.
  • a recommendation request when a user interacts with the recommendation system, a recommendation request will be triggered, and the recommendation system will input the request and its related feature information into the deployed recommendation model, and then predict the user’s preference for all candidate objects click-through rate. Then, according to the predicted click-through rate, the candidate objects are sorted in descending order, and the candidate objects are displayed in different positions in order as the recommendation results for users. Users browse the displayed items and perform user actions, such as browsing, clicking and downloading. These user behaviors will be stored in the log as training data, and the parameters of the recommendation model will be updated irregularly through the offline training module to improve the recommendation effect of the model.
  • the recommendation module of the application market can be triggered.
  • the recommendation module of the application market will predict the user's preference for the user based on the user's historical download records, user click records, application characteristics, time, location and other environmental characteristics.
  • the application market is displayed in descending order of possibility, achieving the effect of increasing the probability of application download. Specifically, apps that are more likely to be downloaded are ranked higher and apps that are less likely to be downloaded are ranked lower.
  • the user's behavior will also be stored in the log and the parameters of the prediction model will be trained and updated through the offline training module.
  • Lifetime Companion can record the past events of the user based on system data and application data, understand the user's current intentions, predict the user's future actions or behaviors, and finally realize intelligent services.
  • user behavior data including end-side text messages, photos, email events, etc.
  • Learning and memory modules such as filtering, association analysis, cross-domain recommendation, causal reasoning, etc., build user personal knowledge graphs.
  • an embodiment of the present invention provides a recommendation system architecture 200 .
  • the data collection device 260 is used to collect samples.
  • a training sample can be composed of multiple feature information, and there can be many types of feature information. Specifically, it can include user feature information, object feature information, and label features.
  • User feature information is used to represent user features. , such as gender, age, occupation, hobbies, etc.
  • Object feature information is used to characterize the characteristics of objects pushed to users. Different recommendation systems correspond to different objects, and the types of features that need to be extracted for different objects are also different. For example, APP
  • the object features extracted in the training samples of the market can be the name (logo), type, size, etc.
  • the label feature is used to indicate whether the sample is positive or negative.
  • the label feature of the sample can be obtained through the user's operation information on the recommended object.
  • the samples that the user has operated on the recommended object are Positive example, the user does not operate on the recommended object, or only browses the sample as a negative example, for example, when the user clicks or downloads or purchases the recommended object, the label feature is 1, indicating that the sample is a positive example, and If the user does not perform any operation on the recommended object, the label feature is 0, indicating that the sample is a negative example.
  • the sample can be stored in the database 230 after collection, and some or all feature information in the sample in the database 230 can also be directly obtained from the client device 240, such as user feature information, user operation information on the object (used to determine the type identification ), object feature information (such as object ID), etc.
  • the training device 220 obtains a model parameter matrix based on sample training in the database 230 for generating the recommendation model 201 . The following will describe 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.
  • 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 .
  • 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, and then use a recommended model (such as the first recommended model in the embodiment of the present application) to train The collected samples are trained to obtain the trained recommendation model; the implementation details of the calculation module 211 can refer to the detailed description of the method embodiment shown in FIG. 5 .
  • the training device 220 After the training device 220 obtains the model parameter matrix based on sample training and is used to construct the recommendation model 201, it sends the recommendation model 201 to the execution device 210, or directly sends the model parameter matrix to the execution device 210, and constructs the recommendation model in the execution device 210,
  • the recommendation model obtained based on video-related sample training can be used to recommend videos to users in video websites or APPs
  • the recommendation model obtained based on APP-related sample training can be used in the application market Recommend APP to users.
  • 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 ID, user identity, gender, occupation, hobbies, etc. , this part of the information can also be obtained from the system database.
  • the recommendation model 201 recommends a target recommended object to the user based on user characteristic information and object characteristic information to be recommended.
  • the execution device 210 may be set in a cloud server, or in a user client.
  • the execution device 210 can call data, codes, etc. in the data storage system 250 , and can also store the output data in the data storage system 250 at the same time.
  • the data storage system 250 may be set in the execution device 210, or set independently, or set in other network entities, and the number may be one or more.
  • 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 For the scores of the objects to be recommended, the objects to be recommended are sorted according to the scores, and the objects ranked higher will be the objects recommended to the client device 240 .
  • the I/O interface 212 returns the recommendation result to the client device 240 for presentation to the user.
  • the training device 220 can generate a corresponding recommendation model 201 based on different sample feature information for different goals, so as to provide users with better results.
  • accompanying drawing 2 is only a schematic diagram of a system architecture provided by an embodiment of the present invention, and the positional relationship between devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data storage system 250 is an external memory relative to the execution device 210 , and in other cases, the data storage system 250 may also be placed in the execution device 210 .
  • the training device 220, the execution device 210, and the client device 240 may be three different physical devices, or the training device 220 and the execution device 210 may be on the same physical device or a cluster, or It is possible that the execution device 210 and the client device 240 are on the same physical device or a cluster.
  • the execution device 210 is implemented by one or more servers, and optionally cooperates with other computing devices, such as data storage, routers, load balancers, etc.; the execution device 210 can be arranged on a physical site, or Distributed across multiple physical sites.
  • the execution device 210 can use the data in the data storage system 250, or call the program code in the data storage system 250 to implement the function of object recommendation, specifically, input the information of the object to be recommended into the recommendation model, and the recommendation model is each
  • the object to be recommended generates an estimated score, and then sorts the estimated score from high to low, and recommends the object to be recommended to the user according to the sorting result. For example, recommend the top 10 objects in the sorted results to the user.
  • the data storage system 250 is used to receive and store the parameters of the recommended model sent by the training device, and to store the data of the recommended results obtained through the recommended model, and of course may also include the program code ( or command).
  • the data storage system 250 can be a distributed storage cluster composed of one or more devices deployed outside the execution device 210. At this time, when the execution device 210 needs to use the data on the storage system 250, the storage system 250 can send The device 210 sends the data required by the execution device, and accordingly, the execution device 210 receives and stores (or caches) the data.
  • the data storage system 250 can also be deployed in the execution device 210. When deployed in the execution device 210, the distributed storage system can include one or more storages.
  • different storages use For storing different types of data, for example, the model parameters of the recommendation model generated by the training device and the data of the recommendation result obtained by the recommendation model can be stored in two different memories respectively.
  • 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.
  • Each user's local device can interact with the execution device 210 through any communication mechanism/communication standard communication network, and the communication network can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
  • the execution device 210 may be implemented by a local device.
  • the local device 301 may implement the recommendation function of the execution device 210 based on the recommendation model to acquire user feature information and feed back the recommendation result to the user, or the local device 302 may Users provide services.
  • the click probability can also be called the click rate, which refers to the ratio of the number of times recommended information (for example, recommended items) on a website or application is clicked to the number of times it is exposed.
  • the click rate is usually an important indicator for measuring the recommendation system in the recommendation system.
  • a personalized recommendation system refers to a system that uses machine learning algorithms to analyze the user's historical data (such as the operation information in the embodiment of this application), predicts new requests, and gives personalized recommendation results.
  • Offline training refers to a module in which in the personalized recommendation system, according to the user's historical data (such as the operation information in the embodiment of this application), the recommended model parameters are iteratively updated according to the machine learning algorithm until the set requirements are met.
  • Online prediction refers to predicting the user's preference for recommended items in the current context based on the offline trained model based on the characteristics of the user, item and context, and predicting the probability of the user choosing the recommended item.
  • Counterfactual technology use counterfactual reasoning, learn the unobserved world, expand the imagination space, get rid of the shackles of the real world, and create new things.
  • Random traffic For user requests, we intervene in the recommendation system, that is, we no longer use the recommendation strategy to assign items, but randomly sample some items from all candidate sets, and then randomly sort them to the user. Demonstrate and collect appropriate feedback.
  • Exposure data the data displayed by the recommendation system to the user.
  • Unexposed data data that the recommendation system has not yet displayed to users.
  • Full data Assuming that the recommendation system can display all items to users and collect user feedback on all items, the collected data is called full data.
  • Position bias Describes the user's tendency to choose items in a better position for interaction. This tendency has nothing to do with whether the item meets the user's actual needs.
  • Selection bias occurs when the "research group” cannot represent the "target group”, so that the risk/benefit measurement of the "research group” cannot accurately represent the "target group”, resulting in inaccurate conclusions. can be effectively generalized.
  • Positive example also known as positive sample, which means a sample with positive feedback from users, such as a sample with download or purchase behavior.
  • Negative examples also known as negative samples, which represent samples with negative feedback from users, such as samples with bad reviews or only browsing behavior.
  • Training set The sample set used to train the model.
  • Label mark whether the sample is a positive example or a negative example, for example, 1 is a positive example and 0 is a negative example.
  • Lifelong learning Based on the user's historical data in video, music, news and other fields, through various models and algorithms, imitating the human brain mechanism, build a cognitive brain, and build a user lifelong learning system framework. Through personalized learning and reasoning, it realizes the understanding of users' true intentions, enables accurate service recommendations, and enhances user stickiness.
  • the neural network can be composed of neural units, and the neural unit can refer to an operation unit that takes xs (ie input data) and intercept 1 as input, and the output of the operation unit can be:
  • Ws is the weight of xs
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is 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 the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting multiple above-mentioned single neural units, 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 with the local receptive field of the previous layer to extract the features of the local receptive field.
  • the local receptive field can be an area composed of several neural units.
  • Deep Neural Network also known as multi-layer neural network
  • DNN Deep Neural Network
  • the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer.
  • the first layer is the input layer
  • the last layer is the output layer
  • the layers in the middle are all hidden layers.
  • the layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
  • the coefficient of the kth neuron of the L-1 layer to the jth neuron of the L layer is defined as It should be noted that the input layer has no W parameter.
  • more hidden layers make the network more capable of describing complex situations in the real world. Theoretically speaking, a model with more parameters has a higher complexity and a greater "capacity", which means that it can complete more complex learning tasks.
  • Training the deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vector W of many layers).
  • the error back propagation (BP) algorithm can be used to correct the size of the parameters in the initial model during the training process, so that the error loss of the model becomes smaller and smaller. Specifically, passing the input signal forward until the output produces an error loss, and updating the parameters in the initial model by backpropagating the error loss information, so that the error loss converges.
  • the backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the optimal model parameters, such as the weight matrix.
  • FIG. 5 is a schematic diagram of an embodiment of a recommendation model training method provided by the embodiment of the present application.
  • a recommendation method provided by the embodiment of the present application includes:
  • the execution body of step 501 may be a server on the cloud side, or an end-side device capable of model training, which is not limited here, and the specific structure may refer to but is not limited to the training device 220 in the above-mentioned embodiments describe.
  • the first recommendation model can be an initialized model, where the so-called initialized model can be understood as the parameters in the model are randomly initialized, it should be understood that the first recommendation model can also be obtained after less The model with the number of training times does not have high recommendation performance, or the first recommendation model can also be a model obtained through log data training, and the recommendation results of this model for the full amount of data (such as non-exposure data) are not accurate (Inaccuracy can be understood as a large difference from the user's real selection result).
  • the first recommendation model may be a machine learning model
  • the machine learning model may be composed of single-level linear or nonlinear operations (for example, support vector machines (support vector machines, SVM) or may be Deep network, that is, a machine learning model composed of multiple levels of nonlinear operations).
  • An example of a deep network is a neural network with one or more hidden layers, and such a machine learning model may be trained by adjusting weights of the neural network according to a backpropagation learning algorithm or the like, for example.
  • random traffic data can be selected.
  • the so-called random traffic data can be understood as presenting to the target user based on the random selection of recommended objects from the candidate object set , the target user can operate on the recommended object (for example, select or not select).
  • the above method can be called an unbiased optimization technique that introduces random traffic, which aims to introduce a random traffic collected by a random strategy to provide unbiased information, and then guide the existing recommendation model based on log data to alleviate the problem during training. Bias problem.
  • the stochastic strategy does not rely on any recommendation model, but randomly selects from a set of candidate items and displays them in a random order. Since the source of the bias problem is avoided as much as possible, the random traffic collected under this strategy can be considered as a proxy of the unbiased distribution, that is, the recommendation model trained by the random traffic is also relatively unbiased.
  • Random traffic at this scale may not be a good proxy for an ideal distribution.
  • some objects can be randomly selected from the unexposed data (that is, objects that are not presented to the target user), and the target user's selection results for these objects can be predicted to build more
  • the amount of data equivalent to random traffic is used as training samples. How to accurately predict the target user's selection results for these objects will be described in subsequent embodiments.
  • the plurality of first candidate objects may be data that the recommendation system has not yet presented to the target user
  • the plurality of first candidate objects may be objects selected from data that has not yet been presented to the target user;
  • the plurality of first candidate objects may be objects randomly selected from data that has not yet been presented to the target user;
  • multiple first candidate objects may be objects presented in one recommendation result at the same time, and the recommendation result may be all or part of the sample source recommendation system.
  • a sample set includes sample 1, sample 2, and sample 3, sample 1 contains features used to describe object 1, sample 2 contains features used to describe object 2, and sample 3 contains features used to describe object 3; here, object 1, object 2, and object 3 belong to three objects displayed on a recommendation result at the same time.
  • object 1, object 2, and object 3 belong to three objects displayed on a recommendation result at the same time.
  • object 1, object 2, and object 3 belong to three objects displayed on a recommendation result at the same time.
  • the "utility" APP recommendation and the "audio-video entertainment” APP recommendation do not belong to the same recommendation result; these recommendation results will be displayed when the user uses the application market on the previous day, and these recommendation results will also be displayed when the user uses the application market on the next day, and will be displayed on the previous day.
  • a recommendation for is not the same impression as a recommendation for the next day.
  • acquiring a plurality of first candidate objects may be understood as acquiring feature information of each first candidate object in the plurality of first candidate objects, and the feature information may have one or more, for example, including the name of the candidate object ( Or called object identification (ID)), the identification (ID) of the APP recommendation result to which the object belongs (such as utility tools, audio-visual entertainment, etc.), brief introduction of the candidate object, size of the candidate object (for example, when the candidate object is an APP,
  • the size of the candidate object can be one of the size of the installation package of the candidate object), the developer of the candidate object, the label of the object (for example, the label can indicate the category of the candidate object), the comment of the candidate object (for example, the favorable rating of the candidate object), etc. or multiple items, of course, it may not include the information listed here but include other attribute information of the object.
  • the first recommendation model can be used to process the multiple first candidate objects, that is, the multiple first candidate objects are used as the input of the first recommendation model, and the first recommendation model feedforward process.
  • the input data of the feedforward process of the first recommendation model may also include user attributes of the target user, wherein the user attributes may include at least one of the following: Gender, age, occupation, income, hobbies, education level;
  • the attribute information of the target user can be attributes related to user preferences, at least one of gender, age, occupation, income, hobbies, and education level, where the gender can be male or female, and the age can be 0- Number between 100, occupation can be teacher, programmer, chef, etc., hobbies can be basketball, tennis, running, etc., education level can be elementary school, junior high school, high school, university, etc.; this application does not limit the target The specific type of user attribute information.
  • the output obtained by performing the feedforward process of the first recommendation model may be the first recommendation result, and optionally, the first recommendation result may include the recommendation score of each of the first candidate objects ; or, the target recommendation object selected from the plurality of first candidate objects, wherein the target recommendation object may be some objects in the plurality of first candidate objects (for example, it may be a plurality of objects with the highest recommendation scores).
  • the recommendation score may represent the prediction score of each first candidate object by the first recommendation model.
  • Target recommendation objects can be determined according to specific settings of the first recommendation model, for example, recommendations are made according to a preset number and sorted by score. For example, if the model is set to recommend the top ten first candidate objects, then the top ten first candidate objects are determined as target recommendation objects.
  • first candidate objects include APP1, APP2, APP3, APP4, APP5, APP6, APP7, APP8, APP9, APP10
  • user characteristic information of the user U1 for example, gender is male, age is 25 , occupation is a software engineer, etc.
  • respective object feature information for example, APP identification, APP profile, etc.
  • the second recommendation model may be a model obtained by training based on random traffic, and since the quantity of random traffic is small, the recommendation accuracy of the second recommendation model is low (for example, the variance of the recommendation result is large).
  • the plurality of second candidate objects may be the above-mentioned random traffic, that is to say, the plurality of second candidate objects may be data presented to the target user, and the target user has already performed operations on the plurality of second candidate objects, and the operation data It may include a plurality of second candidate objects and the actual selection results of the target user for the plurality of second candidate objects.
  • the operation data may be obtained based on an interface on the terminal, where the operation data is obtained by the terminal device based on the operation of the target user on the target interface, and the target interface includes the first interface and a second interface, the first interface includes a control, the control is used to indicate whether to enable the collection of random traffic, the operation includes a first operation of the target user on the first control, and the second The interface is an interface displayed in response to the first operation, the first operation is used to indicate to start the collection of the random traffic, the second interface includes the plurality of second candidate objects, and the operation further includes The target user performs a second operation on multiple second candidate objects, and the second operation is used to determine the real selection result.
  • FIG. 6a is a schematic diagram of a first interface
  • FIG. 6b is a schematic diagram of a second interface.
  • the real selection result can indicate whether the second candidate is a positive sample or a negative sample, that is, the sample type label (label feature), and whether a sample belongs to a positive sample or a negative sample can be determined by analyzing the For example, when the sample type label of a certain sample is 1, it indicates that the certain sample is a positive sample, and when the sample type label of a certain sample is 0, it indicates that the certain sample type samples are negative samples.
  • 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, the operation information is used to represent operations such as "browse", “download”, “comment”, and "purchase”. The information means that the sample type labels are different.
  • the sample type label is used to mark the negative sample when the predefined operation is "browse”
  • the sample type label is used to mark the positive sample when the predefined operation behavior is "download”.
  • which operation corresponds to positive samples and which operation corresponds to negative samples can be predefined.
  • the error of the recommendation result the error is negatively correlated with the similarity, and the error is positively correlated with the first difference;
  • the second recommendation model can obtain a second recommendation result when processing multiple first candidate objects. Since the recommendation accuracy of the second recommendation model is low, the second recommendation result cannot be considered to represent the user The true intention of (that is to say, there is an error between the second recommendation result and the user's true intention).
  • the embodiment of the present application based on the similarities between the multiple first candidate objects and the multiple second candidate objects, and the The first difference between the third recommendation result and the real selection result is used to predict the error of the second recommendation result.
  • the third recommendation result can be obtained. Since the recommendation accuracy of the second recommendation model is low, the third recommendation result cannot be considered to represent the user The real intention of (that is to say, there is an error between the third recommendation result and the real selection result).
  • the multiple second candidate objects processed by the second recommendation model when obtaining the third recommendation result may not be strictly the same as the multiple second candidate objects used when training the second recommendation model, for example, there may be an intersection or no intersection.
  • the first difference between the third recommendation result and the real selection result can express the model error of the second recommendation model to a certain extent, that is, the error of the second recommendation result.
  • 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 real selection result, the greater the error of the second recommendation result ( Other information remains unchanged).
  • the first difference here can be based on Euclidian distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Peel Sen correlation coefficient (pearson correlation coefficient) and other methods to measure, here is not limited.
  • the second predictive model For the data characteristics of the multiple first candidate objects, the second predictive model
  • the data processing accuracy of the data is lower than the data processing accuracy when processing multiple second candidate objects, that is, the error of the second recommendation result is larger), that is to say, the error of the second recommendation result is the same as that of multiple first candidate objects
  • Negative correlation with the similarity between 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 greater the error of the second recommendation result Small (with other information held constant).
  • similarity can be based on Euclidian distance, Manhattan distance, Minkowski distance, cosine similarity, Jaccard coefficient, Pearson Correlation coefficient (pearson correlation coefficient) and other methods to measure, here is not limited.
  • the error can also be negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the so-called negative correlation can be understood as the more the number of second candidate objects in the plurality of second candidate objects The larger the value, the smaller the error of the second recommendation result (under the condition that other information remains unchanged).
  • the error includes a corresponding bias item of the second recommendation result, a corresponding variance item of the second recommendation result and the sum of the first difference, the bias item Negatively correlated with the similarity, the variance item is negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the recommendation accuracy of the second recommendation model is low, since the second recommendation model is also obtained based on random traffic (that is, the above operation data), it has a certain recommendation accuracy (at least compared with the first For the recommendation model, the data processing accuracy of random traffic is higher), so the third difference between the first recommendation result and the second recommendation result can be used as the index for updating the first recommendation model Part of the loss, and the above errors can also be part of the loss.
  • the third difference between the first recommendation result and the second recommendation result may represent the difference between the first prediction model and the second prediction model, although the prediction performance of the second prediction model itself is not is not high (because as the training samples of the second predictive model, that is, the number of multiple second candidate objects is low), but the above-mentioned calculated error can characterize the processing error of the second predictive model, combining the first recommendation result and The result of combining the third difference between the second recommendation results and the error (such as direct addition or other fusion operations) can more accurately characterize the difference between the predicted result and the accurate result of the first recommendation result. difference, while training the first prediction model based on the target loss constructed from the above results can improve the prediction performance of the first prediction model for random traffic.
  • log data and labeled random traffic can also be used to train the first predictive model.
  • the log data When the log data is used to train the first prediction model, the log data may be processed based on the first prediction model, and the difference between the processing result and the true label of the log data is used as a part of the target loss.
  • the plurality of second candidate objects may be processed by the first recommendation model to obtain a fourth recommendation result, and the fourth recommendation result is combined with the The fourth difference between the above-mentioned true selection outcomes is used as part of the target loss.
  • the system can switch to the training mode of the unbiased optimization paradigm based on random traffic.
  • This training mode aims to make the model trained by log data as close as possible to the full amount under the random strategy. Data distribution, optimization goals are as follows:
  • Rt represents the true label of random traffic
  • the error may include a corresponding offset item of the second recommendation result, a corresponding variance item of the second recommendation result, and the sum of the first difference, wherein the offset item is the same as The similarity is negatively correlated, and the variance item is negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the expression of the error can be as follows:
  • item a Indicates the prediction error of the first recommendation model for labeled random traffic (that is, multiple second candidates); since it is difficult to obtain the corresponding label of the user interaction corresponding to the log data under the random strategy, the b item is non-optimizable; item c Indicates the prediction error of the first recommendation model for log data; item d Represents the prediction difference between the first recommendation model and the second recommendation model on the unexposed data (that is, a plurality of first candidate objects); item e The bias term and the variance term represent the prediction error of the second recommendation model on the unexposed data (ie multiple first candidate objects), where the last two items are the bias term and the variance term respectively.
  • 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 the recommendation method can be expressed as follows:
  • the overall process architecture can refer to the process shown in FIG. 6c.
  • the input data in the framework includes random traffic data uniform data (S t ), biased data non-uniform data (S c ) and unobserved sample data unobserved data (S u ), and the output is a recommendation model.
  • S t random traffic data uniform data
  • S c biased data non-uniform data
  • S u unobserved sample data unobserved data
  • the output is a recommendation model.
  • a pre-trained random model is first obtained.
  • the stochastic model and all data sources are input into the unbiased optimization paradigm based on stochastic traffic, and the relevant data is called according to different error terms and the optimization process is performed to finally obtain a more ideal recommendation model.
  • an unbiased optimization paradigm based on random flow is designed, which provides theoretical completeness for the use of random flow. This paradigm combined with the unbiased nature of random traffic enables the model to more fully approximate the unbiased distribution.
  • a counterfactual recommendation method based on an upper bound on the generalization error is designed to actually optimize the proposed unbiased optimization paradigm. Direct optimization of the unbiased optimization paradigm is difficult. By deriving an upper bound on the generalization error of this paradigm, the proposed counterfactual recommendation method aims to fully optimize this upper bound, which is statistically equivalent to the unbiased The optimization paradigm performs step-by-step optimization.
  • the single-domain recommendation involved in this project needs to use the algorithm in the recommendation system, which inevitably suffers from the problem that the real behavior of users cannot be reflected due to the data bias in the recommendation system. Since the object of the lifelong learning project is For users, if there is a bias problem in the collected log data of each domain, it will not be able to reflect the real behavior of the user, and the constructed user personal knowledge map will also be inaccurate.
  • the recommendation system of the application market predicts the user's click probability on the candidate application according to the user, candidate product and context characteristics, and arranges the candidate application in descending order according to the probability, and ranks the application most likely to be downloaded in the lowest position. previous position.
  • users choose to browse, click or download according to their personal interests, and these user behaviors will be stored in the log.
  • the application market uses these accumulated user behavior logs as training data to train the click-through rate prediction model offline.
  • problems such as position bias and selection bias in the collected user behavior logs.
  • an unbiased recommendation model is obtained by combining the training method of the prediction model proposed in this application, and It can effectively avoid the influence of false correlation on user preference estimation, and help to mine the user's causal interest.
  • the model trained in the embodiment of the present application is tested on the interest mining and user portrait construction system based on causal reasoning.
  • the offline experiment results are as follows: In the user portrait system, the algorithm based on gender prediction has increased the accuracy rate by more than 3% compared with the baseline, and the accuracy rate of the multi-age classification task has increased by nearly 8% compared with the baseline rate.
  • the introduction of counterfactual causal learning has improved the accuracy rate of each age group. 50% reduction in variance.
  • the mining of user interest based on counterfactual recommendation replaces the algorithm based on association rule learning, which effectively reduces the user's effective action set and provides interpretability for user preference labels.
  • An embodiment of the present 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 The first recommendation result; the plurality of first candidate objects are processed through the second recommendation model to obtain the second recommendation result; wherein, the second recommendation model is obtained based on the operation data training of the target user, and the operation data Including a plurality of second candidate objects and the target user's real selection results for the plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the second recommendation model processes the The result obtained by the plurality of second candidate objects is the third recommendation result; according to the similarity between the plurality of first candidate objects and the plurality of second candidate objects, and the third recommendation result and the real selecting the first difference between the results, predicting the error of the second recommended result, the error is negatively correlated with the similarity, and the error is positively correlated with the first difference; based on the first recommended result and A third difference between the second
  • the third difference between the first recommendation result and the second recommendation result can represent 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 as the training samples of the second predictive model, that is, the number of multiple second candidate objects is low), but the above-mentioned calculated error can characterize the processing error of the second predictive model, and the first recommendation result and the described
  • the result of combining the third difference between the second recommendation results and the error (such as direct addition or other fusion operations) can more accurately characterize the difference between the predicted result and the accurate result of the first recommendation result, Training the first prediction model with the target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
  • FIG. 8 is a schematic structural diagram of a recommended model training device provided in the embodiment of the present application.
  • the device 800 may include:
  • An acquisition module 801 configured to acquire a first recommendation model and a plurality of first candidate objects
  • step 501 for a specific description of the obtaining module 801, reference may be made to the description of step 501 in the above-mentioned embodiment, which will not be repeated here.
  • a feedforward module 802 configured to process the plurality of first candidate objects through the first recommendation model to obtain a first recommendation result
  • the plurality of first candidate objects are processed through the second recommendation model to obtain the second recommendation result; wherein, the second recommendation model is trained based on the operation data of the target user, and the operation data includes a plurality of second Candidate objects and the target user's real selection results for a plurality of second candidate objects, the second candidate objects are different from the first candidate objects, and the second recommendation model processes the plurality of second candidates
  • the result obtained by the subject is the third recommended result
  • An error determination module 803 configured to base on the similarities 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 real selection result , predicting an error of the second recommendation result, the error is negatively correlated with the similarity, and the error is positively correlated with the first difference;
  • An updating module 804 configured to determine a target loss based on a 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.
  • the first recommendation model is an initialized model.
  • the multiple first candidate objects are objects that have not been presented to the target user
  • the multiple second candidate objects are objects that have been presented to the target user.
  • the multiple second candidate objects are randomly selected from multiple objects that have been presented to the target user, and the multiple first candidate objects are Randomly selected from among the multiple objects presented.
  • the error is also negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the error includes a corresponding bias item of the second recommendation result, a corresponding variance item of the second recommendation result and the sum of the first difference, the bias item Negatively correlated with the similarity, the variance item is negatively correlated with the number of second candidate objects in the plurality of second candidate objects.
  • the first recommendation result and the second recommendation result respectively include a recommendation score of each of the first candidate objects; or,
  • the first recommendation result and the second recommendation result respectively include target recommendation objects selected from the plurality of first candidate objects.
  • the feedforward module is also used for:
  • the update module is specifically used for:
  • a target loss is determined based on a third difference between the first recommendation result and the second recommendation result, a fourth difference between the fourth recommendation result and the true selection result, and the error.
  • the acquisition module is also used to:
  • the user attributes include at least one of the following: gender, age, occupation, income, hobbies, education level;
  • the feedforward module is specifically used for:
  • the plurality of first recommendation objects and the user attributes are processed by the second recommendation model.
  • the first candidate object and the second candidate object include at least one of the following information:
  • the name of the candidate object The name of the candidate object, the developer of the candidate object, the size of the installation package of the candidate object, the category of the candidate object, and the favorable rating of the candidate object.
  • the acquisition module is also used to:
  • the target interface includes a first interface and a second interface
  • the first interface includes controls
  • the control is used to indicate whether to enable the collection of random traffic
  • the operation includes a first operation of 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 instruct to start the collection of the random traffic
  • the second interface includes the plurality of second candidate objects
  • the operation further includes the target user's actions on the plurality of second candidate objects
  • a second operation the second operation is used to determine the real selection result.
  • the third difference between the first recommendation result and the second recommendation result can represent 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 as the training samples of the second predictive model, that is, the number of multiple second candidate objects is low), but the above-mentioned calculated error can characterize the processing error of the second predictive model, and the first recommendation result and the described
  • the result of combining the third difference between the second recommendation results and the error (such as direct addition or other fusion operations) can more accurately characterize the difference between the predicted result and the accurate result of the first recommendation result, Training the first prediction model with the target loss constructed based on the above results can improve the prediction performance of the first prediction model for random traffic.
  • FIG. 9 is a schematic structural diagram of the execution device provided by the embodiment of the present application. Smart wearable devices, servers, etc. are not limited here.
  • the data processing apparatus described in the embodiment corresponding to FIG. 10 may be deployed on the execution device 900 to realize the data processing function in the embodiment corresponding to FIG. 10 .
  • the execution device 900 includes: a receiver 901, a transmitter 902, a processor 903, and a memory 904 (the number of processors 903 in the execution device 900 may be one or more), where the processor 903 may include an application processing device 9031 and communication processor 9032.
  • the receiver 901 , the transmitter 902 , the processor 903 and the memory 904 may be connected through a bus or in other ways.
  • the memory 904 may include read-only memory and random-access memory, and provides instructions and data to the processor 903 .
  • a part of the memory 904 may also include a non-volatile random access memory (non-volatile random access memory, NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 904 stores processors and operating instructions, executable modules or data structures, or their subsets, or their extended sets, wherein the operating instructions may include various operating instructions for implementing various operations.
  • the processor 903 controls the operations of the execution device.
  • various components of the execution device are coupled together through a bus system, where the bus system may include not only a data bus, but also a power bus, a control bus, and a status signal bus.
  • the various buses are referred to as bus systems in the figures.
  • the methods disclosed in the foregoing embodiments of the present application may be applied to the processor 903 or implemented by the processor 903 .
  • the processor 903 may be an integrated circuit chip, which has a signal processing capability.
  • each step of the above method may be completed by an integrated logic circuit of hardware in the processor 903 or instructions in the form of software.
  • the above-mentioned processor 903 may be a general-purpose processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and a vision processing unit (vision processing unit, VPU), a tensor processing unit (tensor processing unit, TPU) and other processors suitable for AI computing, and can further include application specific integrated circuit (ASIC), field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, Discrete gate or transistor logic devices, discrete hardware components.
  • the processor 903 may implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory 904, and the processor 903 reads the information in the memory 904, and executes the model trained in the embodiment corresponding to FIG. 5 in combination with its hardware.
  • the receiver 901 can be used to receive input digital or character information, and generate signal input related to performing device related settings and function control.
  • the transmitter 902 can be used to output digital or character information through the first interface; the 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; the transmitter 902 can also include display devices such as a display screen .
  • FIG. 10 There may be relatively large differences due to different configurations or performances, and may include one or more central processing units (central processing units, CPU) 1010 (for example, one or more processors) and memory 1032, and one or more storage applications
  • the storage medium 1030 of the program 1042 or the data 1044 (such as one or more mass storage devices).
  • the memory 1032 and the storage medium 1030 may be temporary storage or persistent storage.
  • the program stored in the storage medium 1030 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the training device.
  • the central processing unit 1010 may be configured to communicate with the storage medium 1030 , and execute a series of instruction operations in the storage medium 1030 on the training device 1000 .
  • the training device 1000 can also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1058; or, one or more operating systems 1041, such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • operating systems 1041 such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • the training device may perform steps from step 501 to step 505 in the foregoing embodiment.
  • the embodiment of the present application also provides a computer program product, which, when running on a computer, causes the computer to perform the steps performed by the aforementioned execution device, or enables the computer to perform the steps performed by the aforementioned training device.
  • An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a program for signal processing, and when it is run on a computer, the computer executes the steps performed by the aforementioned executing device , or, causing the computer to perform the steps performed by the aforementioned training device.
  • the execution device, training device or terminal device provided in the embodiment of the present application may specifically be a chip.
  • the chip includes: a processing unit and a communication unit.
  • the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, pins or circuits etc.
  • the processing unit can execute the computer-executed instructions stored in the storage unit, so that the chips in the execution device execute the data processing methods described in the above embodiments, or make the chips in the training device execute the data processing methods described in the above embodiments.
  • the storage unit is a storage unit in the chip, such as a register, a cache, etc.
  • the storage unit may also be a storage unit located outside the chip in the wireless access device, such as only Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM), etc.
  • ROM Read-only memory
  • RAM random access memory
  • FIG. 11 is a schematic structural diagram of a chip provided by the embodiment of the present application.
  • the chip can be represented as a neural network processor NPU1100, and the NPU 1100 is mounted to the main CPU (Host CPU) as a coprocessor ), the tasks are assigned by the Host CPU.
  • the core part of the NPU is the operation circuit 1103, and the operation circuit 1103 is controlled by the controller 1104 to extract matrix data in the memory and perform multiplication operations.
  • the NPU 1100 can implement the recommended model training method provided in the embodiment described in FIG. 5 through cooperation among various internal devices.
  • the computing circuit 1103 in the NPU 1100 includes multiple processing units (Process Engine, PE).
  • arithmetic circuit 1103 is a two-dimensional systolic array. Arithmetic circuit 1103 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition.
  • arithmetic circuit 1103 is a general-purpose matrix processor.
  • the operation circuit fetches the data corresponding to the matrix B from the weight memory 1102, and caches it in each PE in the operation circuit.
  • the operation circuit takes the data of matrix A from the input memory 1101 and performs matrix operation with matrix B, and the obtained partial or final results of the matrix are stored in an accumulator 1108 .
  • the unified memory 1106 is used to store input data and output data.
  • the weight data directly accesses the controller (Direct Memory Access Controller, DMAC) 1105 through the storage unit, and the DMAC is transferred to the weight storage 1102.
  • Input data is also transferred to unified memory 1106 by DMAC.
  • DMAC Direct Memory Access Controller
  • the BIU is a Bus Interface Unit, that is, the bus interface unit 1110, which is used for the interaction between the AXI bus and the DMAC and the instruction fetch buffer (Instruction Fetch Buffer, IFB) 1109.
  • the bus interface unit 1110 which is used for the interaction between the AXI bus and the DMAC and the instruction fetch buffer (Instruction Fetch Buffer, IFB) 1109.
  • the bus interface unit 1110 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 1109 to obtain instructions from the external memory, and is also used for the storage unit access controller 1105 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
  • BIU Bus Interface Unit
  • the DMAC is mainly used to move the input data in the external memory DDR to the unified memory 1106 , to move the weight data to the weight memory 1102 , or to move the input data to the input memory 1101 .
  • the vector calculation unit 1107 includes a plurality of calculation processing units, and further processes the output of the calculation circuit 1103 if necessary, such as vector multiplication, vector addition, exponent operation, logarithmic operation, size comparison and so on. It is mainly used for non-convolutional/fully connected layer network calculations in neural networks, such as Batch Normalization (batch normalization), pixel-level summation, and upsampling of feature planes.
  • the vector computation unit 1107 can store the vector of the processed output to the unified memory 1106 .
  • the vector calculation unit 1107 can apply a linear function; or, a nonlinear function to the output of the operation circuit 1103, such as performing linear interpolation on the feature plane extracted by the convolution layer, and then for example, a vector of accumulated values to generate activation values.
  • the vector computation unit 1107 generates normalized values, pixel-level summed values, or both.
  • the vector of processed outputs can be used as an activation input to operational circuitry 1103, eg, for use in subsequent layers in a neural network.
  • An instruction fetch buffer (instruction fetch buffer) 1109 connected to the controller 1104 is used to store instructions used by the controller 1104;
  • the unified memory 1106, the input memory 1101, the weight memory 1102 and the fetch memory 1109 are all On-Chip memories. External memory is private to the NPU hardware architecture.
  • the processor mentioned above can be a general-purpose central processing unit, microprocessor, ASIC, or one or more integrated circuits for controlling the execution of the above-mentioned programs.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be A physical unit can be located in one place, or it can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between modules indicates that they have communication connections, which can be implemented as one or more communication buses or signal lines.
  • the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a floppy disk of a computer , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, training device, or network device, etc.) execute the instructions described in various embodiments of the present application method.
  • a computer device which can be a personal computer, training device, or network device, etc.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transferred from a website, computer, training device, or data
  • the center transmits to another website site, computer, training device or data center via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • wired eg, coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg, infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc.

Abstract

一种推荐模型训练方法,方法包括:将第一推荐模型处理多个第一候选对象得到的第一推荐结果与通过第二推荐模型处理多个第一候选对象得到的第二推荐结果之间的差异作为目标损失的一部分,将可以表征第二预测模型的处理误差也作为目标损失的一部分,所述目标损失可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,基于上述结果构建的目标损失训练第一预测模型可以提高第一预测模型针对于随机流量的预测性能。

Description

一种推荐模型训练方法及装置 技术领域
本申请涉及人工智能领域,尤其涉及一种推荐模型训练方法及装置。
背景技术
人工智能(artificial intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式作出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。
选择率预测,是指预测用户在特定环境下对某个物品的选择概率。例如,应用商店、在线广告等应用的推荐系统中,选择率预测起到关键作用;通过选择率预测可以实现最大化企业的收益和提升用户满意度,推荐系统需同时考虑用户对物品的选择率和物品竞价,其中,选择率为推荐系统根据用户历史行为预测得到,而物品竞价代表该物品被选择/下载后系统的收益。例如,可以通过构建一个函数,该函数可以根据预测的用户选择率和物品竞价计算得到一个函数值,推荐系统按照该函数值对物品进行降序排列。
推荐系统作为反馈循环(feedback loop)系统,用户在与系统的交互过程中会产生各种偏置问题,如位置偏置。位置偏置的存在使得推荐系统收集到的用户反馈数据并不能反映用户的真实偏好。然而大多数经典算法均默认地假设观察到的用户偏好即为用户的真实偏好,并且致力于如何更好地拟合观察到的反馈数据分布。这会导致推荐系统收敛于一个有偏的次优解,降低了推荐系统的推荐性能。
发明内容
本申请提供了一种推荐模型训练方法及装置,可以提高第一预测模型针对于随机流量的预测性能。
第一方面,本申请提供了一种推荐模型训练方法,所述方法包括:
获取第一推荐模型以及多个第一候选对象;
在一种可能的实现中,所述第一推荐模型可以为初始化的模型,其中所谓初始化的模型可以理解为模型中的参数为随机初始化的,应理解,第一推荐模型还可以是经过较少训练次数的模型,并不具备较高的推荐性能,又或者,第一推荐模型还可以为通过日志数据训练得到的模型,该模型针对于全量数据(例如非曝光数据)的推荐结果并不精准(不精准可以理解为和用户真实的选择结果差异较大);
可选的,多个第一候选对象可以为推荐系统还未向目标用户进行呈现的数据;
可选的,多个第一候选对象可以为从还未向目标用户进行呈现的数据中选择的对象;
可选的,多个第一候选对象可以为从还未向目标用户进行呈现的数据中随机选择的对象;
其中,所谓的“呈现”可以描述为展示、显示等;
其中,所谓的“还未向目标用户进行呈现”可以理解为还未同一次呈现在一个推荐结 果中;
在一种可能的实现中,第一推荐模型可以为机器学习模型,机器学习模型例如可以由单层级的线性或非线性运算组成(例如,支撑矢量机(support vector machines,SVM)或者可以是深度网络,即由多层级的非线性运算组成的机器学习模型)。深度网络的示例是具有一个或多个隐藏层的神经网络,并且这样的机器学习模型例如可以通过依据反向传播学习算法等调节神经网络的权重而被训练;
通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;
在一种可能的实现中,可以通过所述第一推荐模型处理所述多个第一候选对象,也就是将多个第一候选对象作为第一推荐模型的输入,并进行第一推荐模型的前馈过程;
通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;
其中,第二推荐模型可以为基于随机流量训练得到的模型,由于随机流量的数量较少,因此第二推荐模型的推荐精度较低(例如推荐结果的方差较大);
其中,多个第二候选对象可以为上述随机流量,也就是说多个第二候选对象可以为已呈现给目标用户的数据,且目标用户已经对多个第二候选对象进行了操作,操作数据可以包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果;
在一种可能的实现中,真实选择结果可以指示该第二候选对象为正样本还是负样本的特征,即样本类型标签(标签特征),一个样本属于正样本还是属于负样本可以通过对样本中的样本类型标签进行识别得出,例如,某个样例的该样本类型标签为1时,表明该某个样例为正样本,某个样例的样本类型标签为0时,表明该某个样例为负样本。一个样本的样本类型标签由用户对该一个样本中的特征描述的对象的操作信息决定;
根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;
在一种可能的实现中,第二推荐模型在处理多个第一候选对象时,可以得到第二推荐结果,由于第二推荐模型的推荐精度较低,第二推荐结果不能认为可以表示出用户的真实意图(也就是说第二推荐结果和用户的真实意图之间存在误差)。
为了预测出第二推荐结果和用户的真实意图之间存在误差,本申请实施例中,可以基于所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,来预测所述第二推荐结果的误差。
在一种可能的实现中,第二推荐模型在处理多个第二候选对象时,可以得到第三推荐结果,由于第二推荐模型的推荐精度较低,第三推荐结果不能认为可以表示出用户的真实意图(也就是说第三推荐结果和真实选择结果之间存在误差)。
应理解,第二推荐模型在得到第三推荐结果时处理的多个第二候选对象可以不严格的 训练第二推荐模型时使用的多个第二候选对象完全一致,例如可以存在交集或者不存在交集。
一方面,第三推荐结果和真实选择结果之间的第一差异可以在一定程度上表达出第二推荐模型的模型误差,也就是第二推荐结果的误差。可选的,第二推荐结果的误差与第一差异正相关,所谓正相关,可以理解为第三推荐结果和真实选择结果之间的第一差异越大,第二推荐结果的误差越大(在其他信息不变的情况下);
应理解,这里的第一差异可以基于欧几里得距离(eucledian distance)、曼哈顿距离(manhattan distance)、明可夫斯基距离(minkowski distance)、余弦相似度(cosine similarity)、Jaccard系数、皮尔森相关系数(pearson correlation coefficient)等方式来衡量,这里并不限定;
另一方面,当多个第一候选对象和多个第二候选对象之间的相似度较大时,可以认为第二推荐结果的误差较大(原因在于,当多个第一候选对象和多个第二候选对象之间的相似度较小时,相当于多个第一候选对象为第二预测模型训练时没有采用的训练样本,针对于多个第一候选对象的数据特征,第二预测模型的数据处理精度相对于处理多个第二候选对象时的数据处理精度更低,也就是第二推荐结果的误差更大),也就是说,第二推荐结果的误差与多个第一候选对象和多个第二候选对象之间的相似度负相关,所谓负相关,可以理解为多个第一候选对象和多个第二候选对象之间的相似度越大,第二推荐结果的误差越小(在其他信息不变的情况下);
应理解,这里的相似度可以基于欧几里得距离(eucledian distance)、曼哈顿距离(manhattan distance)、明可夫斯基距离(minkowski distance)、余弦相似度(cosine similarity)、Jaccard系数、皮尔森相关系数(pearson correlation coefficient)等方式来衡量,这里并不限定;
基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。
本申请实施例提供了一种推荐模型训练方法,所述方法包括:获取第一推荐模型以及多个第一候选对象;通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。通过上述方式,所述第一推荐结果和所述第二推荐结果之间的第三差异可以表征出第一预测模型和第二预测模型的差异,虽然第二预测模型本身的预测性能并不高(因为作为第二预测模型的训练样本,也就是多个第二候选对象的数量较低),但 上述计算出的误差可以表征出第二预测模型的处理误差,将第一推荐结果和所述第二推荐结果之间的第三差异以及误差进行结合(例如直接的加法运算或者其他融合运算)后的结果,可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,而基于上述结果构建的目标损失训练第一预测模型可以提高第一预测模型针对于随机流量的预测性能。
在一种可能的实现中,所述多个第一候选对象为未向所述目标用户呈现的对象,所述多个第二候选对象为已向所述目标用户呈现的对象。
其中,多个第二候选对象可以为上述随机流量,也就是说多个第二候选对象可以为已呈现给目标用户的数据,且目标用户已经对多个第二候选对象进行了操作,操作数据可以包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果。
在一种可能的实现中,所述多个第二候选对象为从已向所述目标用户呈现的多个对象中随机选择的,所述多个第一候选对象为从未向所述目标用户呈现的多个对象中随机选择的。将随机选择的对象作为训练样本,可以降低推荐模型由于偏置导致的误差。
在一种可能的实现中,所述误差还与所述多个第二候选对象中第二候选对象的数量负相关。虽然多个第二候选对象中第二候选对象的数量不高,但当多个第二候选对象中第二候选对象的数量越大时,则可以认为第二推荐模型的推荐精度较高,因此,所述误差还可以与所述多个第二候选对象中第二候选对象的数量负相关,所谓负相关,可以理解为多个第二候选对象中第二候选对象的数量越大,第二推荐结果的误差越小(在其他信息不变的情况下)。
在一种可能的实现中,所述误差包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,所述偏置项与所述相似度负相关,所述方差项与所述多个第二候选对象中第二候选对象的数量负相关。
在一种可能的实现中,所述第一推荐结果和所述第二推荐结果分别包括每个所述第一候选对象的推荐分数;或者,所述第一推荐结果和所述第二推荐结果分别包括从所述多个第一候选对象中选择的目标推荐对象。
其中,推荐分数可以表示第一推荐模型对于各个第一候选对象的预测分值。可以根据第一推荐模型的具体设置决定目标推荐对象,如按预设的数量按分值的排序进行推荐。例如:模型的设置为推荐分值前十的第一候选对象,则将推荐分值前十的第一候选对象确定为目标推荐对象。
在一种可能的实现中,所述方法还包括:通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果;所述基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,包括:基于所述第一推荐结果和所述第二推荐结 果之间的第三差异,所述第四推荐结果与所述真实选择结果之间的第四差异以及所述误差,确定目标损失。还可以使用日志数据和带标签的随机流量来训练第一预测模型。在使用日志数据来训练第一预测模型时,可以基于第一预测模型对日志数据进行处理,并将处理结果和日志数据的真实标签之间的差异作为目标损失的一部分。在使用带标签的随机流量来训练第一预测模型时,可以通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果,并将所述第四推荐结果与所述真实选择结果之间的第四差异作为目标损失的一部分。将第四差异作为目标损失的一部分可以更精准的表达出第一推荐模型的输出和准确标签之间的差异,进而基于目标损失更新第一推荐模型可以提高第一推荐模型的推荐精度。
在一种可能的实现中,所述方法还包括:获取所述目标用户的用户属性,所述用户属性包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;所述通过所述第一推荐模型处理所述多个第一推荐对象,包括:通过所述第一推荐模型处理所述多个第一推荐对象和所述用户属性;所述通过第二推荐模型处理所述多个第一推荐对象,包括:通过所述第二推荐模型处理所述多个第一推荐对象和所述用户属性。
在一种可能的实现中,第一推荐模型的前馈过程的输入数据除了多个第一候选对象,还可以包括目标用户的用户属性,其中,所述用户属性可以包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;
其中,目标用户的属性信息可以为与用户喜好特征相关的属性,性别、年龄、职业、收入、爱好以及受教育程度中的至少一种,其中,性别可以为男或者女,年龄可以为0-100之间的数字,职业可以为教师、程序员、厨师等等,爱好可以为篮球、网球、跑步等等,受教育程度可以为小学、初中、高中、大学等等;本申请并不限定目标用户的属性信息的具体类型。
在一种可能的实现中,获取多个第一候选对象,可以理解为获取多个第一候选对象中每个第一候选对象的特征信息,该特征信息可以有一个或多个,例如包括候选对象的名称(或者称之为对象标识(ID))、对象所属的APP推荐结果的标识(ID)(如,实用工具,影音娱乐等)、候选对象的简介、候选对象大小(例如当候选对象为APP时,候选对象大小可以为候选对象的安装包大小)、候选对象的开发者、对象的标签(例如标签可以指示候选对象的品类)、候选对象的评论(例如候选对象的好评度)等中的一项或多项,当然也可能不包含这里列举的这些信息而是包括该对象的其他属性信息。
在一种可能的实现中,所述方法还包括:获取所述操作数据,其中,所述操作数据为终端设备基于所述目标用户对目标界面的操作获取到的,所述目标界面包括第一界面以及第二界面,所述第一界面包括控件,所述控件用于指示是否开启随机流量的采集,所述操作包括所述目标用户针对于所述第一控件的第一操作,所述第二界面为响应于所述第一操作而显示的界面,所述第一操作用于指示开启所述随机流量的采集,所述第二界面包括所 述多个第二候选对象,所述操作还包括所述目标用户针对于多个第二候选对象的第二操作,所述第二操作用于确定所述真实选择结果。
第二方面,本申请提供了一种推荐模型训练装置,所述装置包括:
获取模块,用于获取第一推荐模型以及多个第一候选对象;
前馈模块,用于通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;
通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;
误差确定模块,用于根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;
更新模块,用于基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。
本申请中,所述第一推荐结果和所述第二推荐结果之间的第三差异可以表征出第一预测模型和第二预测模型的差异,虽然第二预测模型本身的预测性能并不高(因为作为第二预测模型的训练样本,也就是多个第二候选对象的数量较低),但上述计算出的误差可以表征出第二预测模型的处理误差,将第一推荐结果和所述第二推荐结果之间的第三差异以及误差进行结合(例如直接的加法运算或者其他融合运算)后的结果,可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,而基于上述结果构建的目标损失训练第一预测模型可以提高第一预测模型针对于随机流量的预测性能。
在一种可能的实现中,所述第一推荐模型为初始化的模型。
在一种可能的实现中,所述多个第一候选对象为未向所述目标用户呈现的对象,所述多个第二候选对象为已向所述目标用户呈现的对象。
在一种可能的实现中,所述多个第二候选对象为从已向所述目标用户呈现的多个对象中随机选择的,所述多个第一候选对象为从未向所述目标用户呈现的多个对象中随机选择的。
在一种可能的实现中,所述误差还与所述多个第二候选对象中第二候选对象的数量负相关。
在一种可能的实现中,所述误差包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,所述偏置项与所述相似度负相关,所述方差项与所述多个第二候选对象中第二候选对象的数量负相关。
在一种可能的实现中,所述第一推荐结果和所述第二推荐结果分别包括每个所述第一候选对象的推荐分数;或者,
所述第一推荐结果和所述第二推荐结果分别包括从所述多个第一候选对象中选择的目标推荐对象。
在一种可能的实现中,所述前馈模块,还用于:
通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果;
所述更新模块,具体用于:
基于所述第一推荐结果和所述第二推荐结果之间的第三差异,所述第四推荐结果与所述真实选择结果之间的第四差异以及所述误差,确定目标损失。
在一种可能的实现中,所述获取模块,还用于:
获取所述目标用户的用户属性,所述用户属性包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;
所述前馈模块,具体用于:
通过所述第一推荐模型处理所述多个第一推荐对象和所述用户属性;
通过所述第二推荐模型处理所述多个第一推荐对象和所述用户属性。
在一种可能的实现中,所述第一候选对象以及所述第二候选对象包括如下信息的至少一种:
候选对象的名称,候选对象的开发者,候选对象的安装包大小,候选对象的品类,候选对象的好评度。
在一种可能的实现中,所述获取模块,还用于:
获取所述操作数据,其中,所述操作数据为终端设备基于所述目标用户对目标界面的操作获取到的,所述目标界面包括第一界面以及第二界面,所述第一界面包括控件,所述控件用于指示是否开启随机流量的采集,所述操作包括所述目标用户针对于所述第一控件的第一操作,所述第二界面为响应于所述第一操作而显示的界面,所述第一操作用于指示开启所述随机流量的采集,所述第二界面包括所述多个第二候选对象,所述操作还包括所述目标用户针对于多个第二候选对象的第二操作,所述第二操作用于确定所述真实选择结果。
第三方面,本申请实施例提供了一种计算设备,可以包括存储器、处理器以及总线系 统,其中,存储器用于存储程序,处理器用于执行存储器中的程序,以执行如上述第一方面任一可选的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面及任一可选的方法,上述第二方面及任一可选的方法。
第五方面,本申请实施例提供了一种计算机程序产品,包括代码,当代码被执行时,用于实现上述第一方面及任一可选的方法。
第六方面,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持执行设备或训练设备实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据;或,信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存执行设备或训练设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
本申请实施例提供了一种推荐模型训练方法,所述方法包括:获取第一推荐模型以及多个第一候选对象;通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。通过上述方式,所述第一推荐结果和所述第二推荐结果之间的第三差异可以表征出第一预测模型和第二预测模型的差异,虽然第二预测模型本身的预测性能并不高(因为作为第二预测模型的训练样本,也就是多个第二候选对象的数量较低),但上述计算出的误差可以表征出第二预测模型的处理误差,将第一推荐结果和所述第二推荐结果之间的第三差异以及误差进行结合(例如直接的加法运算或者其他融合运算)后的结果,可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,而基于上述结果构建的目标损失训练第一预测模型可以提高第一预测模型针对于随机流量的预测性能。
附图说明
图1为人工智能主体框架的一种结构示意图;
图2为本申请实施例提供的一种系统架构的示意图;
图3为本申请实施例提供的一种系统架构的示意图;
图4为本申请实施例提供的一种推荐流场景的示意图;
图5为本申请实施例提供的一种推荐模型训练方法的流程示意图;
图6a为一种第一界面的示意;
图6b为一种第二界面的示意;
图6c为本申请实施例提供的一种推荐模型训练方法的流程示意图;
图7为本申请实施例提供的一种推荐模型训练方法的流程示意图;
图8为本申请实施例提供的一种推荐模型的训练装置的流程示意图;
图9为本申请实施例提供的一种执行设备的示意图;
图10为本申请实施例提供的一种训练设备的示意图;
图11为本申请实施例提供的一种芯片的示意图。
具体实施方式
下面结合本发明实施例中的附图对本发明实施例进行描述。本发明的实施方式部分使用的术语仅用于对本发明的具体实施例进行解释,而非旨在限定本发明。
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
首先对人工智能系统总体工作流程进行描述,请参见图1,图1示出的为人工智能主体框架的一种结构示意图,下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。其中,“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。
(1)基础设施
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片(CPU、NPU、GPU、ASIC、FPGA等硬件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。
(2)数据
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。
(3)数据处理
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。
(4)通用能力
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。
(5)智能产品及行业应用
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能终端、智能交通、智能医疗、自动驾驶、智慧城市等。
本申请实施例可以应用于信息推荐领域,该场景包括但不限于涉及电商产品推荐、搜索引擎结果推荐、应用市场推荐、音乐推荐、视频推荐等场景,各种不同应用场景中被推荐的物品以下均称为“对象”以方便后续描述,即在不同的推荐场景中,推荐对象可以是APP,或者视频,或者音乐,或者某款商品(如线上购物平台的呈现界面,会根据用户的不同而显示不同的商品进行呈现,这实质也可以是通过推荐模型的推荐结果来进行呈现)。这些推荐场景通常涉及用户行为日志采集、日志数据预处理(例如,量化、采样等)、样本集训练以获得推荐模型、根据推荐模型对训练样本项对应的场景中所涉及的对象(如APP、音乐等)进行分析处理、例如,推荐模型训练环节中所选择的样本来自于手机应用市场用户对于所推荐APP的操作行为,则由此所训练出来的推荐模型则适用于上述手机APP应用市场,或者可以用于其它的类型的终端的APP应用市场进行终端APP的推荐。推荐模型将最终计算出各个待推荐对象的推荐概率或者分值,推荐系统根据一定的选择规则选定的推荐结果,例如按照推荐概率或者分值进行排序,通过相应的应用或者终端设备呈现给用户、用户对推荐结果中的对象进行操作以生成用户行为日志等环节。
参照图4,在推荐过程中,当一个用户与推荐系统进行交互会触发一个推荐请求,推荐系统会将该请求及其相关的特征信息输入到部署的推荐模型中,然后预测用户对所有候选对象的点击率。随后,根据预测的点击率对候选对象进行降序排列,按顺序将候选对象展示在不同的位置作为对用户的推荐结果。用户对展示的项目进行浏览并发生用户行为,如浏览、点击和下载等。这些用户行为会被存入日志中作为训练数据,通过离线训练模块不定期地更新推荐模型的参数,提高模型的推荐效果。
比如,用户打开手机应用市场即可触发应用市场的推荐模块,应用市场的推荐模块会根据用户的历史下载记录、用户点击记录,应用的自身特征,时间、地点等环境特征信息,预测用户对给定的各个候选应用的下载可能性。根据预测的结果,应用市场按照可能性降序展示,达到提高应用下载概率的效果。具体来说,将更有可能下载的应用排在靠前的位置,将不太可能下载的应用排列在靠后的位置。而用户的行为也会存入日志并通过离线训 练模块对预测模型的参数进行训练和更新。
又比如,在终身伴侣相关的应用中,可以基于用户在视频、音乐、新闻等域的历史数据,通过各种模型和算法,仿照人脑机制,构建认知大脑,搭建用户终身学习系统框架。终身伴侣可以根据系统数据和应用数据等来记录用户过去发生的事件,理解用户的当前意图,预测用户未来的动作或行为,最终实现智能服务。在当前第一阶段,根据音乐APP、视频APP和浏览器APP等获取用户的行为数据(包含端侧短信、照片、邮件事件等信息),一方面构建用户画像系统,另一方面实现基于用户信息过滤、关联分析、跨域推荐、因果推理等的学习与记忆模块,构建用户个人知识图谱。
接下来介绍本申请实施例的应用架构。
参见附图2,本发明实施例提供了一种推荐系统架构200。数据采集设备260用于采集样本,一个训练样本可以由多个特征信息组成,特征信息可以有多种,具体可以包括用户特征信息和对象特征信息以及标签特征,用户特征信息用于表征用户的特征,例如性别,年龄,职业,爱好等,对象特征信息用于表征向用户所推送的对象的特征,不同的推荐系统对应不同的对象,不同的对象所需要提取的特征类型也不想同,例如APP市场的训练样本中所提取的对象特征可以为,APP的名称(标识),类型,大小等;而电商类APP的训练样本中所提起的对象特征可以为,商品的名称,所属的类别,价格区间等;标签特征,则是用于表示这个样本是正例还是负例,通常样本的标签特征可以通过用户对所推荐对象的操作信息所获的,用户对所推荐对象有进行操作的样本为正例,用户对所推荐对象没有进行操作,或者仅浏览的样本为负例,例如当用户点击或者下载或者购买了所推荐的对象,则所述标签特征为1,表示该样本是正例,而如果用户没有对所推荐的对象进行任何操作,则所述标签特征为0,表示该样本是负例。样本在采集后可以保存在数据库230中,数据库230中的样本中的部分或全部特征信息也可以直接从客户设备240中获取,如用户特征信息,用户对对象的操作信息(用于确定类型标识),对象特征信息(如对象标识)等。训练设备220基于数据库230中样本训练获取模型参数矩阵用于生成推荐模型201。下面将更详细地描述训练设备220如何训练得到用于生成推荐模型201的模型参数矩阵,推荐模型201能够用于对大量对象进行评估从而得出各个待推荐对象的分值,进一步的还可以从大量对象的评估结果中推荐指定或者预设数目个对象,计算模块211基于推荐模型201的评估结果获取推荐结果,通过I/O接口212推荐给客户设备。
在本申请实施例中,该训练设备220可以从数据库230中样本集内选取正、负样本添加到所述训练集中,之后采用推荐模型(例如本申请实施例中的第一推荐模型)对训练集中的样本进行训练从而得到训练后的推荐模型;计算模块211的实现细节可以参照图5所示的方法实施例的详细描述。
训练设备220基于样本训练获得模型参数矩阵后用于构建推荐模型201后,将推荐模型201发送给执行设备210,或者直接将模型参数矩阵发送给执行设备210,在执行设备210中构建推荐模型,用于进行相应系统的推荐,例如基于视频相关的样本训练获得的推荐模型可以用于视频网站或APP中对用户进行视频的推荐,基于APP相关的样本训练获得的推荐模型可以用于应用市场中对用户进行APP的推荐。
执行设备210配置有I/O接口212,与外部设备进行数据交互,执行设备210可以通过I/O接口212从客户设备240获取用户特征信息,例如用户标识、用户身份、性别、职业、爱好等,此部分信息也可以从系统数据库中获取。推荐模型201基于用户特征信息和待推荐对象特征信息向用户推荐目标推荐对象。执行设备210可以设置在云端服务器中,也可以设置于用户客户端中。
执行设备210可以调用数据存储系统250中的数据、代码等,同时也可以将输出的数据存入数据存储系统250中。数据存储系统250可以设置于执行设备210中,也可以独立设置,或者设置于其他网络实体中,数量可以是一个也可以是多个。
计算模块211使用推荐模型201对用户特征信息,待推荐对象特征信息进行处理,例如,该计算模块211使用推荐模型201对用户特征信息,以及待推荐对象的特征信息进行分析处理,从而得出该待推荐对象的分值,对待推荐对象按照分值进行排序,其中,排序靠前的对象将作为推荐给客户设备240的对象。
最后,I/O接口212将推荐结果返回给客户设备240,呈现给用户。
更深层地,训练设备220可以针对不同的目标,基于不同的样本特征信息生成相应的推荐模型201,以给用户提供更佳的结果。
值得注意的,附图2仅是本发明实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在附图2中,数据存储系统250相对执行设备210是外部存储器,在其它情况下,也可将数据存储系统250置于执行设备210中。
在本申请实施例中,该训练设备220、执行设备210、客户设备240可以分别为三个不同的物理设备,也可能该训练设备220和执行设备210在同一个物理设备或者一个集群上,也可能该执行设备210与该客户设备240在同一个物理设备或者一个集群上。
参见附图3,是本发明实施例提的一种系统架构300。在此架构中执行设备210由一个或多个服务器实现,可选的,与其它计算设备配合,例如:数据存储、路由器、负载均衡器等设备;执行设备210可以布置在一个物理站点上,或者分布在多个物理站点上。执行设备210可以使用数据存储系统250中的数据,或者调用数据存储系统250中的程序代码实现对象推荐的功能,具体地,将待推荐的对象的信息输入到推荐模型中,推荐模型为每个待推荐对象生成预估分数,然后按照预估分数从高到低的顺序进行排序,按照排序结果向用户推荐该待推荐对象。例如,将排序结果中的前10个对象推荐给用户。
其中,数据存储系统250用于接收和存储训练设备发送的推荐模型的参数,以及用于存储通过推荐模型得到的推荐结果的数据,当然还可能包括该存储系统250正常运行所需的程序代码(或指令)。数据存储系统250可以为部署在执行设备210以外的一个设备或者多个设备构成的分布式存储集群,此时,当执行设备210需要使用存储系统250上的数据时,可以由存储系统250向执行设备210发送该执行设备所需的数据,相应地,该执行设备210接收并存储(或者缓存)该数据。当然数据存储系统250也可以部署在执行设备210内,当部署在执行设备210内时,该分布式存储系统可以包括一个或者多个存储器,可选的,存在多个存储器时,不同的存储器用于存储不同类型的数据,如通过训练设备生成的 推荐模型的模型参数和通过推荐模型得到的推荐结果的数据可以分别存储在两个不同的存储器上。
用户可以操作各自的用户设备(例如本地设备301和本地设备302)与执行设备210进行交互。每个本地设备可以表示任何计算设备,例如个人计算机、计算机工作站、智能手机、平板电脑、智能摄像头、智能汽车或其他类型蜂窝电话、媒体消费设备、可穿戴设备、机顶盒、游戏机等。
每个用户的本地设备可以通过任何通信机制/通信标准的通信网络与执行设备210进行交互,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。
在另一种实现中,执行设备210可以由本地设备实现,例如,本地设备301可以基于推荐模型实现执行设备210的的推荐功能获取用户特征信息并向用户反馈推荐结果,或者为本地设备302的用户提供服务。
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。
1、点击概率(click-throughrate,CTR)
点击概率又可以称为点击率,是指网站或者应用程序上推荐信息(例如,推荐物品)被点击次数和曝光次数之比,点击率通常是推荐系统中衡量推荐系统的重要指标。
2、个性化推荐系统
个性化推荐系统是指根据用户的历史数据(例如本申请实施例中的操作信息),利用机器学习算法进行分析,并以此对新请求进行预测,给出个性化的推荐结果的系统。
3、离线训练(offlinetraining)
离线训练是指在个性化推荐系统中,根据用户的历史数据(例如本申请实施例中的操作信息),对推荐模型参数按照器学习的算法进行迭代更新直至达到设定要求的模块。
4、在线预测(onlineinference)
在线预测是指基于离线训练好的模型,根据用户、物品和上下文的特征预测该用户在当前上下文环境下对推荐物品的喜好程度,预测用户选择推荐物品的概率。
5、反事实技术:利用反事实推理、学习未观测的世界,扩展想象空间,摆脱现实世界的束缚,创造新事物。
6、随机流量:对于用户请求,我们对推荐系统进行干预,即我们不再使用推荐策略来进行项目的指派,而是从所有候选集合中随机地采样一些项目,再随机地排序后向用户进行展示并收集相应的反馈。
7、日志数据:从反事实学习的角度分析,当前收集用户日志数据存在各种偏置问题(位置偏置、选择偏置等),被认为是有偏数据。
8、曝光数据:推荐系统向用户进行展示的数据。
9、未曝光数据:推荐系统还未向用户进行展示的数据。
10、全量数据:假设推荐系统可以向用户展示所有的物品并收集到用户对所有物品的反馈,这个收集到的数据被称为全量数据。
11、位置偏置:描述用户倾向性地选择处于更好位置的物品进行交互,这种倾向性与物品是否满足用户的实际需求无关。
12、选择偏置:发生于“被研究群体”不能够代表“目标群体”,以至于对“被研究群体”的风险/收益的衡量不能够准确地表征“目标群体”,导致所获结论不能够被有效地泛化。
13、正例:也称为正样本,表示有用户正向反馈的样本,比如有下载或购买行为的样本。
15、负例:也称为负样本,表示有用户负向反馈的样本,比如有差评或者仅浏览行为的样本。
16、训练集:用来训练模型的样本集。
17、标签:标记样本是正例还是负例,比如1为正例,0为负例。
18、终身学习:基于用户在视频、音乐、新闻等域的历史数据,通过各种模型和算法,仿照人脑机制,构建认知大脑,搭建用户终身学习系统框架。通过个性化学习,推理实现用户真实意图理解,使能精准服务推荐,增强用户粘性。
19、神经网络
神经网络可以是由神经单元组成的,神经单元可以是指以xs(即输入数据)和截距1为输入的运算单元,该运算单元的输出可以为:
Figure PCTCN2021121690-appb-000001
其中,s=1、2、……n,n为大于1的自然数,Ws为xs的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入,激活函数可以是sigmoid函数。神经网络是将多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。
20、深度神经网络
深度神经网络(Deep Neural Network,DNN),也称多层神经网络,可以理解为具有很多层隐含层的神经网络,这里的“很多”并没有特别的度量标准。从DNN按不同层的位置划分,DNN内部的神经网络可以分为三类:输入层,隐含层,输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐含层。层与层之间是全连接的,也就是说,第i层的任意一个神经元一定与第i+1层的任意一个神经元相连。虽然DNN看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
Figure PCTCN2021121690-appb-000002
其中,
Figure PCTCN2021121690-appb-000003
是输入向量,
Figure PCTCN2021121690-appb-000004
是输出向量,
Figure PCTCN2021121690-appb-000005
是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
Figure PCTCN2021121690-appb-000006
经过如此简单的操作得到输出向量
Figure PCTCN2021121690-appb-000007
由于DNN层数多,则系数W和偏移向量
Figure PCTCN2021121690-appb-000008
的数量也就很多了。这些参数在DNN中的定义 如下所述:以系数W为例:假设在一个三层的DNN中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
Figure PCTCN2021121690-appb-000009
上标3代表系数W所在的层数,而下标对应的是输出的第三层索引2和输入的第二层索引4。总结就是:第L-1层的第k个神经元到第L层的第j个神经元的系数定义为
Figure PCTCN2021121690-appb-000010
需要注意的是,输入层是没有W参数的。在深度神经网络中,更多的隐含层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络的也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。
21、损失函数
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。
22、反向传播算法
可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始模型中参数的大小,使得模型的误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始模型中的参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的模型参数,例如权重矩阵。
接下来以模型训练阶段为例对本申请实施例提供的推荐模型训练方法进行说明。
参照图5,图5为本申请实施例提供的一种推荐模型训练方法的实施例示意,如图5示出的那样,本申请实施例提供的一种推荐方法包括:
501、获取第一推荐模型以及多个第一候选对象。
本申请实施例中,步骤501的执行主体可以为云侧的服务器,或者是具备模型训练能力的端侧设备,这里并不限定,具体结构可以参照但不限于上述实施例中关于训练设备220的描述。
在一种可能的实现中,所述第一推荐模型可以为初始化的模型,其中所谓初始化的模型可以理解为模型中的参数为随机初始化的,应理解,第一推荐模型还可以是经过较少训练次数的模型,并不具备较高的推荐性能,又或者,第一推荐模型还可以为通过日志数据训练得到的模型,该模型针对于全量数据(例如非曝光数据)的推荐结果并不精准(不精准可以理解为和用户真实的选择结果差异较大)。
在一种可能的实现中,第一推荐模型可以为机器学习模型,机器学习模型例如可以由单层级的线性或非线性运算组成(例如,支撑矢量机(support vector machines,SVM)或者可以是深度网络,即由多层级的非线性运算组成的机器学习模型)。深度网络的示例是具有一个或多个隐藏层的神经网络,并且这样的机器学习模型例如可以通过依据反向传播学习算法等调节神经网络的权重而被训练。
为了降低位置偏置对推荐模型的影响,在训练数据的选择上,可以选择随机流量的数据,其中,所谓随机流量的数据可以理解为基于从候选对象集中随机选择推荐对象的方式呈现给目标用户,目标用户可以对推荐对象进行操作(例如选择或不选择)。上述方式可以称之为引入随机流量的无偏优化技术,其旨在引入一个由随机策略收集得到的随机流量来提供无偏信息,进而指导现有的基于日志数据的推荐模型在训练过程中缓解偏置问题。随机策略不依赖于任何的推荐模型,而是随机地从候选物品集合中进行选择,并且以随机排序的方式对它们进行展示。由于尽可能地避免了偏置问题的源头,在这种策略下收集到的随机流量可以被认为是无偏分布的一个代理,即由随机流量训练得到的推荐模型也是相对无偏的。
然而,随机流量的收集过程是昂贵的,因为它会损害平台的收益和用户的体验。因此,随机流量的收集通常被限制在一个很小的推荐比例中,导致随机流量的数量相对于日志数据是稀少的。这种规模下的随机流量可能并不能作为理想分布的良好替代。
为了解决上述随机流量数量太少的问题,可以从未曝光数据(也就是没有呈现给目标用户的对象)中随机选择一些对象,并预测目标用户针对于这些对象的选择结果,以此构建更多数量的相当于随机流量的数据来作为训练样本。关于如何准确的预测出目标用户针对于这些对象的选择结果,将在后续实施例中描述。
可选的,多个第一候选对象可以为推荐系统还未向目标用户进行呈现的数据;
可选的,多个第一候选对象可以为从还未向目标用户进行呈现的数据中选择的对象;
可选的,多个第一候选对象可以为从还未向目标用户进行呈现的数据中随机选择的对象;
其中,所谓的“呈现”可以描述为展示、显示等;
其中,所谓的“还未向目标用户进行呈现”可以理解为还未同一次呈现在一个推荐结果中;
可选的,多个第一候选对象可以为同一次呈现在一个推荐结果中的对象,所述推荐结果可以为样本来源的推荐系统中的所有或部分。举例来说,某个样本集包括样本1、样本2和样本3,样本1中包含用于描述对象1的特征,样本2中包含用于描述对象2的特征,样本3中包含用于描述对象3的特征;这里的对象1、对象2和对象3属于同一次展示在一个推荐结果上的三个对象。为了便于理解,这里再对“同一次展示在一个推荐结果的对象”进行举例说明,我们打开应用市场的主页面时,应用市场中会显示“实用工具”APP推荐、“影音娱乐”APP推荐等,其中,“实用工具”APP推荐和“影音娱乐”APP推荐就不属于一个推荐结果;用户前一天使用应用市场会展示这些推荐结果,后一天使用应用市场也会展示这些推荐结果,前一天展示的一次推荐结果与后一天展示的一次推荐结果就不属于同一次展示。
可选的,获取多个第一候选对象,可以理解为获取多个第一候选对象中每个第一候选对象的特征信息,该特征信息可以有一个或多个,例如包括候选对象的名称(或者称之为对象标识(ID))、对象所属的APP推荐结果的标识(ID)(如,实用工具,影音娱乐等)、候选对象的简介、候选对象大小(例如当候选对象为APP时,候选对象大小可以为候选对象的安装包大小)、候选对象的开发者、对象的标签(例如标签可以指示候选对象的品类)、候选对象的评论(例如候选对象的好评度)等中的一项或多项,当然也可能不包含这里例举的这些信息而是包括该对象的其他属性信息。
502、通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;
在一种可能的实现中,可以通过所述第一推荐模型处理所述多个第一候选对象,也就是将多个第一候选对象作为第一推荐模型的输入,并进行第一推荐模型的前馈过程。
在一种可能的实现中,第一推荐模型的前馈过程的输入数据除了多个第一候选对象,还可以包括目标用户的用户属性,其中,所述用户属性可以包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;
其中,目标用户的属性信息可以为与用户喜好特征相关的属性,性别、年龄、职业、收入、爱好以及受教育程度中的至少一种,其中,性别可以为男或者女,年龄可以为0-100之间的数字,职业可以为教师、程序员、厨师等等,爱好可以为篮球、网球、跑步等等,受教育程度可以为小学、初中、高中、大学等等;本申请并不限定目标用户的属性信息的具体类型。
在一种可能的实现中,进行第一推荐模型的前馈过程得到的输出可以为第一推荐结果,可选的,所述第一推荐结果可以包括每个所述第一候选对象的推荐分数;或者,从所述多个第一候选对象中选择的目标推荐对象,其中,目标推荐对象可以为多个第一候选对象中的部分对象(例如可以为推荐分数最高的多个对象)。
其中,推荐分数可以表示第一推荐模型对于各个第一候选对象的预测分值。可以根据第一推荐模型的具体设置决定目标推荐对象,如按预设的数量按分值的排序进行推荐。例如:模型的设置为推荐分值前十的第一候选对象,则将推荐分值前十的第一候选对象确定为目标推荐对象。
举例来说,假若多个第一候选对象包括APP1、APP2、APP3、APP4、APP5、APP6、APP7、APP8、APP9、APP10,将该用户U1的用户特征信息(例如,性别为男、年龄为25、职业为软件工程师等)和这十个APP各自对象特征信息(例如,APP标识,APP简介等)输入到该第一推荐模型,可选的,该第一推荐模型可以分别为这十个APP计算出预测分值,假若为这十个APP计算出的分数分别为: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、APP10=1.1,那么,按照预估分数从高到低进行排序得出顺序结果(或说列表),最后可以将其中排在前5位(假若预先配置了M等于5)的对象作为目标推荐对象。
503、通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中, 所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果。
其中,第二推荐模型可以为基于随机流量训练得到的模型,由于随机流量的数量较少,因此第二推荐模型的推荐精度较低(例如推荐结果的方差较大)。
其中,多个第二候选对象可以为上述随机流量,也就是说多个第二候选对象可以为已呈现给目标用户的数据,且目标用户已经对多个第二候选对象进行了操作,操作数据可以包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果。
在一种可能的实现中,可以基于终端上的界面来获取操作数据,其中,所述操作数据为终端设备基于所述目标用户对目标界面的操作获取到的,所述目标界面包括第一界面以及第二界面,所述第一界面包括控件,所述控件用于指示是否开启随机流量的采集,所述操作包括所述目标用户针对于所述第一控件的第一操作,所述第二界面为响应于所述第一操作而显示的界面,所述第一操作用于指示开启所述随机流量的采集,所述第二界面包括所述多个第二候选对象,所述操作还包括所述目标用户针对于多个第二候选对象的第二操作,所述第二操作用于确定所述真实选择结果。
参照图6a和图6b,图6a为一种第一界面的示意,图6b为一种第二界面的示意。
在一种可能的实现中,真实选择结果可以指示该第二候选对象为正样本还是负样本的特征,即样本类型标签(标签特征),一个样本属于正样本还是属于负样本可以通过对样本中的样本类型标签进行识别得出,例如,某个样例的该样本类型标签为1时,表明该某个样例为正样本,某个样例的样本类型标签为0时,表明该某个样例为负样本。一个样本的样本类型标签由用户对该一个样本中的特征描述的对象的操作信息决定,例如,该操作信息用于表示“浏览”、“下载”、“评论”、“购买”等操作,操作信息则意味着样本类型标签不同,例如,预先定义操作为“浏览”时样本类型标签用于标记负样本,预先定义操作行为“下载”时样本类型标签用于标记正样本。实际应用中,哪种操作对应正样本,哪种操作对应负样本都可以预先定义好。
关于如何基于操作数据对第二预测模型进行训练可以参照现有技术中关于模型训练的相关描述,这里不再赘述。
关于第二推荐模型的模型结构、第二推荐模型的前馈过程以及第二推荐结果的描述可以参照上述实施例中关于第一推荐模型的模型结构、第一推荐模型的前馈过程以及第一推荐结果的描述,相似之处这里不再赘述。
504、根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;
在一种可能的实现中,第二推荐模型在处理多个第一候选对象时,可以得到第二推荐结果,由于第二推荐模型的推荐精度较低,第二推荐结果不能认为可以表示出用户的真实 意图(也就是说第二推荐结果和用户的真实意图之间存在误差)。
为了预测出第二推荐结果和用户的真实意图之间存在误差,本申请实施例中,可以基于所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,来预测所述第二推荐结果的误差。
在一种可能的实现中,第二推荐模型在处理多个第二候选对象时,可以得到第三推荐结果,由于第二推荐模型的推荐精度较低,第三推荐结果不能认为可以表示出用户的真实意图(也就是说第三推荐结果和真实选择结果之间存在误差)。
应理解,第二推荐模型在得到第三推荐结果时处理的多个第二候选对象可以不严格的训练第二推荐模型时使用的多个第二候选对象完全一致,例如可以存在交集或者不存在交集。
一方面,第三推荐结果和真实选择结果之间的第一差异可以在一定程度上表达出第二推荐模型的模型误差,也就是第二推荐结果的误差。可选的,第二推荐结果的误差与第一差异正相关,所谓正相关,可以理解为第三推荐结果和真实选择结果之间的第一差异越大,第二推荐结果的误差越大(在其他信息不变的情况下)。
应理解,这里的第一差异可以基于欧几里得距离(eucledian distance)、曼哈顿距离(manhattan distance)、明可夫斯基距离(minkowski distance)、余弦相似度(cosine similarity)、Jaccard系数、皮尔森相关系数(pearson correlation coefficient)等方式来衡量,这里并不限定。
另一方面,当多个第一候选对象和多个第二候选对象之间的相似度较大时,可以认为第二推荐结果的误差较大(原因在于,当多个第一候选对象和多个第二候选对象之间的相似度较小时,相当于多个第一候选对象为第二预测模型训练时没有采用的训练样本,针对于多个第一候选对象的数据特征,第二预测模型的数据处理精度相对于处理多个第二候选对象时的数据处理精度更低,也就是第二推荐结果的误差更大),也就是说,第二推荐结果的误差与多个第一候选对象和多个第二候选对象之间的相似度负相关,所谓负相关,可以理解为多个第一候选对象和多个第二候选对象之间的相似度越大,第二推荐结果的误差越小(在其他信息不变的情况下)。
应理解,这里的相似度可以基于欧几里得距离(eucledian distance)、曼哈顿距离(manhattan distance)、明可夫斯基距离(minkowski distance)、余弦相似度(cosine similarity)、Jaccard系数、皮尔森相关系数(pearson correlation coefficient)等方式来衡量,这里并不限定。
另一方面,虽然多个第二候选对象中第二候选对象的数量不高,但当多个第二候选对象中第二候选对象的数量越大时,则可以认为第二推荐模型的推荐精度较高,因此,所述误差还可以与所述多个第二候选对象中第二候选对象的数量负相关,所谓负相关,可以理解为多个第二候选对象中第二候选对象的数量越大,第二推荐结果的误差越小(在其他信息不变的情况下)。
在一种可能的实现中,所述误差包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,所述偏置项与所述相似度负相关,所述方 差项与所述多个第二候选对象中第二候选对象的数量负相关。
在一种可能的实现中,虽然第二推荐模型的推荐精度较低,但由于第二推荐模型也是基于随机流量(即上述操作数据)得到的,因此具备一定的推荐精度(至少相对于第一推荐模型而言,对随机流量的数据处理精度是更高的),因此可以将所述第一推荐结果和所述第二推荐结果之间的第三差异来作为用于更新第一推荐模型的损失的一部分,且上述误差也可以作为损失的一部分。
505、基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。
本申请实施例中,所述第一推荐结果和所述第二推荐结果之间的第三差异可以表征出第一预测模型和第二预测模型的差异,虽然第二预测模型本身的预测性能并不高(因为作为第二预测模型的训练样本,也就是多个第二候选对象的数量较低),但上述计算出的误差可以表征出第二预测模型的处理误差,将第一推荐结果和所述第二推荐结果之间的第三差异以及误差进行结合(例如直接的加法运算或者其他融合运算)后的结果,可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,而基于上述结果构建的目标损失训练第一预测模型可以提高第一预测模型针对于随机流量的预测性能。
此外,还可以使用日志数据和带标签的随机流量来训练第一预测模型。
在使用日志数据来训练第一预测模型时,可以基于第一预测模型对日志数据进行处理,并将处理结果和日志数据的真实标签之间的差异作为目标损失的一部分。
在使用带标签的随机流量来训练第一预测模型时,可以通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果,并将所述第四推荐结果与所述真实选择结果之间的第四差异作为目标损失的一部分。
具体的,当随机流量的获取被激活时,系统可以切换到基于随机流量的无偏优化范式的训练模式,该训练模式旨在使得由日志数据训练的模型能够尽可能地逼近随机策略下的全量数据分布,优化目标如下:
Figure PCTCN2021121690-appb-000011
其中,R t表示随机流量的真实标签,
Figure PCTCN2021121690-appb-000012
表示模型对于随机流量的预测误差。
可选的,所述误差可以包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,其中,所述偏置项与所述相似度负相关,所述方差项与所述多个第二候选对象中第二候选对象的数量负相关。
示例性的,该误差的表达式可以为如下的示意:
Figure PCTCN2021121690-appb-000013
其中a项
Figure PCTCN2021121690-appb-000014
表示第一推荐模型对于带标签的随机流量(即多个第二候选对象)的预测误差;由于难以获取日志数据对应的用户交互在随机策略下的对应标签,因此b项
Figure PCTCN2021121690-appb-000015
是不可优化的;c项
Figure PCTCN2021121690-appb-000016
表示第一推荐模型对于日志数据的预测误差;d项
Figure PCTCN2021121690-appb-000017
表示第一推荐模型与第二推荐模型在未曝光数据(即多个第一候选对象)上的预测差异;e项
Figure PCTCN2021121690-appb-000018
偏置项和方差项表示第二推荐模型在未曝光数据(即多个第一候选对象)上的预测误差,其中最后两项分别是偏置项和方差项。
应理解,误差的表达式可以为:
Figure PCTCN2021121690-appb-000019
基于不等于
Figure PCTCN2021121690-appb-000020
可以得到:
Figure PCTCN2021121690-appb-000021
Figure PCTCN2021121690-appb-000022
在获得误差后,可以执行一个基于泛化误差上界的反事实推荐方法来获得推荐模型,该推荐方法的优化函数(即目标损失)可以为如下表达:
Figure PCTCN2021121690-appb-000023
其中,整体的流程架构可以参照图6c所示的流程。
如图7所示,框架中的输入数据包括随机流量数据uniform data(S t)、有偏数据non-uniform data(S c)和未观测样本数据unobserved data(S u),输出是推荐模型。在收集到随机流量数据后,一个预训练的随机模型首先被获得。随后随机模型和所有数据源被输入到基于随机流量的无偏优化范式中,根据不同的误差项调用相关的数据并执行优化的过程,最终获得一个更理想的推荐模型。通过上述方式,设计了基于随机流量的无偏优化范式,为随机流量的使用提供了理论完备性。该范式结合随机流量的无偏性质使得模型能够更加充分地逼近无偏分布。此外,设计了一种基于泛化误差上界的反事实推荐方法,对提出的无偏优化范式进行实际的优化。对无偏优化范式的直接优化是困难的,通过推导该范式的一个泛化误差上界,提出的反事实推荐方法旨在对该上界进行充分地优化,在统计上等价于对无偏优化范式进行逐步地优化。
以终身学习项目为例,在终身学习项目中,可以涉及到视频APP、音乐APP、浏览器 APP和应用市场APP等,从这些端侧APP中获取用户行为数据,可以用于构建用户画像系统,也需要将用户日志数据导入到学习记忆模块,从多域数据挖掘更多有价值的用户特征,构建用户个人知识库,结合用户画像系统,共同构建出用户个人知识图谱。
该项目中涉及到的单域推荐,需要用到推荐系统中的算法,不可避免的遭受着由于推荐系统中存在的数据偏置导致无法反映用户真实行为的问题,由于终身学习项目服务的对象是用户,如果收集到的各域的日志数据存在偏置问题,那么将无法反映出用户的真实行为,构建出的用户个人知识图谱也是不准确的。
以应用市场业务的推荐为例。启动应用市场APP后可以看到“推荐”首页,并且在这个页面内存在多个榜单。以精品应用为例,应用市场的推荐系统根据用户、候选集商品和上下文特征预测用户对候选应用的点击概率,并以该概率将候选应用降序排列,将最可能被下载的应用排在最靠前的位置。用户看到应用市场的推荐结果之后,根据个人的兴趣,选择浏览、点击或者下载等操作,这些用户行为都将被存入日志中。
应用市场将这些累积的用户行为日志作为训练数据离线训练点击率预测模型。然而收集的用户行为日志存在位置偏置和选择偏置等问题,为了消除这些偏置对于点击率预测模型的影响,结合本申请提出的预测模型的训练方法训练得到一个无偏的推荐模型,并且可以有效地避免虚假的相关性对于用户偏好估计的影响,有助于挖掘用户因果性的兴趣。
对比现有技术方案。为了验证本申请实施例训练得到的模型的精度,获取到了两周的应用市场业务数据,做了完备的离线实验,对比了当前技术在AUC指标上的结果。通过实验测试,得出以下结论:相较于基线在AUC上有4.86%的提升。本申请实施例训练得到的模型在公开数据集上同样执行了类似的实验测试,得出以下结论:相较于基线在AUC上有3.25%的提升,在nDCG上有170%的提升。此外,本申请实施例训练得到的模型能够有效地提升对长尾物品的推荐命中率。此外,对本申请实施例训练得到的模型在基于因果推理的兴趣挖掘和构建用户画像系统上进行了实验。离线实验结果如下:在用户画像系统中,基于性别预测的算法较基线准确率提升超3%,年龄多分类任务较基线准确率提升近8%,引入反事实因果学习使得各年龄段的准确率方差降低50%。基于反事实推荐的用户兴趣挖掘,替换了基于关联规则学习的算法,有效降低了用户的有效动作集,并提供出对于用户喜好标签的可解释性。
本申请实施例提供了一种推荐模型训练方法,所述方法包括:获取第一推荐模型以及多个第一候选对象;通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更 新所述第一推荐模型。通过上述方式,所述第一推荐结果和所述第二推荐结果之间的第三差异可以表征出第一预测模型和第二预测模型的差异,虽然第二预测模型本身的预测性能并不高(因为作为第二预测模型的训练样本,也就是多个第二候选对象的数量较低),但上述计算出的误差可以表征出第二预测模型的处理误差,将第一推荐结果和所述第二推荐结果之间的第三差异以及误差进行结合(例如直接的加法运算或者其他融合运算)后的结果,可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,而基于上述结果构建的目标损失训练第一预测模型可以提高第一预测模型针对于随机流量的预测性能。
参照图8,图8为本申请实施例提供的一种推荐模型训练装置的结构示意,参照图8,所述装,800可以包括:
获取模块801,用于获取第一推荐模型以及多个第一候选对象;
其中,关于获取模块801的具体描述,可以参照上述实施例中步骤501的描述,这里不再赘述,
前馈模块802,用于通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;
通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;
其中,关于前馈模块802的具体描述,可以参照上述实施例中步骤502和步骤503的描述,这里不再赘述。
误差确定模块803,用于根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;
其中,关于误差确定模块803的具体描述,可以参照上述实施例中步骤504的描述,这里不再赘述。
更新模块804,用于基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。
其中,关于更新模块804的具体描述,可以参照上述实施例中步骤505的描述,这里不再赘述。
在一种可能的实现中,所述第一推荐模型为初始化的模型。
在一种可能的实现中,所述多个第一候选对象为未向所述目标用户呈现的对象,所述多个第二候选对象为已向所述目标用户呈现的对象。
在一种可能的实现中,所述多个第二候选对象为从已向所述目标用户呈现的多个对象中随机选择的,所述多个第一候选对象为从未向所述目标用户呈现的多个对象中随机选择的。
在一种可能的实现中,所述误差还与所述多个第二候选对象中第二候选对象的数量负 相关。
在一种可能的实现中,所述误差包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,所述偏置项与所述相似度负相关,所述方差项与所述多个第二候选对象中第二候选对象的数量负相关。
在一种可能的实现中,所述第一推荐结果和所述第二推荐结果分别包括每个所述第一候选对象的推荐分数;或者,
所述第一推荐结果和所述第二推荐结果分别包括从所述多个第一候选对象中选择的目标推荐对象。
在一种可能的实现中,所述前馈模块,还用于:
通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果;
所述更新模块,具体用于:
基于所述第一推荐结果和所述第二推荐结果之间的第三差异,所述第四推荐结果与所述真实选择结果之间的第四差异以及所述误差,确定目标损失。
在一种可能的实现中,所述获取模块,还用于:
获取所述目标用户的用户属性,所述用户属性包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;
所述前馈模块,具体用于:
通过所述第一推荐模型处理所述多个第一推荐对象和所述用户属性;
通过所述第二推荐模型处理所述多个第一推荐对象和所述用户属性。
在一种可能的实现中,所述第一候选对象以及所述第二候选对象包括如下信息的至少一种:
候选对象的名称,候选对象的开发者,候选对象的安装包大小,候选对象的品类,候选对象的好评度。
在一种可能的实现中,所述获取模块,还用于:
获取所述操作数据,其中,所述操作数据为终端设备基于所述目标用户对目标界面的操作获取到的,所述目标界面包括第一界面以及第二界面,所述第一界面包括控件,所述控件用于指示是否开启随机流量的采集,所述操作包括所述目标用户针对于所述第一控件的第一操作,所述第二界面为响应于所述第一操作而显示的界面,所述第一操作用于指示开启所述随机流量的采集,所述第二界面包括所述多个第二候选对象,所述操作还包括所述目标用户针对于多个第二候选对象的第二操作,所述第二操作用于确定所述真实选择结果。
本申请中,所述第一推荐结果和所述第二推荐结果之间的第三差异可以表征出第一预测模型和第二预测模型的差异,虽然第二预测模型本身的预测性能并不高(因为作为第二预测模型的训练样本,也就是多个第二候选对象的数量较低),但上述计算出的误差可以表征出第二预测模型的处理误差,将第一推荐结果和所述第二推荐结果之间的第三差异以及误差进行结合(例如直接的加法运算或者其他融合运算)后的结果,可以更准确的表征出第一推荐结果的预测结果和准确结果之间的差异,而基于上述结果构建的目标损失训练 第一预测模型可以提高第一预测模型针对于随机流量的预测性能。
接下来介绍本申请实施例提供的一种执行设备,请参阅图9,图9为本申请实施例提供的执行设备的一种结构示意图,执行设备900具体可以表现为手机、平板、笔记本电脑、智能穿戴设备、服务器等,此处不做限定。其中,执行设备900上可以部署有图10对应实施例中所描述的数据处理装置,用于实现图10对应实施例中数据处理的功能。具体的,执行设备900包括:接收器901、发射器902、处理器903和存储器904(其中执行设备900中的处理器903的数量可以一个或多个),其中,处理器903可以包括应用处理器9031和通信处理器9032。在本申请的一些实施例中,接收器901、发射器902、处理器903和存储器904可通过总线或其它方式连接。
存储器904可以包括只读存储器和随机存取存储器,并向处理器903提供指令和数据。存储器904的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器904存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。
处理器903控制执行设备的操作。具体的应用中,执行设备的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器903中,或者由处理器903实现。处理器903可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器903中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器903可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器、以及视觉处理器(vision processing unit,VPU)、张量处理器(tensor processing unit,TPU)等适用于AI运算的处理器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器903可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器904,处理器903读取存储器904中的信息,结合其硬件来执行通过图5对应的实施例中训练得到的模型。
接收器901可用于接收输入的数字或字符信息,以及产生与执行设备的相关设置以及功能控制有关的信号输入。发射器902可用于通过第一接口输出数字或字符信息;发射器902还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据;发射器902还可以包括显示屏等显示设备。
本申请实施例还提供了一种训练设备,请参阅图10,图10是本申请实施例提供的训练设备一种结构示意图,具体的,训练设备1000由一个或多个服务器实现,训练设备1000可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)1010(例如,一个或一个以上处理器)和存储器1032,一个或一个以上存储应用程序1042或数据1044的存储介质1030(例如一个或一个以上海量存储设备)。其中,存储器1032和存储介质1030可以是短暂存储或持久存储。存储在存储介质1030的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对训练设备中的一系列指令操作。更进一步地,中央处理器1010可以设置为与存储介质1030通信,在训练设备1000上执行存储介质1030中的一系列指令操作。
训练设备1000还可以包括一个或一个以上电源1026,一个或一个以上有线或无线网络接口1050,一个或一个以上输入输出接口1058;或,一个或一个以上操作系统1041,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
具体的,训练设备可以进行上述实施例中步骤501至步骤505的步骤。
本申请实施例中还提供一种包括计算机程序产品,当其在计算机上运行时,使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。
本申请实施例提供的执行设备、训练设备或终端设备具体可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使执行设备内的芯片执行上述实施例描述的数据处理方法,或者,以使训练设备内的芯片执行上述实施例描述的数据处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体的,请参阅图11,图11为本申请实施例提供的芯片的一种结构示意图,所述芯片可以表现为神经网络处理器NPU1100,NPU 1100作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路1103,通过控制器1104控制运算电路1103提取存储器中的矩阵数据并进行乘法运算。
NPU 1100可以通过内部的各个器件之间的相互配合,来实现图5所描述的实施例中提供的推荐模型训练方法。
更具体的,在一些实现中,NPU 1100中的运算电路1103内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路1103是二维脉动阵列。运算电路1103还 可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路1103是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器1102中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器1101中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)1108中。
统一存储器1106用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(Direct Memory Access Controller,DMAC)1105,DMAC被搬运到权重存储器1102中。输入数据也通过DMAC被搬运到统一存储器1106中。
BIU为Bus Interface Unit即,总线接口单元1110,用于AXI总线与DMAC和取指存储器(Instruction Fetch Buffer,IFB)1109的交互。
总线接口单元1110(Bus Interface Unit,简称BIU),用于取指存储器1109从外部存储器获取指令,还用于存储单元访问控制器1105从外部存储器获取输入矩阵A或者权重矩阵B的原数据。
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器1106或将权重数据搬运到权重存储器1102中或将输入数据数据搬运到输入存储器1101中。
向量计算单元1107包括多个运算处理单元,在需要的情况下,对运算电路1103的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如Batch Normalization(批归一化),像素级求和,对特征平面进行上采样等。
在一些实现中,向量计算单元1107能将经处理的输出的向量存储到统一存储器1106。例如,向量计算单元1107可以将线性函数;或,非线性函数应用到运算电路1103的输出,例如对卷积层提取的特征平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元1107生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路1103的激活输入,例如用于在神经网络中的后续层中的使用。
控制器1104连接的取指存储器(instruction fetch buffer)1109,用于存储控制器1104使用的指令;
统一存储器1106,输入存储器1101,权重存储器1102以及取指存储器1109均为On-Chip存储器。外部存储器私有于该NPU硬件架构。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条 或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (23)

  1. 一种推荐模型训练方法,其特征在于,所述方法包括:
    获取第一推荐模型以及多个第一候选对象;
    通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;
    通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;
    根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;
    基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。
  2. 根据权利要求1所述的方法,其特征在于,所述第一推荐模型为初始化的模型。
  3. 根据权利要求1或2所述的方法,其特征在于,所述多个第一候选对象为未向所述目标用户呈现的对象,所述多个第二候选对象为已向所述目标用户呈现的对象。
  4. 根据权利要求1至3任一所述的方法,其特征在于,所述多个第二候选对象为从已向所述目标用户呈现的多个对象中随机选择的,所述多个第一候选对象为从未向所述目标用户呈现的多个对象中随机选择的。
  5. 根据权利要求1至4任一所述的方法,其特征在于,所述误差还与所述多个第二候选对象中第二候选对象的数量负相关。
  6. 根据权利要求1至5任一所述的方法,其特征在于,所述误差包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,所述偏置项与所述相似度负相关,所述方差项与所述多个第二候选对象中第二候选对象的数量负相关。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述第一推荐结果和所述第二推荐结果分别包括每个所述第一候选对象的推荐分数;或者,
    所述第一推荐结果和所述第二推荐结果分别包括从所述多个第一候选对象中选择的目标推荐对象。
  8. 根据权利要求1至7任一所述的方法,其特征在于,所述方法还包括:
    通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果;
    所述基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,包括:
    基于所述第一推荐结果和所述第二推荐结果之间的第三差异,所述第四推荐结果与所述真实选择结果之间的第四差异以及所述误差,确定目标损失。
  9. 根据权利要求1至8任一所述的方法,其特征在于,所述方法还包括:
    获取所述目标用户的用户属性,所述用户属性包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;
    所述通过所述第一推荐模型处理所述多个第一推荐对象,包括:
    通过所述第一推荐模型处理所述多个第一推荐对象和所述用户属性;
    所述通过第二推荐模型处理所述多个第一推荐对象,包括:
    通过所述第二推荐模型处理所述多个第一推荐对象和所述用户属性。
  10. 根据权利要求1至9任一所述的方法,其特征在于,所述方法还包括:
    获取所述操作数据,其中,所述操作数据为终端设备基于所述目标用户对目标界面的操作获取到的,所述目标界面包括第一界面以及第二界面,所述第一界面包括控件,所述控件用于指示是否开启随机流量的采集,所述操作包括所述目标用户针对于所述第一控件的第一操作,所述第二界面为响应于所述第一操作而显示的界面,所述第一操作用于指示开启所述随机流量的采集,所述第二界面包括所述多个第二候选对象,所述操作还包括所述目标用户针对于多个第二候选对象的第二操作,所述第二操作用于确定所述真实选择结果。
  11. 一种推荐模型训练装置,其特征在于,所述装置包括:
    获取模块,用于获取第一推荐模型以及多个第一候选对象;
    前馈模块,用于通过所述第一推荐模型处理所述多个第一候选对象,以得到第一推荐结果;
    通过第二推荐模型处理所述多个第一候选对象,以得到第二推荐结果;其中,所述第二推荐模型为基于目标用户的操作数据训练得到的,所述操作数据包括多个第二候选对象以及所述目标用户针对于多个第二候选对象的真实选择结果,所述第二候选对象与所述第一候选对象不同,且所述第二推荐模型处理所述多个第二候选对象得到的结果为第三推荐结果;
    误差确定模块,用于根据所述多个第一候选对象以及所述多个第二候选对象之间的相似度,以及所述第三推荐结果和所述真实选择结果之间的第一差异,预测所述第二推荐结果的误差,所述误差与所述相似度负相关,所述误差与所述第一差异正相关;
    更新模块,用于基于所述第一推荐结果和所述第二推荐结果之间的第三差异,以及所述误差,确定目标损失,并根据所述目标损失更新所述第一推荐模型。
  12. 根据权利要求11所述的装置,其特征在于,所述第一推荐模型为初始化的模型。
  13. 根据权利要求11或12所述的装置,其特征在于,所述多个第一候选对象为未向所述目标用户呈现的对象,所述多个第二候选对象为已向所述目标用户呈现的对象。
  14. 根据权利要求11至13任一所述的装置,其特征在于,所述多个第二候选对象为从已向所述目标用户呈现的多个对象中随机选择的,所述多个第一候选对象为从未向所述目标用户呈现的多个对象中随机选择的。
  15. 根据权利要求11至14任一所述的装置,其特征在于,所述误差还与所述多个第二候选对象中第二候选对象的数量负相关。
  16. 根据权利要求11至15任一所述的装置,其特征在于,所述误差包括所述第二推荐结果的对应的偏置项、所述第二推荐结果的对应的方差项以及所述第一差异加和,所述偏置项与所述相似度负相关,所述方差项与所述多个第二候选对象中第二候选对象的数量负相关。
  17. 根据权利要求11至16任一所述的装置,其特征在于,所述第一推荐结果和所述第二推荐结果分别包括每个所述第一候选对象的推荐分数;或者,
    所述第一推荐结果和所述第二推荐结果分别包括从所述多个第一候选对象中选择的目标推荐对象。
  18. 根据权利要求11至17任一所述的装置,其特征在于,所述前馈模块,还用于:
    通过所述第一推荐模型处理所述多个第二候选对象,以得到第四推荐结果;
    所述更新模块,具体用于:
    基于所述第一推荐结果和所述第二推荐结果之间的第三差异,所述第四推荐结果与所述真实选择结果之间的第四差异以及所述误差,确定目标损失。
  19. 根据权利要求11至18任一所述的装置,其特征在于,所述获取模块,还用于:
    获取所述目标用户的用户属性,所述用户属性包括如下的至少一种:性别,年龄,职业,收入,爱好,教育程度;
    所述前馈模块,具体用于:
    通过所述第一推荐模型处理所述多个第一推荐对象和所述用户属性;
    通过所述第二推荐模型处理所述多个第一推荐对象和所述用户属性。
  20. 根据权利要求11至19任一所述的装置,其特征在于,所述获取模块,还用于:
    获取所述操作数据,其中,所述操作数据为终端设备基于所述目标用户对目标界面的操作获取到的,所述目标界面包括第一界面以及第二界面,所述第一界面包括控件,所述控件用于指示是否开启随机流量的采集,所述操作包括所述目标用户针对于所述第一控件的第一操作,所述第二界面为响应于所述第一操作而显示的界面,所述第一操作用于指示开启所述随机流量的采集,所述第二界面包括所述多个第二候选对象,所述操作还包括所述目标用户针对于多个第二候选对象的第二操作,所述第二操作用于确定所述真实选择结果。
  21. 一种计算设备,其特征在于,所述计算设备包括存储器和处理器;所述存储器存储有代码,所述处理器被配置为获取所述代码,并执行如权利要求1至10任一所述的方法。
  22. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有一个或多个指令,所述指令在由一个或多个计算机执行时使得所述一个或多个计算机实施权利要求1至10任一所述的方法。
  23. 一种计算机程序产品,包括代码,其特征在于,在所述代码被执行时用于实现如权利要求1至10任一所述的方法。
PCT/CN2021/121690 2021-09-29 2021-09-29 一种推荐模型训练方法及装置 WO2023050143A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/121690 WO2023050143A1 (zh) 2021-09-29 2021-09-29 一种推荐模型训练方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/121690 WO2023050143A1 (zh) 2021-09-29 2021-09-29 一种推荐模型训练方法及装置

Publications (1)

Publication Number Publication Date
WO2023050143A1 true WO2023050143A1 (zh) 2023-04-06

Family

ID=85781020

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/121690 WO2023050143A1 (zh) 2021-09-29 2021-09-29 一种推荐模型训练方法及装置

Country Status (1)

Country Link
WO (1) WO2023050143A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116796076A (zh) * 2023-08-29 2023-09-22 中亿(深圳)信息科技有限公司 业务推荐方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180012170A1 (en) * 2016-07-06 2018-01-11 Palo Alto Research Center Incorporated Computer-Implemented System And Method For Providing Contextually Relevant Task Recommendations To Qualified Users
CN111582973A (zh) * 2020-04-09 2020-08-25 苏宁云计算有限公司 一种商品推荐数据生成方法、装置及系统
CN112232510A (zh) * 2020-12-14 2021-01-15 蚂蚁智信(杭州)信息技术有限公司 多目标推荐模型的训练及信息推荐方法以及装置
CN112487278A (zh) * 2019-09-11 2021-03-12 华为技术有限公司 推荐模型的训练方法、预测选择概率的方法及装置
CN113326440A (zh) * 2021-08-03 2021-08-31 腾讯科技(深圳)有限公司 基于人工智能的推荐方法、装置及电子设备
CN113344671A (zh) * 2021-06-23 2021-09-03 昆明理工大学 一种融合信任因素的个性化推荐模型及构建方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180012170A1 (en) * 2016-07-06 2018-01-11 Palo Alto Research Center Incorporated Computer-Implemented System And Method For Providing Contextually Relevant Task Recommendations To Qualified Users
CN112487278A (zh) * 2019-09-11 2021-03-12 华为技术有限公司 推荐模型的训练方法、预测选择概率的方法及装置
CN111582973A (zh) * 2020-04-09 2020-08-25 苏宁云计算有限公司 一种商品推荐数据生成方法、装置及系统
CN112232510A (zh) * 2020-12-14 2021-01-15 蚂蚁智信(杭州)信息技术有限公司 多目标推荐模型的训练及信息推荐方法以及装置
CN113344671A (zh) * 2021-06-23 2021-09-03 昆明理工大学 一种融合信任因素的个性化推荐模型及构建方法
CN113326440A (zh) * 2021-08-03 2021-08-31 腾讯科技(深圳)有限公司 基于人工智能的推荐方法、装置及电子设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116796076A (zh) * 2023-08-29 2023-09-22 中亿(深圳)信息科技有限公司 业务推荐方法、装置、设备及存储介质
CN116796076B (zh) * 2023-08-29 2023-11-03 中亿(深圳)信息科技有限公司 业务推荐方法、装置、设备及存储介质

Similar Documents

Publication Publication Date Title
WO2021047593A1 (zh) 推荐模型的训练方法、预测选择概率的方法及装置
WO2021233199A1 (zh) 搜索推荐模型的训练方法、搜索结果排序的方法及装置
WO2022016556A1 (zh) 一种神经网络蒸馏方法以及装置
CN115917535A (zh) 推荐模型的训练方法、推荐方法、装置及计算机可读介质
WO2024002167A1 (zh) 一种操作预测方法及相关装置
WO2024041483A1 (zh) 一种推荐方法及相关装置
WO2023185925A1 (zh) 一种数据处理方法及相关装置
CN115879508A (zh) 一种数据处理方法及相关装置
CN115238909A (zh) 一种基于联邦学习的数据价值评估方法及其相关设备
WO2024067779A1 (zh) 一种数据处理方法及相关装置
WO2024012360A1 (zh) 一种数据处理方法及相关装置
WO2023050143A1 (zh) 一种推荐模型训练方法及装置
WO2023246735A1 (zh) 一种项目推荐方法及其相关设备
CN117217284A (zh) 一种数据处理方法及其装置
CN116910357A (zh) 一种数据处理方法及相关装置
CN117057855A (zh) 一种数据处理方法及相关装置
CN117251619A (zh) 一种数据处理方法及相关装置
WO2023197910A1 (zh) 一种用户行为预测方法及其相关设备
CN116308640A (zh) 一种推荐方法及相关装置
CN116843022A (zh) 一种数据处理方法及相关装置
CN116204709A (zh) 一种数据处理方法及相关装置
CN115545738A (zh) 一种推荐方法及相关装置
WO2023051678A1 (zh) 一种推荐方法及相关装置
CN118043802A (zh) 一种推荐模型训练方法及装置
CN117009649A (zh) 一种数据处理方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21958733

Country of ref document: EP

Kind code of ref document: A1