A method for estimating advertisement click rate based on user preference
By constructing user long-term and short-term preference subnets, preference drift subnets and preference fusion subnets, and combining multi-head attention mechanisms and compression-stimulation attention mechanisms, user preference characteristics are learned, which solves the problem of difficulty in utilizing user preference information in existing technologies. , which improves the accuracy of advertising click-through rate estimation and the versatility of the model.
Patent Information
- Application Number
- CN202011605515.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-12-29
AI Technical Summary
Existing advertising click-through rate prediction methods are difficult to make full use of user preference information, especially long-term and short-term preferences and preference drift characteristics, resulting in poor click-through rate prediction results.
A click-through rate estimation method based on user preferences is used to construct user long-term and short-term preference subnetworks, preference drift subnetworks and preference fusion subnetworks. It combines the multi-head attention mechanism and the compression-stimulation attention mechanism to learn fine-grained multi-dimensional information through deep neural networks. Dimensional preference characteristics achieve complementarity and preference fusion of long- and short-term preference characteristics.
It improves the accuracy of click-through rate prediction, can simultaneously consider global long-term and local short-term preferences, automatically learns user preference features, reduces dependence on feature engineering, saves human resources and improves the versatility of the model.
Smart Images

Figure CN112700274B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation systems, and more specifically, to a method for estimating advertisement click rate based on user preference. Background Art
[0002] Click-through rate estimation is a key link in advertising and recommendation. In the field of online advertising, click-through rate estimation is the ratio of ad clicks to ad delivery, which measures the probability of an ad being clicked by a user. Its accuracy is directly related to the user experience of the platform and the revenue of the online advertising platform, and has extremely important research value. The preference information reflected in a series of behaviors such as click-to-buy greatly affects whether a user will click on an advertised product.
[0003] At present, there are two main methods for estimating the click-through rate of advertisements. One is based on traditional machine learning methods for click-through rate estimation, such as logistic regression, gradient boosting tree, factor decomposition machine, etc. These methods are difficult to learn high-order interactive relationships between features and are highly dependent on domain knowledge and feature engineering. The other is based on deep learning methods for click-through rate estimation. Currently, this type of method mainly designs new structures from the perspective of improving the model's feature representation and interaction capabilities, uses DNN to model high-order features, and improves the model's feature representation capabilities through the combination of low-order and high-order features, such as Wide&Deep, DeepFM, PNN, DSTN, etc.
[0004] These methods focus on improving the model's ability to learn low-order and high-order features and their interactions, but ignore the effect of improving click-through rate prediction from the perspective of mining user preferences, making it difficult to fully utilize the user preference information implicit in the behavior sequence. The few methods proposed from the perspective of preference learning, such as DIN and DIEN, have the disadvantages of only considering local short-term preferences or the preference learning structure is too primitive. The current click-through rate prediction methods also lack in-depth exploration and utilization of the diverse and multidimensional characteristics and drift characteristics of user preferences. Summary of the invention
[0005] In response to the deficiencies of the above-mentioned prior art, the present invention provides an advertisement click-through rate prediction method based on user preferences, which can not only simultaneously learn global long-term historical preferences and local short-term historical preferences to achieve the complementarity of long-term and short-term preference features, but also extract fine-grained and multi-dimensional preference drift features and preference fusion features, thereby effectively improving the accuracy of click-through rate prediction.
[0006] The purpose of the present invention is achieved by at least one of the following technical solutions.
[0007] A method for estimating an advertisement click rate based on user preference, the method comprising the following steps:
[0008] S1. Collect user ad click records and user and ad attribute data from the commercial platform, and sort them in chronological order to obtain each user's ad click sequence;
[0009] S2. Preprocess the advertisement click sequence, perform exception processing on the click sequence that is insufficient in length or exceeds the specified length, and obtain a sequence training data set;
[0010] S3. Build a click rate prediction model based on the user preference network, including the construction of user long-term and short-term preference subnets, preference drift subnets, and preference fusion subnets;
[0011] S4, using the training data set obtained by preprocessing to iteratively train the click rate prediction model based on the user preference network;
[0012] S5. Input the user's complete advertisement click sequence, and use the trained click rate prediction model based on the user preference network to learn the user preference characteristics and obtain the click rate prediction result.
[0013] Furthermore, in step S1, the user advertisement click record includes the user ID number, the ID number of the advertisement product clicked to view and purchased, and the purchase time, which is used to record the advertisement products that the user has clicked to view and purchased; the user and advertisement corresponding attribute data includes the user's gender, user's age group, user platform level, advertisement product price, advertisement product evaluation level, and advertisement product sales volume.
[0014] Furthermore, the ad click sequence of each user is obtained by chronological order as follows:
[0015] Sort each user's purchase behavior by Unix timestamp;
[0016] You can write a program in Python to sort the collected data by Unix timestamp, or use Excel to sort by timestamp.
[0017] Further, step S2 includes the following steps:
[0018] S2.1. The embedding layer of the click rate prediction model needs to find the embedding vectors corresponding to the advertisement and the user according to the standardized index, establish new unified index numbers for all users and advertisements that have appeared in the advertisement click sequence, and map the user ID number and advertisement product ID number in the advertisement click sequence to the newly created index number;
[0019] S2.2. In order to facilitate the training of the click rate prediction model and ensure the effect of click rate prediction, the abnormal processing of the advertisement click sequence whose length does not meet the requirements is carried out: the advertisement click sequence whose length is less than the specified length a is eliminated, and the advertisement click sequence whose length exceeds the specified length b is truncated. The truncation method only retains the most recent advertisement click sequence and discards the part that is too old;
[0020] S2.3. For each user advertisement click sequence, assuming that the sequence includes n purchase behaviors, a≤n≤b, the first n-1 purchase behaviors and the nth purchase behavior are divided. When the click rate prediction model is subsequently trained, the click rate prediction model inputs the first n-1 purchase behaviors and uses the nth purchase behavior for supervision. After the training is completed, the complete user behavior sequence is input when the click rate prediction model makes predictions.
[0021] Furthermore, in step S3, the click rate prediction model based on the user preference network includes an input layer, an embedding layer, a user preference extraction layer, a feature fully connected layer and an output layer, which are specifically as follows:
[0022] The input layer input includes user ad click sequence, user attributes of click rate estimation and product attributes of click rate estimation; user ad click sequence is composed of index numbers of the ad products that users have clicked and purchased in chronological order; user attributes of click rate estimation include index number of click rate estimation user and user gender, age group and user platform level; product attributes of click rate estimation include index number of click rate estimation product that needs to be judged whether to recommend and product price, evaluation level and sales volume;
[0023] The embedding layer user ID number and advertisement product ID number map the user advertisement click sequence, the user attributes of click rate estimation and the product attributes of the input layer into a fixed-length, randomly initialized embedding vector;
[0024] The user preference extraction layer introduces two attention mechanisms, Multi-Head Attention and Squeeze-and-Excitation Attenton (SE Attention), into the three designed preference subnetworks. It learns the user's long-term and short-term preferences, drift preferences, and fusion preferences based on the Gated Recurrent Unit (GRU) and the Gated Recurrent Unit with Preference Attention Gate (PAGRU).
[0025] The fully connected layer concatenates the long-term and short-term preference features, drift preference features, and fusion preference features with the embedding vectors obtained by mapping the user ID number and the advertising product ID number in the embedding layer, and the feature vectors corresponding to the additional attributes of the user and the advertising product obtained by one-hot encoding embedding, and learns the high-order interaction relationship between the features through a fully connected neural network (Fully Connected Neural Network, FNN) based on a multi-layer perceptron (Multi-Layer Perceptron, MLP);
[0026] The output layer uses the Softmax function to obtain the click rate estimation result.
[0027] Furthermore, in the input layer, the index number of the advertising product that constitutes the user's advertising click sequence, the index number of the click-through rate estimated user, and the index number of the click-through rate estimated product are the most basic input data and cannot be missing; other user and product attributes are additional attributes. In practice, if these additional attributes cannot be collected, you can choose not to input them, which will not affect the operation of the click-through rate prediction model and the verification of its effectiveness.
[0028] Furthermore, the user preference extraction layer includes a long-term and short-term preference subnet, a preference drift subnet, and a preference fusion subnet; the specific construction steps of the user preference extraction layer are as follows:
[0029] S3.1. Build a long-term and short-term preference subnet based on GRU: Input the user ad click sequence converted by the embedding layer into the GRU unit in sequence. The hidden state vector of each time step of the GRU unit is regarded as the user's historical preference vector at different times, reflecting the user's historical preference information at different times, i.e., each time step. The output of the GRU unit at the last step is the extracted short-term preference representation, and the long-term preference representation is composed of the output of all time steps of GRU. After obtaining the user's long-term and short-term preference representation, use Multi-Head Attention to model the multi-dimensional relationship between the user's long-term and short-term preferences and the advertising products in different subspaces, and extract fine-grained and multi-dimensional long-term and short-term preference features in different dimensions.
[0030] S3.2. Build a preference drift subnet based on PAGRU units: The preference drift subnet receives the hidden state vector of the GRU unit in the long-term and short-term preference subnet at each time step, i.e., the historical preference vector and the user ad click sequence as input, and extracts the preference drift feature by using PAGRU to fuse the user ad click behavior at time t and the preference context information learned by the long-term and short-term preference subnet at time t-1 in a differential combination manner;
[0031] S3.3. Build a preference fusion network based on the compression-activation structure in SE Attention: The preference fusion network receives the long-term and short-term preference features and preference drift features extracted by the long-term and short-term preference extraction network and the preference drift network as input, uses global average pooling to compress multiple preference features into a single channel, and performs preference fusion through the FNN with a double-layer bottleneck structure to learn the complex interaction relationship between multiple features across channels and obtain preference fusion features.
[0032] Furthermore, in step S3.2, the PAGRU unit designs a preference attention gate to control the influence of the preference context information on the drift preference and activate or inhibit the preference context information. The calculation method is as follows:
[0033] a t =sigm(W pa p t-1 +W ha h t-1 +b a ); (1)
[0034] r t =sigm(W xr x t +W hr h t-1 +W pr (a t ⊙p t-1 )+b r ); (2)
[0035] z t =sigm(W xz x t +W hz h t-1 +W pz (a t ⊙p t-1 )+b z ); (3)
[0036]
[0037]
[0038] Among them, h t is the hidden state of PAGRU at time t, representing the drift preference calculated at time t; p t -1 is the user preference information at time t-1, a t is the preferred attention gate at time t, x t represents the embedding vector of the item purchased by the user at time t, r tis the reset gate, z t It is the update gate. is a candidate state, W pa and W ha 、b a They are the two parameter matrices and bias terms of the preference drift subnet corresponding to the preference attention gate, W xr , W hr , W pr 、b r They are the three parameter matrices and bias terms of the reset gate corresponding to the preference drift subnet, W xz , W hz , W pz 、b z They are the three parameter matrices and bias terms of the update gate corresponding to the preference drift subnet, W xh , W hh , W ph 、b h are the three parameter matrices and bias terms of the preference drift subnetwork corresponding to the candidate states, sigm and tanh are the sigmoid and tanh activation functions respectively; ⊙ is the vector dot multiplication operation.
[0039] Further, step S4 is specifically as follows:
[0040] The entire training data set is divided into a training set and a test set in a ratio of 9:1, and the negative log-likelihood function is used as the loss function of the click-through rate prediction model, as shown in formula (6):
[0041]
[0042] in, is the entire training set, which includes N training data corresponding to N users, x = [x u ,x b ,x a ]belong Represents each training data, x u ,x b ,x a They represent CTR estimated user index, ad click sequence, CTR estimated product index, ad click sequence x b =[b1,b2,…,b n ], where b n represents the index of the product that the user clicked to purchase in the nth purchase behavior, y belongs to {0,1}, indicating whether the user clicked on the CTR estimated product, and p(x) represents the probability of the user clicking on the CTR estimated product predicted by the model;
[0043] At the same time, an auxiliary term is added to the loss function, using the ad clicked at time t+1 in the click sequence of user i. The preference representation of user i extracted by the supervised long-term and short-term preference subnet at time t At time t+1, randomly negatively sample an ad that user i did not click at time t+1 Calculate separately and and The inner product of The click probability of the user is calculated, and the negative log-likelihood loss of the click probability is calculated, that is, formula (7):
[0044]
[0045] Where σ represents the activation sigmoid function. The overall loss function is shown in formula (8):
[0046] L=L target +α*L aux ; (8)
[0047] Where α is a hyperparameter used to balance the weight of auxiliary preference learning loss and CTR estimation loss.
[0048] Furthermore, step S5 specifically includes the following steps:
[0049] S5.1. Input the user's entire click sequence, which is mapped into a low-dimensional dense vector by the embedding layer;
[0050] S5.2, Multi-head Attention is introduced through the long-term and short-term preference subnet and the preference drift subnet to extract the long-term and short-term preference features and the preference drift features;
[0051] S5.3, introduce SE Attention through the preference fusion subnet to extract preference fusion features;
[0052] S5.4. The long-term and short-term preference features, preference drift features, preference fusion features, and other attribute features of users and products are integrated in the fully connected feature layer, and the final click rate prediction result is obtained in the output layer through the MLP-based FNN network.
[0053] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0054] 1. This invention mines user preferences that have an important impact on CTR estimation based on user ad click sequences. It not only considers the impact of global long-term preferences and local short-term preferences at the same time to achieve long-term and short-term preference complementarity, but also proposes and designs preference drift modeling based on PAGRU and preference fusion based on SE Attention. At the same time, Multi-head Attention is used to extract fine-grained and multi-dimensional preference features, thereby effectively improving the accuracy of click-through rate estimation.
[0055] 2. The present invention adopts a method based on deep neural network to construct a model. The model can automatically learn effective user preference features and model the complex interaction relationship between multiple features with the help of deep neural network. It does not rely on costly feature engineering and has the advantages of saving human resources, reducing costs and high versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is an overall flow chart of an embodiment of the present invention.
[0057] Figure 2 The figure is an overall architecture diagram of a click rate prediction model based on a user preference network according to an embodiment of the present invention.
[0058] Figure 3 This is a diagram of the long-term and short-term preference subnet structure for implementing the present invention.
[0059] Figure 4 This is a structural diagram of the preferred drift subnet PAGRU according to an embodiment of the present invention.
[0060] Figure 5 This is a diagram of the preferred fusion subnet structure of an embodiment of the present invention.
[0061] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings. DETAILED DESCRIPTION
[0062] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments, but the implementation manner of the present invention is not limited thereto.
[0063] Example:
[0064] A method for estimating the click-through rate of advertisements based on user preferences, such as Figure 1 As shown, the following steps are included:
[0065] S1. Collect user ad click records and user and ad attribute data from the commercial platform, and sort them in chronological order to obtain each user's ad click sequence;
[0066] The user advertisement click record includes the user ID number, the ID number of the advertisement product clicked to view and purchased, and the purchase time, and is used to record the advertisement products that the user has clicked to view and purchased; the user and advertisement corresponding attribute data includes the user's gender, user's age group, user platform level, advertisement product price, advertisement product evaluation level, and advertisement product sales volume.
[0067] The ad click sequence of each user is sorted in chronological order as follows:
[0068] Sort each user's purchase behavior by Unix timestamp;
[0069] You can write a program in Python to sort the collected data by Unix timestamp, or use Excel to sort by timestamp.
[0070] This embodiment collects 1,689,187 records and sorts out the click behavior sequences of 192,403 users.
[0071] S2. Preprocessing the advertisement click sequence. In this embodiment, the specified length is set to 4, the limited length is set to 100, and abnormal processing is performed on the click sequence whose length is insufficient or exceeds the limited length to obtain a sequence training data set, including the following steps:
[0072] S2.1. The embedding layer of the click rate prediction model needs to find the embedding vectors corresponding to the advertisement and the user according to the standardized index, establish new unified index numbers for all users and advertisements that have appeared in the advertisement click sequence, and map the user ID number and advertisement product ID number in the advertisement click sequence to the newly created index number;
[0073] S2.2. In order to facilitate the training of the click-through rate prediction model and ensure the effect of click-through rate prediction, the abnormal handling of the advertisement click sequence that does not meet the length requirement is carried out: the advertisement click sequence with a length less than the specified length of 4 is filtered out, and the advertisement click sequence with a length exceeding the specified length of 100 is truncated. The truncation method only retains the first 100 advertisement click products that occurred recently, and discards the ones that are too old;
[0074] S2.3. For each user advertisement click sequence, assuming that the sequence includes n purchase behaviors, 4≤n≤100, the first n-1 purchase behaviors and the nth purchase behavior are divided. When the click rate prediction model is subsequently trained, the click rate prediction model inputs the first n-1 purchase behaviors and uses the nth purchase behavior for supervision. After the training is completed, the complete user behavior sequence is input when the click rate prediction model makes predictions.
[0075] S3. Build a click rate prediction model based on the user preference network, including the construction of user long-term and short-term preference subnets, preference drift subnets, and preference fusion subnets;
[0076] like Figure 2 As shown, the click rate prediction model based on the user preference network includes an input layer, an embedding layer, a user preference extraction layer, a feature fully connected layer and an output layer, as follows:
[0077] The input layer input includes user ad click sequence, user attributes of click rate estimation and product attributes of click rate estimation; user ad click sequence is composed of index numbers of the ad products that users have clicked and purchased in chronological order; user attributes of click rate estimation include index number of click rate estimation user and user gender, age group and user platform level; product attributes of click rate estimation include index number of click rate estimation product that needs to be judged whether to recommend and product price, evaluation level and sales volume;
[0078] Among the inputs of the input layer, the index numbers of the advertising products that constitute the user's advertising click sequence, the index numbers of the users with estimated click-through rates, and the index numbers of the products with estimated click-through rates are the most basic input data and cannot be missing. Other user and product attributes are additional attributes. In practice, if these additional attributes cannot be collected, you can choose not to input them, which will not affect the operation of the click-through rate prediction model and the verification of its effectiveness.
[0079] The embedding layer user ID number and advertisement product ID number map the user advertisement click sequence, the user attribute of click rate estimation and the product attribute of the input layer into a fixed-length, randomly initialized embedding vector. In this embodiment, the embedding vector length of the user and advertisement product is uniformly set to 36;
[0080] In this embodiment, the user and product additional attributes are encoded using a one-hot encoding method. For the user gender and the evaluation level of the advertisement product in the additional attributes, the one-hot encoding is used to embed them into a fixed-length feature vector. For example, the feature vector "01" indicates that the gender is male, and the feature vector "10" indicates that the gender is female. For the user age group, user platform level, advertisement product price, and advertisement product sales volume in the additional attributes, the intervals are divided and the one-hot encoding is also used to embed them into a fixed-length feature vector. For example, the product price in the range of 1-100, 100-1000, 1000-10000, and above 10000 is represented by the feature vectors "1000", "0100", "0010", and "0001" respectively.
[0081] The user preference extraction layer introduces two attention mechanisms, Multi-Head Attention and Squeeze-and-Excitation Attenton (SE Attention), into the three designed preference subnetworks. The user's long-term and short-term preferences, drift preferences, and fusion preferences are learned based on the Gated Recurrent Unit (GRU) and the Gated Recurrent Unit with Preference Attention Gate (PAGRU). In this embodiment, the number of attention heads of the Multi-Head Attention hyperparameter is set to 4.
[0082] The user preference extraction layer includes a long-term and short-term preference subnet, a preference drift subnet, and a preference fusion subnet. The specific construction steps of the user preference extraction layer are as follows:
[0083] S3.1. Build a long-term and short-term preference subnet based on GRU: The user ad click sequence converted by the embedding layer is input into the GRU unit in sequence. The hidden state vector of each time step of the GRU unit is regarded as the user's historical preference vector at different times, reflecting the user's historical preference information at different times, i.e., each time step. The output of the GRU unit at the last step is the extracted short-term preference representation, and the long-term preference representation is composed of the output of all time steps of GRU. After obtaining the user's long-term and short-term preference representation, the multi-dimensional relationship between the user's long-term and short-term preferences and the advertising products is modeled in different subspaces with the help of Multi-Head Attention, and the fine-grained and multi-dimensional long-term and short-term preference features in different dimensions are extracted. The structure of the long-term and short-term preference subnet is shown in the attached figure. Figure 3 As shown; the extraction algorithms of long-term and short-term preference features are shown in Table 1 and Table 2 respectively.
[0084] Table 1 Short-term preference feature extraction algorithm based on Multi-Head Attention
[0085]
[0086]
[0087] Table 3-2 Long-term preference feature extraction algorithm based on Multi-Head Attention
[0088]
[0089] S3.2. Build a preference drift subnet based on PAGRU units: The preference drift subnet receives the hidden state vector of the GRU unit in the long-term and short-term preference subnet at each time step, i.e., the historical preference vector and the user ad click sequence as input, and extracts the preference drift feature by using PAGRU to fuse the user ad click behavior at time t and the preference context information learned by the long-term and short-term preference subnet at time t-1 in a differential combination manner;
[0090] like Figure 4 As shown, the PAGRU unit designs a preference attention gate to control the influence of preference context information on drift preference and activate or inhibit the preference context information. The calculation method is as follows:
[0091] a t =sigm(W pa p t-1 +W ha h t-1 +b a ); (1)
[0092] r t =sigm(W xr x t +W hr h t-1 +W pr (a t ⊙p t-1 )+b r ); (2)
[0093] z t =sigm(W xz x t +W hz h t-1 +W pz (a t ⊙p t-1 )+b z ); (3)
[0094]
[0095]
[0096] Among them, h t is the hidden state of PAGRU at time t, representing the drift preference calculated at time t; p t -1 is the user preference information at time t-1, a t is the preferred attention gate at time t, x t represents the embedding vector of the item purchased by the user at time t, r t is the reset gate, z t It is the update gate. is a candidate state, W pa and W ha 、b a They are the two parameter matrices and bias terms of the preference drift subnet corresponding to the preference attention gate, W xr , W hr , W pr 、b r They are the three parameter matrices and bias terms of the reset gate corresponding to the preference drift subnet, W xz , W hz , W pz 、b z They are the three parameter matrices and bias terms of the update gate corresponding to the preference drift subnet, W xh , W hh , W ph 、b h are the three parameter matrices and bias terms of the preference drift subnetwork corresponding to the candidate states, sigm and tanh are the sigmoid and tanh activation functions respectively; ⊙ is the vector dot multiplication operation.
[0097] S3.3. Build a preference fusion network based on the compression-activation structure in SE Attention: The preference fusion network receives the long-term and short-term preference features and preference drift features extracted by the long-term and short-term preference extraction network and the preference drift network as input, uses global average pooling to compress multiple preference features into a single channel, and performs preference fusion through a double-layer bottleneck structure FNN to learn the complex interaction relationship between multiple features across channels and obtain preference fusion features. The preference fusion subnet structure is as follows: Figure 5 shown.
[0098] The fully connected layer concatenates the long-term and short-term preference features, drift preference features, and fusion preference features with the embedding vectors obtained by mapping the user ID number and the advertising product ID number in the embedding layer, and the feature vectors corresponding to the additional attributes of the user and the advertising product obtained by one-hot encoding embedding, and learns the high-order interaction relationship between the features through a fully connected neural network (Fully Connected Neural Network, FNN) based on a multi-layer perceptron (Multi-Layer Perceptron, MLP);
[0099] The output layer uses the Softmax function to obtain the click rate estimation result.
[0100] S4. The training data set obtained by preprocessing is used to iteratively train the click rate prediction model based on the user preference network, as follows:
[0101] In this embodiment, the training parameter Epoch is set to 3, the Batch size is set to 128, the optimization algorithm is Adam, the initial learning rate is set to 0.001, and the learning rate decays to half of the original after each epoch training. The entire training data set is divided into a training set and a test set at a ratio of 9:1, and the negative log-likelihood function is used as the loss function of the click-through rate prediction model, as shown in formula (6):
[0102]
[0103] in, is the entire training set, which includes N training data corresponding to N users, x = [x u ,x b ,x a ]belong Represents each training data, x u ,x b ,x a They represent CTR estimated user index, ad click sequence, CTR estimated product index, ad click sequence x b =[b1,b2,…,b n ], where b n represents the index of the product that the user clicked to purchase in the nth purchase behavior, y belongs to {0,1}, indicating whether the user clicked on the CTR estimated product, and p(x) represents the probability of the user clicking on the CTR estimated product predicted by the model;
[0104] At the same time, an auxiliary term is added to the loss function, using the ad clicked at time t+1 in the click sequence of user i. The preference representation of user i extracted by the supervised long-term and short-term preference subnet at time t At time t+1, randomly negatively sample an ad that user i did not click at time t+1 Calculate separately and and The inner product of The click probability of the user is calculated, and the negative log-likelihood loss of the click probability is calculated, that is, formula (7):
[0105]
[0106] Where σ represents the activation sigmoid function. The overall loss function is shown in formula (8):
[0107] L=L target +α*L aux ; (8)
[0108] Where α is a hyperparameter used to balance the weight of auxiliary preference learning loss and CTR estimation loss. In this embodiment, α is set to 0.5.
[0109] S5. Input the user's complete ad click sequence, use the trained click rate prediction model based on the user preference network to learn the user preference features, and obtain the click rate prediction result, which specifically includes the following steps:
[0110] S5.1. Input the user's entire click sequence, which is mapped into a low-dimensional dense vector with a fixed length of 36 by the embedding layer;
[0111] S5.2, Multi-head Attention is introduced through the long-term and short-term preference subnet and the preference drift subnet to extract the long-term and short-term preference features and the preference drift features;
[0112] S5.3, introduce SE Attention through the preference fusion subnet to extract preference fusion features;
[0113] S5.4. The long-term and short-term preference features, preference drift features, preference fusion features, and other attribute features of users and products are integrated in the fully connected feature layer, and the final click rate prediction result is obtained in the output layer through the MLP-based FNN network.
[0114] This embodiment uses the Tensorflow 1.2 open source platform, the programming language Python 3.5, and the GPU acceleration components are CUDA 8.0 and cuDNN 7.0.5 to build and train the model. When running this embodiment, the graphics card must have more than 5G of allocatable video memory.
[0115] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for estimating the click-through rate of advertisements based on user preferences. It is characterized in that The following steps are involved: S1. Collect user ad click records and user and ad corresponding attribute data in the commercial platform, and sort them in chronological order to obtain each user's ad click sequence; the user ad click record includes the user ID number, the ad product ID number clicked and purchased, and the purchase time, which is used to record the ad products that the user has clicked and purchased; the user and ad corresponding attribute data includes the user's gender, user age group, user platform level, ad product price, ad product evaluation level, and ad product sales volume; S2, preprocessing the advertisement click sequence, performing exception processing on the click sequence whose length is insufficient or exceeds the specified length, and obtaining a sequence training data set; comprising the following steps: S2.
1. Create new unified index numbers for all users and advertisements that have appeared in the advertisement click sequence, and map the user ID numbers and advertisement product ID numbers in the advertisement click sequence to the newly created index numbers; S2.
2. Exception handling of advertisement click sequences that do not meet the length requirements: remove advertisement click sequences whose length is less than the specified length a, and truncate advertisement click sequences whose length exceeds the specified length b; S2.3, for each user advertisement click sequence, assuming that the sequence includes n purchase behaviors, a≤n≤b, the first n-1 purchase behaviors and the nth purchase behavior are divided, and the first n-1 purchase behaviors are input into the click rate estimation model during the subsequent click rate estimation model training, and the nth purchase behavior is used as supervision. After the training is completed, the complete user behavior sequence is input into the click rate estimation model for prediction; S3. Construct a click rate prediction model based on the user preference network, including the construction of the user's long-term and short-term preference subnet, the preference drift subnet, and the preference fusion subnet; the click rate prediction model based on the user preference network includes an input layer, an embedding layer, a user preference extraction layer, a feature fully connected layer, and an output layer, as follows: The input layer input includes user ad click sequence, user attributes of click rate estimation and product attributes of click rate estimation; user ad click sequence is composed of index numbers of the ad products that users have clicked and purchased in chronological order; user attributes of click rate estimation include index number of click rate estimation user and user gender, age group and user platform level; product attributes of click rate estimation include index number of click rate estimation product that needs to be judged whether to recommend and product price, evaluation level and sales volume; The embedding layer maps the user ad click sequence, the user attributes of the click rate estimation and the product attributes inputted by the input layer into a fixed-length, randomly initialized embedding vector according to the user ID number and the ad product ID number; The user preference extraction layer introduces two attention mechanisms, Multi-Head Attention and Squeeze-Excite Attention, into the three designed preference subnetworks. The gated recurrent unit GRU and the gated recurrent unit PAGRU with fused preference attention gate learn the user's long-term and short-term preferences, drift preferences, and fusion preferences. The feature fully connected layer concatenates the long-term and short-term preference features, drift preference features, and fusion preference features with the embedding vectors obtained by mapping the user ID number and the advertising product ID number in the embedding layer, and the feature vectors corresponding to the additional attributes of the user and the advertising product obtained by using one-hot encoding embedding, and learns the high-order interaction relationship between the features through the fully connected neural network FNN based on the multi-layer perceptron MLP; The output layer uses the Softmax function to obtain the click rate estimation result; The user preference extraction layer includes a long-term and short-term preference subnet, a preference drift subnet, and a preference fusion subnet. The specific construction steps of the user preference extraction layer are as follows: S3.
1. Build a long-term and short-term preference subnet based on GRU: Input the user ad click sequence converted by the embedding layer into the GRU unit in sequence. The hidden state vector of each time step of the GRU unit is regarded as the user's historical preference vector at different times, reflecting the user's historical preference information at different times, i.e., each time step. The output of the GRU unit at the last step is the extracted short-term preference representation, and the long-term preference representation is composed of the output of all time steps of GRU. After obtaining the user's long-term and short-term preference representation, use Multi-Head Attention to model the multi-dimensional relationship between the user's long-term and short-term preferences and the advertising products in different subspaces, and extract fine-grained and multi-dimensional long-term and short-term preference features in different dimensions. S3.
2. Build a preference drift subnet based on PAGRU units: The preference drift subnet receives the hidden state vector of the GRU unit in the long-term and short-term preference subnet at each time step, i.e., the historical preference vector and the user ad click sequence as input, and extracts the preference drift feature by using PAGRU to fuse the user ad click behavior at time t and the preference context information learned by the long-term and short-term preference subnet at time t-1 in a differential combination manner; The PAGRU unit designs a preference attention gate to control the influence of preference context information on drift preference and activate or inhibit the preference context information. The calculation method is as follows: (1) (2) (3) (4) (5) in, yes The hidden state of PAGRU at this moment represents The drift preference calculated at every moment; yes User preference information at all times, yes The preferred attention gate of the moment, represent The embedding vector of the item purchased by the user at that moment, It is the reset gate. It is the update gate. is the candidate state, and , They are the two parameter matrices and bias terms of the preference drift subnet corresponding to the preference attention gate, , , , They are the three parameter matrices and bias terms of the reset gate corresponding to the preference drift subnet, , , , They are the three parameter matrices and bias terms of the update gate corresponding to the preference drift subnet, , , , They are the three parameter matrices and bias items corresponding to the candidate states of the preference drift subnet, , They are , Activation function; It is the vector dot multiplication operation; S3.
3. Build a preference fusion network based on the compression-activation structure in SE Attention: The preference fusion network receives the long-term and short-term preference features and preference drift features extracted by the long-term and short-term preference extraction network and the preference drift network as input, uses global average pooling to compress multiple preference features into a single channel, and performs preference fusion through the FNN with a double-layer bottleneck structure, learns the complex interaction relationship between multiple features across channels, and obtains preference fusion features; S4, using the training data set obtained by preprocessing to iteratively train the click rate prediction model based on the user preference network; S5. Input the user's complete advertisement click sequence, and use the trained click rate prediction model based on the user preference network to learn the user preference characteristics and obtain the click rate prediction result.
2. The method for estimating the click rate of advertisements based on user preferences according to claim 1, It is characterized in that The ad click sequence of each user is sorted in chronological order as follows: Sort each user's purchase behavior by Unix timestamp; You can write a program in Python to sort the collected data by Unix timestamp, or use Excel to sort by timestamp.
3. The method for estimating the click rate of advertisements based on user preferences according to claim 2, It is characterized in that Among the inputs of the input layer, the index numbers of the advertising products that constitute the user's advertising click sequence, the index numbers of the users with estimated click-through rates, and the index numbers of the products with estimated click-through rates are the most basic input data and cannot be missing. Other user and product attributes are additional attributes. In practice, if these additional attributes cannot be collected, you can choose not to input them, which will not affect the operation of the click-through rate prediction model and the verification of its effectiveness.
4. The method for estimating the click rate of advertisements based on user preferences according to claim 1, It is characterized in that Step S4 is specifically as follows: The entire training data set is divided into a training set and a test set in a ratio of 9:1, and the negative log-likelihood function is used as the loss function of the click-through rate prediction model, as shown in formula (6): (6) in, is the entire training set, including The training data corresponds to Users, belong , represents each training data, They represent CTR estimated user index, ad click sequence, CTR estimated product index, and ad click sequence respectively. ,in Indicates the index of the product that the user clicked to purchase in the nth purchase behavior. belong Indicates whether the user clicked on the CTR estimated product. It indicates the probability of a user clicking on a CTR-estimated product as predicted by the model; At the same time, an auxiliary term is added to the loss function, using the click sequence of user i Ads that click all the time Supervising the long-term and short-term preference subnetwork The user i preference representation extracted at time ,exist Random negative sampling at a moment Ads that user i did not click at time , respectively calculated and , and The inner product of The activation function is converted to user i , The click probability of the user is calculated, and the negative log-likelihood loss of the click probability is calculated, that is, formula (7): (7) in Indicates activation Function; the overall loss function is shown in formula (8): (8) in It is a hyperparameter used to balance the weight of auxiliary preference learning loss and CTR estimation loss.
5. According to any one of claims 1 to 4, a method for estimating the click rate of advertisements based on user preferences, It is characterized in that Step S5 specifically includes the following steps: S5.
1. Input the user's entire click sequence, which is mapped into a low-dimensional dense vector by the embedding layer; S5.2, Multi-head Attention is introduced through the long-term and short-term preference subnet and the preference drift subnet to extract the long-term and short-term preference features and the preference drift features; S5.3, introduce SE Attention through the preference fusion subnet to extract preference fusion features; S5.
4. The long-term and short-term preference features, preference drift features, preference fusion features, and other attribute features of users and products are integrated in the fully connected feature layer, and the final click rate prediction result is obtained in the output layer through the MLP-based FNN network.
