Method and apparatus for training click-through rate prediction model and predicting click-through rate
By training the click-through rate prediction model and adaptively adjusting the model parameters using the dynamic parameterization layer, the problem that deep neural networks are difficult to perceive higher-order relationships in click-through rate prediction is solved, and the accuracy and efficiency of the recommendation system are improved.
Patent Information
- Application Number
- CN202111552526.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-12-17
AI Technical Summary
The existing deep neural network-based click-through rate prediction method is difficult to adaptively interact with input and context, which makes it difficult for the model to effectively perceive higher factorial relationships in the recommendation system, and there are problems with model expression ability and delay.
The training click-through rate prediction model is adopted to generate dynamic weights and biases through the domain-based dynamic parameterization layer, the user behavior-based dynamic parameterization layer, the search behavior-based dynamic parameterization layer, and the feature-based dynamic parameterization layer, and the model parameters are adaptively adjusted to perceive the intrinsic properties of different samples and improve the accuracy of click-through rate prediction.
On the premise of ensuring that online services are not time-consuming, the accuracy of click-through rate prediction and the adaptability of the model are improved, and the effect of the recommendation system is enhanced.
Smart Images

Figure CN114240555B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to methods and apparatuses for training a click-through rate prediction model and predicting a click-through rate. Background Art
[0002] In recent years, deep neural networks (DNNs) have achieved great success in click-through rate (CTR) prediction tasks. Essentially, its core component is a linear transformation that models the interaction between input and context information through fixed kernels. From a human perspective, people will choose which product to click according to their preferences, or may choose to click on other products after clicking on several similar products. This characteristic is accompanied by implicit low-order interactions, making it difficult for DNNs to perceive multiplicative relationships. Nowadays, a large amount of research is devoted to constructing appropriate high-order interaction modules to model this relationship. In existing recommendation systems, DNN-based click-through rate prediction methods are difficult to perceive high-order multiplicative relationships. In recent years, many works mainly use DNN + high-order interaction modules to attempt to characterize this relationship, but these methods cannot perform adaptive interaction based on input and context, and the problems of their model expression ability and high latency limit their application in real recommendation systems. Summary of the Invention
[0003] Embodiments of the present disclosure propose methods and apparatuses for training a click-through rate prediction model and predicting a click-through rate.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for training a click-through rate prediction model, including: obtaining a training sample set and a click-through rate prediction model, where each training sample includes user information, commodity information, a user behavior sequence, and a click label, and the click-through rate prediction model includes a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, and a first fully connected layer; performing the following training steps: selecting a target training sample from the training sample set; inputting the user information and commodity information of the target training sample into the first representation embedding layer to obtain a sparse category vector; inputting the user behavior sequence of the target training sample into the second representation embedding layer to obtain a user behavior vector; inputting the sparse category vector into the domain-based dynamic parameterization layer of the click-through rate prediction model to generate a first weight and a first bias, and linearly transforming the sparse category vector according to the first weight and the first bias to obtain a first output result; inputting the user behavior vector into the user behavior-based dynamic parameterization layer to generate a second weight and a second bias, and convolving the user behavior vector according to the second weight and the second bias to obtain a second output result; performing click-through rate prediction based on the first output result and the second output result through the first fully connected layer to obtain a predicted value; calculating a loss value according to the predicted value and the click label of the target training sample; if the loss value is less than a predetermined threshold, determining that the training of the click-through rate prediction model is completed.
[0005] In some embodiments, the method further includes: if the loss value is greater than or equal to the predetermined threshold, adjusting the network parameters of the click-through rate prediction model and continuing to perform the above training steps.
[0006] In some embodiments, the click-through rate prediction model further includes a search behavior-based dynamic parameterization layer, a first multi-head attention layer, a second multi-head attention layer, and a second fully connected layer; and performing click-through rate prediction based on the first output result and the second output result through the first fully connected layer to obtain a predicted value includes: inputting the user behavior vector into the first multi-head attention layer to obtain a first attention result; taking the weighted sum of the first attention result and the second output result as a first weighted result; inputting the sparse category vector into the second fully connected layer to obtain a query vector; inputting the first weighted result and the query vector into the search behavior-based dynamic parameterization layer to generate a third weight and a third bias, and linearly transforming the query vector according to the third weight and the third bias to obtain a third output result; inputting the first weighted result and the query vector into the second multi-head attention layer to obtain a second attention result; taking the weighted sum of the second attention result and the third output result as a second weighted result; performing click-through rate prediction based on the first output result and the second weighted result through the first fully connected layer to obtain a predicted value.
[0007] In some embodiments, the click-through rate prediction model further includes a feature-based dynamic parameterization layer and a third fully-connected layer; and predicting the click-through rate through a first fully-connected layer based on the first output result and the second output result to obtain a predicted value, including: selecting a context vector from the sparse category vector; linearly projecting the first output result to a low dimension through the third fully-connected layer and then concatenating it with the second weighted result to obtain a concatenated result; inputting the concatenated result and the context vector into the feature-based dynamic parameterization layer to generate a fourth weight and a fourth bias, and linearly transforming the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; and inputting the fourth output result into the first fully-connected layer to obtain the predicted value of the click-through rate.
[0008] In some embodiments, the click-through rate prediction model further includes a feature-based dynamic parameterization layer and a third fully-connected layer; and predicting the click-through rate through a first fully-connected layer based on the first output result and the second output result to obtain a predicted value, including: selecting a context vector from the sparse category vector; linearly projecting the first output result to a low dimension through the third fully-connected layer to obtain a projected result; inputting the projected result and the context vector into the feature-based dynamic parameterization layer to generate a fourth weight and a fourth bias, and linearly transforming the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; and inputting the fourth output result into the first fully-connected layer to obtain the predicted value of the click-through rate.
[0009] In some embodiments, the domain-based dynamic parameterization layer includes: a first pooling layer, a first weight generation layer, and a first sample adaptive affine layer, and the user behavior-based dynamic parameterization layer includes: a second pooling layer, a second weight generation layer, and a second sample adaptive convolutional layer.
[0010] In some embodiments, the search behavior-based dynamic parameterization layer includes: a third pooling layer, a third weight generation layer, and a third sample adaptive affine layer, and the feature-based dynamic parameterization layer includes: a fourth weight generation layer and a fourth sample adaptive affine layer.
[0011] In a second aspect, embodiments of the present disclosure provide a method for predicting a click-through rate, including: obtaining user information, product information, and user historical behavior of a user; inputting the user information, the product information, and the user historical behavior into the click-through rate prediction model trained according to any one of the methods in the first aspect to obtain the predicted value of the click-through rate of the user for the product.
[0012] In some embodiments, the method further includes: selecting a predetermined number of products in descending order of the predicted click-through rate values of the products; and pushing product information of the selected products to the user.
[0013] In some embodiments, the method further includes: during the process of predicting the click-through rate, adjusting weights and biases of at least one of the following dynamically parameterized layers in the click-through rate prediction model according to the user information, the product information, and the user's historical behavior: a domain-based dynamically parameterized layer, a user-behavior-based dynamically parameterized layer, a search-behavior-based dynamically parameterized layer, and a feature-based dynamically parameterized layer.
[0014] In some embodiments, the method further includes: obtaining product information clicked by the user as a click label; calculating a loss value according to the click label and the predicted click-through rate value; and adjusting network parameters of the click-through rate prediction model according to the loss value.
[0015] In some embodiments, the method further includes: obtaining product information clicked by the user and adding it to the user's historical behavior.
[0016] In a third aspect, an embodiment of the present disclosure provides an apparatus for training a click-through rate prediction model, including: an acquisition unit configured to acquire a training sample set and a click-through rate prediction model, where each training sample includes user information, product information, a user behavior sequence, and a click label, and the click-through rate prediction model includes a first representation embedding layer, a second representation embedding layer, a domain-based dynamically parameterized layer, a user-behavior-based dynamically parameterized layer, and a first fully connected layer; a training unit configured to perform the following training steps: selecting a target training sample from the training sample set; inputting the user information and product information of the target training sample into the first representation embedding layer to obtain a sparse category vector; inputting the user behavior sequence of the target training sample into the second representation embedding layer to obtain a user behavior vector; inputting the sparse category vector into the domain-based dynamically parameterized layer of the click-through rate prediction model to generate a first weight and a first bias, and linearly transforming the sparse category vector according to the first weight and the first bias to obtain a first output result; inputting the user behavior vector into the user-behavior-based dynamically parameterized layer to generate a second weight and a second bias, and performing convolution on the user behavior vector according to the second weight and the second bias to obtain a second output result; performing click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value; calculating a loss value according to the predicted value and the click label of the target training sample; and if the loss value is less than a predetermined threshold, determining that the training of the click-through rate prediction model is completed.
[0017] In some embodiments, the apparatus further includes an adjustment unit configured to: if the loss value is greater than or equal to a predetermined threshold, adjust the network parameters of the click-through rate prediction model, and continue to execute the above training steps.
[0018] In some embodiments, the click-through rate prediction model further includes a dynamically parameterized layer based on search behavior, a first multi-head attention layer, a second multi-head attention layer, and a second fully-connected layer; and the training unit is further configured to: input the user behavior vector into the first multi-head attention layer to obtain a first attention result; use the weighted sum of the first attention result and the second output result as a first weighted result; input the sparse category vector into the second fully-connected layer to obtain a query vector; input the first weighted result and the query vector into the dynamically parameterized layer based on search behavior to generate a third weight and a third bias, and linearly transform the query vector according to the third weight and the third bias to obtain a third output result; input the first weighted result and the query vector into the second multi-head attention layer to obtain a second attention result; use the weighted sum of the second attention result and the third output result as a second weighted result; perform click-through rate prediction through a first fully-connected layer based on the first output result and the second weighted result to obtain a predicted value.
[0019] In some embodiments, the click-through rate prediction model further includes a feature-based dynamically parameterized layer and a third fully-connected layer; and the training unit is further configured to: select a context vector from the sparse category vector; linearly project the first output result to a low dimension through the third fully-connected layer and then concatenate it with the second weighted result to obtain a concatenated result; input the concatenated result and the context vector into the feature-based dynamically parameterized layer to generate a fourth weight and a fourth bias, and linearly transform the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; input the fourth output result into the first fully-connected layer to obtain a predicted value of the click-through rate.
[0020] In some embodiments, the click-through rate prediction model further includes a feature-based dynamically parameterized layer and a third fully-connected layer; and the training unit is further configured to: select a context vector from the sparse category vector; linearly project the first output result to a low dimension through the third fully-connected layer to obtain a projected result; input the projected result and the context vector into the feature-based dynamically parameterized layer to generate a fourth weight and a fourth bias, and linearly transform the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; input the fourth output result into the first fully-connected layer to obtain a predicted value of the click-through rate.
[0021] In some embodiments, the domain-based dynamic parameterization layer includes: a first pooling layer, a first weight generation layer, and a first sample adaptive affine layer. The user behavior-based dynamic parameterization layer includes: a second pooling layer, a second weight generation layer, and a second sample adaptive convolutional layer.
[0022] In some embodiments, the search behavior-based dynamic parameterization layer includes: a third pooling layer, a third weight generation layer, and a third sample adaptive affine layer. The feature-based dynamic parameterization layer includes: a fourth weight generation layer and a fourth sample adaptive affine layer.
[0023] Fourthly, an embodiment of the present disclosure provides a device for predicting click-through rate, including: an acquisition unit configured to acquire user information, commodity information, and user historical behavior of a user; a prediction unit configured to input the user information, the commodity information, and the user historical behavior into a click-through rate prediction model trained according to the method described in any one of the first aspect to obtain a predicted click-through rate value of the user for the commodity.
[0024] In some embodiments, the device further includes a recommendation unit configured to: select a predetermined number of commodities in descending order of the predicted click-through rate values of the commodities; push the commodity information of the selected commodities to the user.
[0025] In some embodiments, the device further includes an adjustment unit configured to: during the process of predicting the click-through rate, adjust the weights and biases of at least one of the following dynamic parameterization layers in the click-through rate prediction model according to the user information, the commodity information, and the user historical behavior: the domain-based dynamic parameterization layer, the user behavior-based dynamic parameterization layer, the search behavior-based dynamic parameterization layer, and the feature-based dynamic parameterization layer.
[0026] In some embodiments, the device further includes an adjustment unit configured to: acquire the commodity information clicked by the user as a click label; calculate a loss value according to the click label and the predicted click-through rate value; adjust the network parameters of the click-through rate prediction model according to the loss value.
[0027] In some embodiments, the acquisition unit is further configured to: acquire the commodity information clicked by the user and add it to the user historical behavior of the user.
[0028] Fifthly, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device storing one or more computer programs thereon, and when the one or more computer programs are executed by the one or more processors, enabling the one or more processors to implement the method described in any one of the first aspect.
[0029] Sixthly, an embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the method described in any one of the first aspect is implemented.
[0030] The method and apparatus for training a click-through rate prediction model and predicting a click-through rate provided by the embodiments of the present disclosure generate dynamic weights adaptively according to samples through a domain-based dynamic parameterization layer and a user behavior-based dynamic parameterization layer. By perceiving the intrinsic attributes of different samples, the parameters of the model are automatically adjusted, and at the same time, click-through rate estimation is performed on the premise of ensuring that the online service time consumption is not large. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Other features, objects, and advantages of the present disclosure will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings:
[0032] Figure 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
[0033] Figure 2 is a flowchart of an embodiment of the method for training a click-through rate prediction model according to the present disclosure;
[0034] Figures 3a - 3h is a schematic diagram of the network structure of the click-through rate prediction model according to the present disclosure;
[0035] Figure 4 is a flowchart of an embodiment of the method for predicting a click-through rate according to the present disclosure;
[0036] Figure 5 is a schematic structural diagram of an embodiment of the apparatus for training a click-through rate prediction model according to the present disclosure;
[0037] Figure 6 is a schematic structural diagram of an embodiment of the apparatus for predicting a click-through rate according to the present disclosure;
[0038] Figure 7 is a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] The present disclosure will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only for explaining the related invention and not for limiting the invention. Additionally, it should be noted that for the sake of description, only parts related to the relevant invention are shown in the drawings.
[0040] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other. The following will describe the present disclosure in detail with reference to the accompanying drawings and in combination with the embodiments.
[0041] Figure 1 An exemplary system architecture 100 is shown that can apply the method for training a click-through rate prediction model, the device for training a click-through rate prediction model, the method for predicting a click-through rate, or the device for predicting a click-through rate according to the embodiments of the present disclosure.
[0042] As Figure 1 shown, the system architecture 100 may include terminals 101, 102, a network 103, a database server 104, and a server 105. The network 103 is used to provide a medium for communication links between the terminals 101, 102, the database server 104, and the server 105. The network 103 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0043] The user 110 may use the terminals 101, 102 to interact with the server 105 through the network 103 to receive or send messages, etc. Various client applications may be installed on the terminals 101, 102, such as model training applications, click-through rate prediction applications, shopping applications, payment applications, web browsers, and instant messaging tools, etc.
[0044] The terminals 101, 102 here may be hardware or software. When the terminals 101, 102 are hardware, they may be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), laptop portable computers, and desktop computers, etc. When the terminals 101, 102 are software, they may be installed in the above-listed electronic devices. It may be implemented as multiple software or software modules (for example, used to provide distributed services), or it may be implemented as a single software or software module. No specific limitation is made here.
[0045] The database server 104 may be a database server that provides various services. For example, a sample set may be stored in the database server. The sample set contains a large number of samples. Among them, the samples may include user information, commodity information, user behavior sequences, and click labels. In this way, the user 110 may also select samples from the sample set stored in the database server 104 through the terminals 101, 102.
[0046] Server 105 can also be a server that provides various services, such as a background server that supports various applications displayed on terminals 101 and 102. The background server can use the samples in the sample set sent by terminals 101 and 102 to train the initial model, and can use the training results (such as the generated click-through rate prediction model) for information recommendation. In this way, the website service provider can apply the click-through rate prediction model to predict the click-through rate of commodity information, so as to recommend recommended information with a high click-through rate to users, thereby improving the hit rate and conversion rate of the recommended information.
[0047] Here, the database server 104 and the server 105 can also be hardware or software. When they are hardware, they can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When they are software, they can be implemented as multiple software or software modules (such as those used to provide distributed services), or as a single software or software module. No specific limitation is made here. The database server 104 and the server 105 can also be servers of a distributed system, or servers combined with blockchain. The database server 104 and the server 105 can also be cloud servers, or intelligent cloud computing servers or intelligent cloud hosts with artificial intelligence technology.
[0048] It should be noted that the method for training the click-through rate prediction model or the method for predicting the click-through rate provided by the embodiments of the present disclosure is generally executed by the server 105. Correspondingly, the device for training the click-through rate prediction model or the device for predicting the click-through rate is generally also set in the server 105.
[0049] It should be pointed out that in the case where the server 105 can implement the relevant functions of the database server 104, the database server 104 may not be provided in the system architecture 100.
[0050] It should be understood that Figure 1 the numbers of the terminals, networks, database servers, and servers in
[0051] Continue to refer to Figure 2 , which shows a flow 200 of an embodiment of the method for training a click-through rate prediction model according to the present disclosure. The method for training the click-through rate prediction model may include the following steps:
[0052] Step 201, obtain a training sample set and a click-through rate prediction model.
[0053] In this embodiment, the execution subject of the method for training the click-through rate prediction model (such as Figure 1The server shown (105) can obtain the training sample set in various ways. For example, the executing entity can obtain the existing sample set stored therein from a database server (such as Figure 1 the database server shown (104)) through a wired connection or a wireless connection. For another example, a user can collect training samples through a terminal (such as Figure 1 the terminals shown (101, 102)). In this way, the executing entity can receive the training samples collected by the terminal and store these training samples locally to generate a training sample set.
[0054] Here, the training sample set can include at least one training sample. Among them, each training sample includes user information, commodity information, user behavior sequence, and click label. The user information can be some user sparse IDs, such as user labels, user device labels, user location labels, etc. The commodity information can be some commodity sparse IDs, such as commodity labels, commodity category labels, commodity brand labels, etc. Different types of sparse IDs are referred to as domains in this article. The user behavior sequence refers to the user's browsing, collecting, purchasing, etc. behaviors. The click label is used to identify the click probability of the user on the displayed commodity, where 1 represents a click and 0 represents no click.
[0055] The click-through rate prediction model here is an initial model and can include a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, and a first fully connected layer, as Figure 3a shown.
[0056] Optionally, the click-through rate prediction model can include a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, a first fully connected layer, a search behavior-based dynamic parameterization layer, a first multi-head attention layer, a second multi-head attention layer, and a second fully connected layer, as Figure 3b shown;
[0057] Optionally, the click-through rate prediction model can include a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, a first fully connected layer, a feature-based dynamic parameterization layer, a third fully connected layer, and a third embedding representation layer, as Figure 3c shown.
[0058] Optionally, the click-through rate prediction model can include a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, a first fully connected layer, a search behavior-based dynamic parameterization layer, a first multi-head attention layer, a second multi-head attention layer, a second fully connected layer, a feature-based dynamic parameterization layer, a third fully connected layer, and a third embedding representation layer, as Figure 3d shown.
[0059] Step 202: Select a target training sample from the training sample set.
[0060] In this embodiment, the execution subject may select a training sample from the training sample set obtained in step 201 as the target training sample, and execute the training steps of steps 203 to 210. Among them, the selection method and the number of selected training samples are not limited in this disclosure. For example, at least one sample may be randomly selected, or a sample with a longer user behavior sequence (that is, more user operations) may be selected therefrom. A sample with a label of 1 is a positive sample, and a sample with a label of 0 is a negative sample. It is necessary to ensure that the ratio of positive samples and negative samples in the training process is basically the same.
[0061] Step 203: Input the user information and product information of the target training sample into the first representation embedding layer to obtain a sparse category vector.
[0062] In this embodiment, the first representation embedding layer processes and discretizes the user sparse ID and the product sparse ID, and uses one-hot encoding to vectorize the features to obtain a high-dimensional sparse vector, and then performs low-dimensional embedding to obtain a dense vector representation, named the sparse category vector, to reduce the complexity of the neural network model.
[0063] Step 204: Input the user behavior sequence of the target training sample into the second representation embedding layer to obtain a user behavior vector.
[0064] In this embodiment, the second representation embedding layer uses Multi-Hot encoding to vectorize the features of the user behavior sequence to obtain a high-dimensional sparse vector, and then performs low-dimensional embedding to obtain a dense vector representation, named the user behavior vector, to reduce the complexity of the neural network model.
[0065] Step 205: Input the sparse category vector into the domain-based dynamic parameterization layer to generate a first weight and a first bias, and linearly transform the sparse category vector according to the first weight and the first bias to obtain a first output result.
[0066] In this embodiment, the structure of the domain-based dynamic parameterization layer is as Figure 3eAs shown, it includes a pooling layer, a weight generation layer, and a sample adaptive affine layer. First, the pooling layer performs feature aggregation on different feature domains. For example, global max pooling or global average pooling is used to aggregate features in different domains, such as product IDs, user IDs, etc. After obtaining the aggregated vector, two-layer MLP (multi-layer perceptron, also known as fully connected layer) is used to generate the forward weights and bias values. Here, it is assumed that the input feature dimension is 16, and the output dimensions of the two-layer MLP are 8 and 272 respectively. The first layer of the MLP represents a linear transformation, and the second layer of the MLP represents the output of instance-level dynamic weights and biases. The size of the weights is 16*16, and the bias is 16. Therefore, through deformation operations, the output after the two-layer MLP can be transformed into a kernel (weight) and a bias for mimicking the forward calculation in the fully connected layer. Subsequently, in the feature aggregation layer: for each different feature domain, the generated kernel and bias are used to perform a linear transformation to obtain a domain vector with a dimension of 16.
[0067] Then, the generated weights and biases are used to mimic the affine transformation of the original sample through the sample adaptive affine layer, that is, simple matrix multiplication and addition, to obtain the first output result. It should be noted that the weights and biases here are different for each different sample, which is different from the fully connected layer.
[0068] In this application, four dynamic parameterization layers are involved. Therefore, they are distinguished by "the first pooling layer", "the second pooling layer", "the first weight generation layer", "the second weight generation layer", "the first weight", "the second weight", "the first bias", "the second bias", etc.
[0069] Step 206, input the user behavior vector into the dynamic parameterization layer based on user behavior to generate the second weight and the second bias, and perform convolution on the user behavior vector according to the second weight and the second bias to obtain the second output result.
[0070] In this embodiment, the structure of the dynamic parameterization layer based on user behavior is as Figure 3gAs shown, it includes a pooling layer, a weight generation layer, and a sample adaptive convolution layer. First, a convolution operation can be performed on the user behavior vector to extract some local features. Subsequently, through the pooling layer, a global aggregation function is used for feature aggregation, such as global max pooling, global average pooling, etc., to obtain the user behavior global aggregation vector. For the aggregated vector, two fully connected layers (double-layer MLP) are selected to generate the dynamic convolution kernel and bias value. Here, it is assumed that the dimension of the user behavior vector is 32, the length of the user behavior is 100, the width of the convolution kernel is 3, the output dimension of the convolution kernel is 64, and the output dimensions of the double-layer MLP are set to 8 and 6208 respectively. Among them, the dimension of the first layer of the MLP can be freely set, while the output dimension of the second layer of the MLP is determined by the length and width of the convolution kernel, the input dimension, the output dimension, and the bias dimension, that is, 3 * 32 * 64 + 64.
[0071] Subsequently, the dynamic convolution kernel and bias term are obtained through splitting and deformation operations respectively. In the sample adaptive convolution layer, a convolution operation is used to perform a local linear transformation on the original user behavior vector (convolving with the dynamic convolution kernel and then adding the bias), and finally the second output result is obtained. Among them, the length of the user behavior feature is 100 and the dimension is 64. The larger the width of the convolution kernel, the more user behavior information can be perceived, but at the same time, it will also cause problems in optimization. In actual use, the size of the convolution kernel can be selected as 3. All the numerical values mentioned here are for illustration and do not constitute a specific neural network structure.
[0072] Step 207, based on the first output result and the second output result, perform click-through rate prediction through the first fully connected layer to obtain the predicted value.
[0073] In this embodiment, the first fully connected layer here is equivalent to a classification layer, and the probability that the product is clicked, that is, the predicted value, can be obtained.
[0074] In some optional implementation manners of this embodiment, the click-through rate prediction model further includes a dynamic parameterization layer based on search behavior, a first multi-head attention layer, a second multi-head attention layer, and a second fully connected layer. Predicting the click-through rate through a first fully connected layer based on the first output result and the second output result to obtain a predicted value, including: inputting the user behavior vector into the first multi-head attention layer to obtain a first attention result; taking the weighted sum of the first attention result and the second output result as a first weighted result; inputting the sparse category vector into the second fully connected layer to obtain a query vector; inputting the first weighted result and the query vector into the dynamic parameterization layer based on search behavior to generate a third weight and a third bias, and linearly transforming the query vector according to the third weight and the third bias to obtain a third output result; inputting the first weighted result and the query vector into the second multi-head attention layer to obtain a second attention result; taking the weighted sum of the second attention result and the third output result as a second weighted result; predicting the click-through rate through a first fully connected layer based on the first output result and the second weighted result to obtain a predicted value.
[0075] As Figure 3b shown, the first attention result output after the weighted combination of the user behavior vector and the output of the multi-head attention layer is used as the overall user behavior vector and input into the user behavior decoder. The user behavior decoder is composed of a multi-head attention layer and a dynamic parameterization layer based on search behavior. As Figure 3h shown, the dynamic parameterization layer based on search behavior also includes a pooling layer, a weight generation layer, and a sample adaptive affine layer. First, use the pooling layer to aggregate all user behavior vectors (the first attention result), such as global average pooling, etc., and use a two-layer MLP to generate the forward weight and bias values. Here, it is assumed that the dimension of the search vector is 32, the dimension of the aggregated user behavior vector is 64, and the output dimensions of the two-layer MLP can be set to 8, 2112. The second layer of the MLP outputs the dynamic weight and bias, where the size of the weight is 32 * 64 and the size of the bias is 64. Subsequently, in the sample adaptive affine layer, for the search vector, use the generated dynamic weight and bias to generate a search behavior aggregation vector (the third output result) with a dimension of 64.
[0076] Take the weighted sum of the third output result and the second attention result and the first output result as the input of the first fully connected layer, and predict the click-through rate to obtain a predicted value.
[0077] The query vector contains information such as the search term, product category, product label, etc. of the current behavior. The dynamic parameterization layer based on search behavior learns the guiding significance of past user behaviors for whether the current product is clicked by modeling the relationship between the user behavior sequence and the query vector.
[0078] In some alternative implementation manners of this embodiment, the click-through rate prediction model further includes a feature-based dynamic parameterization layer, a third fully connected layer, and a third embedding representation layer; and the click-through rate is predicted through the first fully connected layer based on the first output result and the second output result to obtain a predicted value, including: selecting context information from user information and commodity information; inputting the context information into the third embedding representation layer to obtain a context vector; linearly projecting the first output result and the second output result to a low dimension through the third fully connected layer to obtain a projection result; inputting the projection result and the context vector into the feature-based dynamic parameterization layer to generate a fourth weight and a fourth bias, and linearly transforming the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; and inputting the fourth output result into the first fully connected layer to obtain the predicted value of the click-through rate.
[0079] The click-through rate prediction model is as Figure 3c shown. The context information is part of the pre-specified user information and commodity information, for example, user tags, commodity brands, etc. The function of the third embedding representation layer is the same as that of the first embedding representation layer. The output result of the domain-based dynamic parameterization layer is the first output result, and the output result of the user behavior-based dynamic parameterization layer is the second output result. After concatenating the first output results, a single-layer fully connected layer (the third fully connected layer) is used to linearly project to a low dimension, and then concatenated with the second output result and jointly input into the feature-based dynamic parameterization layer (as Figure 3f shown). The feature-based dynamic parameterization layer includes a weight generation layer and a sample adaptive affine layer. Among them, the weight generation layer uses the context vector obtained from the sparse context ID and uses two-layer MLP to generate dynamic weights and bias values. Assuming that the dimension of the context vector is 16, the input dimension of the concatenated features is 512, and the required output dimension is 256, the output dimensions of the two-layer MLP are 8 and 131328 respectively. Through splitting and deformation operations, a weight matrix of size 512*256 and a bias value of 256 are obtained respectively, and the input vector is affine-transformed through a linear transformation operation. Finally, the fourth output result is obtained by stacking this layer. Finally, the click-through rate prediction value is obtained by the linear classification layer (the first fully connected layer).
[0080] In some alternative implementation manners of this embodiment, the click-through rate prediction model further includes a feature-based dynamic parameterization layer, a third fully connected layer, and a third embedding representation layer; and predicting the click-through rate through a first fully connected layer based on the first output result and the second output result to obtain a predicted value, including: selecting context information from user information and commodity information; inputting the context information into the third embedding representation layer to obtain a context vector; linearly projecting the first output result to a low dimension through the third fully connected layer and concatenating it with the second weighted result to obtain a concatenated result; inputting the concatenated result and the context vector into the feature-based dynamic parameterization layer to generate a fourth weight and a fourth bias, and linearly transforming the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; inputting the fourth output result into the first fully connected layer to obtain the predicted value of the click-through rate.
[0081] The structure of the click-through rate prediction model is as Figure 3d shown. It includes 4 types of dynamic parameterization layers. The processing of each type of dynamic parameterization layer has been described above and will not be elaborated here. The difference from the previous implementation manner is that the second weighted result is used to replace the second output result. Other processes are the same and will not be elaborated.
[0082] Step 208, calculating a loss value according to the predicted value and the click label of the target training sample.
[0083] In this embodiment, the predicted value and the corresponding click label can be used as parameters and input into a specified loss function, so that the loss value between the two can be calculated.
[0084] In this embodiment, the loss function is usually used to measure the degree of inconsistency between the predicted value of the model (such as the predicted click-through rate) and the true value (such as the click label). It is a non-negative real-valued function. Generally, the smaller the loss function, the better the robustness of the model. The loss function can be set according to actual needs.
[0085] Step 209, if the loss value is less than a predetermined threshold, it is determined that the training of the click-through rate prediction model is completed.
[0086] In this embodiment, the predetermined threshold generally can be used to represent the ideal situation of the degree of inconsistency between the predicted value and the true value. That is to say, when the loss value reaches the predetermined threshold, it can be considered that the predicted value is close to or approximately equal to the true value. The predetermined threshold can be set according to actual needs.
[0087] It should be noted that if there are multiple (at least two) training samples selected in step 202, the execution entity can compare the loss value of each training sample with the predetermined threshold respectively. Thus, it can be determined whether the loss value of each training sample reaches the predetermined threshold.
[0088] Step 210. If the loss value is greater than or equal to a predetermined threshold, adjust the network parameters of the click-through rate prediction model, and continue to execute steps 202-210.
[0089] In this embodiment, if the loss value is greater than or equal to the predetermined threshold, it indicates that the click-through rate prediction model is not yet trained. The network parameters of the click-through rate prediction model can be adjusted using relevant optimization algorithms. For example, the random gradient descent technique can be used to modify the weights in each convolutional layer of the initial click-through rate prediction model. And step 202 can be returned to reselect training samples from the training sample set. Thus, the above training steps can be continued.
[0090] It should be noted that the selection method here is not limited in this disclosure either. For example, in the case of a large number of training samples in the training sample set, the execution entity can select the training samples that have not been selected from them.
[0091] The dynamic parameterization model uses the dense vectors obtained in steps 203 and 204 to obtain an output as the click-through rate prediction value and performs overall training. Among them, the domain-based dynamic parameterization layer is used to learn the dynamic interaction information between feature domains; the feature-based dynamic parameterization layer uses the dense vectors obtained from sparse context features to calculate dynamic weights for sample-adaptive aggregation of input features; the user-behavior-based dynamic parameterization layer uses the feature representation after user behavior aggregation to generate dynamic weights for sample-adaptive convolution and aggregation of user search query features respectively.
[0092] The trained click-through rate prediction model can be directly applied to feature-based modeling and user-behavior-sequence-based modeling problems to handle the problem of inaccurate click-through rate estimation.
[0093] Please refer to Figure 4 , which shows the flow 400 of an embodiment of the method for predicting click-through rate provided by this disclosure. The method for predicting click-through rate may include the following steps:
[0094] Step 401. Obtain the user information, product information, and user historical behavior of the user.
[0095] In this embodiment, the execution entity of the method for predicting click-through rate (such as Figure 1 the server 105 shown) can obtain the user information, product information, and user historical behavior of the user in various ways. For example, the execution entity can obtain the user information, product information (information to be recommended), and user historical behavior stored therein from the database server (such as Figure 1 the database server 104 shown) through a wired connection method or a wireless connection method. For another example, the execution entity can also receive the terminal (such as Figure 1The log information collected by the shown terminals 101, 102) or other devices, as well as the product information to be recommended.
[0096] In this embodiment, the product information can be the information of any product to be recommended, such as the product information displayed on an e-commerce platform.
[0097] Step 402: Input the user information, product information, and the user's historical behavior into a click-through rate prediction model to obtain the predicted click-through rate value of the user for the product.
[0098] In this embodiment, the executing entity can input the user information, product information, and the user's historical behavior obtained in step 401 into the click-through rate prediction model, so as to generate the predicted click-through rate value of the user for the product. The recommended ranking of the product information can be generated according to the predicted click-through rate value of the user for the product. For example, the higher the predicted value, the higher the priority of recommendation to the user, and the products with predicted values lower than the recommendation threshold are not recommended to the user.
[0099] During the prediction process, the click-through rate prediction model will still adjust the weights and biases of the 4 dynamically parameterized layers according to the user information, product information, and the user's historical behavior.
[0100] In this embodiment, the click-through rate prediction model can be generated by using the method described in the above Figure 2 embodiment. The specific generation process can refer to the relevant description of the Figure 2 embodiment and will not be elaborated here.
[0101] It should be noted that the method for predicting the click-through rate in this embodiment can be used to test the click-through rate prediction models generated in the above embodiments. Furthermore, the click-through rate prediction model can be continuously optimized according to the test results. This method can also be the actual application method of the click-through rate prediction models generated in the above embodiments. Using the click-through rate prediction models generated in the above embodiments to perform click-through rate prediction helps to improve the accuracy and success rate of information recommendation.
[0102] In some optional implementation manners of this embodiment, the method further includes: selecting a predetermined number of products in descending order of the predicted click-through rate values of the products; pushing the product information of the selected products to the user. The prediction of the click-through rate can be used for information recommendation to pre-judge the products that the user may click and make targeted recommendations, thereby improving the hit rate of information recommendation.
[0103] In some alternative implementation manners of this embodiment, the method further includes: during the process of predicting the click-through rate, adjusting the weights and biases of at least one of the following dynamically parameterized layers in the click-through rate prediction model according to the user information, the product information, and the user's historical behavior: the domain-based dynamically parameterized layer, the user-behavior-based dynamically parameterized layer, the search-behavior-based dynamically parameterized layer, and the feature-based dynamically parameterized layer. The specific adjustment process is as Figures 3a - 3h shown, which has been elaborated above, so it will not be repeated here. Dynamically adding new samples for retraining the model further improves the accuracy of model prediction.
[0104] In some alternative implementation manners of this embodiment, the method further includes: obtaining the product information clicked by the user as a click label; calculating a loss value according to the click label and the click-through rate prediction value; and adjusting the network parameters of the click-through rate prediction model according to the loss value. After recommending a product to the user, the product information clicked by the user is the true value, which can be used as a click label, equivalent to adding new samples and retraining the model, further improving the accuracy of model prediction.
[0105] In some alternative implementation manners of this embodiment, the method further includes: obtaining the product information clicked by the user and adding it to the user's historical behavior. This can increase the number of samples without manual operation, reducing both labor costs and improving the accuracy of the model.
[0106] Continue to refer to Figure 5 , as an implementation of the method shown above Figure 2 , this disclosure provides an embodiment of an apparatus for training a click-through rate prediction model. This apparatus embodiment corresponds to the method embodiment shown in Figure 2 , and this apparatus can be specifically applied to various electronic devices.
[0107] As Figure 5As shown in the figure, the device 500 for training a click-through rate prediction model according to this embodiment may include: an acquisition unit 501 and a training unit 502. Among them, the acquisition unit 501 is configured to acquire a training sample set and a click-through rate prediction model. Each training sample includes user information, commodity information, a user behavior sequence, and a click label. The click-through rate prediction model includes a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, and a first fully connected layer. The training unit 502 is configured to perform the following training steps: select a target training sample from the training sample set; input the user information and commodity information of the target training sample into the first representation embedding layer to obtain a sparse category vector; input the user behavior sequence of the target training sample into the second representation embedding layer to obtain a user behavior vector; input the sparse category vector into the domain-based dynamic parameterization layer of the click-through rate prediction model to generate a first weight and a first bias, and linearly transform the sparse category vector according to the first weight and the first bias to obtain a first output result; input the user behavior vector into the user behavior-based dynamic parameterization layer to generate a second weight and a second bias, and perform convolution on the user behavior vector according to the second weight and the second bias to obtain a second output result; perform click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value; calculate a loss value according to the predicted value and the click label of the target training sample; if the loss value is less than a predetermined threshold, determine that the training of the click-through rate prediction model is completed.
[0108] In some alternative implementation manners of this embodiment, the device further includes an adjustment unit 503, which is configured to: if the loss value is greater than or equal to the predetermined threshold, adjust the network parameters of the click-through rate prediction model, and continue to perform the above training steps.
[0109] In some alternative implementation manners of this embodiment, the click-through rate prediction model further includes a dynamically parameterized layer based on search behavior, a first multi-head attention layer, a second multi-head attention layer, and a second fully connected layer; and the training unit 502 is further configured to: input the user behavior vector into the first multi-head attention layer to obtain a first attention result; use the weighted sum of the first attention result and the second output result as a first weighted result; input the sparse category vector into the second fully connected layer to obtain a query vector; input the first weighted result and the query vector into the dynamically parameterized layer based on search behavior to generate a third weight and a third bias, and linearly transform the query vector according to the third weight and the third bias to obtain a third output result; input the first weighted result and the query vector into the second multi-head attention layer to obtain a second attention result; use the weighted sum of the second attention result and the third output result as a second weighted result; perform click-through rate prediction through a first fully connected layer based on the first output result and the second weighted result to obtain a predicted value.
[0110] In some alternative implementation manners of this embodiment, the click-through rate prediction model further includes a dynamically parameterized layer based on features and a third fully connected layer; and the training unit 502 is further configured to: select a context vector from the sparse category vector; linearly project the first output result to a low dimension through the third fully connected layer and then splice it with the second weighted result to obtain a spliced result; input the spliced result and the context vector into the dynamically parameterized layer based on features to generate a fourth weight and a fourth bias, and linearly transform the spliced result according to the fourth weight and the fourth bias to obtain a fourth output result; input the fourth output result into the first fully connected layer to obtain a predicted value of the click-through rate.
[0111] In some alternative implementation manners of this embodiment, the click-through rate prediction model further includes a dynamically parameterized layer based on features and a third fully connected layer; and the training unit 502 is further configured to: select a context vector from the sparse category vector; linearly project the first output result to a low dimension through the third fully connected layer to obtain a projected result; input the projected result and the context vector into the dynamically parameterized layer based on features to generate a fourth weight and a fourth bias, and linearly transform the spliced result according to the fourth weight and the fourth bias to obtain a fourth output result; input the fourth output result into the first fully connected layer to obtain a predicted value of the click-through rate.
[0112] In some alternative implementation manners of this embodiment, the domain-based dynamic parameterization layer includes: a first pooling layer, a first weight generation layer, and a first sample adaptive affine layer, and the user behavior-based dynamic parameterization layer includes: a second pooling layer, a second weight generation layer, and a second sample adaptive convolution layer.
[0113] In some alternative implementation manners of this embodiment, the search behavior-based dynamic parameterization layer includes: a third pooling layer, a third weight generation layer, and a third sample adaptive affine layer, and the feature-based dynamic parameterization layer includes: a fourth weight generation layer and a fourth sample adaptive affine layer.
[0114] Continue to refer to Figure 6 , as an implementation of the method shown above Figure 4 , the present disclosure provides an embodiment of an apparatus for predicting click-through rate. This apparatus embodiment corresponds to the method embodiment shown in Figure 4 , and this apparatus can be specifically applied to various electronic devices.
[0115] As Figure 6 shown, the apparatus 600 for predicting click-through rate in this embodiment may include: an acquisition unit 601 and a prediction unit 602. Among them, the acquisition unit 601 is configured to acquire user information, commodity information, and user historical behavior of a user; the prediction unit 602 is configured to input the user information, the commodity information, and the user historical behavior into a click-through rate prediction model trained according to the method described in any item of the first aspect, so as to obtain a click-through rate prediction value of the user for the commodity.
[0116] In some alternative implementation manners of this embodiment, the apparatus 600 further includes a recommendation unit (not shown in the drawings), which is configured to: select a predetermined number of commodities in descending order of the click-through rate prediction values of the commodities; push the commodity information of the selected commodities to the user.
[0117] In some alternative implementation manners of this embodiment, the apparatus 600 further includes an adjustment unit (not shown in the drawings), which is configured to: adjust the weights and biases of at least one of the following dynamic parameterization layers in the click-through rate prediction model according to the user information, the commodity information, and the user historical behavior during the process of predicting the click-through rate: the domain-based dynamic parameterization layer, the user behavior-based dynamic parameterization layer, the search behavior-based dynamic parameterization layer, and the feature-based dynamic parameterization layer.
[0118] In some alternative implementation manners of this embodiment, the apparatus further includes an adjustment unit (not shown in the drawings), which is configured to: acquire the commodity information clicked by the user as a click label; calculate a loss value according to the click label and the click-through rate prediction value; adjust the network parameters of the click-through rate prediction model according to the loss value.
[0119] In some alternative implementations of this embodiment, the obtaining unit 601 is further configured to: obtain the product information clicked by the user and add it to the user's historical behavior.
[0120] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0121] An electronic device includes: one or more processors; a storage device storing one or more computer programs thereon, and when the one or more computer programs are executed by the one or more processors, the one or more processors implement the method as described in process 200.
[0122] A computer-readable medium stores a computer program thereon, wherein the computer program, when executed by a processor, implements the method as described in process 200.
[0123] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement the embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementations of the present disclosure described and / or claimed herein.
[0124] As Figure 7 shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0125] Multiple components in device 700 are connected to I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disc, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0126] The computing unit 701 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 executes the various methods and processes described above, such as the method for training a click-through rate prediction model. For example, in some embodiments, the method for training a click-through rate prediction model can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method for training a click-through rate prediction model described above can be executed. Alternatively, in other embodiments, the computing unit 701 can be configured to execute the method for training a click-through rate prediction model in any other suitable way (e.g., by means of firmware).
[0127] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0128] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when executed by the processor or controller, the program codes cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0129] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0130] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0131] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0132] A computer system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology. The server can be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.
[0133] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this is not limited herein.
[0134] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for training a click-through rate prediction model, comprising: Obtain a training sample set and a click-through rate prediction model. Each training sample includes user information, product information, a user behavior sequence, and a click label. The click-through rate prediction model includes a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user behavior-based dynamic parameterization layer, a first fully connected layer, a search behavior-based dynamic parameterization layer, a first multi-head attention layer, a second multi-head attention layer, and a second fully connected layer; Perform the following training steps: Select a target training sample from the training sample set; Input the user information and product information of the target training sample into the first representation embedding layer to obtain a sparse category vector; Input the user behavior sequence of the target training sample into the second representation embedding layer to obtain a user behavior vector; Input the sparse category vector into the domain-based dynamic parameterization layer to generate a first weight and a first bias, and linearly transform the sparse category vector according to the first weight and the first bias to obtain a first output result; Input the user behavior vector into the user behavior-based dynamic parameterization layer to generate a second weight and a second bias, and convolve the user behavior vector according to the second weight and the second bias to obtain a second output result; Perform click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value; Calculate a loss value according to the predicted value and the click label of the target training sample; If the loss value is less than a predetermined threshold, determine that the training of the click-through rate prediction model is completed; Among them, performing click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value includes: Input the user behavior vector into the first multi-head attention layer to obtain a first attention result; Use the weighted sum of the first attention result and the second output result as the first weighted result; Input the sparse category vector into the second fully connected layer to obtain a query vector; Input the first weighted result and the query vector into the search behavior-based dynamic parameterization layer to generate a third weight and a third bias, and linearly transform the query vector according to the third weight and the third bias to obtain a third output result; Input the first weighted result and the query vector into the second multi-head attention layer to obtain a second attention result; Use the weighted sum of the second attention result and the third output result as the second weighted result; Perform click-through rate prediction through the first fully connected layer based on the first output result and the second weighted result to obtain a predicted value.
2. The method according to claim 1, wherein, The method further includes: If the loss value is greater than or equal to the predetermined threshold, adjust the network parameters of the click-through rate prediction model and continue to execute the above training steps.
3. The method according to claim 1, wherein, The click-through rate prediction model further includes a feature-based dynamic parameterization layer, a third fully connected layer, and a third embedding representation layer; and Performing click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value includes: Select context information from the user information and product information; Input the context information into the third embedding representation layer to obtain a context vector; Linearly project the first output result through the third fully connected layer to a low dimension and concatenate it with the second weighted result to obtain a concatenated result; Input the concatenated result and the context vector into a feature-based dynamic parameterization layer to generate a fourth weight and a fourth bias, and linearly transform the concatenated result according to the fourth weight and the fourth bias to obtain a fourth output result; Input the fourth output result into the first fully connected layer to obtain a predicted value of the click-through rate.
4. The method according to claim 1, wherein, The click-through rate prediction model further includes a feature-based dynamic parameterization layer, a third fully connected layer, and a third embedding representation layer; And Using the first output result and the second output result to predict the click-through rate through the first fully connected layer to obtain a predicted value, including: Select context information from the user information and the product information; Input the context information into the third embedding representation layer to obtain a context vector; Linearly project the first output result and the second output result through the third fully connected layer to a low dimension to obtain a projected result; Input the projected result and the context vector into a feature-based dynamic parameterization layer to generate a fourth weight and a fourth bias, and linearly transform the projected result according to the fourth weight and the fourth bias to obtain a fourth output result; Input the fourth output result into the first fully connected layer to obtain a predicted value of the click-through rate.
5. The method according to claim 1, wherein, The domain-based dynamic parameterization layer includes: a first pooling layer, a first weight generation layer, and a first sample adaptive affine layer. The user behavior-based dynamic parameterization layer includes: a second pooling layer, a second weight generation layer, and a second sample adaptive convolutional layer.
6. The method according to claim 3, wherein, The search behavior-based dynamic parameterization layer includes: a third pooling layer, a third weight generation layer, and a third sample adaptive affine layer. The feature-based dynamic parameterization layer includes: a fourth weight generation layer and a fourth sample adaptive affine layer.
7. A method for predicting click-through rate, comprising: Obtain the user's user information, product information, and user historical behavior; Input the user information, the product information, and the user historical behavior into the click-through rate prediction model trained according to the method of any one of claims 1-6 to obtain a predicted value of the user's click-through rate on the product.
8. The method according to claim 7, the method further comprising: Select a predetermined number of products in descending order of the predicted click-through rate of the products; Push the product information of the selected products to the user.
9. The method according to claim 7, the method further comprising: During the prediction of the click-through rate, adjust the weights and biases of at least one of the following dynamic parameterization layers in the click-through rate prediction model according to the user information, the product information, and the user historical behavior: the domain-based dynamic parameterization layer, the user behavior-based dynamic parameterization layer, the search behavior-based dynamic parameterization layer, and the feature-based dynamic parameterization layer.
10. The method according to claim 8, the method further comprising: Obtain the product information clicked by the user as a click label; Calculate a loss value according to the click label and the predicted click-through rate value; Adjust the network parameters of the click-through rate prediction model according to the loss value.
11. The method according to claim 8, the method further comprising: Obtain the product information clicked by the user and add it to the user's user historical behavior.
12. An apparatus for training a click-through rate prediction model, comprising: An acquisition unit configured to acquire a training sample set and a click-through rate prediction model, where each training sample includes user information, product information, a user behavior sequence, and a click label, and the click-through rate prediction model includes a first representation embedding layer, a second representation embedding layer, a domain-based dynamic parameterization layer, a user-behavior-based dynamic parameterization layer, a first fully connected layer, a search-behavior-based dynamic parameterization layer, a first multi-head attention layer, a second multi-head attention layer, and a second fully connected layer; A training unit configured to perform the following training steps: select a target training sample from the training sample set; input the user information and product information of the target training sample into the first representation embedding layer to obtain a sparse category vector; input the user behavior sequence of the target training sample into the second representation embedding layer to obtain a user behavior vector; input the sparse category vector into the domain-based dynamic parameterization layer to generate a first weight and a first bias, and linearly transform the sparse category vector according to the first weight and the first bias to obtain a first output result; input the user behavior vector into the user-behavior-based dynamic parameterization layer to generate a second weight and a second bias, and convolve the user behavior vector according to the second weight and the second bias to obtain a second output result; perform click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value; calculate a loss value according to the predicted value and the click label of the target training sample; if the loss value is less than a predetermined threshold, determine that the training of the click-through rate prediction model is completed; wherein performing click-through rate prediction through the first fully connected layer based on the first output result and the second output result to obtain a predicted value includes: inputting the user behavior vector into the first multi-head attention layer to obtain a first attention result; using the weighted sum of the first attention result and the second output result as a first weighted result; inputting the sparse category vector into the second fully connected layer to obtain a query vector; inputting the first weighted result and the query vector into the search-behavior-based dynamic parameterization layer to generate a third weight and a third bias, and linearly transform the query vector according to the third weight and the third bias to obtain a third output result; inputting the first weighted result and the query vector into the second multi-head attention layer to obtain a second attention result; using the weighted sum of the second attention result and the third output result as a second weighted result; performing click-through rate prediction through the first fully connected layer based on the first output result and the second weighted result to obtain a predicted value.
13. An apparatus for predicting click-through rate, comprising: An acquisition unit configured to acquire user information, product information, and user historical behavior of a user; A prediction unit configured to input the user information, the product information, and the user historical behavior into the click-through rate prediction model trained by the method according to any one of claims 1-6 to obtain a click-through rate predicted value of the user for the product.
14. An electronic device, comprising: One or more processors; A storage device having stored thereon one or more computer programs, When the one or more computer programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-11.
15. A computer-readable medium, having a computer program stored thereon, wherein, When the computer program is executed by a processor, the method according to any one of claims 1-11 is implemented.
Citation Information
Patent Citations
Advertisement click-through rate prediction method and system based on neural network
CN113706211A