Initialization method and device of user ID Embedding, equipment and medium
Through the clustering comparison learning method, the ID embedding of new users is initialized by using the convergence value of historical users, which solves the cold start problem of user ID embedding in the recommendation system, and improves the model training efficiency and the accuracy of recommended results.
Patent Information
- Application Number
- CN202411185603.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-31
AI Technical Summary
The random initialization method of user ID embedding in the existing recommendation system leads to cold start problems, resulting in slow convergence speed of model training and lack of effective initial values, which affects the accuracy of the recommendation results.
Through clustering analysis, new users are divided into target user categories, and the convergence value of historical users is used to initialize the ID embedding of new users. It provides a cold-start user ID embedding initialization method based on cluster comparison learning, using the SwAV model for Vector representation and clustering processing of user feature information to determine the initial ID embedding value of new users.
It improves the prior information content of the initial value of the new user ID embedding, shortens the model training time, improves the accuracy of the recommended results and the utilization efficiency of user training sample data, and solves the cold start problem.
Smart Images

Figure CN119226824A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation systems, and in particular to a method, device, equipment and medium for initializing user ID Embedding (vector embedding representation). Background Art
[0002] Modeling recommendation models based on ID (Identifier) embedding (vector embedding representation) has become the most mainstream paradigm in the field of recommendation systems. Currently, almost all existing recommendation deep model series are modeled based on ID features. When modeling deep recommendation models, user ID features are one of the most important features in the recommendation model features. The advantage of using user ID as a feature is that the recommendation system can better understand users based on various historical behavior data of user IDs, better characterize user characteristics, and make better personalized recommendations. We know that to apply user ID features to recommendation models, it is necessary to embed their vectors, that is, to represent them with an embedding vector. However, learning a good embedding vector requires a large amount of data for training. For new users, they have almost no or very little behavior data, and face serious cold start user ID embedding problems; the existing user ID embedding parameter initialization technology basically adopts random initialization. Its implementation is very simple, that is, random parameter initialization. The use of random initialization generally takes into account the data distribution of random parameters. If it is not considered, it will easily lead to parameter gradient explosion and gradient disappearance problems. There are usually two random initialization data distribution methods: Gaussian distribution: the parameters are randomly initialized with a Gaussian distribution with a fixed mean and a fixed variance; uniform distribution: the parameters are initialized with a uniform distribution in an interval [-r, r]. The setting of the hyperparameter r can be adjusted according to the dimension of the neuron data.
[0003] In the process of implementing the present invention, the applicant found that the initial value of the user ID embedding obtained by random initialization or initialization with a fixed initial value has a cold start phenomenon during business model training, which leads to the problem of slow convergence speed of business model training, which has become one of the technical problems that need to be urgently solved in the prior art. Summary of the invention
[0004] The embodiments of the present invention provide a method, apparatus, device and medium for initializing a user ID Embedding (ID vector embedding representation), which solves the problem that the initial value of the user ID embedding obtained by random initialization or initialization with a fixed initial value has a cold start phenomenon during business model training, thereby causing the business model training to converge slowly.
[0005] To achieve the above-mentioned purpose, in a first aspect, an embodiment of the present invention provides a method for initializing a user ID Embedding, comprising:
[0006] Obtain user feature information of new users;
[0007] According to the user characteristic information of the new user, determining the target user category to which the new user belongs in at least one preset user category; wherein the at least one user category is obtained by pre-clustering a plurality of historical users based on similarity of user characteristic information;
[0008] A preset number of historical users corresponding to the target user category are obtained, and an initial value of the ID Embedding of the new user is determined based on the convergence values of the ID Embeddings of the preset number of historical users; wherein the initial value of the ID Embedding of the new user is used to input a first business model to learn the user feature information of the new user, so as to obtain a convergence value of the ID Embedding of the new user.
[0009] In a second aspect, an embodiment of the present invention provides a user ID vector embedding representation Embedding initialization device, comprising:
[0010] A user information acquisition unit, used to acquire user characteristic information of a new user;
[0011] A user category determination unit, configured to determine, based on the user feature information of the new user, a target user category to which the new user belongs in at least one preset user category; wherein the at least one user category is obtained by performing a cluster analysis on a plurality of historical users based on similarity of user feature information in advance;
[0012] A vector initial value determination unit is used to obtain a preset number of historical users from the historical users corresponding to the target user category, and determine the initial value of the ID Embedding of the new user according to the convergence value of the ID Embedding of the preset number of historical users; wherein the initial value of the ID Embedding of the new user is used to input the first business model to learn the user feature information of the new user, so as to obtain the convergence value of the ID Embedding of the new user.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, adapted to execute various instructions; and
[0014] The storage device is suitable for storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor and include the initialization method of the user ID Embedding as described above.
[0015] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor including an initialization method for user ID Embedding as described above.
[0016] The above technical solution has the following beneficial effects: finding a historical user group that is similar to the new user, and determining the initial value of the new user's ID Embedding through the convergence value of the user ID Embedding of the corresponding historical user group, so that the initial value of the new user's ID Embedding is no longer meaningless and random, but has obtained certain prior information related to the new user from the historical user group that is similar to the new user. When the initial value of the ID Embedding of the new user with prior information is used in the first business model, such as the recommendation business model, the convergence speed of the model training is faster than that of the initial value parameters obtained by random initialization, less user training sample data is required, and the accuracy of the recommendation results generated for new users is also better. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flowchart of a method for initializing a user ID Embedding according to one embodiment of the present invention;
[0019] Figure 2 It is a schematic diagram of the architecture of a user ID Embedding initialization device according to one embodiment of the present invention;
[0020] Figure 3 It is a flow diagram of the SwAV model clustering initialization user ID Embedding according to one embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] First, as Figure 1 As shown, an embodiment of the present invention provides a method for initializing a user ID vector embedding representation Embedding, including:
[0023] Step S10, obtaining user characteristic information of the new user;
[0024] Step S11, determining a target user category to which the new user belongs in at least one preset user category according to the user feature information of the new user; wherein the at least one user category is obtained by performing a cluster analysis on a plurality of historical users based on similarity of user feature information in advance;
[0025] The at least one user category is obtained in advance by performing cluster analysis on a plurality of historical users based on similarity of user feature information, and the user category represents a cluster of users having similar user feature information;
[0026] Step S12, obtaining a preset number of historical users from the historical users corresponding to the target user category, and determining the initial value of the ID Embedding of the new user according to the convergence values of the ID Embeddings of the preset number of historical users; wherein the initial value of the ID Embedding of the new user is used to input the first business model to learn the user feature information of the new user, so that the value of the ID Embedding of the new user can converge faster than using a 0 value or a random value as an initial value, and obtain the convergence value of the ID Embedding of the new user; the convergence value of the ID Embedding of the new user is the embedding vector that best reflects the feature information of the new user; the initial value of the ID Embedding of the new user is the embedding vector that summarizes the feature information of the new user.
[0027] In some embodiments, the inventors have found that when the business model under the prior art inputs the user's ID Embedding, it is either set to a certain initial value such as 0, or initialized with a random value, resulting in the initial value of the user's ID Embedding not containing any user-related or business information. It is necessary to update the user's ID Embedding from blank when training the business model to establish an ID Embedding value related to the user or business. The prior art has low training efficiency and low accuracy. The existing user ID Embedding parameter random initialization technology only allows the ID Embedding parameter to obtain an initial value for iterative update training, which has no practical meaning and is not explainable. The quality of the obtained user ID Embedding initial value is also random and uncontrollable. A large amount of user behavior data is required to train and update it, and there is a cold start problem. Cold start means that data mining requires data accumulation, and the initial data of the product is empty or the amount of data is too small, resulting in the required amount of data not meeting the requirements. The inventor believes that the first step to solve the cold start user ID embedding problem is to select a suitable initial value for embedding. This step is very critical for user ID embedding parameter learning. The appropriate initial value can greatly shorten the training time of user ID embedding parameters, speed up the convergence speed of IDembedding, quickly reach the optimal solution state, and thus improve the prediction accuracy of the recommendation model. The inventor proposes a method for initializing user ID Embedding (vector embedding representation), specifically a cold start user ID Embedding initialization method based on clustering contrast learning. The user ID Embedding initial value is creatively calculated and assigned using the convergence value of historical users of the same type, so that it has some practical significance and can summarize the user's feature information, so it is more accurate than 0 or random values. The first business model can be any expert system or artificial intelligence model that uses user ID Embedding as a parameter for analysis and reasoning, specifically including but not limited to content recommendation models. The initial value of the user ID Embedding determined by this application obtains certain prior information about the new user from the historical user group that is close to the new user. When the initial value of the ID Embedding of the new user with prior information is applied to the first business model, the convergence speed of the user ID Embedding update is faster, the learning and training efficiency is higher, and the output result of the business model will be more accurate. New users include users who need to initialize the initial value of the ID Embedding.For users who need to initialize the initial value of ID Embedding, some user feature information can be obtained, including but not limited to gender, age group, initial interests selected by the user, and regional information corresponding to the login IP, etc. These user feature information reflects the user characteristics to a certain extent; user categories are characterized as user clusters with similar basic information. In theory, similar users also have certain similarities in their behaviors. Since the recommendation model (first business model) using the initial value of user ID Embedding learns parameters based on user behavior data, the convergence value of the ID Embedding of users in the same cluster can be used to initialize the initial value of the user ID Embedding, which is better than random initialization and learning from scratch. Categorize the crowd and classify similar people into one category. Similar people have certain similarities in their interests and behaviors, so it is inferred that their user ID Embedding also has similar information. For example, the user ID Embedding mean or other linear or nonlinear function mapping of the same cluster is used to obtain the initial value of the user ID Embedding, which can carry certain prior information, which can help the recommendation model accelerate the convergence speed of learning the user ID Embedding, and thus obtain better recommendation results. According to the user feature information of the user, the target user category to which the user belongs is determined in at least one preset user category. This ID Embedding parameter initialization method introduces the user's prior knowledge to select the initial value. Based on the fact that the user ID Embeddings of similar users also have certain similarities, the users are clustered to find a cluster group that belongs to the same user category as the user, and a certain mapping value of the user ID Embedding contained in the cluster group of this user category is used to initialize the initial value of the user's ID Embedding. The specific mapping method includes but is not limited to taking the mean, median, maximum value, minimum value, etc. of the user ID Embedding under the same user category, or fitting the user ID Embedding under the same user category through a specific function relationship to obtain the initial value of the user's ID Embedding.
[0028] The embodiments of the present invention have the following technical effects: finding a historical user group that is similar to a new user, and determining the initial value of the ID Embedding of the new user through the convergence value of the user ID Embedding of the corresponding historical user group, so that the initial value of the ID Embedding of the new user is no longer meaningless and random, but has obtained certain prior information related to the new user from the historical user group that is similar to the new user. When the initial value of the ID Embedding of the new user with prior information is used in the first business model, such as the recommendation business model, the convergence speed of the model training is faster than that of the initial value parameters obtained by the random initialization method, and less user training sample data is required. The accuracy of the recommendation results generated for the new user is also better, which can well solve the problem of the cold start user ID Embedding initialization step.
[0029] Furthermore, determining the initial value of the ID Embedding of the new user according to the convergence values of the ID Embeddings of the preset number of historical users includes:
[0030] The convergence values of the ID Embeddings of the preset number of historical users are averaged, and the obtained average is used as the initial value of the ID Embedding of the new user; the convergence values of the ID Embeddings of the historical users are pre-determined by the first business model.
[0031] In some embodiments, a preset number of historical users may be all or part of the historical users in the same user category as the new user. Using the mean of the convergence values of the ID Embeddings of a preset number of historical users as the initial value of the ID Embedding of the new user can ensure that the ID Embedding value of the new user meets most situations, and avoid the problem of reduced training effect caused by data bias when the subsequent first business model (such as a content recommendation model) uses the ID Embedding of the new user to continue training and prediction. The convergence value of the ID Embedding of the historical user is determined in advance by the first business model, so that the ID Embedding of the historical user can have the user feature information of the historical user, and can also have user-related information and business-related information at the same time as it is updated during the training or prediction process of the first business model. The initial value of the ID Embedding of the new user determined based on the convergence value of the ID Embedding of the historical user with user-related information and business-related information will also have user-related information and business-related information similar to those of the new user.
[0032] Further, determining, based on the user characteristic information of the new user, a target user category to which the new user belongs in at least one preset user category includes:
[0033] Vectorizing the user characteristic information of the new user to obtain a vector representation of the user characteristic information of the new user;
[0034] The vector representation of the user feature information of the new user is input into the first SwAV model for comparative clustering processing to obtain the target user category to which the new user belongs output by the first SwAV model.
[0035] In some embodiments, a pre-trained first SwAV model is used to classify new users. SwAV is a clustering contrast learning proposed based on image recognition. The core point of the SwAV model is to use the same picture to undergo data transformation (cropping, rotation, stretching and / or translation, etc.) to obtain two views, and then compare the codes of the views of the two views for contrast learning, so that the codes of different views of the same picture remain similar, thereby learning the prototype vector of each cluster center. The same picture is rotated, stretched and translated, and the essential content is consistent, but only visually different, so the clustering contrast learning method principle of SwAV has a good effect in image recognition. Conventionally, in crowd identification classification, user feature information such as gender, age group, initial interest selected by the user, and the corresponding region of the login IP are converted into a vector representation of the user feature information. It is impossible to physically or visually explain the meaning represented by the vector representation of the user feature information after rotation, stretching and translation transformation, and it does not have the meaning invariance that the content can be clearly expressed after the image is transformed. Therefore, in the common sense of technicians in the recommendation field or crowd identification field, the SwAV model is not considered suitable for crowd identification. The inventors overcame the above-mentioned common sense cognitive obstacles and applied the SwAV model to crowd identification, and found that the vector representation of user feature information is translated and transformed. After the transformation, the direction of the vector representation of user feature information remains unchanged, but the position changes differently. The vector representation of the transformed user feature information still has a high degree of similarity. The inventors proposed a user ID Embedding initialization method, which is also a cold start user ID Embedding initialization method. Users are classified based on the SwAV model, and the initial value of the new user's ID Embedding is obtained according to the ID Embedding convergence value mapping of historical users in the user category to which the new user belongs. When the first business model uses the ID Embedding of the new user for online recommendation and training, the speed at which the user ID Embedding parameters converge to a stable state can be accelerated. SwAV (Swapping Assignments between multiple Views of the same image) is an unsupervised comparative learning clustering method. SwAV is also an online learning algorithm that can be used for online training of models in recommendation systems. Its module network parameters can be learned in parallel with the parameters of the benchmark recommendation model. Figure 3 As shown, in some embodiments, the existing recommendation algorithm model learning and training process can be improved by adding a SwAV unsupervised contrastive learning clustering initialization user ID Embedding parameter module, and other process modules of the recommendation algorithm model can remain unchanged.
[0036] The embodiment of the present invention has the following technical effects: the newly used ID Embedding determined by the embodiment of the present invention is used for the subsequent recommendation model to compare the effect of the benchmark model using the random initialization method. The effect on new users (new users: within the past thirty days, the number of login days <4): the next-day retention rate of the recommendation model using the newly used ID Embedding determined by the embodiment of the present invention increases by 1.2%, the average number of reads per person increases by 3.95%, and the comparison of the Weibo platform is the average number of blog posts read per person. The click-through rate CTR increases by 3.7%, and the interaction rate, that is, the proportion of users forwarding comments and likes increases by 2.8%. The higher the average number of reads per person, the click-through rate, and the interaction rate, the more the recommended content is in line with the user's interests, which means that the recommendation model learns the user's idEmbedding more accurately. Among them, the next-day retention is a very important feature to measure the recommendation effect of new users. It means whether the user will log in again the next day after logging in on the same day. The higher the next-day retention, the better the recommendation effect, which can increase the user's stickiness to the platform and reduce user churn; the average number of reads per person is the average number of blog posts read per person.
[0037] Furthermore, the training method of the first business model includes:
[0038] Obtain user feature information and ID Embedding convergence values of multiple historical users;
[0039] Vectorizing the user feature information of each historical user to obtain a vector representation of the user feature information of each historical user;
[0040] Determine a training data set and a joint model, wherein each training data in the training data set includes a vector representation of user feature information of a historical user and a convergence value of ID Embedding, and the joint model consists of a second SwAV model and a second business model;
[0041] Iteratively train the joint model using the training data set until a convergence condition is met, and obtain the model parameters of the second SwAV model after training, the model parameters of the second business model after training, and the at least one user category output by the second SwAV model and the historical users corresponding to each user category;
[0042] Initializing the model parameters of the first SwAV model using the model parameters trained by the second SwAV model, and initializing the model parameters of the first business model using the model parameters trained by the second business model;
[0043] The first SwAV model and the second SwAV model have the same model structure; the first business model and the second business model have the same model structure.
[0044] In some embodiments, multiple historical users, user feature information of each historical user and a convergence value of ID Embedding are obtained; the user feature information of each historical user is vectorized to obtain a vector representation of the user feature information of each historical user; the vector representations of the user feature information of all historical users and the convergence value of ID Embedding are used as training data and input into a joint model consisting of a second SwAV model and a second business model, unsupervised iterative training is performed on the second SwAV model, the model parameters of the second SwAV model are updated, supervised training is performed on the second business model, the model parameters of the second business model are updated, until the second business model converges, and the trained model parameters of the second SwAV model, the trained model parameters of the second business model, and the at least one user category output by the second SwAV model and the at least one historical user corresponding to each user category are obtained; the model parameters of the first SwAV model are initialized using the trained model parameters of the second SwAV model, and the model parameters of the first business model are initialized using the trained model parameters of the second business model; wherein the first SwAV model and the second SwAV model have the same model structure; and the first business model and the second business model have the same model structure.
[0045] Further, the joint model is iteratively trained using the training data set until a convergence condition is met, and the model parameters of the second SwAV model after training, the model parameters of the second business model after training, and the at least one user category output by the second SwAV model and the historical users corresponding to each user category are obtained, including:
[0046] All training data in the training data set are input into a joint model consisting of a second SwAV model and a second business model, unsupervised iterative training is performed on the second SwAV model, model parameters of the second SwAV model are updated, supervised training is performed on the second business model, model parameters of the second business model are updated until the second business model converges, and model parameters of the second SwAV model after training, model parameters of the second business model after training, and at least one user category output by the second SwAV model and historical users corresponding to each user category are obtained.
[0047] Further, the joint model is iteratively trained using the training data set until a convergence condition is met, and the model parameters of the second SwAV model after training, the model parameters of the second business model after training, and the at least one user category output by the second SwAV model and the historical users corresponding to each user category are obtained, including:
[0048] Dividing all training data in the training data set into multiple training batches, and selecting a training batch from the multiple training batches as a target training batch;
[0049] From the historical users corresponding to the target training batch, a number of historical users are randomly selected as target new users corresponding to the target training batch, and the remaining historical users are used as target historical users corresponding to the target training batch.
[0050] Inputting the vector representation of the user feature information of the target historical users corresponding to the target training batch into the second SwAV model, obtaining all user categories corresponding to the target training batch and the target historical users corresponding to each user category output by the second SwAV model, obtaining the clustering cross entropy loss based on the enhanced representation of the target historical users corresponding to the target training batch and each class center prototype vector, determining the update gradient of the second SwAV model parameters by the cross entropy loss, and updating the model parameters of the second SwAV model by the gradient descent method; the enhanced representation and the class center prototype vector are automatically generated inside the second SwAV model according to the input training data;
[0051] Inputting the vector representation of the user feature information of each target new user corresponding to the target training batch into the second SwAV model after updating the parameters, and obtaining the output user category of each target new user;
[0052] Obtaining a convergence value of the ID embedding of each target historical user having the same user category as each target new user in the target training batch;
[0053] Determine the initial value of the ID embedding of each target new user according to the acquired convergence value of the ID embedding of each target historical user corresponding to each target new user;
[0054] The initial value of the ID embedding of each target new user is used as the initialization vector of the ID embedding of the target new user required to be input to the second business model, and the specific business to which the ID embedding of the target new user is applied is trained through the second business model to obtain a business estimate value corresponding to the business target of the specific business output by the second business model, and a loss function value used by the second business model is determined based on the business estimate value and the corresponding business target value, and an update gradient of the second business model is determined according to the loss function value, and the model parameters of the second business model are updated using the gradient descent method; the business estimate value output by the second business model represents the convergence value of the ID embedding of the target new user;
[0055] Determining whether the second service model converges;
[0056] If the second business model has not converged, a new training batch is selected from the multiple training batches as a target training batch, and the process returns to the step of randomly selecting a number of historical users from the historical users corresponding to the target training batch as target new users corresponding to the target training batch, and taking the remaining historical users as target historical users corresponding to the target training batch;
[0057] If the second business model converges, it is confirmed that the convergence conditions are met, and all user categories corresponding to the current target training batch and the target historical users corresponding to each user category are respectively used as the at least one user category and the historical users corresponding to each user category output by the second SwAV model, and the model parameters of the current second SwAV model are used as the model parameters of the second SwAV model after training, and the current model parameters of the second business model are used as the model parameters of the second business model after training.
[0058] In some embodiments, some basic user feature information can be obtained for new users when they register for the APP, such as gender, age group, initial interests selected by the user, and geographical information corresponding to the login IP, etc. This information reflects the user characteristics to a certain extent, and this information can be used to perform SwAV unsupervised clustering on users, and group similar people into the same cluster (user category). Since the model training is based on batch training batches, SwAV unsupervised clustering can be performed on users in a batch, and it can be known which cluster the new user belongs to, and then the user ID Embedding under this cluster is averaged, and this mean is used as the initial value of the new user ID Embedding. The initial value of the target new user ID Embedding is obtained in the above manner, and the input of the second business model includes the initial value of the ID embedding of each target new user and the vector representation of the corresponding user feature information.
[0059] The following describes how to use the SwAV algorithm to implement ID Embedding initialization steps:
[0060] Set the training batch size to 1024, the number of categories required for clustering by the SwAV model to 100, and first set the initial value of the new user's ID Embedding to 0 for placeholder.
[0061] When training the model, the model input feature embedding layer extracts the vector representations corresponding to the user age, gender, IP region, and interest feature slot in a batch, and then concatenates these vector representations. This concatenated vector is used as the user's cluster representation (the vector representation of the user's feature information), and then input into the SwAV model for cluster learning training. The online learning process of the SwAV algorithm model is as follows:
[0062] Step 1: Through the pre-set feature filter, the vector representations of the features required by the SwAV algorithm model (such as user age, gender, IP region, and interest features) are extracted from the samples in the batch and spliced together as the vector representation of the user's user feature information. Then, the vector representation of each user feature information is transformed to obtain two data-enhanced user representation vectors x1 and x2. SwAV clusters the data in the batch online based on the Sinkhorn-Knopp algorithm for the two enhanced representation vectors. By matching and comparing with the k category prototype vectors, it is determined which user category the enhanced representation vector belongs to.
[0063] Step 2: Calculate the Loss by comparing the enhanced representation with the central prototype vector of each user category, and return the gradient to update the SwAV network parameters. The calculated Loss is the cross entropy loss, which is expressed as follows:
[0064]
[0065] where c k is the prototype vector of the k-th cluster center, q j For x i The prediction vector is obtained through the Sinkhorn-Knopp algorithm.
[0066] Finally, this SwAV algorithm model will calculate the probability that the user belongs to 100 clusters through the softmax function. We take the class corresponding to the maximum cluster probability as the cluster to which the user belongs.
[0067] For new users, the pre-trained SwAV model can be used to learn the cluster (user category) corresponding to the new user, extract the user ID Embedding of the cluster (user category) described by the new user in a batch, calculate the average, and use the obtained mean to update the new user ID Embedding.
[0068] The embodiments of the present invention have the following technical effects: the random initialization method of user ID Embedding in the prior art is random and uncontrollable in selecting the initial value, requires a large amount of user behavior data to train and update it, and has a slow parameter convergence speed. By using the online SwAV unsupervised clustering algorithm, a group similar to the new user is found, and the mean of the group user ID Embedding corresponding to the new user is calculated to initialize the ID Embedding parameters of the new user. This initialization is no longer random, and the initialization ID Embedding value selected already has certain user prior information. The convergence speed of the initial value parameters obtained by the random initialization method is faster, so less single user training sample data is required, and the accuracy of the recommendation results generated for new users is also better.
[0069] Furthermore, the user feature information of the new user is vectorized to obtain a vector representation of the user feature information of the new user, including:
[0070] Vectorizing all user information included in the user characteristic information of the new user into corresponding vector representations; the user characteristic information includes: at least one user information;
[0071] The vector representations corresponding to all user information are concatenated to obtain the vector representation of the user characteristic information of the new user. The user information includes but is not limited to age, gender, IP region and / or interest characteristics.
[0072] Second, as Figure 2 As shown, an embodiment of the present invention provides an initialization device for embedding a user ID vector, including:
[0073] The user information acquisition unit 200 is used to acquire user characteristic information of a new user;
[0074] A user category determination unit 201 is used to determine, according to the user feature information of the new user, a target user category to which the new user belongs in at least one preset user category; wherein the at least one user category is obtained by performing a cluster analysis on a plurality of historical users based on similarity of user feature information in advance;
[0075] The vector initial value determination unit 202 is used to obtain a preset number of historical users from the historical users corresponding to the target user category, and determine the initial value of the ID Embedding of the new user according to the convergence values of the ID Embeddings of the preset number of historical users; wherein the initial value of the ID Embedding of the new user is used to input the first business model to learn the user feature information of the new user, so that the value of the ID Embedding of the new user can converge faster than using a 0 value or a random value as an initial value, thereby obtaining the convergence value of the ID Embedding of the new user; the convergence value of the ID Embedding of the new user is the embedding vector that best reflects the feature information of the new user; the initial value of the ID Embedding of the new user is the embedding vector that summarizes the feature information of the new user.
[0076] Furthermore, the vector initial value determination unit is used to average the convergence values of ID Embedding of the preset number of historical users, and use the obtained average as the initial value of ID Embedding of the new user; the convergence value of ID Embedding of the historical users is determined in advance by the first business model.
[0077] Furthermore, the user category determination unit includes:
[0078] A user information vectorization module, used to vectorize the user feature information of the new user to obtain a vector representation of the user feature information of the new user;
[0079] User category determination module, used to
[0080] The vector representation of the user feature information of the new user is input into the first SwAV model for comparative clustering processing to obtain the target user category to which the new user belongs output by the first SwAV model.
[0081] Furthermore, the device also includes a training unit for the first business model;
[0082] The training unit of the first business model includes:
[0083] The historical user acquisition module is used to obtain the user feature information of multiple historical users and the convergence value of ID Embedding;
[0084] A historical user vectorization module, used to vectorize the user feature information of each historical user to obtain a vector representation of the user feature information of each historical user;
[0085] A model training module is used to determine a training data set and a joint model, wherein each training data in the training data set includes a vector representation of user feature information of a historical user and a convergence value of ID Embedding, and the joint model is composed of a second SwAV model and a second business model; the joint model is iteratively trained using the training data set until a convergence condition is met, and the model parameters of the second SwAV model after training, the model parameters of the second business model after training, and the at least one user category output by the second SwAV model and the historical users corresponding to each user category are obtained;
[0086] A model parameter updating module, used to initialize the model parameters of the first SwAV model using the model parameters trained by the second SwAV model, and to initialize the model parameters of the first business model using the model parameters trained by the second business model;
[0087] The first SwAV model and the second SwAV model have the same model structure; the first business model and the second business model have the same model structure.
[0088] Furthermore, the model training module is configured as follows:
[0089] All training data in the training data set are input into a joint model consisting of a second SwAV model and a second business model, unsupervised iterative training is performed on the second SwAV model, model parameters of the second SwAV model are updated, supervised training is performed on the second business model, model parameters of the second business model are updated until the second business model converges, and model parameters of the second SwAV model after training, model parameters of the second business model after training, and at least one user category output by the second SwAV model and historical users corresponding to each user category are obtained.
[0090] Furthermore, the model training module includes:
[0091] A training batch division and selection module, used to divide all training data in the training data set into multiple training batches, and select one training batch from the multiple training batches as a target training batch;
[0092] A user division module, used to randomly select a number of historical users from the historical users corresponding to the target training batch as target new users corresponding to the target training batch, and use the remaining historical users as target historical users corresponding to the target training batch;
[0093] A SwAV model training module, used for inputting the vector representation of the user feature information of the target historical users corresponding to the target training batch into the second SwAV model, obtaining all the user categories corresponding to the target training batch and the target historical users corresponding to each user category output by the second SwAV model, obtaining the clustering cross entropy loss based on the enhanced representation of the target historical users corresponding to the target training batch and each class center prototype vector, determining the update gradient of the second SwAV model parameters by the cross entropy loss, and updating the model parameters of the second SwAV model by the gradient descent method; the enhanced representation and the class center prototype vector are automatically generated inside the second SwAV model according to the input training data;
[0094] A target new user classification module, used for inputting the vector representation of the user feature information of each target new user corresponding to the target training batch into the second SwAV model after the parameter update, and obtaining the user category of each target new user as output;
[0095] A module for acquiring similar historical users, used to acquire the convergence value of the ID embedding of each target historical user having the same user category as each target new user in the target training batch;
[0096] A target new user vector representation initial value determination module is used to determine the initial value of the ID embedding of each target new user according to the acquired convergence value of the ID embedding of each target historical user corresponding to each target new user;
[0097] A business model training module, used to use the initial value of the ID embedding of each target new user as the initialization vector of the ID embedding of the target new user required to be input by the second business model, train the specific business that applies the ID embedding of the target new user through the second business model, obtain the business estimate value corresponding to the business goal of the specific business output by the second business model, and determine the loss function value used by the second business model based on the business estimate value and the corresponding business goal value, determine the update gradient of the second business model according to the loss function value, and update the model parameters of the second business model using the gradient descent method; the business estimate value output by the second business model represents the convergence value of the ID embedding of the target new user;
[0098] A convergence judgment module, used to judge whether the second service model converges;
[0099] A new batch training triggering module, configured to select a new training batch from the multiple training batches as a target training batch and trigger the user segmentation module if the second business model has not converged;
[0100] A training result output module is used to confirm that the convergence conditions are met if the second business model converges, and use all user categories corresponding to the current target training batch and the target historical users corresponding to each user category as the at least one user category and the historical users corresponding to each user category output by the second SwAV model, respectively, and use the model parameters of the current second SwAV model as the model parameters of the second SwAV model after training, and use the current model parameters of the second business model as the model parameters of the second business model after training.
[0101] Furthermore, the user information vectorization module is configured to: vectorize all user information included in the user feature information of the new user into corresponding vector representations; splice the vector representations corresponding to all user information to obtain the vector representation of the user feature information of the new user; wherein the user feature information includes: at least one type of user information.
[0102] The embodiments of the present invention are device-type embodiments that correspond one-to-one to the aforementioned method embodiments. The embodiments of the present invention can be understood based on the aforementioned method-type embodiments, and will not be described in detail here.
[0103] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a processor, suitable for executing various instructions; and a storage device, suitable for storing multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor including the initialization method of the user ID Embedding as described above.
[0104] The embodiment of the present invention is an electronic device embodiment for loading and executing the corresponding aforementioned method embodiment. The embodiment of the present invention can be understood based on the corresponding aforementioned method embodiment and will not be described in detail here.
[0105] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor including an initialization method for user ID Embedding as described above.
[0106] The embodiment of the present invention is an embodiment of a computer-readable storage medium for storing instructions corresponding to the aforementioned corresponding methods. The embodiment of the present invention can be understood based on the aforementioned corresponding method embodiments, and will not be described in detail here.
[0107] The above technical solution of the embodiment of the present invention is described in detail below in conjunction with specific application examples. For technical details not introduced during the implementation process, please refer to the relevant description in the previous text.
[0108] The clustering contrast learning algorithm used in the cold start user ID Embedding parameter initialization method based on the clustering contrast learning method proposed in the embodiment of the present invention is the SwAV (Swapping Assignments between multiple Views of the same image) unsupervised contrast learning clustering method. SwAV is an online learning algorithm that can be well matched to the online training of the model in the recommendation system. Its module network parameters can be learned in parallel with the benchmark recommendation model parameters. The improvement of the existing recommendation algorithm model learning and training process in this application is to add the SwAV unsupervised contrast learning clustering initialization user ID Embedding parameter module.
[0109] For new users, we can obtain some basic user information (user characteristic information) when they register the APP, including but not limited to gender, age group, initial interests selected by the user, and geographical information corresponding to the login IP, etc. This information reflects the user characteristics to a certain extent. We can use this information to perform SwAV unsupervised clustering on users and classify similar people into the same cluster. Since the model training is based on batches, SwAV unsupervised clustering can be performed on users within a batch to find out which cluster the new user belongs to, and then the convergence values of the user IDembedding under this cluster are averaged, and this average is used as the initial value of the new user ID Embedding. The following mainly introduces the steps of how to use the SwAV algorithm to implement id Embedding initialization:
[0110] Step 1: Set the training batch size to 1024, the number of categories that SwAV needs to cluster to 100, and set the initial value of the new user's ID Embedding to 0 for placeholder.
[0111] Step 2: When training the model, the model input feature vector embedding representation layer is used to extract the user age, gender, IP region, and interest features in a batch to generate corresponding vector representations. Then, the vector representations corresponding to these features are concat-joined and the concatenated vector is used as the user's cluster representation (vector representation of user feature information). Then, it is input into the SwAV algorithm model for cluster learning training. The online learning process of the SwAV algorithm model is as follows:
[0112] Step 1: Through the pre-set feature filter, the vector representations of the features required by the SwAV algorithm model are extracted from the samples in the batch and spliced together as the user's representation vector (the vector representation of the user's feature information). Then, the vector representation of each user's feature information is transformed to obtain two data-enhanced versions of the user representation vectors x1 and x2 (the first enhanced user vector representation and the second enhanced user vector representation). SwAV clusters the data in the batch online for the two enhanced representation vectors according to the Sinkhorn-Knopp algorithm. By matching and comparing with k category prototype vectors, it is determined which category the enhanced representation vector belongs to. Among them, the category prototype is iteratively updated by the swAV algorithm during the training process.
[0113] Step 2: Calculate the Loss by comparing the enhanced representation with the prototype vector of each class center, backpropagate the gradient to update the SwAV network parameters, and calculate the loss function by comparing the cross entropy loss of formula (1).
[0114] Finally, this SwAV algorithm model will calculate the probability that the user belongs to 100 clusters through the softmax function. We take the class corresponding to the maximum cluster probability as the cluster to which the user belongs.
[0115] Step 3: From step 2, we know the cluster corresponding to the new user. We extract the convergence value of the user ID Embedding of the cluster in the batch, calculate the average, and use this average to update the initial value of the new user ID Embedding initialized with 0. The convergence value of the user ID Embedding is the convergence value pre-trained and learned by business models such as recommendation systems for historical users.
[0116] The embodiments of the present invention have the following technical effects: the existing random initialization method of user id Embedding selects the initial value randomly and uncontrollably, requires a large amount of user behavior data to train and update it, and the parameter convergence speed is slow. The application proposes to use the online SwAV unsupervised clustering algorithm to find a group similar to the new user, calculate the group user id Embedding mean corresponding to the new user to initialize the id Embedding parameters of the new user. This initialization is no longer random, and the initialization id Embedding value selected already has certain user prior information. The convergence speed of the initial value parameters obtained by the random initialization method is faster, so less single user training sample data is required, and the accuracy of the recommendation results generated for new users is also better.
[0117] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0118] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0119] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.
[0120] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including". In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
[0121] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.
[0122] The various illustrative logic blocks or units described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.
[0123] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.
[0124] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.
[0125] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for initializing user ID Embedding, characterized in that: include: Obtain user feature information of new users; According to the user characteristic information of the new user, determining the target user category to which the new user belongs in at least one preset user category; wherein the at least one user category is obtained by pre-clustering a plurality of historical users based on similarity of user characteristic information; A preset number of historical users corresponding to the target user category are obtained, and an initial value of the ID Embedding of the new user is determined based on the convergence values of the ID Embeddings of the preset number of historical users; wherein the initial value of the ID Embedding of the new user is used to input a first business model to learn the user feature information of the new user, so as to obtain a convergence value of the ID Embedding of the new user.
2. The method for initializing user ID Embedding as claimed in claim 1, characterized in that: The determining the initial value of the ID Embedding of the new user according to the convergence values of the ID Embeddings of the preset number of historical users includes: The convergence values of the ID Embeddings of the preset number of historical users are averaged, and the obtained average is used as the initial value of the ID Embedding of the new user; the convergence values of the ID Embeddings of the historical users are pre-determined by the first business model.
3. The method for initializing user ID Embedding according to claim 1, characterized in that: The determining, based on the user characteristic information of the new user, a target user category to which the new user belongs in at least one preset user category includes: Vectorizing the user characteristic information of the new user to obtain a vector representation of the user characteristic information of the new user; The vector representation of the user feature information of the new user is input into the first SwAV model for comparative clustering processing to obtain the target user category to which the new user belongs output by the first SwAV model.
4. The method for initializing user ID Embedding as claimed in claim 3, characterized in that: The training method of the first business model includes: Obtain user feature information and ID Embedding convergence values of multiple historical users; Vectorizing the user feature information of each historical user to obtain a vector representation of the user feature information of each historical user; Determine a training data set and a joint model, wherein each training data in the training data set includes a vector representation of user feature information of a historical user and a convergence value of ID Embedding, and the joint model consists of a second SwAV model and a second business model; Iteratively train the joint model using the training data set until a convergence condition is met, and obtain the model parameters of the second SwAV model after training, the model parameters of the second business model after training, and the at least one user category output by the second SwAV model and the historical users corresponding to each user category; Initializing the model parameters of the first SwAV model using the model parameters trained by the second SwAV model, and initializing the model parameters of the first business model using the model parameters trained by the second business model; The first SwAV model and the second SwAV model have the same model structure; the first business model and the second business model have the same model structure.
5. The method for initializing user ID Embedding as claimed in claim 4, characterized in that: Iteratively training the joint model using the training data set until a convergence condition is met, obtaining model parameters of the second SwAV model after training, model parameters of the second business model after training, and the at least one user category output by the second SwAV model and historical users corresponding to each user category, including: All training data in the training data set are input into a joint model consisting of a second SwAV model and a second business model, unsupervised iterative training is performed on the second SwAV model, model parameters of the second SwAV model are updated, supervised training is performed on the second business model, model parameters of the second business model are updated until the second business model converges, and model parameters of the second SwAV model after training, model parameters of the second business model after training, and at least one user category output by the second SwAV model and historical users corresponding to each user category are obtained.
6. The method for initializing user ID Embedding as claimed in claim 4, characterized in that: Iteratively training the joint model using the training data set until a convergence condition is met, obtaining model parameters of the second SwAV model after training, model parameters of the second business model after training, and the at least one user category output by the second SwAV model and historical users corresponding to each user category, including: Dividing all training data in the training data set into multiple training batches, and selecting a training batch from the multiple training batches as a target training batch; Randomly select a number of historical users from the historical users corresponding to the target training batch as target new users corresponding to the target training batch, and use the remaining historical users as target historical users corresponding to the target training batch; Inputting the vector representation of the user feature information of the target historical users corresponding to the target training batch into the second SwAV model, obtaining all user categories corresponding to the target training batch and the target historical users corresponding to each user category output by the second SwAV model, obtaining the clustering cross entropy loss based on the enhanced representation of the target historical users corresponding to the target training batch and each class center prototype vector, determining the update gradient of the second SwAV model parameters by the cross entropy loss, and updating the model parameters of the second SwAV model by the gradient descent method; the enhanced representation and the class center prototype vector are automatically generated inside the second SwAV model according to the input training data; Inputting the vector representation of the user feature information of each target new user corresponding to the target training batch into the second SwAV model after updating the parameters, and obtaining the output user category of each target new user; Obtaining a convergence value of the ID embedding of each target historical user having the same user category as each target new user in the target training batch; Determine the initial value of the ID embedding of each target new user according to the acquired convergence value of the ID embedding of each target historical user corresponding to each target new user; The initial value of the ID embedding of each target new user is used as the initialization vector of the ID embedding of the target new user required to be input to the second business model, and the specific business to which the ID embedding of the target new user is applied is trained through the second business model to obtain a business estimate value corresponding to the business target of the specific business output by the second business model, and a loss function value used by the second business model is determined based on the business estimate value and the corresponding business target value, and an update gradient of the second business model is determined according to the loss function value, and the model parameters of the second business model are updated using the gradient descent method; the business estimate value output by the second business model represents the convergence value of the ID embedding of the target new user; Determining whether the second service model converges; If the second business model has not converged, a new training batch is selected from the multiple training batches as a target training batch, and the process returns to the step of randomly selecting a number of historical users from the historical users corresponding to the target training batch as target new users corresponding to the target training batch, and taking the remaining historical users as target historical users corresponding to the target training batch; If the second business model converges, it is confirmed that the convergence conditions are met, and all user categories corresponding to the current target training batch and the target historical users corresponding to each user category are respectively used as the at least one user category and the historical users corresponding to each user category output by the second SwAV model, and the model parameters of the current second SwAV model are used as the model parameters of the second SwAV model after training, and the current model parameters of the second business model are used as the model parameters of the second business model after training.
7. The method for initializing user ID Embedding as claimed in claim 3, characterized in that: Vectorizing the user feature information of the new user to obtain a vector representation of the user feature information of the new user includes: Vectorizing all user information included in the user characteristic information of the new user into corresponding vector representations; wherein the user characteristic information includes: at least one type of user information; The vector representations corresponding to all the user information are concatenated to obtain the vector representation of the user feature information of the new user.
8. A user ID Embedding initialization device, characterized in that: include: A user information acquisition unit, used to acquire user characteristic information of a new user; A user category determination unit, configured to determine, based on the user feature information of the new user, a target user category to which the new user belongs in at least one preset user category; wherein the at least one user category is obtained by performing a cluster analysis on a plurality of historical users based on similarity of user feature information in advance; A vector initial value determination unit is used to obtain a preset number of historical users from the historical users corresponding to the target user category, and determine the initial value of the ID Embedding of the new user according to the convergence values of the ID Embeddings of the preset number of historical users; wherein the initial value of the ID Embedding of the new user is used to input the first business model to learn the user feature information of the new user, so as to obtain the convergence value of the ID Embedding of the new user.
9. An electronic device, characterized in that: include: A processor, adapted to execute various instructions; as well as A storage device, adapted to store a plurality of instructions, wherein the instructions are adapted to be loaded and executed by a processor, including an initialization method for user ID Embedding as described in claims 1-7.
10. A computer-readable storage medium, characterized in that: A plurality of instructions are stored therein, and the instructions are suitable for being loaded by a processor and executed including the initialization method of the user ID Embedding as described in claims 1-7.
