Training method of recommendation model, pushing method and device of resource object
By transferring dark knowledge through a teacher-student network architecture, the training process of the coarse-ranking model was optimized, the prediction accuracy and consistency issues of the coarse-ranking model were resolved, and higher output consistency and accuracy with the fine-ranking model were achieved.
Patent Information
- Application Number
- CN202310899436.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2043-07-20
AI Technical Summary
In existing technologies, the prediction accuracy of coarse-ranking models is low and the consistency between predictions and fine-ranking models is not high, resulting in poor resource object push performance.
A teacher-student network architecture is adopted. A pre-trained, highly complex second-resource recommendation model is used as the teacher network, and its dark knowledge is transferred to a simple first-resource recommendation model as the student network. During training, the student network is optimized using distillation loss function and weight loss function to form coarse-ranking and fine-ranking models.
It improves the consistency and accuracy of the output data of the coarse-ranking model with that of the fine-ranking model, optimizes the training process, and enhances the processing efficiency and accuracy of the coarse-ranking model.
Smart Images

Figure CN116955812B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of Internet, and particularly relates to a training method of a recommendation model, a pushing method of a resource object, a training device of a recommendation model, a pushing device of a resource object, an electronic device, a storage medium and a computer program product. BACKGROUND
[0002] With the development of deep learning technology, the way of pushing resource objects to users online is more and more widely applied to various Internet platforms.
[0003] At present, generally, a preliminary prediction sorting of the push feedback effect is first performed on multiple resource objects recalled by a coarse sorting model to filter out initial sorting resource objects corresponding to an earlier prediction sorting, and then a further prediction sorting of the push feedback effect is performed on the initial sorting resource objects by a fine sorting model to filter out a target resource object corresponding to an earliest prediction sorting and push it to a user account.
[0004] In the prior art, since the coarse sorting model processes more resource objects than the fine sorting model, the coarse sorting model is generally trained using a relatively simple network model for system performance consideration, and thus there are problems of low prediction accuracy of the trained coarse sorting model and low consistency of the predictions between the coarse sorting model and the fine sorting model. SUMMARY
[0005] The present disclosure provides a training method of a recommendation model, a pushing method of a resource object, a training device of a recommendation model, a pushing device of a resource object, an electronic device, a storage medium and a computer program product to at least solve the problem of low consistency of the predictions between the coarse sorting model and the fine sorting model in the related art. The technical solutions of the present disclosure are as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a training method of a recommendation model is provided, comprising:
[0007] obtaining a first resource recommendation model to be trained, and taking the first resource recommendation model as a student network to be trained; the first resource recommendation model is used to determine first estimated feedback data of each of a plurality of sample resource objects, and based on the first estimated feedback data, a candidate sample object is filtered out from the plurality of sample resource objects; the first estimated feedback data represents prediction data of the sample resource object being implemented by a to-be-pushed user a preset feedback behavior;
[0008] obtaining a pre-trained second resource recommendation model, and taking the second resource recommendation model as a teacher network; the second resource recommendation model is used to determine second estimated feedback data of a plurality of candidate sample objects, and select a target sample object from the plurality of candidate sample objects based on the second estimated feedback data; the second estimated feedback data represents predicted data of the candidate sample object being implemented with a preset feedback behavior by the to-be-pushed user; a complexity of the second resource recommendation model is higher than that of the first resource recommendation model;
[0009] training the student network to be trained based on the teacher network, so as to migrate at least part of dark knowledge of the teacher network to the student network in a training process, and after the student network is trained, determining a first resource recommendation model corresponding to the student network as a coarse ranking model of a resource recommendation platform, and determining a second resource recommendation model corresponding to the teacher network as a fine ranking model of the resource recommendation platform; wherein the coarse ranking model is used to perform a first round of screening on a plurality of to-be-pushed resource objects of the resource recommendation platform, and the fine ranking model is used to perform a second round of screening on a plurality of candidate resource objects screened in the first round of screening, so as to obtain a target resource object recommended to a to-be-pushed user.
[0010] In an example embodiment, the training of the student network to be trained based on the teacher network, so as to migrate at least part of dark knowledge of the teacher network to the student network in a training process, comprises:
[0011] In each iteration process, based on a difference between weight parameters of an intermediate layer of the current student network and weight parameters of an intermediate layer of the current teacher network, determine weight loss function information between the teacher-student network; and
[0012] In each iteration process, based on a difference between estimated feedback data respectively output by the current student network and the current teacher network for the same sample resource object, determine distillation loss function information between the teacher-student network;
[0013] According to the distillation loss function information and the weight loss function information, determine comprehensive loss function information for the current student network;
[0014] Update the current student network based on the comprehensive loss function information.
[0015] In an example embodiment, the determining of the comprehensive loss function information for the current student network according to the distillation loss function information and the weight loss function information comprises:
[0016] obtaining first cross-entropy loss function information of the current student network and second cross-entropy loss function information of the current teacher network; the first cross-entropy loss function information represents a difference between first estimated feedback data output by the current student network for a first sample resource object and first actual feedback data corresponding to the first sample resource object; the second cross-entropy loss function information represents a difference between second estimated feedback data output by the current teacher network for a second sample resource object and second actual feedback data corresponding to the second sample resource object;
[0017] determining comprehensive loss function information for the current student network according to the first cross-entropy loss function information, the second cross-entropy loss function information, the distillation loss function information and the weight loss function information.
[0018] In an example embodiment, the distillation loss function information between the teacher-student networks is determined based on a difference between the estimated feedback data respectively output by the current student network and the current teacher network for the same sample resource object, including:
[0019] for the same sample resource object, inputting first feature data into the current student network to obtain first estimated feedback data of the sample resource object through the current student network, and inputting second feature data into the current teacher network to obtain second estimated feedback data of the sample resource object through the current teacher network; wherein the first feature data includes user features and resource object features of a to-be-pushed user, and the second feature data includes user features, resource object features and cross features of the to-be-pushed user; the cross features are associated features between the user features and the resource object features;
[0020] determining the distillation loss function information between the teacher-student networks based on a mean square error or information divergence between the first estimated feedback data and the second estimated feedback data.
[0021] In an example embodiment, full connection layers in the current teacher network and the current student network are each configured with a preset exponential function.
[0022] the first estimated feedback data of the sample resource object through the current student network includes:
[0023] inputting the first feature data into the current student network to obtain first initial estimated feedback data of the sample resource object through the current student network, and processing the first initial estimated feedback data based on the preset exponential function to obtain the first estimated feedback data of the sample resource object;
[0024] The second estimated feedback data of the sample resource object is obtained by the current teacher network, including:
[0025] The second feature data is input into the current teacher network, the second initial estimated feedback data of the sample resource object is obtained by the current teacher network, and the second initial estimated feedback data is processed based on the preset exponential function to obtain the second estimated feedback data of the sample resource object.
[0026] The preset exponential function is used to adjust the data distribution of the plurality of estimated feedback data corresponding to the plurality of sample resource objects output by the full connection layer in the current teacher network and the current student network, so that the data distribution tends to be smooth.
[0027] In an exemplary embodiment, before migrating at least part of the dark knowledge of the teacher network to the student network during the training process, the training of the student network to be trained based on the teacher network further includes:
[0028] The network type and network structure of the teacher network are obtained.
[0029] The student network to be trained is constructed based on the network type and network structure of the teacher network.
[0030] The network type of the student network to be trained is the same as that of the teacher network, the number of intermediate layers of the student network is less than that of the teacher network, and each intermediate layer of the student network corresponds to a corresponding intermediate layer in the teacher network.
[0031] In an exemplary embodiment, the student network to be trained is constructed based on the network type and network structure of the teacher network, including:
[0032] The student network of the same network type and network structure is constructed based on the network type and network structure of the teacher network.
[0033] Each intermediate layer in the student network corresponds to a corresponding odd-numbered intermediate layer in the teacher network, or each intermediate layer in the student network corresponds to a corresponding even-numbered intermediate layer in the teacher network.
[0034] In an exemplary embodiment, the difference between the weight parameters of the intermediate layers of the current student network and the weight parameters of the intermediate layers of the current teacher network is used to determine the weight loss function information between the teacher and student networks, including:
[0035] obtaining first weight parameters of each intermediate layer in the current student network and second weight parameters of each target intermediate layer in the current teacher network; the target intermediate layer is an intermediate layer corresponding to the intermediate layer of the current student network;
[0036] determining a weight loss function information between the teacher-student network based on a mean square error or information divergence between the first weight parameters and the second weight parameters.
[0037] In an exemplary embodiment, before the obtaining of the pre-trained second resource recommendation model and the taking of the second resource recommendation model as the teacher network, further comprising:
[0038] obtaining a pre-training sample resource object and actual feedback data corresponding to the pre-training sample resource object;
[0039] inputting feature data of the pre-training sample resource object into the second resource recommendation model to be trained to obtain estimated feedback data for the pre-training sample resource object; the estimated feedback data represents predicted data of the pre-training sample resource object being implemented by a to-be-pushed user a preset feedback behavior;
[0040] adjusting the second resource recommendation model to be trained based on a difference between the estimated feedback data and the actual feedback data corresponding to the pre-training sample resource object until a pre-trained second resource recommendation model is obtained, and taking the second resource recommendation model as a pre-trained teacher network.
[0041] According to a second aspect of the embodiments of the present disclosure, a resource object pushing method is provided, comprising:
[0042] inputting a plurality of to-be-pushed resource objects in a resource recommendation platform into a coarse ranking model, determining first estimated feedback data of each of the plurality of to-be-pushed resource objects by the coarse ranking model, and performing a first round of screening on the plurality of to-be-pushed resource objects based on the first estimated feedback data to screen out a plurality of candidate resource objects; the first estimated feedback data represents predicted data of each of the to-be-pushed resource objects being implemented by a to-be-pushed user a preset feedback behavior;
[0043] inputting a plurality of the candidate resource objects into a fine ranking model, determining second estimated feedback data corresponding to the plurality of candidate resource objects by the fine ranking model, and performing a second round of screening on the plurality of candidate resource objects based on the second estimated feedback data to determine a target resource object; the second estimated feedback data represents predicted data of the candidate resource object being implemented by a to-be-pushed user a preset feedback behavior; wherein the coarse ranking model and the fine ranking model are obtained based on a training method of a recommendation model;
[0044] recommend the target resource object to the to-be-pushed user.
[0045] According to a third aspect of the embodiments of the present disclosure, a training apparatus of a recommendation model is provided, comprising:
[0046] a student network unit configured to perform obtaining a first resource recommendation model to be trained, and taking the first resource recommendation model as a student network to be trained; the first resource recommendation model is used to determine first estimated feedback data of each of a plurality of sample resource objects, and select a candidate sample object from the plurality of sample resource objects based on the first estimated feedback data; the first estimated feedback data represents prediction data of the sample resource object implementing a preset feedback behavior by a to-be-pushed user;
[0047] a teacher network unit configured to perform obtaining a second resource recommendation model pre-trained, and taking the second resource recommendation model as a teacher network; the second resource recommendation model is used to determine second estimated feedback data of a plurality of candidate sample objects, and select a target sample object from the plurality of candidate sample objects based on the second estimated feedback data; the second estimated feedback data represents prediction data of the candidate sample object implementing a preset feedback behavior by the to-be-pushed user; the complexity of the second resource recommendation model is higher than that of the first resource recommendation model;
[0048] a model training unit configured to perform training the student network to be trained based on the teacher network, to migrate at least part of the dark knowledge of the teacher network to the student network in a training process, and to determine a first resource recommendation model corresponding to the student network as a coarse ranking model of a resource recommendation platform after the training of the student network is completed, and to determine a second resource recommendation model corresponding to the teacher network as a fine ranking model of the resource recommendation platform; wherein the coarse ranking model is used to perform a first round of screening on a plurality of to-be-pushed resource objects of the resource recommendation platform, and the fine ranking model is used to perform a second round of screening on a plurality of candidate resource objects screened in the first round of screening, to obtain a target resource object recommended to a to-be-pushed user.
[0049] According to a fourth aspect of the embodiments of the present disclosure, a pushing apparatus of a resource object is provided, comprising:
[0050] a first screening unit configured to perform inputting a plurality of to-be-pushed resource objects in a resource recommendation platform into a coarse ranking model, determining first estimated feedback data of each of the plurality of to-be-pushed resource objects by the coarse ranking model, and performing a first round of screening on the plurality of to-be-pushed resource objects based on the first estimated feedback data to screen a plurality of candidate resource objects; the first estimated feedback data represents prediction data of each of the to-be-pushed resource objects implementing a preset feedback behavior by a to-be-pushed user;
[0051] a second screening unit configured to input the plurality of candidate resource objects into a fine ranking model, determine second estimated feedback data corresponding to the plurality of candidate resource objects by the fine ranking model, and perform a second round of screening on the plurality of candidate resource objects based on the second estimated feedback data to determine a target resource object; the second estimated feedback data represents predicted data of the candidate resource object being implemented with a preset feedback behavior by a to-be-pushed user; and the coarse ranking model and the fine ranking model are obtained based on the training method of the recommendation model.
[0052] a target resource object pushing unit configured to perform recommendation of the target resource object to the to-be-pushed user.
[0053] According to a fifth aspect of the embodiments of the present disclosure, an electronic device is provided, comprising:
[0054] a processor;
[0055] a memory for storing executable instructions of the processor;
[0056] The processor is configured to execute the executable instructions to implement the training method of the recommendation model or the pushing method of the resource object according to any one of the above.
[0057] According to a sixth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the electronic device can execute the training method of the recommendation model or the pushing method of the resource object according to any one of the above.
[0058] According to a seventh aspect of the embodiments of the present disclosure, a computer program product is provided, and the computer program product includes program instructions. When the program instructions are executed by a processor of an electronic device, the electronic device can execute the training method of the recommendation model or the pushing method of the resource object according to any one of the above.
[0059] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0060] The method first acquires a first resource recommendation model to be trained, and takes the first resource recommendation model as a student network to be trained; then acquires a second resource recommendation model pre-trained, and takes the second resource recommendation model as a teacher network; then trains the student network to be trained based on the teacher network, so as to migrate at least part of the dark knowledge of the teacher network to the student network in the training process, and after the student network is trained, determines the first resource recommendation model corresponding to the student network as a coarse ranking model of the resource recommendation platform, and determines the second resource recommendation model corresponding to the teacher network as a fine ranking model of the resource recommendation platform. In this way, on the one hand, the pre-trained second resource recommendation model is used as the teacher network to train the student network, and the trained student network is used as the coarse ranking model in the resource recommendation platform, so as to optimize the training process and speed up the training efficiency of the coarse ranking model; on the other hand, since the teacher network is determined based on the pre-trained second resource recommendation model, and the dark knowledge of the teacher network is migrated to the student network in the process of training the student network to be trained, and then the trained student network is used as the coarse ranking model, the way and efficiency of the coarse ranking model for processing the resource object are similar to those of the fine ranking model, so as to ensure the consistency between the output data of the coarse ranking model and the output data of the fine ranking model, and improve the precision and accuracy of the output data corresponding to the coarse ranking model.
[0061] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0062] The accompanying drawings incorporated in the specification and forming a part of the specification illustrate embodiments consistent with the present disclosure, and together with the specification serve to explain the principles of the present disclosure, and do not limit the present disclosure.
[0063] Figure 1 is an application environment diagram of a recommendation model training method according to an exemplary embodiment.
[0064] Figure 2 is a flowchart of a recommendation model training method according to an exemplary embodiment.
[0065] Figure 3 is a flowchart of a step of determining a pre-trained teacher network according to an exemplary embodiment.
[0066] Figure 4 is a flowchart of a step of constructing a student network to be trained according to an exemplary embodiment.
[0067] Figure 5 is a structure diagram of a teacher-student network according to an exemplary embodiment.
[0068] Figure 6 FIG. 1 is a flowchart illustrating a step of training a student network to be trained according to an example embodiment.
[0069] Figure 7 FIG. 2 is a module diagram of a teacher-student network according to an example embodiment.
[0070] Figure 8 FIG. 3 is a flowchart illustrating a pushing method of a resource object according to an example embodiment.
[0071] Figure 9 FIG. 4 is a flowchart illustrating a pushing method of a resource object according to another example embodiment.
[0072] Figure 10 FIG. 5 is a block diagram of a training device of a recommendation model according to an example embodiment.
[0073] Figure 11 FIG. 6 is a block diagram of a pushing device of a resource object according to an example embodiment.
[0074] Figure 12 FIG. 7 is a block diagram of an electronic device according to an example embodiment.
[0075] Figure 13 FIG. 8 is a block diagram of a computer-readable storage medium according to an example embodiment.
[0076] Figure 14 FIG. 9 is a block diagram of a computer program product according to an example embodiment. DETAILED DESCRIPTION
[0077] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0078] The term "and / or" in the embodiments of the present application means any and all possible combinations of one or more of the associated listed items. It should also be noted that when used in the present specification, "comprise / comprising" specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0079] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.
[0080] In addition, although the terms "first", "second" and the like are used repeatedly in this application to describe various operations (or various elements or various applications or various instructions or various data) and the like, these operations (or elements or applications or instructions or data) should not be limited by these terms. These terms are only used to distinguish one operation (or element or application or instruction or data) from another operation (or element or application or instruction or data). For example, the first estimated feedback data can be referred to as the second estimated feedback data, and the second estimated feedback data can also be referred to as the first estimated feedback data, only the scope included by the two is different, without departing from the scope of the application, the first estimated feedback data and the second estimated feedback data are both a set of feedback data to be predicted in the push prediction model, only the two are not a set of feedback data predicted by the same push prediction model.
[0081] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0082] The training method of the recommendation model or the push method of the resource object provided by the embodiments of the present application can be applied to an electronic device, which can include a terminal 102 and / or a server 104 in an application environment as shown in Figure 1 The terminal 102 communicates with the server 104 through a communication network. The data storage system can store the processed data in the server 104, or send the processed data stored in the server 104 to the terminal 102. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.
[0083] In some embodiments, reference is made to Figure 1The electronic device first acquires a first resource recommendation model, and takes the first resource recommendation model as a student network to be trained; the first resource recommendation model is used to determine first estimated feedback data of a plurality of sample resource objects respectively, and based on the first estimated feedback data, candidate sample objects are screened out from the plurality of sample resource objects; the first estimated feedback data represents prediction data of the sample resource objects being implemented with a preset feedback behavior by a to-be-pushed user; then, the electronic device acquires a second resource recommendation model pre-trained, and takes the second resource recommendation model as a pre-trained teacher network; the second resource recommendation model is used to determine second estimated feedback data of the plurality of candidate sample objects, and based on the second estimated feedback data, a target sample object to be recommended to the to-be-pushed user is screened out from the plurality of candidate sample objects; the second estimated feedback data represents prediction data of the candidate sample objects being implemented with a preset feedback behavior by the to-be-pushed user; the complexity of the second resource recommendation model is higher than that of the first resource recommendation model; then, the student network is trained based on the teacher network again, so as to migrate the tacit knowledge of the teacher network to the student network in the training process, until the student network trained is completed; finally, the student network trained is determined as a coarse ranking model of a resource recommendation platform, and the pre-trained teacher network is determined as a fine ranking model of the resource recommendation platform; the coarse ranking model is used to perform a first round of screening on a plurality of to-be-pushed resource objects of the resource recommendation platform, and the fine ranking model is used to perform a second round of screening on a plurality of candidate resource objects screened out in the first round of screening, so as to obtain a target resource object to be recommended to the to-be-pushed user.
[0084] In some embodiments, the terminal 102 (such as a mobile terminal, a fixed terminal) can be implemented in various forms. Among them, the terminal 102 can be a mobile terminal including, for example, a mobile phone, a smart phone, a notebook computer, a portable handheld device, a personal digital assistant (PDA), a tablet computer (PAD), etc., which can push the corresponding target resource object according to the feedback data of the fine ranking model and the feedback data predicted by the coarse ranking model. The terminal 102 can also be an automated teller machine (ATM), an automatic integrated machine, a digital TV, a desktop computer, a fixed computer, etc., which can push the corresponding target resource object according to the feedback data of the fine ranking model and the feedback data predicted by the coarse ranking model.
[0085] In the following, it is assumed that the terminal 102 is a fixed terminal. However, those skilled in the art will understand that the configuration according to the embodiments disclosed in the present application can also be applied to the terminal 102 of the mobile type if there are operations or elements specially used for mobile purposes.
[0086] In some embodiments, the data processing components running on server 104 can load any of a variety of additional server applications and / or middleware applications, including, for example, HTTP (HyperText Transfer Protocol), FTP (File Transfer Protocol), CGI (Common Gateway Interface), RDBMS (Relational Database Management System), and the like, that are being executed.
[0087] In some embodiments, terminal 102 can be implemented with a standalone data processor or a data processing cluster composed of multiple data processors. Server 104 can be adapted to run one or more application services or software components that provide various additional server applications and / or middleware applications described in the foregoing disclosure.
[0088] In some embodiments, the application services can include a service interface (e.g., an operation interface for user configuration of data information of a resource object, a display interface for displaying a target resource object to a user) for providing a resource object configuration to a user, and a corresponding program service, and the like. The software components can include, for example, an application program (SDK) or a client (APP) having a push function of a corresponding target resource object based on feedback data of a fine ranking model and feedback data predicted by a coarse ranking model.
[0089] In some embodiments, the application program or client having a push display function of a corresponding target resource object provided by server 104 includes a portal in the foreground providing one-to-one application services to a user and a plurality of business systems in the background for data processing, so as to extend the push function of a resource object to an APP or a client, and thus the user can use and access the push function of a corresponding target resource object based on feedback data of a fine ranking model and feedback data predicted by a coarse ranking model at any time and in any place.
[0090] In some embodiments, the push display function of a corresponding target resource object of an APP or a client can be a computer program running in a user mode to complete one or more specific tasks, which can interact with a user and has a visual user interface. The APP or client can include two parts: a graphical user interface (GUI) and an engine, by which a digital client system can provide a variety of application services to a user in the form of a user interface.
[0091] In some embodiments, a user can input corresponding code data or control parameters to an APP or a client through an input device in terminal 102, so as to execute the application services of a computer program in server 104 and display the application services in a user interface.
[0092] As an example, when the server needs to recommend an e-commerce product to a user, server 104 will extract 100 e-commerce products from the database, then use a coarse ranking model to roughly calculate the predicted click-through rate (CTR) for each e-commerce product in the user's account, and input the top 10 e-commerce products with the highest predicted CTR into the fine ranking model. The fine ranking model will then accurately calculate the predicted CTR for these 10 e-commerce products and send the e-commerce product with the highest predicted CTR to terminal 102, so that the product content corresponding to this e-commerce product can be displayed on the display interface of terminal 102, showing the user the product information of the e-commerce product in real time.
[0093] Optionally, the input method corresponding to the input device can be touch screen input, keypad input, voice input, or related control program input, etc.
[0094] In some embodiments, the operating system running the app or client may include various versions of Microsoft... Apple and / or Linux operating system, various commercial or similar Operating systems (including but not limited to various GNU / Linux operating systems, Google) OS and / or mobile operating systems, such as Phone OS OS OS operating systems, as well as other online or offline operating systems, are not specifically limited here.
[0095] In some embodiments, such as Figure 2 As shown, a training method for a recommendation model is provided, which can be applied to... Figure 1 Taking server 104 as an example, the method includes the following steps:
[0096] Step S11: Obtain the first resource recommendation model to be trained, and use the first resource recommendation model as the student network to be trained.
[0097] In one embodiment, the first resource recommendation model is one of the recommendation models applied in a resource recommendation system. This first resource recommendation model is used to determine first estimated feedback data for each of multiple sample resource objects, and based on the first estimated feedback data, to filter candidate sample objects from the multiple sample resource objects.
[0098] Specifically, in the process of training the first resource recommendation model, multiple sample resource objects are first obtained, and then each sample resource object is input into the first resource recommendation model to be trained. The first resource recommendation model to be trained performs data processing on each sample resource object to output the first prediction feedback data of each sample resource object. Then, based on the first prediction feedback data, the multiple sample resource objects are filtered to select candidate sample objects.
[0099] In some embodiments, the obtained sample resource objects are historical resource objects already recommended in the resource recommendation system, and these sample resource objects are related to the recommendation domain applied by the resource recommendation system. In specific implementations, sample resource objects can be categorized and collected according to the recommendation domain applied by the system. For example, the recommendation domain could be e-commerce, audio / video, automatic navigation, or intelligent sports. Accordingly, the obtained sample resource objects could be one type of application sample from fields such as e-commerce-related product push samples, audio / video-related audio / video push samples, navigation-related navigation push samples, and sports-related sports push samples.
[0100] In one embodiment, the resource recommendation system is a management system for evaluating and recommending resource objects to user accounts. As an example, the resource recommendation system is a product recommendation platform in the e-commerce field, where the server retrieves multiple recommended products already featured on the platform as sample resource objects.
[0101] In one embodiment, the first predicted feedback data characterizes the predicted data of the sample resource object being subject to a preset feedback behavior by the user to be pushed to.
[0102] In one embodiment, the data processing performed by the first resource recommendation model on the resource object is to perform network inference on the resource object in order to predict the feedback behavior of the resource object regarding the user account, that is, to predict whether the user account will implement the feedback behavior corresponding to the resource object after receiving the recommended resource object.
[0103] In some embodiments, the user account's feedback behavior is determined by the push scenario corresponding to the resource object. For example, a resource object is a recommended product in an e-commerce advertisement. The push scenario involves exposing the recommended product to the user account online, and the exposed recommended product includes a link to its detailed description. If the user account clicks on the link to access the detailed description of the exposed recommended product or converts to purchase the recommended product, then the user account has performed the feedback behavior corresponding to the resource object. If the user account does not click on the link to access the detailed description of the exposed recommended product or convert to purchase the recommended product, then the user account has not performed the feedback behavior corresponding to the resource object. This feedback behavior includes clicking the detailed description link, forwarding the recommended product, consuming the recommended product, adding the recommended product to favorites, etc.
[0104] Step S12: Obtain the pre-trained second resource recommendation model and use it as the teacher network.
[0105] In one embodiment, the second resource recommendation model is a different model from the first resource recommendation model used in the resource recommendation system. This second resource recommendation model is used to determine second estimated feedback data for multiple candidate sample objects, and based on the second estimated feedback data, to select target sample objects to be recommended to the user.
[0106] Specifically, in the process of training the second resource recommendation model, candidate sample objects are first obtained from the first resource recommendation model. Then, each candidate sample object is input into the second resource recommendation model to be trained. The second resource recommendation model to be trained processes the data of each candidate sample object to output the second prediction feedback data of each candidate sample object. Then, based on the second prediction feedback data, the multiple candidate sample objects are filtered to select the target sample object.
[0107] In one embodiment, the data processing performed on the resource object by the second resource recommendation model is to perform network inference on the resource object in order to predict the feedback behavior of the resource object regarding the user account, that is, to predict whether the user account will implement the feedback behavior corresponding to the resource object after receiving the recommended resource object.
[0108] In one embodiment, the second predicted feedback data characterizes the predicted data of the candidate sample object being subjected to a preset feedback behavior by the user to be pushed to.
[0109] Among them, the first feedback data obtained by the first resource recommendation model and the second feedback data obtained by the second resource recommendation model both represent the predicted data of the user to be pushed to implement the preset feedback behavior after the resource object is recommended by the resource recommendation system.
[0110] In one embodiment, the prediction data can be the probability predicted by the student network or teacher network for the user to whom the resource object is to be pushed to implement a preset feedback behavior.
[0111] The predicted probability includes a first probability value predicting that the training sample will be subject to a preset feedback behavior by the user to be pushed to, or a second probability value predicting that the training sample will not be subject to a preset feedback behavior by the user to be pushed to.
[0112] In one embodiment, the recommendation model to be trained includes a first resource recommendation model and a second resource recommendation model to be trained, and the complexity of the second resource recommendation model is higher than that of the first resource recommendation model.
[0113] Specifically, the second resource recommendation model is a complex prediction model with superior inference performance, while the first resource recommendation model is a simpler prediction model with weaker inference performance compared to the second resource recommendation model. Both of them can be deep learning models trained from a large number of training samples in the target domain related to the pushed resources.
[0114] In some embodiments, both the first resource recommendation model and the second resource recommendation model are used to make recommendation predictions for resource objects and obtain predicted recommendation data.
[0115] In some embodiments, the target domain related to the push resource represents the application domain of the prediction model to be generated, such as dividing the application domain of the prediction model into e-commerce, audio and video, navigation, sports and other fields.
[0116] In some embodiments, the prediction model may be a multi-layered RNN (Recurrent Neural Network), CNN (Convolutional Neural Network), Transformer (self-attention mechanism), or other network models with arbitrary structures, and this application does not limit this.
[0117] Step S13: Train the student network to be trained based on the teacher network, so as to transfer at least part of the dark knowledge of the teacher network to the student network during the training process. After the student network is trained, determine the first resource recommendation model corresponding to the student network as the coarse ranking model of the resource recommendation platform, and determine the second resource recommendation model corresponding to the teacher network as the fine ranking model of the resource recommendation platform.
[0118] In one embodiment, during the training of the recommendation model, a second resource recommendation model is used as the teacher network and a first resource recommendation model is used as the student network to be trained, so as to obtain the student network by performing knowledge distillation on the teacher network. Specifically, knowledge distillation is used to train the student network to be trained based on at least some of the dark knowledge in the teacher network (including training information learned by the teacher network).
[0119] In some embodiments, knowledge distillation is a network training method based on a teacher network and a student network as a framework. That is, the server distills the knowledge learned by a single complex teacher network into a simple student network, thereby effectively improving the accuracy of student network reasoning while ensuring the training speed of the student network to a certain extent.
[0120] Specifically, knowledge distillation of the teacher network involves extracting useful information and knowledge from the teacher network to guide the training process of the student network. By training the student network with the useful information and knowledge extracted from the teacher network (including network processing, network layers, and weights), the hidden knowledge in the teacher network can be transferred to the student network, thereby enabling the student network to achieve better performance than directly training the student network alone.
[0121] The network parameters between the student network and the teacher network can be similar or have certain regularities. These network parameters include hyperparameters, the number of model layers, the number of model parameters, and so on.
[0122] In some embodiments, the number of teacher networks may include one or more. That is, the server can dynamically select multiple teacher networks and assign appropriate weight ratios to multiple teacher networks to perform knowledge distillation in order to train the student network to be trained. This enables multiple teacher networks to distill effective knowledge information to the student network, so that the student network learned by distillation achieves the best performance and improves the user experience.
[0123] In some embodiments, the knowledge distillation process requires multiple epochs of iterative training for each network (including student and teacher networks). One iteration cycle represents one round of iterative training of the network, i.e., completing one iteration training of the entire sample training set. Within each iteration cycle, based on a set iteration step size (batch_size), at least one forward and backward propagation process is performed on the sample training set within the current iteration cycle.
[0124] In one embodiment, after the student network training is completed, the determined coarse ranking model is used to perform a first round of screening of multiple resource objects to be pushed to the resource recommendation platform, and the determined fine ranking model is used to perform a second round of screening of multiple candidate resource objects selected in the first round, so as to obtain the target resource objects to be recommended to the user.
[0125] In one embodiment, the first round of screening performed by the coarse-ranking model includes determining the first estimated feedback data for each of the multiple input resource objects to be pushed, and based on the first estimated feedback data, selecting candidate resource objects from the multiple resource objects to be pushed and providing them to the fine-ranking model.
[0126] In some embodiments, the resource objects to be pushed are resource objects retrieved by the server from the database, and the number of them is greater than two.
[0127] In some embodiments, the coarse-ranking model determines the first estimated feedback data for each of the multiple resource objects to be pushed by: the server first inputs each resource object to be pushed into the coarse-ranking model for network inference to obtain the first estimated feedback data for each resource object to be pushed; then, the coarse-ranking model selects candidate resource objects from the resource objects to be pushed based on the differences between the first estimated feedback data, and pushes the candidate resource objects to the fine-ranking model.
[0128] In one embodiment, the second round of filtering performed by the fine-ranking model includes determining second estimated feedback data of the input candidate resource objects, and filtering out target resource objects to be pushed to the user account from the candidate resource objects based on the second estimated feedback data.
[0129] The number of candidate resource objects includes at least two, and the number of candidate resource objects is less than the number of resource objects to be pushed, while the number of target resource objects is no greater than the number of candidate resource objects.
[0130] In some embodiments, the fine-ranking model determines the second estimated feedback data of the candidate push resource objects by: the server first inputting each candidate resource object into the fine-ranking model for network inference to obtain the second estimated feedback data for each candidate resource object; then, the fine-ranking model selects the target resource object from the candidate resource objects based on the differences between the second estimated feedback data, and pushes the target resource object to the user account.
[0131] In one embodiment, both the first estimated feedback data and the second estimated feedback data characterize the predicted data of the candidate resource object being subject to a preset feedback behavior by the user account.
[0132] In one embodiment, the prediction data can be the probability or classification type predicted by the fine-ranking model for a candidate resource object being subject to a preset feedback behavior by a user account.
[0133] The predicted probabilities include the probability value of predicting whether the candidate resource object will be subject to a preset feedback behavior by the user account or the probability value of predicting whether the candidate resource object will not be subject to a preset feedback behavior by the user account; the predicted classification type includes predicting whether the candidate resource object will be subject to a preset feedback behavior by the user account or the prediction that the candidate resource object will not be subject to a preset feedback behavior by the user account.
[0134] In a specific training scenario, the server first retrieves a predetermined number of pre-training samples from the database and trains a fine-ranking model using these samples. Then, the server uses the fine-ranking model as the teacher network in knowledge distillation learning and trains the student network to be trained using this teacher network. During the training of the student network, knowledge distillation is performed on the teacher network, thereby transferring the teacher network's hidden knowledge to the student network, resulting in a trained student network. Finally, the server uses this trained student network as a coarse-ranking model to obtain the pre-trained push model.
[0135] In a specific application scenario, after obtaining the pre-trained push model, the server retrieves S1 resource objects to be pushed from the database and inputs these S1 resource objects into the pre-trained coarse-ranking model to obtain the first estimated feedback data corresponding to each resource object. Then, based on the first estimated feedback data, the server selects P2 (P1 > P2) candidate resource objects from the S1 resource objects to be pushed and provides them to the pre-trained fine-ranking model to obtain the second estimated feedback data corresponding to each candidate resource object. Finally, based on the second estimated feedback data, the server selects P3 (P2 > P3) target resource objects from the candidate resource objects and pushes the target resource objects to the user account.
[0136] In the training process of the above recommendation model, the server first obtains the first resource recommendation model to be trained and uses it as the student network to be trained; then it obtains the pre-trained second resource recommendation model and uses it as the teacher network; then it trains the student network to be trained based on the teacher network, so as to transfer at least part of the dark knowledge of the teacher network to the student network during the training process. After the student network is trained, the first resource recommendation model corresponding to the student network is determined as the coarse ranking model of the resource recommendation platform, and the second resource recommendation model corresponding to the teacher network is determined as the fine ranking model of the resource recommendation platform. In this way, on the one hand, the pre-trained second resource recommendation model is used as the teacher network to train the student network, and the trained student network is used as the coarse ranking model in the resource recommendation platform, thereby optimizing the training process and accelerating the training efficiency of the coarse ranking model. On the other hand, since the teacher network is determined based on the pre-trained second resource recommendation model, and the hidden knowledge of the teacher network is transferred to the student network during the training of the student network to be trained, and then the trained student network is used as the coarse ranking model, the way and efficiency of the coarse ranking model in processing resource objects are similar to those of the fine ranking model. This ensures the consistency between the output data of the coarse ranking model and the output data of the fine ranking model, and improves the accuracy and precision of the corresponding output data of the coarse ranking model.
[0137] Those skilled in the art will understand that the methods disclosed in the above-described specific embodiments can be implemented in more concrete ways. For example, the implementation described above, in which the server trains a student network based on a teacher network to transfer the teacher network's hidden knowledge to the student network during the training process, is merely illustrative.
[0138] For example, the server determines the trained student network as the coarse-ranking model of the resource recommendation platform; or the server determines the pre-trained teacher network as the fine-ranking model of the resource recommendation platform, etc. This is just one way of combining them. In actual implementation, there can be other variations. For example, the first estimated feedback data of the resource objects to be pushed determined by the coarse-ranking model and the second estimated feedback data of the candidate resource objects determined by the fine-ranking model can be combined or combined into another system, or some features can be ignored or not executed.
[0139] In one exemplary embodiment, see Figure 3 , Figure 3 This is a flowchart illustrating an embodiment of determining a pre-trained teacher network in this application. Before step S11, that is, before the server obtains the pre-trained second resource recommendation model and uses the second resource recommendation model as the teacher network, it can also specifically include the following methods:
[0140] Step a1: Obtain the pre-trained sample resource objects and the corresponding actual feedback data.
[0141] In one embodiment, the pre-trained samples include sample resource objects and feature data specific to the sample resource objects.
[0142] In some embodiments, the sample resource object is various pushable entities, such as various styles of online products (e.g., images, audio and video, goods), online advertisements, or online services that are pushed to user accounts for exposure.
[0143] In some embodiments, the feature data for the sample resource object includes user features about the user to be pushed, resource object features about the sample resource object, and cross features, wherein the cross features are the correlation features between user features and resource object features.
[0144] For example, user features can be various user attribute features of the user to be pushed to (including occupation, age, gender, education, address, etc.) and account attribute features (including browsing history, account level, followed list, etc.); resource object features can be the object attribute features of the resource object itself (including product attribute features, service category features, functional attribute features, etc.). Cross features can be the matching features between user features and resource object features (including the matching features between age features and functional attribute features, gender features and product attribute features, address features and service category features, etc.), and / or the historical application features between the user to be pushed to and the sample resource object (including the user's evaluation features, rating features, comment features, sharing and collection features, etc. of the sample resource object or resource objects of the same type as the sample resource object).
[0145] Step a2: Input the feature data of the pre-trained sample resource objects into the second resource recommendation model to be trained to obtain the predicted feedback data for the pre-trained sample resource objects.
[0146] In one embodiment, the predicted feedback data characterizes the predicted data of the pre-trained sample resource object being pushed to the user to perform a preset feedback behavior.
[0147] In some embodiments, the server can automatically construct the network structure of the resource recommendation model to be trained (i.e., the second resource recommendation model used as the teacher network) using an automated machine learning model, and set the initial parameters of the network structure. For example, the automated machine learning model can set the hidden layer size, depth, convolutional kernel size, Transformer depth, etc., and set parameters related to the network structure that determine the complexity of the generated fine-ranking model to be trained, and automatically select the optimal optimizer parameters to obtain the resource recommendation model to be trained. Then, the automated machine learning model can use the network structure with the initial parameters to predict the feature data of the input pre-training sample resource objects and generate predicted feedback data for the pre-training sample resource objects.
[0148] Understandably, the automated machine learning model includes a controller that, through Neural Architecture Search (NAS), such as reinforcement learning or evolutionary algorithms, can learn a higher-performing network structure when the network structure generated by the automated machine learning model has high performance. For example, if the prediction speed of the generated network structure is not high enough, it can replace network units that affect the prediction speed with network units that can make the network structure predict faster. In this embodiment, after determining the parameters of the constructed network structure, the automated machine learning model can also determine the prediction speed, accuracy, and other performance aspects of the network structure. When the performance of the generated network structure is high, it can use the NAS algorithm to train a higher-performing network structure as the resource recommendation model to be trained.
[0149] Step a3: Based on the difference between the estimated feedback data and the actual feedback data corresponding to the pre-trained sample resource objects, adjust the second resource recommendation model to be trained until a pre-trained second resource recommendation model is obtained, and use the second resource recommendation model as the pre-trained teacher network.
[0150] In one embodiment, the actual feedback data includes actual data corresponding to the user account performing a preset feedback action on the pre-trained sample and actual data corresponding to the user account not performing a preset feedback action on the pre-trained sample.
[0151] In some embodiments, the server determines the current model loss value of the second resource recommendation model to be trained based on the difference between the estimated feedback data and the corresponding actual feedback data. Then, the server adjusts the model parameters of the second resource recommendation model to be trained based on the model loss value.
[0152] When adjusting model parameters based on the model loss value, the server can use gradient descent to adjust the model parameters in the direction that reduces the corresponding loss value.
[0153] In this process, after determining the model loss value based on the difference between the estimated feedback data and the corresponding actual feedback data, the server can adjust the model parameters of the refined ranking model in a way that minimizes the model loss value. During the training of the second resource recommendation model to be trained, the model parameters are gradually adjusted until the training termination condition is met, resulting in a pre-trained second resource recommendation model. This second resource recommendation model can predict behavioral feedback based on the object features of the input resource object, obtaining predicted feedback data about the resource object.
[0154] In one exemplary embodiment, see Figure 4 , Figure 4 This is a schematic flowchart illustrating an embodiment of constructing a student network to be trained in this application. Prior to step S12, i.e., before the server trains the student network based on the teacher network to transfer at least some of the teacher network's dark knowledge to the student network during the training process, the process may further include the following:
[0155] Step b1: Obtain the network type and network structure of the teacher network.
[0156] In some embodiments, the network structure can be a multi-layered RNN (Recurrent Neural Network), CNN (Convolutional Neural Network), Transformer (self-attention mechanism), or other network models with arbitrary structures, and this application does not limit this.
[0157] In some embodiments, the network type can be a neural network such as ResNet-34 or ResNet-50.
[0158] Step b2: Construct the student network to be trained based on the network type and network structure of the teacher network.
[0159] Among them, the student network to be trained has the same network type as the teacher network, the number of intermediate layers in the student network is less than the number of intermediate layers in the teacher network, and each intermediate layer in the student network corresponds to a corresponding intermediate layer in the teacher network.
[0160] In one embodiment, the server constructs a student network with the same network type and structure as the teacher network.
[0161] In this system, each intermediate layer in the student network corresponds to an odd-numbered intermediate layer in the teacher network, or each intermediate layer in the student network corresponds to an even-numbered intermediate layer in the teacher network.
[0162] In one exemplary embodiment, seeFigure 5 , Figure 5 This is a schematic diagram of the network structure of an embodiment of the teacher-student network in this application. In this schematic diagram of the teacher-student network structure, the teacher network includes 6 intermediate layers (i.e., A2, A3, A4, A5, A6, A7), and the student network includes 3 intermediate layers (i.e., B2, B3, B4). Among them, layer A2 corresponds to layer B2, layer A4 corresponds to layer B3, layer A6 corresponds to layer B3, and the output layer A8 of the teacher network corresponds to the output layer B5 of the student network.
[0163] In one exemplary embodiment, see Figure 6 , Figure 6 This is a flowchart illustrating an embodiment of training a student network in this application. In step S12, the server trains the student network based on the teacher network to transfer at least some of the teacher network's hidden knowledge to the student network during the training process. This can be further implemented in the following ways:
[0164] Step S121: In each iteration, based on the difference between the weight parameters of the intermediate layer of the current student network and the weight parameters of the intermediate layer of the current teacher network, determine the weight loss function information between the teacher and student networks.
[0165] In one implementation, the server determines the weight loss function information between the teacher-student network, including:
[0166] Step 1: Obtain the first weight parameters of each intermediate layer in the current student network, and the second weight coefficients of each target intermediate layer in the current teacher network.
[0167] The target intermediate layer is the intermediate layer corresponding to the intermediate layer of the current student network.
[0168] Step 2: Determine the weight loss function information between the teacher-student network based on the mean square error or information divergence between the first and second weight parameters.
[0169] In one specific implementation, firstly, the server obtains the first weight coefficients of each intermediate layer in the student network and the corresponding second weight coefficients of each intermediate layer in the teacher network; then, the server normalizes the first and second weight coefficients based on a preset exponential function to obtain a first processed value for the first weight coefficient and a second processed value for the second weight coefficient; then, based on the information divergence between the first and second processed values, the server determines the information divergence loss function for the teacher-student network and uses the information divergence loss function as the weight loss function to determine the weight loss function information for the teacher-student network.
[0170] Information divergence, also known as information gain, information entropy, or relative entropy, represents the KL (Kullback-Leibler divergence) between the first and second processed values. The information divergence loss function is the same as the KL divergence loss function.
[0171] The weight loss function information for the teacher-student network can be represented by the following expression:
[0172] weight loss = KL(weight teachuer ||weight student );
[0173] Where, weight teachuer The first processed value representing the first weight coefficient, weight student The second processing value represents the second weighting coefficient, and KL represents the information gain between the two data.
[0174] In another specific implementation, firstly, the server obtains the first weight coefficients of each intermediate layer in the student network and the corresponding second weight coefficients of each intermediate layer in the teacher network; then, it normalizes the first and second weight coefficients based on a preset exponential function to obtain a first processed value for the first weight coefficient and a second processed value for the second weight coefficient; then, based on the mean squared error between the first and second processed values, it determines the mean squared error loss function for the teacher-student network; finally, it uses the difference between the mean squared error loss function and the cross-entropy loss function for the teacher network as the weight loss function to determine the weight loss function information for the teacher-student network.
[0175] The mean square error (MSE) represents the mean of the squared differences between the first and second processed values, and the mean square error loss function is the MSE loss function.
[0176] The weight loss function information for the teacher-student network can be represented by the following expression:
[0177] weight loss = MSE(weight teachuer weight student )-H(weight teachuer );
[0178] Where, weight teachuer The first predicted value, weight, represents the first predicted value based on the first predicted feedback data. studentThe second predicted value is represented by the second estimated feedback data, and the mean square error between the two data is represented by MSE.
[0179] Step S122: In each iteration, based on the difference between the predicted feedback data output by the current student network and the current teacher network for the same sample resource object, determine the distillation loss function information between the teacher and student networks.
[0180] In one implementation, the server determines distillation loss function information between the teacher-student network, including:
[0181] Step 1: For the same sample resource object, input the first feature data into the current student network, and obtain the first predicted feedback data of the sample resource object through the current student network; and input the second feature data into the current teacher network, and obtain the second predicted feedback data of the sample resource object through the current teacher network.
[0182] The first feature data includes the user characteristics and resource object characteristics of the user to be pushed to, and the second feature data includes the user characteristics, resource object characteristics and cross features of the user to be pushed to; the cross features are the correlation features between the user characteristics and the resource object characteristics.
[0183] In one embodiment, a preset exponential function is configured in both the fully connected layer of the current teacher network and the fully connected layer of the current student network.
[0184] In some embodiments, the server obtains the first estimated feedback data of the sample resource object through the current student network, including: inputting the first feature data into the current student network, obtaining the first initial estimated feedback data of the sample resource object through the current student network, and processing the first initial estimated feedback data based on a preset exponential function to obtain the first estimated feedback data of the sample resource object.
[0185] In some embodiments, the server obtains second estimated feedback data of the sample resource object through the current teacher network, including: inputting second feature data into the current teacher network, obtaining second initial estimated feedback data through the current teacher network, and processing the second initial estimated feedback data based on a preset exponential function to obtain the second estimated feedback data of the sample resource object.
[0186] The preset exponential function is used to adjust the data distribution of multiple estimated feedback data output by the fully connected layers in the current teacher network and the current student network for multiple sample resource objects, so that the data distribution tends to be smooth.
[0187] In some embodiments, the preset exponential function is a soft max function carrying a temperature coefficient T, where the temperature coefficient T is a control coefficient configured by the server for the teacher-student network, and T > 1. The soft max function is used to smooth the prediction results of various categories output by the current teacher network or the current student network, so as to enhance the attention to other categories besides the largest category (positive label).
[0188] As an example, if the temperature coefficient T carried in the soft max function is larger, the difference in probability values corresponding to the prediction results of various categories output by the current teacher network or the current student network will increase, the probability distribution entropy between the prediction results of various categories output will increase, the probability value of the non-maximum category (negative label) output will increase, the difference in cross entropy between the current student network and the current teacher network will increase, and the current student network will learn more additional information from the distillation loss corresponding to the current teacher network (i.e., learn more information about negative labels).
[0189] The soft max function carrying the temperature coefficient T can be characterized by the following expression:
[0190]
[0191] Where, q i This refers to the probability of a certain classification label calculated using a soft max function with a temperature coefficient T; the probability q of that classification label. i This includes q1 and q2; q1 refers to the probability of a positive label, and q2 refers to the probability of a negative label.
[0192] Among them, z i It refers to the estimated value of a certain type of feedback behavior (e.g., click / conversion / click-to-conversion) of the user to be pushed to, output by the current student network or the current teacher network.
[0193] Among them, z j This refers to the total estimated value of all types of feedback behaviors (e.g., clicks / conversions / click-to-conversions) output by the current student network or the current teacher network regarding the user to be pushed to.
[0194] Step 2: Based on the mean square error or information divergence between the first and second predicted feedback data, determine the distillation loss function information between the teacher-student network.
[0195] In one specific implementation, firstly, the server acquires first predicted feedback data and second predicted feedback data; wherein, the first predicted feedback data is characterized based on a first predicted value, and the second predicted feedback data is characterized based on a second predicted value; then, the server determines an information divergence loss function for the teacher-student network based on the information divergence between the first and second predicted values, and uses the information divergence loss function as a distillation loss function to determine the distillation loss function information for the teacher-student network.
[0196] The first predicted value represents the probability that the sample resource object will be subject to a preset feedback action by the user account or the probability that the sample resource object will not be subject to a preset feedback action by the user account; the second predicted value represents the probability that the sample resource object will be subject to a preset feedback action by the user account or the probability that the sample resource object will not be subject to a preset feedback action by the user account.
[0197] The distillation loss function information between the teacher-student network can be represented by the following expression:
[0198] distill loss = KL(predict) teachuer ||predict student );
[0199] Among them, predict teachuer The first predicted value is represented by the first predicted feedback data. student The second predicted value is represented by the second estimated feedback data, and KL represents the information gain between the two data.
[0200] In another implementation, firstly, the server acquires first and second predicted feedback data; wherein the first predicted feedback data is characterized based on a first predicted value, and the second predicted feedback data is characterized based on a second predicted value; then, the server determines the mean squared error loss function for the teacher-student network based on the mean squared error between the first and second predicted values; then, the difference between the mean squared error loss function and the cross-entropy loss function for the current teacher network is used as the distillation loss function to determine the distillation loss function information for the teacher-student network.
[0201] The distillation loss function information between the teacher-student network can be represented by the following expression:
[0202] distill loss = MSE(predict) teachuer ,predict student )-H(predict teachuer );
[0203] Among them, predictteachuer The first predicted value is represented by the first predicted feedback data. student The second predicted value is represented by the second estimated feedback data, and the mean square error between the two data is represented by MSE.
[0204] Step S123: Determine the comprehensive loss function information for the current student network based on the distillation loss function information and the weight loss function information.
[0205] As an example, the server is configured with weight information corresponding to the distillation loss function as A1 and weight information corresponding to the weight loss function as A2. Then, the loss functions and their corresponding weight information are merged into a comprehensive loss function for the student network to be trained.
[0206] Step S124: Update the current student network based on the comprehensive loss function information.
[0207] In some embodiments, the server updates the network parameters of the student network based on the comprehensive loss function information until a fully trained student network is obtained. When updating the network parameters according to the comprehensive loss function information, a gradient descent method can be used to update the network parameters in the direction that decreases the corresponding loss value of the network.
[0208] In another exemplary embodiment, see Figure 7 , Figure 7 This is a schematic diagram of a module of an embodiment of the teacher-student network in this application. In step S12, during the process of the server determining the comprehensive loss function information for the student network to be trained based on the distillation loss function information and the weight loss function information, it can be further implemented in the following ways:
[0209] Step 1: Obtain the first cross-entropy loss function information of the current student network and the second cross-entropy loss function information of the current teacher network.
[0210] In one embodiment, the first cross-entropy loss function information characterizes the difference between the first estimated feedback data output by the current student network for the first sample resource object and the first actual feedback data corresponding to the first sample resource object.
[0211] In one embodiment, the server obtains the first cross-entropy loss function information of the current student network, including: first, obtaining the first feature data of the sample resource object; then, inputting the first feature data into the current student network, obtaining initial predicted feedback data through the current student network, and normalizing the initial predicted feedback data based on a preset exponential function configured for the fully connected layers in the current student network to obtain the first predicted feedback data; then, determining the first cross-entropy loss function information of the current student network based on the cross-entropy function between the first predicted feedback data and the first actual feedback data corresponding to the sample resource object.
[0212] The first feature data includes user features and resource object features.
[0213] In some embodiments, the first exponential function is used by the fully connected layer to identify the initial estimated feedback data as the first estimated feedback data corresponding to whether the sample resource object has been subject to a preset feedback behavior by the user to be pushed or has not been subject to a preset feedback behavior by the user to be pushed.
[0214] Specifically, the fully connected layer identifies the initial predicted feedback data by establishing a neural network with a soft max function as the normalization function to identify the initial predicted feedback data in order to determine the sample label of the sample resource object. After being identified by the neural network with the soft max function as the normalization function, the initial predicted feedback data is represented by a sample label of "0" or "1". A label "0" indicates that the sample resource object has received a preset feedback action from the user to be pushed to, while a label "1" indicates that the sample resource object has not received a preset feedback action from the user to be pushed to.
[0215] As an example, the first actual feedback data includes sample labels with the label "0" or the label "1", where label "0" corresponds to actual feedback data A3 where the sample resource object is subjected to a preset feedback behavior by the user to be pushed, and label "1" corresponds to actual feedback data A4 where the sample resource object is not subjected to a preset feedback behavior by the user to be pushed.
[0216] As another example, the first predicted feedback data is the student prediction result of the coarse-ranked model for the current student network output regarding the training samples. The student prediction result includes predicted feedback data B3 corresponding to the sample resource object being subject to a preset feedback behavior by the user to be pushed, or predicted feedback data B4 corresponding to the sample resource object not being subject to a preset feedback behavior by the user to be pushed.
[0217] The first cross-entropy loss function information of the current student network can be represented by the following expression:
[0218] student loss=cross_entropy(label, predict student );
[0219] Wherein, label represents the first actual feedback data corresponding to the sample resource object, and predict... student The first predicted feedback data represents the current student network's output in response to the input sample resource object, and cross_entropy represents the cross-entropy between the two types of data.
[0220] In one embodiment, the second cross-entropy loss function information characterizes the difference between the second estimated feedback data output by the current teacher network for the second sample resource object and the second actual feedback data corresponding to the second sample resource object.
[0221] In one embodiment, the server obtains the second cross-entropy loss function information of the current teacher network, including: first, obtaining the second feature data of the sample resource object; then, inputting the second feature data into the current teacher network, obtaining initial predicted feedback data through the current teacher network, and normalizing the initial predicted feedback data based on a preset exponential function configured for the fully connected layers in the current teacher network to obtain the second predicted feedback data; then, determining the second cross-entropy loss function information of the current teacher network based on the cross-entropy function between the second predicted feedback data and the second actual feedback data corresponding to the sample resource object.
[0222] The second feature data includes user features, resource object features, and cross features; the cross features are the correlation features between user features and resource object features.
[0223] In some embodiments, the second exponential function is used by the fully connected layer to identify the initial estimated feedback data as the second estimated feedback data corresponding to whether the sample resource object has been subject to a preset feedback behavior by the user to be pushed or has not been subject to a preset feedback behavior by the user to be pushed.
[0224] Specifically, the fully connected layer identifies the initial predicted feedback data by establishing a neural network with a soft max function as the normalization function to identify the initial predicted feedback data in order to determine the sample label of the sample resource object. After being identified by the neural network with the soft max function as the normalization function, the initial predicted feedback data is represented by a sample label of "0" or "1". A label "0" indicates that the sample resource object has received a preset feedback action from the user to be pushed to, while a label "1" indicates that the sample resource object has not received a preset feedback action from the user to be pushed to.
[0225] As an example, the second actual feedback data includes sample labels with the label "0" or the label "1", where label "0" corresponds to actual feedback data A1 where the sample resource object is subjected to a preset feedback behavior by the user to be pushed, and label "1" corresponds to actual feedback data A2 where the sample resource object is not subjected to a preset feedback behavior by the user to be pushed.
[0226] As another example, the second predicted feedback data is the teacher prediction result of the fine ranking model for the current teacher network output regarding the training samples. The teacher prediction result includes predicted feedback data B1 corresponding to the sample resource object being subject to the preset feedback behavior by the user to be pushed, or predicted feedback data B2 corresponding to the sample resource object not being subject to the preset feedback behavior by the user to be pushed.
[0227] The second cross-entropy loss function information of the current teacher network can be represented based on the following expression:
[0228] teacher loss=cross_entropy(label, predict teachuer );
[0229] Wherein, label represents the second actual feedback data corresponding to the sample resource object, and predict... teachuer The second predicted feedback data represents the output of the current teacher network in response to the input sample resource object, and cross_entropy represents the cross-entropy between the two types of data.
[0230] Step 2: Based on the information of the first cross-entropy loss function, the second cross-entropy loss function, the distillation loss function, and the weight loss function, as well as the weight information corresponding to each loss function, determine the comprehensive loss function information for the current student network.
[0231] As an example, the server configures the weight information corresponding to the first cross-entropy loss function as X1, the weight information corresponding to the second cross-entropy loss function as X2, the weight information corresponding to the distillation loss function as X3, and the weight information corresponding to the weight loss function as X4. Then, the loss functions and their corresponding weight information are merged into a comprehensive loss function information for the current student network, and the current student network is updated using this comprehensive loss function information until the trained student network is obtained.
[0232] In some embodiments, such as Figure 8 As shown, Figure 8 A flowchart illustrating a method for pushing resource objects is provided, demonstrating how this method can be applied to... Figure 1 Taking terminal 102 as an example, the method includes the following steps:
[0233] Step S21: Input multiple resource objects to be pushed from the resource recommendation platform into the coarse ranking model. The coarse ranking model determines the first estimated feedback data of each of the multiple resource objects to be pushed. Based on the first estimated feedback data, the multiple resource objects to be pushed are screened in the first round to select multiple candidate resource objects.
[0234] In one embodiment, the resource objects to be pushed are multiple push entities that can be pushed to user accounts, which are recalled by the terminal from the database. These include various types of online products (such as pictures, audio and video, and goods), online advertisements, or online services that can be pushed to user accounts.
[0235] In one embodiment, the estimated feedback data of the resource object to be pushed represents the predicted data of the resource object to be pushed being subject to a preset feedback behavior by the user account and the predicted data of the resource object to be pushed not being subject to a preset feedback behavior by the user account.
[0236] In one embodiment, the coarse-ranking model determines the first estimated feedback data corresponding to multiple resource objects to be pushed, including: the terminal inputs the first feature data of the resource objects to be pushed into the coarse-ranking model, and the coarse-ranking model processes the first feature data to determine the first estimated feedback data of each of the multiple resource objects to be pushed.
[0237] In one embodiment, the first feature data of the resource objects to be pushed includes: the resource object features of each of the multiple resource objects to be pushed and the user features of the user to be pushed.
[0238] In one embodiment, the first round of screening performed by the coarse-sorting model includes selecting candidate resource objects from the multiple resource objects to be pushed based on the first estimated feedback data of each of the multiple resource objects to be pushed.
[0239] Specifically, the coarse ranking model first multiplies the first estimated feedback data of each of the multiple resource objects to be pushed with the corresponding resource indicator value to obtain the corresponding push energy value. Then, the coarse ranking model sorts the multiple resource objects to be pushed in order of their respective push energy values and selects the first preset number of candidate resource objects.
[0240] Among them, the resource metric values are push parameters configured by the design engineer based on the resource object to be pushed (such as the number of times the resource object is exposed, the exposure revenue, etc.).
[0241] In one embodiment, the push energy value is the resource return rate that the pusher corresponding to the resource object to be pushed can obtain after pushing the resource object to the user to be pushed. The higher the push energy value, the higher the corresponding resource return rate; the lower the push energy value, the lower the corresponding resource return rate.
[0242] Step S22: Input multiple candidate resource objects into the fine ranking model, the fine ranking model determines the second estimated feedback data corresponding to the multiple candidate resource objects, and performs a second round of screening on the multiple candidate resource objects based on the second estimated feedback data to determine the target resource object.
[0243] In some embodiments, the second predicted feedback data characterizes the predicted data of the candidate resource object being subject to a preset feedback behavior by the user to be pushed to.
[0244] In one embodiment, the fine-ranking model determines the second estimated feedback data corresponding to the candidate resource object, including: the terminal inputs the second feature data of the candidate resource object into the fine-ranking model, and the fine-ranking model determines the second estimated feedback data about the candidate resource object.
[0245] In one embodiment, the second feature data of the candidate resource object includes: resource object features of the candidate resource object, user features of the user to be pushed to, and cross features; wherein, the cross features are the correlation features between the resource object features and the user features.
[0246] In one embodiment, the second round of screening performed by the fine-ranking model includes selecting the target resource object from the multiple candidate resource objects based on the second estimated feedback data of each of the multiple candidate resource objects.
[0247] Specifically, the fine-ranking model first multiplies the second estimated feedback data of each of the multiple candidate resource objects with the corresponding resource indicator value to obtain the corresponding push energy value. Then, the server sorts the multiple candidate resource objects according to the order of their push energy values and selects the target resource object that is ranked first.
[0248] In one embodiment, the coarse ranking model and the fine ranking model are obtained based on the training method of the recommendation model in the above embodiment. That is, the coarse ranking model is used as the student network during the training process, and the fine ranking model is used as the teacher network. The coarse ranking model is based on the teacher network to train the student network. The trained student network is obtained by transferring at least part of the dark knowledge of the teacher network to the student network during the training process.
[0249] Step S23: Recommend the target resource object to the users to be pushed.
[0250] In a specific application scenario, taking e-commerce as an example, the electronic device first retrieves S1 product advertisements from the database and inputs these S1 product advertisements into the coarse-ranking model in the resource recommendation platform for behavioral feedback prediction, obtaining the predicted feedback data X1 corresponding to each product advertisement; then, based on each predicted feedback data X1, the coarse-ranking model selects P2 (P1>P2) product advertisements from the S1 product advertisements and provides them to the fine-ranking model in the resource recommendation platform for behavioral feedback prediction, obtaining the predicted feedback data X2 corresponding to each product advertisement; finally, based on each predicted feedback data X2, the fine-ranking model selects P3 (P2>P3) target product advertisements from each product advertisement and pushes the target product advertisements to the user account.
[0251] To more clearly illustrate the resource object push method provided in the embodiments of this disclosure, the following describes the resource object push method in detail with a specific embodiment. In an exemplary embodiment, refer to... Figure 9 , Figure 9 This is a flowchart illustrating a method for pushing resource objects according to another exemplary embodiment. This method is used in an electronic device and specifically includes the following:
[0252] Step S31: Extract the first number of candidate recommended resource objects from the database, as well as the feature information of each candidate recommended resource object.
[0253] The styles of candidate recommended resource objects can include products, advertisements, images, and even services to be recommended.
[0254] The feature information of the candidate recommended resource objects includes user account-side features, recommended object-side features, and user / object cross features.
[0255] Among them, user account-side features can be user information (such as user ID, number of users, user's region, attribute occupation, age, gender, education information, etc.); recommendation object-side features can be descriptive information about the recommended resource object (such as promotional slogans, reasons for recommendation, product attributes, industry, author name, etc.); user / object cross features are the feature information that is related to the user account and the recommended resource object (such as historical user account evaluations, ratings, comments, etc. of the recommended resource object).
[0256] Step S32: Input the feature information of the first number of candidate recommended resource objects into the trained coarse-ranking model to make recommendation predictions and obtain the first predicted value of the candidate recommended resource objects.
[0257] Among them, the coarse-ranking model is one of the trained push models. It uses student network representation to calculate the conversion prediction value of candidate recommended resource objects.
[0258] To improve the timeliness of online predictions, the student network is designed to be relatively simple, using, for example, three fully connected layers and the ReLU activation function. The student network uses a relatively simple set of features, which significantly reduces the time required for online predictions, but its prediction accuracy is not very high.
[0259] Among them, the conversion prediction value of the candidate recommended resource object represents the probability that the candidate recommended resource object will be converted by the user account after the candidate recommended resource object is recommended.
[0260] The conversion probability includes the probability of being clicked by a user account (i.e., CTR, Click Through Rate), the probability of being converted and used by a user account (CVR, Conversion Rate), and the probability of being clicked and then converted and used by a user account (CTCVR, Click Through Conversion Rate).
[0261] Step S33: Input the feature information of the first number of candidate recommended resource objects into the adjustment system to adjust the conversion cost, and obtain the first adjusted conversion cost for each candidate recommended resource object.
[0262] Among them, the feature information of the first number of candidate recommended resource objects also includes the original conversion cost, the conversion prediction value, and the preset number of exposures.
[0263] Here, conversion cost represents the cost of transferable resources that the recommender corresponding to the recommended resource object needs to pay for each conversion by a user account. For example, each time a user account clicks / forwards / favorites / purchases a recommended e-commerce advertisement, the recommender corresponding to that e-commerce advertisement pays a certain cost of transferable resources.
[0264] The electronic device inputs the original conversion cost, conversion prediction value, and preset exposure count of each of the first number of candidate recommended resource objects into the price adjustment system to adjust the original conversion cost and obtain the first adjusted conversion cost for each candidate recommended resource object.
[0265] Step S34: The product of the first predicted value and the corresponding first adjustment conversion cost of the first number of candidate recommended resource objects is taken as the first recommended recovery value of each candidate recommended resource object.
[0266] The recommended return value is represented by eCPM = CVR * auto_cpa_bid * N; where CVR is the probability that a recommended resource object is converted and used by a user account, or CVR can be the probability that a recommended resource object is clicked by a user account, or the probability that a recommended resource object is clicked and then converted and used by a user account. auto_cpa_bid is the adjusted conversion cost of the candidate recommended resource object. N is the preset number of exposures for the candidate recommended resource object.
[0267] Step S35: Sort the first number of candidate recommended resource objects according to the order of their corresponding first recommended recovery values, and select the second number of candidate recommended resource objects that are ranked first.
[0268] Step S36: Input the feature information of the second number of candidate recommended resource objects into the trained fine ranking model to make recommendation predictions and obtain the second predicted value of the candidate recommended resource objects.
[0269] Step S36 is similar to step S32 described above, and will not be repeated here.
[0270] Step S37: Input the feature information of the second number of candidate recommended resource objects into the adjustment system to adjust the conversion cost, and obtain the second adjusted conversion cost for each candidate recommended resource object.
[0271] Step S37 is similar to step S33 described above, and will not be repeated here.
[0272] Step S38: The product of the second predicted value and the corresponding second adjustment conversion cost of the second number of candidate recommended resource objects is taken as the second recommended recovery value of each candidate recommended resource object.
[0273] Step S38 is similar to step S34 described above, and will not be repeated here.
[0274] Step S39: Sort the second number of candidate recommended resource objects according to the order of their corresponding second recommended recovery values, select the target recommended resource object that is ranked first, and recommend the target recommended resource object to the user account.
[0275] Step S39 is similar to step S35 described above, and will not be repeated here.
[0276] The above scheme optimizes the training process and accelerates the training efficiency of the coarse-ranking model by utilizing a pre-trained second resource recommendation model as the teacher network to train the student network and then using the trained student network as the coarse-ranking model in the resource recommendation platform. Furthermore, since the teacher network is determined based on the pre-trained second resource recommendation model, and the teacher network's hidden knowledge is transferred to the student network during training, the trained student network, when used as the coarse-ranking model, ensures that the coarse-ranking model processes resource objects in a manner and with similar efficiency to the fine-ranking model. This guarantees consistency between the output data of the coarse-ranking model and the fine-ranking model, improving the accuracy and precision of the output data.
[0277] It should be understood that, although Figures 2-9 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 2-9 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0278] It is understood that the same / similar parts between the various embodiments of the methods described above in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments, and relevant parts can be referred to the description of other method embodiments.
[0279] Figure 10 This is a block diagram of a training device for a recommendation model provided in an embodiment of this application. (Refer to...) Figure 10 The training device 10 for the recommendation model includes: a student network unit 11, a teacher network unit 12, and a model training unit 13.
[0280] The student network unit 11 is configured to acquire a first resource recommendation model to be trained and use the first resource recommendation model as the student network to be trained. The first resource recommendation model is used to determine the first estimated feedback data of each of the multiple sample resource objects and to select candidate sample objects from the multiple sample resource objects based on the first estimated feedback data. The first estimated feedback data represents the prediction data of the sample resource object being pushed to the user to perform a preset feedback behavior.
[0281] The teacher network unit 12 is configured to acquire a pre-trained second resource recommendation model and use the second resource recommendation model as the teacher network. The second resource recommendation model is used to determine second estimated feedback data of multiple candidate sample objects and to filter target sample objects from the multiple candidate sample objects based on the second estimated feedback data. The second estimated feedback data represents the predicted data of the candidate sample object being subjected to a preset feedback behavior by the user to be pushed to. The complexity of the second resource recommendation model is higher than that of the first resource recommendation model.
[0282] The model training unit 13 is configured to perform training on the student network to be trained based on the teacher network, so as to transfer at least part of the dark knowledge of the teacher network to the student network during the training process. After the student network is trained, a first resource recommendation model corresponding to the student network is determined as the coarse ranking model of the resource recommendation platform, and a second resource recommendation model corresponding to the teacher network is determined as the fine ranking model of the resource recommendation platform. The coarse ranking model is used to perform a first round of screening of multiple resource objects to be pushed by the resource recommendation platform, and the fine ranking model is used to perform a second round of screening of multiple candidate resource objects selected in the first round, so as to obtain the target resource objects to be recommended to the user.
[0283] In some embodiments, in training the student network to be trained based on the teacher network to transfer at least some of the dark knowledge of the teacher network to the student network during training, the model training unit 13 is specifically configured to:
[0284] In each iteration, based on the difference between the weight parameters of the intermediate layers of the current student network and the weight parameters of the intermediate layers of the current teacher network, the weight loss function information between the teacher and student networks is determined; and
[0285] In each iteration, based on the difference between the predicted feedback data output by the current student network and the current teacher network for the same sample resource object, the distillation loss function information between the teacher and student networks is determined.
[0286] Based on the distillation loss function information and the weight loss function information, determine the comprehensive loss function information for the current student network;
[0287] The current student network is updated based on the comprehensive loss function information.
[0288] In some embodiments, in determining the comprehensive loss function information for the current student network based on the distillation loss function information and the weight loss function information, the model training unit 13 is specifically used for:
[0289] Obtain the first cross-entropy loss function information of the current student network and the second cross-entropy loss function information of the current teacher network; the first cross-entropy loss function information characterizes the difference between the first estimated feedback data output by the current student network for the first sample resource object and the first actual feedback data corresponding to the first sample resource object; the second cross-entropy loss function information characterizes the difference between the second estimated feedback data output by the current teacher network for the second sample resource object and the second actual feedback data corresponding to the second sample resource object;
[0290] Based on the first cross-entropy loss function information, the second cross-entropy loss function information, the distillation loss function information, and the weight loss function information, the comprehensive loss function information for the current student network is determined.
[0291] In some embodiments, in determining the distillation loss function information between the teacher-student networks based on the difference between the predicted feedback data output by the current student network and the current teacher network for the same sample resource object, the model training unit 13 is specifically used for:
[0292] For the same sample resource object, first feature data is input into the current student network, and first estimated feedback data for the sample resource object is obtained through the current student network; and second feature data is input into the current teacher network, and second estimated feedback data for the sample resource object is obtained through the current teacher network; wherein, the first feature data includes user features and resource object features of the user to be pushed, and the second feature data includes user features, resource object features, and cross features of the user to be pushed; the cross features are the correlation features between the user features and the resource object features;
[0293] Based on the mean square error or information divergence between the first and second predicted feedback data, the distillation loss function information between the teacher-student network is determined.
[0294] In some embodiments, the fully connected layers in the current teacher network and the current student network are both configured with a preset exponential function; in terms of obtaining the first estimated feedback data of the sample resource object through the current student network and the second estimated feedback data of the sample resource object through the current teacher network, the model training unit 13 is further configured to:
[0295] The first feature data is input into the current student network, and the first initial estimated feedback data of the sample resource object is obtained through the current student network. Based on the preset exponential function, the first initial estimated feedback data is processed to obtain the first estimated feedback data of the sample resource object.
[0296] The second feature data is input into the current teacher network, and the second initial estimated feedback data of the sample resource object is obtained through the current teacher network. Based on the preset exponential function, the second initial estimated feedback data is processed to obtain the second estimated feedback data of the sample resource object.
[0297] The preset exponential function is used to adjust the data distribution of multiple estimated feedback data output by the fully connected layers in the current teacher network and the current student network for multiple sample resource objects, so that the data distribution tends to be smooth.
[0298] In some embodiments, before training the student network to be trained based on the teacher network to transfer at least some of the dark knowledge of the teacher network to the student network during training, the model training unit 13 is further configured to:
[0299] Obtain the network type and network structure of the teacher network;
[0300] The student network to be trained is constructed based on the network type and network structure of the teacher network.
[0301] The student network to be trained is of the same network type as the teacher network, the number of intermediate layers in the student network is less than the number of intermediate layers in the teacher network, and each intermediate layer of the student network corresponds to a corresponding intermediate layer in the teacher network.
[0302] In some embodiments, in the aspect of constructing the student network to be trained based on the network type and network structure of the teacher network, the model training unit 13 is further configured to:
[0303] Based on the network type and network structure of the teacher network, construct a student network with the same network type and network structure;
[0304] In this context, each intermediate layer in the student network corresponds to an odd-numbered intermediate layer in the teacher network, or each intermediate layer in the student network corresponds to an even-numbered intermediate layer in the teacher network.
[0305] In some embodiments, in determining the weight loss function information between the teacher-student networks based on the difference between the weight parameters of the intermediate layers of the current student network and the weight parameters of the intermediate layers of the current teacher network, the model training unit 13 is further configured to:
[0306] Obtain the first weight parameters of each intermediate layer in the current student network and the second weight coefficients of each target intermediate layer in the current teacher network; the target intermediate layer is the intermediate layer corresponding to the intermediate layer of the current student network.
[0307] Based on the mean square error or information divergence between the first weight coefficient and the second weight coefficient, the weight loss function information between the teacher-student network is determined.
[0308] In some embodiments, before obtaining the pre-trained second resource recommendation model and using the second resource recommendation model as the teacher network, the teacher network unit 12 is further configured to:
[0309] Obtain the pre-trained sample resource object and the actual feedback data corresponding to the pre-trained sample resource object;
[0310] The feature data of the pre-trained sample resource object is input into the second resource recommendation model to be trained to obtain the estimated feedback data for the pre-trained sample resource object; the estimated feedback data represents the predicted data of the pre-trained sample resource object being pushed to the user to perform a preset feedback behavior;
[0311] Based on the difference between the estimated feedback data and the actual feedback data corresponding to the pre-trained sample resource objects, the second resource recommendation model to be trained is adjusted until a pre-trained second resource recommendation model is obtained, and the second resource recommendation model is used as the pre-trained teacher network.
[0312] Figure 11 This is a block diagram of a resource object push device provided in an embodiment of this application. (Refer to...) Figure 11 The resource object push device 10A includes: a first filtering unit 11A, a second filtering unit 12A, and an object push unit 13A.
[0313] The first filtering unit 11A is configured to input multiple resource objects to be pushed from the resource recommendation platform into a coarse-ranking model, determine the first estimated feedback data of each of the multiple resource objects to be pushed by the coarse-ranking model, and perform a first round of filtering on the multiple resource objects to be pushed based on the first estimated feedback data to filter out multiple candidate resource objects; the first estimated feedback data represents the prediction data of the preset feedback behavior implemented by the user to be pushed to each of the resource objects to be pushed.
[0314] The second filtering unit 12A is configured to input multiple candidate resource objects into a fine-ranking model, whereby the fine-ranking model determines second estimated feedback data corresponding to the multiple candidate resource objects, and performs a second round of filtering on the multiple candidate resource objects based on the second estimated feedback data to determine the target resource object; the second estimated feedback data represents the prediction data of the candidate resource object being subject to a preset feedback behavior by the user to be pushed to; wherein the coarse-ranking model and the fine-ranking model are obtained based on the training method of the recommendation model;
[0315] The object push unit 13A is configured to recommend the target resource object to the user to be pushed to.
[0316] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0317] Figure 12 This is a block diagram of an electronic device 20 provided in an embodiment of this application. For example, the electronic device 20 can be a server, an electronic component, or a server array, etc. (Refer to...) Figure 12 The electronic device 20 includes a processor 21, which may be a collection of processors, including one or more processors. The electronic device 20 also includes memory resources represented by memory 22, on which computer programs, such as application programs, are stored. The computer programs stored in memory 22 may include one or more modules, each corresponding to a set of executable instructions. Furthermore, the processor 21 is configured to implement, when executing the computer program, a training method for a recommendation model as described above, or a method for pushing resource objects.
[0318] In some embodiments, electronic device 20 is a server, and the computing system within this server may run one or more operating systems, including any of the operating systems discussed above and any commercially available server operating system. Electronic device 20 may also run any of a variety of additional server applications and / or middleware applications, including HTTP (Hypertext Transfer Protocol) servers, FTP (File Transfer Protocol) servers, CGI (Common Gateway Interface) servers, super servers, database servers, etc. Exemplary database servers include, but are not limited to, commercially available database servers from companies such as IBM.
[0319] In some embodiments, processor 21 typically controls the overall operation of electronic device 20, such as operations associated with display, data processing, data communication, and recording operations. Processor 21 may include one or more processors to execute computer programs to perform all or part of the steps of the methods described above. Furthermore, processor 21 may include one or more modules to facilitate interaction between processor 21 and other components. For example, processor 21 may include a multimedia module to facilitate control of the interaction between the user electronic device and processor 21 using multimedia components.
[0320] In some embodiments, the processor component in processor 21 may also be referred to as a CPU (Central Processing Unit). The processor component may be an electronic chip with signal processing capabilities. The processor component may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor, or the processor component may be any conventional processor. Furthermore, the processor component may be implemented using integrated circuit chips.
[0321] In some embodiments, memory 22 is configured to store various types of data to support operation of electronic device 20. Examples of such data include instructions for any application or method operating on electronic device 20, acquired data, messages, images, videos, etc. Memory 22 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, optical disk, or graphene storage.
[0322] In some embodiments, the memory 22 can be a memory module, TF card, etc., and can store all information in the electronic device 20, including the input raw data, computer programs, intermediate running results, and final running results. In some embodiments, it stores and retrieves information according to the location specified by the processor 21. In some embodiments, the electronic device 20 has a memory function and can ensure normal operation because of the memory 22. In some embodiments, the memory 22 of the electronic device 20 can be classified into main memory (RAM) and auxiliary memory (external memory) according to its purpose, or it can be classified into external memory and internal memory. External memory is usually magnetic media or optical discs, which can store information for a long time. RAM refers to the storage component on the motherboard, which is used to store the currently executing data and programs, but it is only used to temporarily store programs and data. The data will be lost when the power is turned off or disconnected.
[0323] In some embodiments, electronic device 20 may further include: a power supply component 23 configured to perform power management of electronic device 20, a wired or wireless network interface 24 configured to connect electronic device 20 to a network, and an input / output (I / O) interface 25. Electronic device 20 may operate on an operating system stored in memory 22, such as Windows Server, MacOS X, Unix, Linux, FreeBSD, or similar.
[0324] In some embodiments, power supply component 23 provides power to various components of electronic device 20. Power supply component 23 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 20.
[0325] In some embodiments, the wired or wireless network interface 24 is configured to facilitate wired or wireless communication between the electronic device 20 and other devices. The electronic device 20 may access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof.
[0326] In some embodiments, the wired or wireless network interface 24 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the wired or wireless network interface 24 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0327] In some embodiments, the input / output (I / O) interface 25 provides an interface between the processor 21 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to, a home button, volume buttons, a power button, and a lock button.
[0328] Figure 13 This is a block diagram of a computer-readable storage medium 30 provided in an embodiment of this application. The computer-readable storage medium 30 stores a computer program 31, wherein when the computer program 31 is executed by the processor 21 of the electronic device 20, the electronic device 20 is able to execute the model training method or the resource object push method described above.
[0329] If the integrated units of the various functional units in the various embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium 30. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer-readable storage medium 30 includes a computer program 31, which includes several instructions to cause a computer device (which may be a personal computer, system server, or network device, etc.), an electronic device (e.g., MP3, MP4, etc., or a mobile phone, tablet computer, wearable device, etc., or a desktop computer, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of this application.
[0330] Figure 14 This is a block diagram of a computer program product 40 provided in an embodiment of this application. The computer program product 40 stores program instructions 41. When the program instructions 41 are executed by the processor 21 of the electronic device 20, the electronic device 20 is able to execute the training method of the recommendation model or the push method of resource objects as described above.
[0331] Those skilled in the art will understand that embodiments of this application can provide a method for training a recommendation model, a method for pushing resource objects, a training device 10 for a recommendation model, a pushing device 10A for resource objects, an electronic device 20, a computer-readable storage medium 30, or a computer program product 40. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product 40 embodied on one or more computer program instructions 41 (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0332] This application is described with reference to flowchart illustrations and / or block diagrams of a recommendation model training method, a resource object pushing method, a recommendation model training apparatus 10, a resource object pushing apparatus 10A, an electronic device 20, a computer-readable storage medium 30, or a computer program product 40 according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by the computer program product 40. These computer program products 40 can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, such that program instructions 41, executable by the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the recommendation model training method, a resource object pushing method, a recommendation model training apparatus 10, a resource object pushing apparatus 10A, an electronic device 20, a computer-readable storage medium 30, or a computer program product 40. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0333] These computer program products 40 may also be stored in a computer-readable storage medium capable of directing a computer or other programmable data processing device to function in a particular manner, such that program instructions 41 stored in the computer program product 40 produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0334] These program instructions 41 may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing the program instructions 41 that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0335] It should be noted that the various methods, apparatuses, electronic devices, computer-readable storage media, computer program products, etc. described above may also include other implementation methods according to the description of the method embodiments. For specific implementation methods, please refer to the description of the relevant method embodiments, which will not be elaborated here.
[0336] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0337] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for training a recommendation model, characterized in that, The method includes: A first resource recommendation model to be trained is obtained and used as a student network to be trained. The first resource recommendation model is used to determine the first estimated feedback data of each of the multiple sample resource objects, and based on the first estimated feedback data, candidate sample objects are selected from the multiple sample resource objects. The first estimated feedback data represents the prediction data of the sample resource object being pushed to the user to perform a preset feedback behavior. A pre-trained second resource recommendation model is obtained and used as a teacher network. The second resource recommendation model is used to determine the second estimated feedback data of multiple candidate sample objects, and to select target sample objects from the multiple candidate sample objects based on the second estimated feedback data. The second estimated feedback data represents the prediction data of the candidate sample object being subjected to a preset feedback behavior by the user to be pushed. The complexity of the second resource recommendation model is higher than that of the first resource recommendation model. The student network to be trained is trained based on the teacher network, so that at least part of the hidden knowledge of the teacher network is transferred to the student network during the training process. After the student network is trained, a first resource recommendation model corresponding to the student network is determined as the coarse ranking model of the resource recommendation platform, and a second resource recommendation model corresponding to the teacher network is determined as the fine ranking model of the resource recommendation platform. The coarse ranking model is used to perform a first round of screening of multiple resource objects to be pushed by the resource recommendation platform, and the fine ranking model is used to perform a second round of screening of multiple candidate resource objects selected in the first round, so as to obtain the target resource objects recommended to the user to be pushed.
2. The method according to claim 1, characterized in that, The step of training the student network to be trained based on the teacher network, so as to transfer at least part of the dark knowledge of the teacher network to the student network during the training process, includes: In each iteration, based on the difference between the weight parameters of the intermediate layers of the current student network and the weight parameters of the intermediate layers of the current teacher network, the weight loss function information between the teacher and student networks is determined; and In each iteration, based on the difference between the predicted feedback data output by the current student network and the current teacher network for the same sample resource object, the distillation loss function information between the teacher and student networks is determined. Based on the distillation loss function information and the weight loss function information, determine the comprehensive loss function information for the current student network; The current student network is updated based on the comprehensive loss function information.
3. The method according to claim 2, characterized in that, The step of determining the comprehensive loss function information for the current student network based on the distillation loss function information and the weighted loss function information includes: Obtain the first cross-entropy loss function information of the current student network and the second cross-entropy loss function information of the current teacher network; the first cross-entropy loss function information characterizes the difference between the first estimated feedback data output by the current student network for the first sample resource object and the first actual feedback data corresponding to the first sample resource object; the second cross-entropy loss function information characterizes the difference between the second estimated feedback data output by the current teacher network for the second sample resource object and the second actual feedback data corresponding to the second sample resource object; Based on the first cross-entropy loss function information, the second cross-entropy loss function information, the distillation loss function information, and the weight loss function information, the comprehensive loss function information for the current student network is determined.
4. The method according to claim 2, characterized in that, The determination of the distillation loss function information between the teacher-student networks based on the differences between the predicted feedback data output by the current student network and the current teacher network for the same sample resource object includes: For the same sample resource object, first feature data is input into the current student network, and first estimated feedback data for the sample resource object is obtained through the current student network; and second feature data is input into the current teacher network, and second estimated feedback data for the sample resource object is obtained through the current teacher network; wherein, the first feature data includes user features and resource object features of the user to be pushed, and the second feature data includes user features, resource object features, and cross features of the user to be pushed; the cross features are the correlation features between the user features and the resource object features; Based on the mean square error or information divergence between the first and second predicted feedback data, the distillation loss function information between the teacher-student network is determined.
5. The method according to claim 4, characterized in that, Both the fully connected layers in the current teacher network and the current student network are configured with preset exponential functions. The first estimated feedback data for the sample resource object obtained through the current student network includes: The first feature data is input into the current student network, and the first initial estimated feedback data of the sample resource object is obtained through the current student network. Based on the preset exponential function, the first initial estimated feedback data is processed to obtain the first estimated feedback data of the sample resource object. The second estimated feedback data for the sample resource objects obtained through the current teacher network includes: The second feature data is input into the current teacher network, and the second initial estimated feedback data of the sample resource object is obtained through the current teacher network. Based on the preset exponential function, the second initial estimated feedback data is processed to obtain the second estimated feedback data of the sample resource object. The preset exponential function is used to adjust the data distribution of multiple estimated feedback data output by the fully connected layers in the current teacher network and the current student network for multiple sample resource objects, so that the data distribution tends to be smooth.
6. The method according to claim 2, characterized in that, Before training the student network to be trained based on the teacher network, to transfer at least some of the dark knowledge of the teacher network to the student network during the training process, the method further includes: Obtain the network type and network structure of the teacher network; The student network to be trained is constructed based on the network type and network structure of the teacher network. The student network to be trained is of the same network type as the teacher network, the number of intermediate layers in the student network is less than the number of intermediate layers in the teacher network, and each intermediate layer of the student network corresponds to a corresponding intermediate layer in the teacher network.
7. The method according to claim 6, characterized in that, The construction of the student network to be trained based on the network type and network structure of the teacher network includes: Based on the network type and network structure of the teacher network, construct a student network with the same network type and network structure; In this context, each intermediate layer in the student network corresponds to an odd-numbered intermediate layer in the teacher network, or each intermediate layer in the student network corresponds to an even-numbered intermediate layer in the teacher network.
8. The method according to claim 6, characterized in that, The determination of the weight loss function information between the teacher-student networks based on the difference between the weight parameters of the intermediate layer of the current student network and the weight parameters of the intermediate layer of the current teacher network includes: Obtain the first weight parameters of each intermediate layer in the current student network and the second weight parameters of each target intermediate layer in the current teacher network; the target intermediate layer is the intermediate layer corresponding to the intermediate layer of the current student network. Based on the mean square error or information divergence between the first weight parameter and the second weight parameter, the weight loss function information between the teacher-student network is determined.
9. The method according to claim 1, characterized in that, Before obtaining the pre-trained second resource recommendation model and using the second resource recommendation model as the teacher network, the method further includes: Obtain the pre-trained sample resource object and the actual feedback data corresponding to the pre-trained sample resource object; The feature data of the pre-trained sample resource object is input into the second resource recommendation model to be trained to obtain the estimated feedback data for the pre-trained sample resource object; the estimated feedback data represents the predicted data of the pre-trained sample resource object being pushed to the user to perform a preset feedback behavior; Based on the difference between the estimated feedback data and the actual feedback data corresponding to the pre-trained sample resource objects, the second resource recommendation model to be trained is adjusted until a pre-trained second resource recommendation model is obtained, and the second resource recommendation model is used as the pre-trained teacher network.
10. A method for pushing resource objects, characterized in that, include: Multiple resource objects to be pushed from the resource recommendation platform are input into a coarse ranking model. The coarse ranking model determines the first estimated feedback data for each of the multiple resource objects to be pushed. Based on the first estimated feedback data, the multiple resource objects to be pushed are screened in the first round to select multiple candidate resource objects. The first estimated feedback data represents the prediction data of the preset feedback behavior implemented by the user to be pushed to each of the resource objects to be pushed. Multiple candidate resource objects are input into a fine-ranking model, which determines second estimated feedback data corresponding to the multiple candidate resource objects. Based on the second estimated feedback data, a second round of screening is performed on the multiple candidate resource objects to determine the target resource object. The second estimated feedback data represents the predicted data of the candidate resource object being subject to a preset feedback behavior by the user to be pushed to. The coarse-ranking model and the fine-ranking model are obtained based on the method of any one of claims 1-9. The target resource object is recommended to the user to be pushed to.
11. A training device for a recommendation model, characterized in that, include: The student network unit is configured to acquire a first resource recommendation model to be trained and use the first resource recommendation model as the student network to be trained. The first resource recommendation model is used to determine the first estimated feedback data for each of multiple sample resource objects, and to select candidate sample objects from the multiple sample resource objects based on the first estimated feedback data; the first estimated feedback data represents the prediction data of the sample resource object being subject to a preset feedback behavior by the user to be pushed to. The teacher network unit is configured to execute the acquisition of a pre-trained second resource recommendation model and use the second resource recommendation model as the teacher network. The second resource recommendation model is used to determine the second estimated feedback data of multiple candidate sample objects, and to filter out target sample objects from the multiple candidate sample objects based on the second estimated feedback data; the second estimated feedback data represents the prediction data of the candidate sample object being subject to a preset feedback behavior by the user to be pushed to. The complexity of the second resource recommendation model is higher than that of the first resource recommendation model; The model training unit is configured to perform training on the student network to be trained based on the teacher network, so as to transfer at least part of the dark knowledge of the teacher network to the student network during the training process, and after the student network is trained, determine a first resource recommendation model corresponding to the student network as the coarse ranking model of the resource recommendation platform, and determine a second resource recommendation model corresponding to the teacher network as the fine ranking model of the resource recommendation platform; wherein, the coarse ranking model is used to perform a first round of screening of multiple resource objects to be pushed by the resource recommendation platform, and the fine ranking model is used to perform a second round of screening of multiple candidate resource objects selected in the first round, so as to obtain the target resource objects to be recommended to the user.
12. A resource object push device, characterized in that, include: The first screening unit is configured to input multiple resource objects to be pushed from the resource recommendation platform into a coarse ranking model, determine the first estimated feedback data of each of the multiple resource objects to be pushed by the coarse ranking model, and perform a first round of screening on the multiple resource objects to be pushed based on the first estimated feedback data to select multiple candidate resource objects. The first estimated feedback data represents the predicted data of the preset feedback behavior performed by the user to be pushed on each of the resource objects to be pushed; The second filtering unit is configured to input multiple candidate resource objects into a fine-ranking model, determine second estimated feedback data corresponding to the multiple candidate resource objects by the fine-ranking model, and perform a second round of filtering on the multiple candidate resource objects based on the second estimated feedback data to determine the target resource object; the second estimated feedback data represents the prediction data of the candidate resource object being subject to a preset feedback behavior by the user to be pushed; wherein, the coarse-ranking model and the fine-ranking model are obtained based on the method of any one of claims 1-9; The object push unit is configured to recommend the target resource object to the user to be pushed.
13. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the executable instructions to implement the training method of the recommendation model as described in any one of claims 1 to 9, or the method for pushing resource objects as described in claim 10.
14. A computer-readable storage medium comprising a computer program, characterized in that, When the computer program is executed by the processor of the electronic device, the electronic device is able to perform the training method of the recommendation model as described in any one of claims 1 to 9, or the push method of the resource object as described in claim 10.
Citation Information
Patent Citations
Multimedia resource estimated click rate determination method and device and a server
CN109408724A
Question answering method based on knowledge distillation, terminal equipment and storage medium
CN114372478A