Method and apparatus for making recommendation, and electronic device and medium
By representing the user behavior sequence as a probability distribution and utilizing MMD distance, the problem of difficult retention of dynamic correlation and collaborative delivery in sequential recommendations is solved, which improves recommendation accuracy and new object exposure and improves user experience.
Patent Information
- Application Number
- PCT/CN2024/092078
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-11
- Filing Date
- 2024-05-09
- Publication Date
- 2024-11-14
AI Technical Summary
The existing sequential recommendation method is difficult to effectively retain the dynamic correlation and collaborative delivery in user behavior sequences, resulting in difficulty in cold start of new objects, poor recommendation accuracy and user experience.
The accuracy of recommended results and exposure of new objects are improved by representing the sequence of objects' historical interactions as a probability distribution and measuring the differences between the object's probability distributions using the maximum mean difference (MMD) distance.
Improve the accuracy of the sequential recommendation model, promote cold start of new objects and exposure of unpopular objects, improve user experience, and enhance correlation retention between objects.
Smart Images

Figure CN2024092078_14112024_PF_FP_ABST
Abstract
Description
Method, device, electronic device, and medium for recommendation
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 11, 2023, with application number 202310532185.X and invention name “Methods, devices, electronic devices and media for recommendation”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present disclosure relates generally to the field of computers, and more particularly, to methods, apparatuses, electronic devices, and media for recommendation. Background Art
[0004] A recommender system is an information filtering system that predicts a user's preference for certain items by analyzing various factors, including historical user behavior, and then recommends a personalized list of items. Recommender systems are widely used in content distribution, music and film, social networking, and e-commerce.
[0005] Sequential recommendation refers to the task of providing personalized recommendations based on a user's behavior sequences over a period of time (for example, reading articles, viewing videos, adding music to favorites, adding friends, etc.). Compared to traditional recommendation tasks, sequential recommendation not only considers user interests and preferences but also the temporal nature of behavior, thus better meeting the user's actual needs. In scenarios where sequential recommendation is applied, users typically generate a large amount of behavior sequence data. Extracting useful information from this behavior sequence data and improving recommendation effectiveness is a major research direction in sequential recommendation.
[0006] Summary of the Invention
[0007] Embodiments of the present disclosure provide a method, apparatus, electronic device, and medium for recommendation. By calculating the maximum mean discrepancy (MMD) distance between the probability distributions of each pair of objects, the association between objects can be better preserved, thereby promoting the cold start of new objects, increasing the exposure of unpopular objects, improving the accuracy of sequential recommendation models, and enhancing the user experience.
[0008] In a first aspect of the present disclosure, a method for recommendation is provided. The method includes obtaining a sequence of objects historically interacted with by a user, the sequence of objects being sorted by interaction time. The method also includes generating an object distribution sequence based on multiple probability distributions for multiple objects in the object sequence. The method also includes generating an MMD distance set based on the object distribution sequence by determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence. Furthermore, the method includes generating a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set.
[0009] In a second aspect of the present disclosure, a device for recommendation is provided. The device includes an object sequence acquisition module configured to acquire a sequence of objects historically interacted with by a user, the sequence of objects being sorted by interaction time. The device also includes a distribution sequence generation module configured to generate an object distribution sequence based on multiple probability distributions of multiple objects in the object sequence. The device also includes a distribution distance determination module configured to generate an MMD distance set based on the object distribution sequence by determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence. In addition, the device also includes a recommendation result generation module configured to generate a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set.
[0010] In a third aspect of the present disclosure, an electronic device is provided. The electronic device includes one or more processors; and a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for recommendation. The method includes obtaining a sequence of objects with historical user interactions, and the object sequence is sorted by interaction time. The method also includes generating an object distribution sequence based on multiple probability distributions of multiple objects in the object sequence. The method also includes generating an MMD distance set based on the object distribution sequence by determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence. In addition, the method also includes generating a recommendation result for recommending objects to the user based on the object distribution sequence and the MMD distance set.
[0011] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, having stored thereon a computer program that, when executed by a processor, implements a method for recommendation. The method includes obtaining a sequence of objects historically interacted with by a user, the sequence of objects being sorted by interaction time. The method also includes generating an object distribution sequence based on multiple probability distributions for multiple objects in the object sequence. The method also includes generating an MMD distance set based on the object distribution sequence by determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence. Furthermore, the method also includes generating a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set.
[0012] This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. It is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0014] FIG1 illustrates a schematic diagram of an example environment in which various embodiments of the present disclosure may be implemented;
[0015] FIG2 shows a flow chart of a method for recommendation according to some embodiments of the present disclosure;
[0016] FIG3 is a schematic diagram illustrating a process of training a sequential recommendation model in a training phase according to some embodiments of the present disclosure;
[0017] FIG4 is a schematic diagram illustrating a process of calculating the MMD between objects using the MMD self-attention module during the training phase according to some embodiments of the present disclosure;
[0018] FIG5 is a schematic diagram illustrating a process of calculating multiple centroid distributions using an MMD self-attention module during a training phase according to some embodiments of the present disclosure;
[0019] FIG6 is a schematic diagram showing a process of generating recommendation results by using a sequential recommendation model in the reasoning phase according to some embodiments of the present disclosure;
[0020] FIG7 shows a block diagram of an apparatus for recommendation according to some embodiments of the present disclosure; and
[0021] FIG8 shows a block diagram of a device capable of implementing various embodiments of the present disclosure. DETAILED DESCRIPTION
[0022] It is understood that all user-related data involved in this technical solution must be obtained and used only after authorization by the user. This means that if a user's personal information is to be used in this technical solution, the user's explicit consent and authorization must be obtained before such data is obtained; otherwise, the relevant data will not be collected or used. It is also understood that when implementing this technical solution, relevant laws and regulations must be strictly observed during the data collection, use, and storage process, and necessary technologies and measures must be implemented to protect the user's data security and ensure the safe use of data.
[0023] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0024] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or the same objects, unless explicitly stated. Other explicit and implicit definitions may also be included below.
[0025] Recommender systems have become an indispensable part of various platforms (e.g., content distribution platforms), and are used to address the problem of information overload. In practical applications, the interaction data between users and objects provides an important source of information for recommendation systems to generate recommendation results. This interaction data can include user behaviors such as clicking, adding to favorites, and rating objects, which reflect the user's interest and preference for the object. By analyzing this interaction data, the recommendation system can establish relationships between users and objects, thereby improving recommendation accuracy. However, in practical applications, the interactions between users and objects are not only static but also have a temporal relationship. Sequential recommendation aims to predict the next object of interest to the user based on the user's historical behavior sequence and current context information, thereby improving recommendation effectiveness.
[0026] Because user interactions are interconnected and guided by user interests, sequential recommendation can perform well in recommendation tasks. For example, if a user enjoys reading, they may browse book-related articles on a content distribution platform, and they may also browse articles related to e-readers on the same platform. In this case, browsing both book-related and e-reader-related articles indicates that reading is one of the user's interests, so it is reasonable for the system to recommend book-related articles to users who exhibit these behaviors. This shows that sequential recommendation is superior in modeling dynamic user interests.
[0027] The Transformer network is a neural network architecture based on the attention mechanism. Inspired by the attention mechanism introduced in Transformer networks, some methods have attempted to apply self-attention to address the limitations of Markov chain / recurrent neural network (MC / RNN)-based methods. One of the main motivations for these methods is to extract context from long interaction sequences while making predictions based on a small number of actions. To achieve this goal, these methods leverage self-attention to learn adaptive weights for each object in the sequence. In this way, these methods can overcome the limitations of previous MC / RNN-based methods.
[0028] While effective, these methods ignore the dynamic uncertainty inherent in sequential recommendation. Some traditional sequential recommendation methods deterministically model dynamic user interests. Specifically, these methods utilize fixed vectors in the latent space to represent user interests. However, this representation is limited in that it is difficult to model diverse user interests. In particular, real-world recommendation systems may recommend a variety of objects across multiple categories, and user interests are dynamic and diverse. For example, a user browsing articles related to e-readers on a content distribution platform may indicate an interest in reading or digital technology. In this case, the recommender system cannot determine whether the user is interested in reading or digital technology, and the fixed vectors fail to capture the user's precise interests. Consequently, this leads to a degenerate representation of user interests in the interest latent space. Furthermore, some traditional sequential recommendation methods fail to incorporate collaborative transitivity within user behavior sequences. In addition to providing object-to-object transitions within a user behavior sequence, collaborative transitivity can also provide additional semantic relationships in the latent space. For example, based on the transition pairs (i1→i2) and (i2→i3) between two objects, one can conclude that i1 is close to i2, and i2 is close to i3. Based on collaborative transitivity, we can infer that i1 is also close to i3. However, traditional self-attention methods using dot product operations cannot well represent collaborative transitivity. For example, assuming i1 = [0, 1], i2 = [1, 1], and i3 = [1, 0], the dot product of (i1, i2) and (i2, i3) is 1, while the dot product of (i1, i3) is 0, indicating that i1 and i3 are far apart in the latent space. If there is no transfer between i1 and i3 in the user behavior sequence during a cold start, the connection between the two will be even less well represented.
[0029] To this end, an embodiment of the present disclosure proposes a solution for sequential recommendation. The solution uses the form of probability distribution to represent objects, thereby converting the object sequence of the user's historical interaction into a sequence of probability distribution of objects. Then, the solution uses MMD to measure the distance between the probability distributions of objects, and generates a recommendation result for recommending objects to users based on the MMD distance between the probability distributions of these objects. In this way, the solution proposed in the embodiment of the present disclosure can better retain the correlation between objects, thereby promoting the cold start of new objects, increasing the exposure of unpopular objects, and improving user experience. In addition, the solution can also improve the accuracy of the sequential recommendation model.
[0030] FIG1 illustrates a schematic diagram of an example environment 100 in which various embodiments of the present disclosure may be implemented. In the example shown in FIG1 , environment 100 includes a platform 102 and a user 104. Platform 102 may be, for example, a content distribution platform. Platform 102 includes a sequential recommendation model 106 and an object library 108. Object library 108 includes a variety of objects with which users can interact. For example, on a content distribution platform, the objects may be articles. Platform 102 may expose some of the objects in object library 108 to user 104, who may then select some of the exposed objects to interact with. For example, the interactions may include browsing, adding to favorites, commenting on them, and so on. In environment 100, user 104 interacts with objects 112-1, 112-2, ..., 112-P in object library 108 in chronological order, and the objects with which these users interact form an object sequence 116. It should be noted that the objects in the object sequence 116 are ordered according to interaction time, ie, the user 104 first interacts with the object 112 - 1 , then interacts with the object 112 - 2 , and finally interacts with the object 112 -P.
[0031] In environment 100, platform 102 inputs object sequence 116 into sequential recommendation model 106 to predict the next object that the user may be interested in interacting with, thereby recommending the predicted object to user 104. As shown in FIG1 , sequential recommendation model 106 can predict, based on object sequence 116 that user 104 has interacted with, from object library 108 that the object that user 104 may be interested in interacting with next is object 118. Platform 102 then exposes object 118 to user 104, hoping that user 104 will interact with it. In environment 100, the object that user 104 actually interacts with next is object 120, which may or may not be the same object as object 118. By interacting with object 120, user 104 provides feedback to platform 102 on the accuracy of its recommended objects, thereby helping platform 102 optimize sequential recommendation model 106.
[0032] It should be noted that although the recommendation result output by the sequential recommendation model 106 in the environment 100 shown in FIG1 only includes one object (i.e., object 118), in some embodiments of the present disclosure, the recommendation result output by the sequential recommendation model 106 may also be a recommendation list including multiple objects, and the multiple objects in the recommendation list may be ranked according to criteria such as recommendation scores. In these embodiments, the platform 102 may expose all objects in the recommendation list to the user 104, or may expose several objects ranked at the top of the recommendation list to the user 104.
[0033] In addition, it should be understood that the platform 102 in the environment 100 shown in FIG1 can be any platform that uses a recommendation system to recommend objects to users, such as a content distribution platform, a music platform, a video platform, a social platform, an e-commerce platform, etc. Correspondingly, the objects in the environment 100 shown in FIG1 (e.g., objects 112-1, 112-2, 112-P, 120, etc.) can be any objects that use a recommendation system to recommend to users, such as articles, music, videos, people, items, etc.
[0034] FIG2 illustrates a flow chart of a method 200 for recommendation according to some embodiments of the present disclosure. As shown in FIG2 , at block 202 , method 200 obtains a sequence of objects with which a user has historically interacted, where the objects in the sequence are sorted by interaction time. For example, in environment 100 shown in FIG1 , method 200 obtains object sequence 116 , which includes objects 112 - 1 , 112 - 2 , ... , 112 -P that user 104 has interacted with on platform 102 . All objects in object sequence 116 are sorted by the time at which user 104 interacted with them.
[0035] At block 204, method 200 generates an object distribution sequence based on multiple probability distributions for multiple objects in the object sequence. For example, method 200 may utilize a random distribution (e.g., a Gaussian distribution) in sequential recommendation model 106 to generate a corresponding probability distribution for each object in object sequence 116. The probability distributions of these objects constitute the object distribution sequence. Compared to methods that use fixed vectors to represent objects, method 200 can introduce uncertainty and provide greater flexibility by representing objects as probability distributions.
[0036] At block 206, method 200 generates a set of MMD distances based on the object distribution sequence by determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence. For example, in the environment 100 shown in FIG1 , method 200 can utilize the sequential recommendation model 106 to calculate the MMD distance between the probability distributions of each pair of objects. MMD is a method for estimating the difference between two probability distributions. MMD measures the similarity between two probability distributions by calculating the norm of the difference between their means in feature space.
[0037] At block 208, method 200 generates a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set. For example, in the environment 100 shown in FIG1 , method 200 may utilize the sequential recommendation model 106 to find the most suitable object 118 to recommend to the user 104 from the object library 108 based on the object distribution sequence corresponding to the object sequence 116 and the generated MMD distance set. In some embodiments, the recommendation result output by the sequential recommendation model 106 may also be a recommendation list including multiple objects, and the multiple objects in the recommendation list may be sorted according to criteria such as recommendation scores.
[0038] By representing objects as probability distributions, method 200 can introduce uncertainty into the sequential recommendation model 106 and provide greater flexibility. Furthermore, by calculating the MMD distance between probability distributions, the solution proposed in the embodiments of the present disclosure can better preserve the correlation between objects, thereby promoting the cold start of new objects, increasing the exposure of unpopular objects, and improving the user experience. Furthermore, this solution can also improve the accuracy of the sequential recommendation model.
[0039] Figures 3 to 5 illustrate schematic diagrams of the process of training a sequential recommendation model during the training phase according to some embodiments of the present disclosure. Figure 3 illustrates the overall training process of the sequential recommendation model according to some embodiments of the present disclosure, Figure 4 illustrates details of using the MMD self-attention module to calculate the MMD portion between objects during the overall training process according to some embodiments of the present disclosure, and Figure 5 illustrates the process of using the MMD self-attention module to calculate multiple centroid distributions according to some embodiments of the present disclosure. Figure 6 illustrates the process of generating recommendation results using the sequential recommendation model during the inference phase according to some embodiments of the present disclosure.
[0040] Figure 3 illustrates a schematic diagram of a process 300 for training a sequential recommendation model during the training phase, according to some embodiments of the present disclosure. As shown in Figure 3 , process 300 inputs a sequence 318 of objects from a user's historical interactions into a sequential recommendation model 302. Object sequence 318 includes objects 312-1, 312-2, ..., 312-P (collectively referred to as objects 312), where objects 312 can be items on a content distribution platform, such as merchandise or videos. Unlike traditional methods that use deterministic vectors to represent objects, in process 300, sequential recommendation model 302 represents each object 312 in object sequence 318 as a probability distribution. In some embodiments, objects 312 can be represented as probability distributions using a random distribution, such as a Gaussian distribution. As shown in Figure 3 , object 312-1 is represented as distribution 322-1, object 312-1 is represented as distribution 322-2, ..., and object 312-P is represented as distribution 322-P. In this way, uncertainty can be introduced into sequential recommendation model 302, providing greater flexibility. The distributions 322 - 1 , 322 - 2 , . . . , 322 -P constitute an object distribution sequence 328 , and in the object distribution sequence 328 , the probability distributions of all objects are sorted according to the time when the user interacted with the corresponding object.
[0041] In some embodiments, after generating the object distribution sequence 328, the process 300 uses the MMD self-attention module 304 to determine the MMD distance between the probability distributions of each pair of objects in the object distribution sequence 328, thereby generating an MMD distance set. In some embodiments, the MMD self-attention module 304 uses the MMD distance set to generate a centroid distribution of the object distribution sequence 328, which is the average probability distribution of the object distribution sequence 328. The centroid distribution can represent the user's interest preferences at this moment after the user interacts with the objects in the object sequence 318. In some embodiments, the MMD self-attention module 304 can sample the generated centroid distribution to generate a sample embedding representing the object that the user may be interested in, and then output it to the feedforward neural network 306.
[0042] MMD is a measure used to estimate the difference between two probability distributions. The MMD between two probability distributions can be calculated by the following equation (1):
[0043] in is a measurement from the probability distribution μ x and μ y The positive definite kernel function of the similarity between samples.
[0044] The centroid distribution is an aggregation of probability distributions. In particular, we use ΔP to represent the probability simplex and Express The probability measurement of , given a set of P probability distributions {μ1, μ2, ..., μ P}, the centroid distribution weighted by the weight vector β can be calculated by the following equation (2):
[0045] in represents the difference between probability distributions, while the definition of the centroid distribution is similar to the estimate of the mean of the points in Euclidean space.
[0046] Figure 4 shows a schematic diagram of a process 400 for calculating the MMD between objects using the MMD self-attention module 304 during the training phase according to some embodiments of the present disclosure. As shown in Figure 4, the MMD self-attention module 304 samples the probability distribution of each object in the object distribution sequence 328 to generate a sampled embedding sequence. For example, the MMD self-attention module 304 samples the distribution 322-1 to generate a sampled embedding 402-1, samples the distribution 322-2 to generate a sampled embedding 402-2, ..., samples the distribution 322-P to generate a sampled embedding 402-P. In this document, the sampled embeddings 402-1, 402-2, ..., 402-P are collectively referred to as sampled embeddings 402. In this way, the solution proposed in the present disclosure can represent the object sequence of the user's historical interaction as a sequence of samples of the probability distribution.
[0047] In some embodiments, since the probability distribution of each object does not include the relative position information of the object in the sequence, a trainable corresponding position embedding can be generated for each sample embedding 422 in the sample embedding sequence, thereby generating a position embedding sequence. Then, an adjusted sample embedding sequence can be generated based on the sample embedding sequence and the position embedding sequence. Then, an MMD distance set can be generated based on the adjusted sample embedding sequence.
[0048] In the process 400 shown in FIG4 , P sample embeddings 402 are included. For a given user u, E u =[x1, x2, ..., x P ] to represent the sample embedding 402, where x1 corresponds to the sample embedding 402-1, x2 corresponds to the sample embedding 402-2, and x p Corresponding to the sample embedding 402-P, the adjusted sample embedding sequence can be expressed by the following equation (3):
[0049] Where p1 represents the position embedding corresponding to x1, p2 represents the position embedding corresponding to x2, and p P Indicates that x PThe corresponding position is embedded.
[0050] In the process 400 shown in FIG4 , a new self-attention variable can be introduced to adapt to the probability distribution of the object. In the process 400 , A∈R n×n To represent the self-attention value, and A ij Represents the distribution μ in the object distribution sequence i and μ j The MMD distance between them. The traditional self-attention method uses the dot product operation to calculate the association between objects. However, the dot product operation cannot measure the difference between the probability distributions of objects. The MMD can be used to measure the difference between the probability distributions of objects through the following equation (4): ij =-MMD 2 (μ i , μ j ) (4)
[0051] where μ i and μ j is the probability distribution corresponding to objects i and j in the object sequence.
[0052] In some embodiments, a positive definite kernel function can be used to calculate the MMD between probability distributions. In some embodiments, a Gaussian kernel function can be used to calculate the MMD. The advantage of the Gaussian kernel function over other positive definite kernels is that the Gaussian kernel function has stronger expressive power and a wider range of applications. The Gaussian kernel function can capture the complex nonlinear structure of the data, and the Gaussian kernel function also has good mathematical properties, such as symmetry, positive definiteness, and differentiability, etc., so the complexity of the algorithm can be simplified. In process 400, the Gaussian kernel function k(x i , x j ):
[0053] where x i and x j represents the sampled embedding, ξ represents the bandwidth parameter, and α represents the hyperparameter used to adjust the length of the kernel function value.
[0054] As shown in FIG4 , process 400 determines the MMD distance between corresponding distributions 322 by calculating the MMD between sample embeddings 402. The MMD self-attention module 304 can calculate the MMD between the two sample embeddings for each pair of sample embeddings 402. For example, process 400 can calculate the MMD between sample embedding 402-1 and sample embedding 402-2 to obtain MMD 408, calculate the MMD between sample embedding 402-2 and sample embedding 402-P to obtain MMD 410, and calculate the MMD between sample embedding 402-1 and sample embedding 402-P to obtain MMD 412. Then, process 400 can generate a set of MMD distances, which includes, for example, MMDs 408, 410, 412, etc. It should be understood that although FIG4 does not show the MMD between sample embeddings 402-1, 402-2, and 402-P and other sample embeddings in the sample embedding sequence, process 400 calculates the MMD between each pair of sample embeddings. For example, assuming that the sample embedding sequence includes 4 sample embeddings, process 400 calculates the MMD between 6 pairs of sample embeddings respectively. Assuming that the sample embedding sequence includes 5 sample embeddings, process 400 calculates the MMD between 10 pairs of sample embeddings respectively.
[0055] In some embodiments, to obtain a probability distribution representing the user's interest preferences, the process 400 may generate a centroid distribution 414 of the object distribution sequence based on the object distribution sequence 328 and the MMD distance set. The centroid distribution 414 is an aggregation of all distributions 322 in the object distribution sequence 328, and the centroid distribution 414 may represent the user's interest distribution. The process 400 may then sample the centroid distribution 414 to generate a sample embedding 416, and input the sample embedding 416 into the feedforward neural network 306. The centroid distribution μ may be calculated by the following equation (6): u :
[0056] In process 400, the weighting parameter β may be calculated by the following equation (7):
[0057] Where A represents the attention matrix and d represents the spatial dimension.
[0058] By utilizing an MMD-based self-attention mechanism, the solution provided by the present disclosure can implicitly elevate sample embeddings to an infinite-dimensional feature space using a Gaussian kernel function, thereby improving the accuracy of the sequential recommendation model 302. Furthermore, during the training process of the sequential recommendation model 302, this solution can fully utilize the information contained in the probability distributions of the two objects, thereby improving the collaborative transferability between the objects, promoting the cold start of new objects, increasing the exposure of unpopular objects, and improving the user experience.
[0059] Returning to Figure 3, in process 300, the MMD self-attention module 304 can output a sample embedding 416 of the centroid distribution 414. However, the centroid distribution is a linear aggregation of probability distributions, making it unable to help model complex relationships. 2 , then with weight β∈Δ P Multiple probability distributions of The center of gravity distribution μ ★ is the combination of multiple probability distributions calculated by the following equation (8):
[0060] It can be seen from this that the sample embedding obtained by sampling the centroid distribution will also show a linear relationship. However, since more complex relationships can be modeled using nonlinearity, in some embodiments, the sample embedding obtained by sampling the centroid distribution can be input into a feedforward neural network to introduce nonlinearity to the sample embedding. In some embodiments, nonlinearity can be introduced by including multiple fully connected layers in the feedforward neural network and using an exponential linear unit (ELU) activation function.
[0061] As shown in FIG3 , the process 300 may input the sample embedding 416 of the centroid distribution 414 output by the MMD self-attention module 304 into the feedforward neural network 306. The feedforward neural network 306 includes two layers and uses the ELU activation function to generate the intermediate embedding. The output FFN(x) of the feedforward neural network 306 can be expressed as follows: FFN(x) = ELU(xW1+b1)W2+b2 (9)
[0062] where W1∈R d×d , W2∈R d×d ,b1∈R d and b2∈R d are learnable parameters and x can be the sampled embedding 416.
[0063] As shown in Figure 3, process 300 can input the intermediate embedding output by the feedforward neural network 306 into the regularization module 308 and use the regularization module 308 to stabilize the training process. Then, process 400 generates a predicted embedding at the layer output 310. In some embodiments, process 400 can apply a random dropout layer to the output of the feedforward neural network 306 to optimize the feedforward neural network 306 to reduce overfitting. In some embodiments, process 400 can generate a predicted embedding based on the sampled embedding 416 and the output of the random dropout layer, and using residual connections and layer normalization techniques. For example, for the first t objects in the object sequence of the user's historical interaction, the predicted embedding X can be generated by the following equation (10): t : X t=LayerNorm(x+Dropout(FFN(x))) (10)
[0064] Where Dropout() represents a random dropout layer, LayerNorm() represents layer normalization, and x can be a sampled embedding 416.
[0065] The process 300 can generate a predicted distribution of objects that the user is likely to interact with next time based on the predicted embedding. During the training phase, in order to fully utilize the training data, the process 300 can generate a predicted distribution based on the probability distribution of the first N objects in the object distribution sequence 328, and then optimize the sequential recommendation model 302 based on the difference between the generated predicted distribution and the true probability distribution of the N+1th object. For example, the object distribution sequence 328 includes P distributions 322, and the process 300 can generate a predicted distribution 332-1 based on the distribution 322-1, and then optimize the sequential recommendation model 302 by comparing the difference between the predicted distribution 332-1 and the distribution 322-2. The process 300 can also generate a predicted distribution 332-2 based on the distribution 322-1 and the distribution 322-2, and then optimize the sequential recommendation model 302 by comparing the difference between the predicted distribution 332-2 and the next distribution of the distribution 322-2. Similarly, process 300 can generate predicted distributions 332-1, 332-2, ..., 332-P based on object distribution sequence 328. (Predicted distribution 332-P needs to be compared with the probability distribution of the object of the next user interaction after object distribution sequence 328 to optimize the model.) In this way, the training data can be fully utilized and the model training cost can be reduced.
[0066] In some embodiments, in order to generate multiple predicted distributions 332 using the object distribution sequence 328, multiple centroid distributions can be generated in the MMD self-attention module. Figure 5 shows a schematic diagram of a process 500 for calculating multiple centroid distributions using the MMD self-attention module during the training phase according to some embodiments of the present disclosure. As shown in Figure 5, the MMD self-attention module 304 samples the distributions 322-1, 322-2, ..., 322-P in the object distribution sequence 328 to generate sample embeddings 402-1, 402-2, ..., 402-P. Process 500 can generate a centroid distribution 502-1 based on the sample embedding 402-1, and then sample the centroid distribution 502-1 to generate a sample embedding 512-1. Process 500 can also generate a centroid distribution 502-2 based on the sample embeddings 402-1 and 402-2, and then sample the centroid distribution 502-2 to generate a sample embedding 512-2. The process 500 can also generate a centroid distribution 502-P based on all P sample embeddings 402, and then sample the centroid distribution 502-P to generate a sample embedding 512-P. In this way, the sequential recommendation model 302 can generate multiple prediction distributions 332 based on multiple centroid distributions 502, thereby making full use of the training data and saving the training cost of the model. It should be understood that for clarity, the process of calculating the MMD between the sample embeddings 402 is not shown in Figure 5, but the process of generating the centroid distribution 502 based on the sample embedding 402 described above includes all the details of generating the centroid distribution by calculating the MMD between the sample embeddings as shown in Figure 4.
[0067] Referring back to FIG3 , in some embodiments, the process 300 may determine the MMD distance between the predicted distribution and the probability distribution of the target object in the object library 108 shown in FIG1 , and then select the object with the smallest MMD distance as the recommendation result. In other embodiments, multiple objects with the smallest MMD distance or multiple objects with an MMD distance less than a predetermined threshold may be selected as the recommendation result. For example, as shown in FIG3 , the process 300 determines the MMD distances between the predicted distributions 332-1, 332-2, ..., 332-P and the target object in the object library 108, respectively, thereby determining objects 342-1, 342-2, ..., 342-P as the recommendation result. The predicted distribution μ generated based on the first t interacting objects can be determined by the following equation (11): t and the probability distribution μ of the i-th target object in the object library 108 i The MMD distance between
[0068] When optimizing the sequential recommendation model 302 during the training phase, in some embodiments, the Bayesian Personalized Ranking (BPR) loss can be used as the main objective function to measure the ranking prediction error. The main objective function (also known as the first loss function) is: As shown in the following equation (12):
[0069] Where S represents the object sequence of the user's historical interaction, S u represents the object sequence of user u’s historical interactions, σ is the sigmoid function, is the MMD distance between the predicted distribution generated based on the first t objects in the object sequence and the probability distribution of the positive sample (the sample of the user's next actual interaction), It is the MMD distance between the predicted distribution generated based on the first t objects in the object sequence and the probability distribution of negative samples (samples with which the user has not interacted).
[0070] In some embodiments, the hinge loss function can be used to generate a regularization term (also called a second loss function) to improve representation learning. As shown in the following equation (13):
[0071] where [x] + =max(x,0) is the hinge loss function, Represents the distance between the predicted distribution and the positive sample, Represents the distance between the predicted distribution and the negative samples.
[0072] In some embodiments, the main objective function can be combined with the regularization term to generate a multi-task objective function (also called a third loss function). As shown in the following equation (14):
[0073] Where λ is used to adjust A hyperparameter for the length of the loss.
[0074] During the inference phase, the platform 102 can input the object sequence of the user's historical interactions into the sequential recommendation model 302. The sequential recommendation model 302 then generates a recommendation result for the user based on all objects in the object sequence. FIG6 illustrates a schematic diagram of a process 600 for generating recommendation results using a sequential recommendation model during the inference phase, according to some embodiments of the present disclosure.
[0075] As shown in Figure 6, the sequential recommendation model 302 obtains an object sequence 608 of user historical interactions, including objects 602-1, 602-2, ..., 602-P (collectively referred to as object 602) in the object sequence 608. Process 600 can represent each object 602 in the object sequence 608 as a probability distribution, that is, distribution 612-1, 612-2, ..., 612-P (collectively referred to as distribution 612). Then, process 600 uses the MMD self-attention module 304 to calculate the MMD distance between the probability distributions of each pair of objects in the object distribution 618, and then generates the center of gravity distribution of the object distribution 618 based on the MMD distance set. Process 600 can sample the center of gravity distribution to generate corresponding sampling embeddings. Then, via the feedforward neural network 306, the regularization module 308 and the layer output 310, the process 600 can generate a predicted distribution 334 based on the sampling embedding of the center of gravity distribution. Then, the process 600 may determine the MMD distance between the predicted distribution 334 and the probability distribution of the target object in the object library 108 , and then select the object 626 having the smallest MMD distance to the predicted distribution 334 as the recommendation result to recommend to the user.
[0076] FIG7 shows a block diagram of a device 700 for recommendation according to some embodiments of the present disclosure. As shown in FIG7 , the device 700 includes an object sequence acquisition module 702, which is configured to acquire a sequence of objects of a user's historical interactions, and the object sequence is sorted by interaction time. The device 700 also includes a distribution sequence generation module 704, which is configured to generate an object distribution sequence based on multiple probability distributions of multiple objects in the object sequence. The device 700 also includes a distribution distance determination module 706, which is configured to generate an MMD distance set based on the object distribution sequence by determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence. In addition, the device 700 also includes a recommendation result generation module 708, which is configured to generate a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set.
[0077] It can be understood that the apparatus 700 of the present disclosure can achieve at least one of the many advantages that can be achieved by the method or process described above. For example, by using MMD to measure the distance between the probability distributions of objects and generating a recommendation result for recommending objects to the user based on the MMD distance between the probability distributions of these objects, the correlation between objects can be better preserved, thereby promoting the cold start of new objects, increasing the exposure of unpopular objects, and improving the user experience. In addition, the accuracy of the sequential recommendation model can also be improved.
[0078] FIG8 shows a block diagram of an electronic device 800 according to some embodiments of the present disclosure, and device 800 may be the device or apparatus described in an embodiment of the present disclosure. As shown in FIG8 , device 800 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or computer program instructions loaded from a storage unit 808 into a random access memory (RAM) 803. In RAM 803, various programs and data required for the operation of device 800 can also be stored. CPU / GPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to bus 804. Although not shown in FIG8 , device 800 may also include a coprocessor.
[0079] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0080] The various methods or processes described above may be performed by the CPU / GPU 801. For example, in some embodiments, the methods may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU / GPU 801, one or more steps or actions in the methods or processes described above may be performed.
[0081] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0082] Computer-readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device.Computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination thereof.More specific examples (non-exhaustive list) of computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove having instructions stored thereon, and any suitable combination thereof.Computer-readable storage medium used herein is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (for example, light pulses by fiber optic cables), or electrical signals transmitted by wires.
[0083] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0084] The computer program instructions for performing the disclosed operation can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data or source code or the object code written in any combination of one or more programming languages, programming languages include object-oriented programming languages, and conventional procedural programming languages.Computer-readable program instructions can be performed completely on a user's computer, partially on a user's computer, performed as an independent software package, partly on a user's computer and partly on a remote computer, or performed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network-including local area network (LAN) or wide area network (WAN), or can be connected to an external computer (such as utilizing an internet service provider to connect by the internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to carry out personalized customization electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLA), this electronic circuit can perform computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0085] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0086] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0087] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a special hardware-based system that performs the prescribed function or action, or can be implemented by a combination of special hardware and computer instructions.
[0088] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or technical improvements to existing technologies, or to enable other persons skilled in the art to understand the embodiments disclosed herein.
[0089] Some example implementations of the present disclosure are listed below.
[0090] Example 1. A method for recommendation, comprising:
[0091] Obtain a sequence of objects that the user has interacted with historically, sorted by interaction time;
[0092] generating an object distribution sequence based on a plurality of probability distributions of a plurality of objects in the object sequence;
[0093] generating an MMD distance set based on the object distribution sequence by determining a maximum mean difference (MMD) distance between probability distributions of each pair of objects in the object distribution sequence; and
[0094] Based on the object distribution sequence and the MMD distance set, a recommendation result for recommending an object to the user is generated.
[0095] Example 2. The method of Example 1, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence comprises:
[0096] A sampled embedding sequence is generated by sampling the probability distribution of each object in the object distribution sequence.
[0097] Example 3. The method of Example 2, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises:
[0098] generating a position embedding sequence by generating a trainable corresponding position embedding for each sample embedding in the sample embedding sequence;
[0099] generating an adjusted sample embedding sequence based on the sample embedding sequence and the position embedding sequence; and
[0100] The MMD distance set is generated based on the adjusted sample embedding sequence.
[0101] Example 4. The method of Example 3, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises:
[0102] For a first sample embedding and a second sample embedding in the adjusted sample embedding sequence, determining an MMD between the first sample embedding and the second sample embedding,
[0103] Wherein the first sampling embedding corresponds to the probability distribution of the first object in the object distribution sequence, the second sampling embedding corresponds to the probability distribution of the second object in the object distribution sequence, and the MMD indicates the MMD distance between the probability distribution of the first object and the probability distribution of the second object.
[0104] Example 5. The method of Example 4, wherein determining the MMD between the first sample embedding and the second sample embedding comprises:
[0105] The MMD is determined using a Gaussian kernel function based on the first sample embedding, the second sample embedding, a bandwidth parameter, and a hyperparameter.
[0106] Example 6. The method of Example 1, wherein generating the recommendation result of recommending an object to the user comprises:
[0107] generating a centroid distribution of the object distribution sequence based on the object distribution sequence and the MMD distance set, wherein the centroid distribution is an average probability distribution of the object distribution sequence; and
[0108] generating a predicted probability distribution based on the centroid distribution of the object distribution sequence; and
[0109] Based on the predicted probability distribution, the recommendation result is generated.
[0110] Example 7. The method of Example 6, wherein generating the centroid distribution of the object distribution sequence comprises:
[0111] determining a weighting parameter for the object distribution sequence based on the MMD distance set; and
[0112] The center-of-gravity distribution of the object distribution sequence is generated based on the object distribution sequence and the weighting parameter.
[0113] Example 8. The method of Example 6, wherein generating the predicted probability distribution comprises:
[0114] Generate a centroid sampling embedding by sampling the centroid distribution of the object distribution sequence; and
[0115] Based on the centroid sampling embedding, an intermediate embedding is generated using a feedforward neural network and an exponential linear unit (ELU) activation function, wherein the feedforward neural network includes multiple fully connected layers.
[0116] Example 9. The method of Example 8, wherein generating the predicted probability distribution further comprises:
[0117] generating a predicted embedding based on the centroid-sampled embedding and the intermediate embedding using residual connections, layer normalization, and random dropout layers; and
[0118] Based on the predicted embedding, the predicted probability distribution is generated.
[0119] Example 10. The method according to Example 6, wherein generating the recommendation result further comprises:
[0120] Generate a predicted MMD distance set by determining the MMD distance between the predicted probability distribution and the probability distribution of each target object in the target object library; and
[0121] The recommendation result is determined based on the predicted MMD distance set.
[0122] Example 11. The method of Example 6, further comprising:
[0123] Based on the predicted probability distribution, the probability distribution of positive samples of the user's next actual interaction, and the probability distribution of negative samples with which the user has not interacted, a first loss function is generated using Bayesian personalized ranking.
[0124] Example 12. The method of Example 11, further comprising:
[0125] A second loss function is generated using a hinge loss function based on the predicted probability distribution, the probability distribution of the positive samples, and the probability distribution of the negative samples.
[0126] Example 13. The method of Example 12, further comprising:
[0127] generating a joint loss function based on the first loss function and the second loss function; and
[0128] The joint loss function is used to generate a sequential recommendation model.
[0129] Example 14. An apparatus for recommendation, comprising:
[0130] An object sequence acquisition module is configured to acquire a sequence of objects that a user has interacted with historically, wherein the sequence of objects is sorted by interaction time;
[0131] a distribution sequence generating module, configured to generate an object distribution sequence based on a plurality of probability distributions of a plurality of objects in the object sequence;
[0132] a distribution distance determination module configured to generate an MMD distance set based on the object distribution sequence by determining a maximum mean difference (MMD) distance between probability distributions of each pair of objects in the object distribution sequence; and
[0133] The recommendation result generation module is configured to generate a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set.
[0134] Example 15. The apparatus of Example 14, wherein determining the MMD distance between probability distributions of each pair of objects in the object distribution sequence comprises:
[0135] The object distribution sampling module is configured to generate a sampled embedding sequence by sampling the probability distribution of each object in the object distribution sequence.
[0136] Example 16. The apparatus of Example 15, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises:
[0137] a position embedding generation module configured to generate a position embedding sequence by generating a trainable corresponding position embedding for each sample embedding in the sample embedding sequence;
[0138] a position embedding using module configured to generate an adjusted sample embedding sequence based on the sample embedding sequence and the position embedding sequence; and
[0139] The distance set generating module is configured to generate the MMD distance set based on the adjusted sample embedding sequence.
[0140] Example 17. The apparatus of Example 16, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises:
[0141] a distribution distance determination module configured to determine, for a first sample embedding and a second sample embedding in the adjusted sample embedding sequence, an MMD between the first sample embedding and the second sample embedding;
[0142] Wherein the first sampling embedding corresponds to the probability distribution of the first object in the object distribution sequence, the second sampling embedding corresponds to the probability distribution of the second object in the object distribution sequence, and the MMD indicates the MMD distance between the probability distribution of the first object and the probability distribution of the second object.
[0143] Example 18. The apparatus of Example 17, wherein determining the MMD between the first sample embedding and the second sample embedding comprises:
[0144] The kernel function using module is configured to determine the MMD using a Gaussian kernel function based on the first sample embedding, the second sample embedding, a bandwidth parameter and a hyperparameter.
[0145] Example 19. The apparatus of Example 14, wherein generating the recommendation result of recommending an object to the user comprises:
[0146] a centroid distribution generating module configured to generate a centroid distribution of the object distribution sequence based on the object distribution sequence and the MMD distance set, wherein the centroid distribution is an average probability distribution of the object distribution sequence; and
[0147] a predicted distribution generating module configured to generate a predicted probability distribution based on the centroid distribution of the object distribution sequence; and
[0148] The predicted distribution using module is configured to generate the recommendation result based on the predicted probability distribution.
[0149] Example 20. The apparatus of example 20, wherein generating the centroid distribution of the object distribution sequence comprises:
[0150] a weighting parameter determination module configured to determine a weighting parameter for the object distribution sequence based on the MMD distance set; and
[0151] The weighting parameter using module is configured to generate the centroid distribution of the object distribution sequence based on the object distribution sequence and the weighting parameter.
[0152] Example 21. The apparatus of Example 19, wherein generating the predicted probability distribution comprises:
[0153] a centroid distribution sampling module configured to generate a centroid sampling embedding by sampling the centroid distribution of the object distribution sequence; and
[0154] An intermediate embedding generation module is configured to generate an intermediate embedding based on the centroid sampling embedding using a feedforward neural network and an exponential linear unit (ELU) activation function, wherein the feedforward neural network includes multiple fully connected layers.
[0155] Example 22. The apparatus of Example 21, wherein generating the predicted probability distribution further comprises:
[0156] A prediction embedding generation module configured to generate a prediction embedding based on the centroid sampled embedding and the intermediate embedding using residual connections, layer normalization, and random dropout layers; and
[0157] The prediction distribution generation module is configured to generate the prediction probability distribution based on the prediction embedding.
[0158] Example 23. The apparatus according to Example 19, wherein generating the recommendation result further comprises:
[0159] a predicted distance generation module configured to generate a predicted MMD distance set by determining the MMD distance between the predicted probability distribution and the probability distribution of each target object in the target object library; and
[0160] The predicted distance using module is configured to determine the recommendation result based on the predicted MMD distance set.
[0161] Example 24. The apparatus of Example 19, further comprising:
[0162] The first loss generation module is configured to generate a first loss function using Bayesian personalized ranking based on the predicted probability distribution, the probability distribution of positive samples of the user's next actual interaction, and the probability distribution of negative samples with which the user has not interacted.
[0163] Example 25. The apparatus of Example 24, further comprising:
[0164] The second loss generation module is configured to generate a second loss function using a hinge loss function based on the predicted probability distribution, the probability distribution of the positive samples, and the probability distribution of the negative samples.
[0165] Example 26. The apparatus of Example 25, further comprising:
[0166] A third loss generating module is configured to generate a joint loss function based on the first loss function and the second loss function; and
[0167] The third loss using module is configured to generate a sequential recommendation model using the joint loss function.
[0168] Example 27. An electronic device comprising:
[0169] processor; and
[0170] a memory coupled to the processor, the memory having instructions stored therein, the instructions causing the electronic device to perform actions when executed by the processor, the actions comprising:
[0171] Obtain a sequence of objects that the user has interacted with historically, sorted by interaction time;
[0172] generating an object distribution sequence based on a plurality of probability distributions of a plurality of objects in the object sequence;
[0173] generating an MMD distance set based on the object distribution sequence by determining a maximum mean difference (MMD) distance between probability distributions of each pair of objects in the object distribution sequence; and
[0174] Based on the object distribution sequence and the MMD distance set, a recommendation result for recommending an object to the user is generated.
[0175] Example 28. The electronic device of Example 27, wherein determining the MMD distance between probability distributions of each pair of objects in the object distribution sequence comprises:
[0176] A sampled embedding sequence is generated by sampling the probability distribution of each object in the object distribution sequence.
[0177] Example 29. The electronic device of Example 28, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises:
[0178] generating a position embedding sequence by generating a trainable corresponding position embedding for each sample embedding in the sample embedding sequence;
[0179] generating an adjusted sample embedding sequence based on the sample embedding sequence and the position embedding sequence; and
[0180] The MMD distance set is generated based on the adjusted sample embedding sequence.
[0181] Example 30. The electronic device of Example 29, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises:
[0182] For a first sample embedding and a second sample embedding in the adjusted sample embedding sequence, determining an MMD between the first sample embedding and the second sample embedding,
[0183] Wherein the first sampling embedding corresponds to the probability distribution of the first object in the object distribution sequence, the second sampling embedding corresponds to the probability distribution of the second object in the object distribution sequence, and the MMD indicates the MMD distance between the probability distribution of the first object and the probability distribution of the second object.
[0184] Example 31. The electronic device of Example 30, wherein determining the MMD between the first sample embedding and the second sample embedding comprises:
[0185] The MMD is determined using a Gaussian kernel function based on the first sample embedding, the second sample embedding, a bandwidth parameter, and a hyperparameter.
[0186] Example 32. The electronic device of Example 27, wherein generating the recommendation result of recommending an object to the user comprises:
[0187] generating a centroid distribution of the object distribution sequence based on the object distribution sequence and the MMD distance set, wherein the centroid distribution is an average probability distribution of the object distribution sequence; and
[0188] generating a predicted probability distribution based on the centroid distribution of the object distribution sequence; and
[0189] Based on the predicted probability distribution, the recommendation result is generated.
[0190] Example 33. The electronic device of Example 32, wherein generating the center-of-gravity distribution of the object distribution sequence comprises:
[0191] determining a weighting parameter for the object distribution sequence based on the MMD distance set; and
[0192] The center-of-gravity distribution of the object distribution sequence is generated based on the object distribution sequence and the weighting parameter.
[0193] Example 34. The electronic device of Example 32, wherein generating the predicted probability distribution comprises:
[0194] Generate a centroid sampling embedding by sampling the centroid distribution of the object distribution sequence; and
[0195] Based on the centroid sampling embedding, an intermediate embedding is generated using a feedforward neural network and an exponential linear unit (ELU) activation function, wherein the feedforward neural network includes multiple fully connected layers.
[0196] Example 35. The electronic device of Example 34, wherein generating the predicted probability distribution further comprises:
[0197] generating a predicted embedding based on the centroid-sampled embedding and the intermediate embedding using residual connections, layer normalization, and random dropout layers; and
[0198] Based on the predicted embedding, the predicted probability distribution is generated.
[0199] Example 36. The electronic device according to Example 32, wherein generating the recommendation result further comprises:
[0200] Generate a predicted MMD distance set by determining the MMD distance between the predicted probability distribution and the probability distribution of each target object in the target object library; and
[0201] The recommendation result is determined based on the predicted MMD distance set.
[0202] Example 37. The electronic device of Example 32, further comprising:
[0203] Based on the predicted probability distribution, the probability distribution of positive samples of the user's next actual interaction, and the probability distribution of negative samples with which the user has not interacted, a first loss function is generated using Bayesian personalized ranking.
[0204] Example 38. The electronic device of Example 37, further comprising:
[0205] A second loss function is generated using a hinge loss function based on the predicted probability distribution, the probability distribution of the positive samples, and the probability distribution of the negative samples.
[0206] Example 39. The electronic device of Example 38, further comprising:
[0207] generating a joint loss function based on the first loss function and the second loss function; and
[0208] The joint loss function is used to generate a sequential recommendation model.
[0209] Although the present disclosure has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for recommendation, include: Obtain a sequence of objects that the user has interacted with historically, where the sequence of objects is sorted by interaction time; generating an object distribution sequence based on a plurality of probability distributions of a plurality of objects in the object sequence; Based on the object distribution sequence, generating an MMD distance set by determining a maximum mean difference (MMD) distance between probability distributions of each pair of objects in the object distribution sequence; and Based on the object distribution sequence and the MMD distance set, a recommendation result for recommending an object to the user is generated.
2. The method according to claim 1, wherein the MMD distance between the probability distributions of each pair of objects in the object distribution sequence is determined include: A sampled embedding sequence is generated by sampling the probability distribution of each object in the object distribution sequence.
3. The method according to claim 2, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises: include: generating a sequence of position embeddings by generating a trainable corresponding position embedding for each sampled embedding in the sequence of sampled embeddings; Based on the sample embedding sequence and the position embedding sequence, generating an adjusted sample embedding sequence; as well as The MMD distance set is generated based on the adjusted sample embedding sequence.
4. The method according to claim 3, wherein determining the MMD distance between the probability distributions of each pair of objects in the object distribution sequence further comprises: include: For a first sample embedding and a second sample embedding in the adjusted sample embedding sequence, determining an MMD between the first sample embedding and the second sample embedding, The first sample embedding corresponds to the probability distribution of the first object in the object distribution sequence, the second sample embedding corresponds to the probability distribution of the second object in the object distribution sequence, and the MMD indicates the probability distribution of the first object. The MMD distance between the probability distribution of the cloth and the second object.
5. The method of claim 4, wherein determining the MMD between the first sample embedding and the second sample embedding include: The MMD is determined using a Gaussian kernel function based on the first sample embedding, the second sample embedding, a bandwidth parameter, and a hyperparameter.
6. The method according to claim 1, wherein the recommendation result of recommending an object to the user is generated include: Based on the object distribution sequence and the MMD distance set, generating a centroid distribution of the object distribution sequence, wherein the centroid distribution is an average probability distribution of the object distribution sequence; as well as generating a predicted probability distribution based on the centroid distribution of the object distribution sequence; and Based on the predicted probability distribution, the recommendation result is generated.
7. The method according to claim 6, wherein the centroid distribution of the object distribution sequence is generated include: Determining a weighting parameter for the object distribution sequence based on the MMD distance set; as well as The centroid distribution of the object distribution sequence is generated based on the object distribution sequence and the weighting parameter.
8. The method of claim 6, wherein the predicted probability distribution is generated include: Generate a centroid sampling embedding by sampling the centroid distribution of the object distribution sequence; as well as Based on the centroid sampling embedding, an intermediate embedding is generated using a feedforward neural network and an exponential linear unit (ELU) activation function, wherein the feedforward neural network includes a plurality of fully connected layers.
9. The method of claim 8, wherein generating the predicted probability distribution further comprises: include: Based on the centroid sampling embedding and the intermediate embedding, residual connection, layer regression Normalization and random dropout layers to generate prediction embeddings; as well as Based on the predicted embedding, the predicted probability distribution is generated.
10. The method according to claim 6, generating the recommendation result further include: Generate a predicted MMD distance set by determining the MMD distance between the predicted probability distribution and the probability distribution of each target object in the target object library; as well as The recommendation result is determined based on the predicted MMD distance set.
11. The method according to claim 6, further comprising: include: Based on the predicted probability distribution, the probability distribution of the positive samples of the next actual interaction of the user, and the probability distribution of the negative samples that the user has not interacted with, a first loss function is generated by using Bayesian personalized ranking.
12. The method according to claim 11, further comprising: include: Based on the predicted probability distribution, the probability distribution of the positive samples, and the probability distribution of the negative samples, a second loss function is generated using a hinge loss function.
13. The method according to claim 12, further comprising: include: Generate a joint loss function based on the first loss function and the second loss function; as well as The joint loss function is used to generate a sequential recommendation model.
14. A device for recommending, include: An object sequence acquisition module is configured to acquire a sequence of objects that a user has interacted with historically, wherein the sequence of objects is sorted by interaction time; a distribution sequence generation module, configured to generate an object distribution sequence based on a plurality of probability distributions of a plurality of objects in the object sequence; a distribution distance determination module configured to generate an MMD distance set based on the object distribution sequence by determining a maximum mean difference (MMD) distance between probability distributions of each pair of objects in the object distribution sequence; and The recommendation result generation module is configured to generate a recommendation result for recommending an object to the user based on the object distribution sequence and the MMD distance set.
15. An electronic device, include: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 13. 16 . A computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement the method according to claim 1 .
Citation Information
Patent Citations
Sequence recommendation method and device focusing on core interest of user
CN114461906A
Feature extraction method and device, electronic equipment and storage medium
CN114707633A
Recommendation method and device, electronic equipment and medium
CN116484106A
Systems and methods for a cross media joint friend and item recommendation framework
US20210272217A1
Scalable architecture for recommendation
US20220237682A1
