Object recommendation method, device, medium and computing device

By using forward diffusion networks and reverse diffusion networks in object recommendations, combining the attention layer of historical interactive objects and category sequences, and injecting Gaussian noise, the problems of high computing costs and uncontrollable recommendation results in the prior art are solved, and a more accurate and personalized recommendation effect is achieved.

CN118170992BActive Publication Date: 2025-04-22HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410444949.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2025-04-22
Estimated Expiration
2044-04-12

AI Technical Summary

Technical Problem

The prior art introduces a hyperparameter suppression mass diffusion process in object recommendation, which increases calculation costs, and is affected by multiple factors based on hyperparameter selection, resulting in uncontrollable recommendation results.

Method used

By constructing an attention layer based on historical interactive object sequences and category sequences in the forward diffusion network, Gaussian noise is injected, and a Gaussian representation of the predicted object is generated using the reverse diffusion network to perform object recommendation.

Benefits of technology

It improves the accuracy and personalization of the recommended results, reduces the calculation cost, and realizes controllability of the diffusion process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170992B_ABST
    Figure CN118170992B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide an object recommendation method, apparatus, medium and computing device. By constructing an attention layer based on interactive objects and interactive object category sequences in a forward diffusion network, the historical interactive object sequence and historical interactive object category sequence of the target user in a specified recommendation scenario are obtained to characterize the user preference, the user's historical interactive object sequence and the corresponding historical interactive object category sequence are modeled as Gaussian distributions, and the reverse diffusion network and the forward diffusion network are set to use the same structure and parameters, according to the historical interaction sequence and the introduced Gaussian noise, the Gaussian representation of the predicted object is generated through the forward diffusion network and the reverse denoising network, so that the object is recommended according to the Gaussian representation, and the generation of recommendation results is guided by multiple historical sequence information such as historical interactive objects and object category sequences, thereby improving the accuracy of personalized recommendations for users in specified recommendation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of data analysis, and more specifically, embodiments of the present invention relate to object recommendation methods, devices, media, and computing devices. Background Art

[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] Object recommendation refers to the use of users' historical behavior data, preference information and other personal characteristics to analyze and mine user needs through algorithms, and recommend items or services that meet their interests and preferences to users. During the recommendation process, the system will provide personalized recommendation results based on the user's personalized needs and behavioral habits to enhance user experience and satisfaction, such as customized recommendations for music, goods, videos and other scenarios.

[0004] In the related technology, the mass diffusion model is used to estimate the similarity from collected items to uncollected items, and the process of suppressing mass diffusion by using hyperparameters is proposed. By obtaining item data sets and user data sets with different popularity and establishing a hyperparameter balanced diffusion model, it is possible to generate a personalized recommendation list based on users and items according to the diffusion model. The best recommendation results are obtained by traversing the hyperparameters, and excessive diffusion between people and items is suppressed by adjusting popular users and items at the same time, thereby improving the diversity of recommendation results.

[0005] However, the above scheme introduces hyperparameters to suppress the quality diffusion process. By adjusting both users and items at the same time to suppress excessive diffusion, it increases the computational cost of generating recommended objects that meet user preferences in the recommendation scenario. In addition, since the hyperparameter selection is affected by multiple factors and the diffusion model is unsupervised, it is impossible to accurately generate recommendation results for users in this recommendation scenario. Summary of the invention

[0006] In view of this, in order to solve the above problems, embodiments of the present invention are intended to provide an object recommendation method, apparatus, medium and computing device.

[0007] In a first aspect of the embodiments of the present invention, a method for object recommendation is provided, the method comprising:

[0008] Obtain the target user's historical interaction object sequence in the specified recommendation scenario and the corresponding historical interaction object category sequence;

[0009] respectively determining an object Gaussian representation sequence of the historical interaction object sequence and a category Gaussian representation sequence of the historical interaction object category sequence;

[0010] Injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain a noisy Gaussian representation sequence; the noise information includes a noisy Gaussian representation after the random noise that conforms to the Gaussian distribution is subjected to noise processing, and an embedding vector corresponding to the number of noise processing steps; the noise processing is implemented by a noise layer of a pre-trained forward diffusion network;

[0011] Inputting the noisy Gaussian representation sequence and the class Gaussian representation sequence into the attention layer of the forward diffusion network; the attention layer is used to perform sequence information aggregation processing on the noisy Gaussian representation sequence and the class Gaussian representation sequence;

[0012] Inputting the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network into the reverse diffusion network to obtain the predicted Gaussian representation of the predicted object; the reverse diffusion network has the same structure and parameters as the forward diffusion network;

[0013] According to the predicted Gaussian representation of the predicted object, the interactive object recommendation result for the target user in the specified recommendation scenario is determined from a candidate object set; the candidate object set refers to a set of all selectable objects for recommendation in the specified recommendation scenario.

[0014] Optionally, the determining the object Gaussian representation sequence of the historical interaction object sequence and the category Gaussian representation sequence of the historical interaction object category sequence respectively includes:

[0015] Determine the Gaussian representation of each element in the target interaction sequence; the target interaction sequence includes any one of the historical interaction object sequence and the historical interaction object category sequence;

[0016] Determine a positional Gaussian representation corresponding to the sequence position of the element;

[0017] The sum of the element Gaussian representation and the position Gaussian representation of each element is sorted in sequence order to obtain a Gaussian representation sequence corresponding to the target interaction sequence.

[0018] Optionally, injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain the noisy Gaussian representation sequence includes:

[0019] Adding the noisy Gaussian representation to the embedding vector to obtain a first Gaussian representation;

[0020] Multiplying the control parameter corresponding to the interactive object by the first Gaussian representation element by element to obtain a second Gaussian representation; the control parameter is sampled from a Gaussian distribution whose mean and variance are hyperparameters;

[0021] The second Gaussian representation is added to the Gaussian representation of the interactive object to generate a noisy Gaussian representation sequence.

[0022] Optionally, the embedding vector has the same length as the noise Gaussian representation; the method further includes a step of acquiring the embedding vector, comprising:

[0023] Encoding the odd positions of the embedded vector using a cosine function, and encoding the even positions of the embedded vector using a sine function;

[0024] An embedding vector is obtained according to the encoding results of the sine function and the cosine function.

[0025] Optionally, the noisy Gaussian representation includes a first mean vector and a first covariance vector; the Gaussian representation of the interactive object includes an object mean vector and an object covariance vector; the noisy Gaussian representation sequence includes a noisy mean sequence and a noisy covariance sequence;

[0026] The injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain the noisy Gaussian representation sequence includes:

[0027] Combining the first mean vector, the embedding vector and the object mean vector to obtain the noisy mean sequence;

[0028] The first covariance vector, the embedding vector and the object covariance vector are combined to obtain the noisy covariance sequence.

[0029] Optionally, the noisy Gaussian representation sequence includes a noisy Gaussian representation of each interactive object; the category Gaussian representation sequence includes a category Gaussian representation of the category to which each interactive object belongs; the attention layer of the forward diffusion network includes a self-attention layer and a cross-attention aggregation layer;

[0030] The self-attention layer is used to determine the attention score of the p-th interactive object to the q-th interactive object according to the category Gaussian representation to which the p-th interactive object belongs and the noisy Gaussian representation of the q-th interactive object for multiple interactive objects in the noisy Gaussian representation sequence; wherein p is less than or equal to q;

[0031] The cross-attention aggregation layer is used to normalize the attention scores of the interactive objects, and utilize the cross-attention mechanism to aggregate information of the interactive objects according to the normalized results of the attention scores and the category Gaussian representation sequence.

[0032] Optionally, when the forward diffusion network includes the self-attention layer and the cross-attention layer, the forward diffusion network also includes a feedforward neural network layer; the feedforward neural network layer is used to perform post-processing operations on the mean and covariance in the aggregated vector respectively; the post-processing operations include at least: normalization operation, introduction of nonlinear information processing operation, at least one of the operations.

[0033] Optionally, the reverse diffusion network is used to perform a jump reverse diffusion process on the last Gaussian representation to generate the predicted Gaussian representation; the number of steps of the reverse diffusion is calculated based on the number of steps of the noise addition process and a set skip sampling step size.

[0034] Optionally, the method further comprises a training step of the forward diffusion network, wherein the training step comprises:

[0035] Acquire training samples, including a historical interaction object sequence and a historical interaction object category sequence of each sample user in the specified recommendation scenario, and a target interaction object at the next moment of the last interaction moment in the historical interaction object sequence;

[0036] Constructing a Gaussian representation sequence of sample objects of the historical interaction object sequence and a Gaussian representation sequence of sample categories of the historical interaction object category sequence;

[0037] Input the third Gaussian representation of the target interactive object into the noise layer of the forward diffusion network, and inject the fourth Gaussian representation output by the noise layer and the embedding vector corresponding to the number of noise processing steps of the noise layer as noise information into the sample object Gaussian representation sequence to generate a corresponding noisy sample Gaussian representation sequence;

[0038] The noisy sample Gaussian representation sequence and the sample category Gaussian representation sequence are input into the attention layer, and according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network, the network parameters of the forward diffusion network are adjusted until the training convergence conditions are met.

[0039] Optionally, adjusting the network parameters of the forward diffusion network according to the difference between the last Gaussian representation in the Gaussian representation sequence of the result output of the last layer of the forward diffusion network and the third Gaussian representation comprises:

[0040] Using the mean and covariance of the last Gaussian representation and the mean and covariance of the third Gaussian representation as input parameters for calculating the Wasserstein distance, to obtain a distance value indicating the difference;

[0041] According to the distance value and the cross entropy loss function, the network parameters of the forward diffusion network are adjusted.

[0042] In a second aspect of the embodiments of the present invention, there is provided an object recommendation device, the device comprising:

[0043] A historical interaction information acquisition module is used to acquire the target user's historical interaction object sequence in a specified recommendation scenario and the corresponding historical interaction object category sequence;

[0044] a Gaussian representation sequence acquisition module, used to respectively determine the object Gaussian representation sequence of the historical interaction object sequence and the category Gaussian representation sequence of the historical interaction object category sequence;

[0045] A forward noise processing module is used to inject noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain a noisy Gaussian representation sequence; the noise information includes a noisy Gaussian representation after the random noise that conforms to the Gaussian distribution is subjected to noise processing, and an embedding vector corresponding to the number of noise processing steps; the noise processing is implemented by a noise layer of a pre-trained forward diffusion network;

[0046] A forward diffusion module, used for inputting the noisy Gaussian representation sequence and the class Gaussian representation sequence into the attention layer of the forward diffusion network; the attention layer is used for performing sequence information aggregation processing on the noisy Gaussian representation sequence and the class Gaussian representation sequence;

[0047] A reverse diffusion module, used for inputting the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network into the reverse diffusion network to obtain a predicted Gaussian representation of the predicted object; the reverse diffusion network has the same structure and parameters as the forward diffusion network;

[0048] A recommendation result acquisition module is used to determine the interactive object recommendation result for the target user in the specified recommendation scenario from a candidate object set based on the predicted Gaussian representation of the predicted object; the candidate object set refers to the set of all selectable objects for recommendation in the specified recommendation scenario.

[0049] Optionally, the Gaussian representation sequence acquisition module is specifically used for:

[0050] Determine the Gaussian representation of each element in the target interaction sequence; the target interaction sequence includes any one of the historical interaction object sequence and the historical interaction object category sequence;

[0051] Determine a positional Gaussian representation corresponding to the sequence position of the element;

[0052] The sum of the element Gaussian representation and the position Gaussian representation of each element is sorted in sequence order to obtain a Gaussian representation sequence corresponding to the target interaction sequence.

[0053] Optionally, the forward noise addition processing module is specifically used to:

[0054] Adding the noisy Gaussian representation to the embedding vector to obtain a first Gaussian representation;

[0055] Multiplying the control parameter corresponding to the interactive object by the first Gaussian representation element by element to obtain a second Gaussian representation; the control parameter is sampled from a Gaussian distribution whose mean and variance are hyperparameters;

[0056] The second Gaussian representation is added to the Gaussian representation of the interactive object to generate a noisy Gaussian representation sequence.

[0057] Optionally, the embedding vector has the same length as the noise Gaussian representation; and the apparatus further includes a step of acquiring the embedding vector, comprising:

[0058] Encoding the odd positions of the embedded vector using a cosine function, and encoding the even positions of the embedded vector using a sine function;

[0059] An embedding vector is obtained according to the encoding results of the sine function and the cosine function.

[0060] Optionally, the noisy Gaussian representation includes a first mean vector and a first covariance vector; the Gaussian representation of the interactive object includes an object mean vector and an object covariance vector; the noisy Gaussian representation sequence includes a noisy mean sequence and a noisy covariance sequence;

[0061] The forward noise adding processing module is specifically used for:

[0062] Combining the first mean vector, the embedding vector and the object mean vector to obtain the noisy mean sequence;

[0063] The first covariance vector, the embedding vector and the object covariance vector are combined to obtain the noisy covariance sequence.

[0064] Optionally, the noisy Gaussian representation sequence includes a noisy Gaussian representation of each interactive object; the category Gaussian representation sequence includes a category Gaussian representation of the category to which each interactive object belongs; the attention layer of the forward diffusion network includes a self-attention layer and a cross-attention aggregation layer;

[0065] The self-attention layer is used to determine the attention score of the p-th interactive object to the q-th interactive object according to the category Gaussian representation to which the p-th interactive object belongs and the noisy Gaussian representation of the q-th interactive object for multiple interactive objects in the noisy Gaussian representation sequence; wherein p is less than or equal to q;

[0066] The cross-attention aggregation layer is used to normalize the attention scores of the interactive objects, and utilize the cross-attention mechanism to aggregate information of the interactive objects according to the normalized results of the attention scores and the category Gaussian representation sequence.

[0067] Optionally, the forward diffusion network also includes a feedforward neural network layer; the feedforward neural network layer is used to perform post-processing operations on the mean and covariance in the aggregated vector respectively; the post-processing operations include at least: normalization operation, introduction of nonlinear information processing operation.

[0068] Optionally, the reverse diffusion network is used to perform a jump reverse diffusion process on the last Gaussian representation to generate the predicted Gaussian representation; the number of steps of the reverse diffusion is calculated based on the number of steps of the noise addition process and a set skip sampling step size.

[0069] Optionally, the device further comprises a training step of the forward diffusion network, the training step comprising:

[0070] A training sample acquisition module, used to acquire training samples, including a historical interaction object sequence and a historical interaction object category sequence of each sample user in the specified recommendation scenario, and a target interaction object at the next moment of the last interaction moment in the historical interaction object sequence;

[0071] A Gaussian representation sequence construction module, used to construct a Gaussian representation sequence of sample objects of the historical interaction object sequence and a Gaussian representation sequence of sample categories of the historical interaction object category sequence;

[0072] a noisy sample sequence generation module, configured to input the third Gaussian representation of the target interactive object into the noisy layer of the forward diffusion network, and inject the fourth Gaussian representation output by the noisy layer and the embedding vector corresponding to the number of noisy processing steps of the noisy layer as noisy information into the sample object Gaussian representation sequence, to generate a corresponding noisy sample Gaussian representation sequence;

[0073] A training module is used to input the noisy sample Gaussian representation sequence and the sample category Gaussian representation sequence into the attention layer, and adjust the network parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network until the training convergence condition is met.

[0074] Optionally, when the training module is used to adjust the network parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network, it includes:

[0075] Using the mean and covariance of the last Gaussian representation and the mean and covariance of the third Gaussian representation as input parameters for calculating the Wasserstein distance, to obtain a distance value indicating the difference;

[0076] According to the distance value and the cross entropy loss function, the network parameters of the forward diffusion network are adjusted.

[0077] In a third aspect of the embodiments of the present invention, a readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method is implemented.

[0078] In a fourth aspect of the embodiments of the present invention, a computing device is provided, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the above method by calling the computer program.

[0079] According to the object recommendation method provided by the embodiment of the present invention, by constructing an attention layer based on the historical interaction object sequence and the historical interaction object category sequence in the forward diffusion network, it is possible to aggregate the interaction object and interaction object category sequence information, and characterize the user interaction preference by obtaining the historical interaction object sequence and the historical interaction object sequence of the target user in the specified recommendation scenario. The reverse diffusion network and the forward diffusion network are set to use the same structure and parameters, and the Gaussian representation of the predicted object is generated by using the forward diffusion network and the reverse denoising network according to the Gaussian distribution obtained by modeling the two types of historical sequences and the introduced random noise, so as to perform object recommendation based on the Gaussian representation, thereby realizing the use of multiple historical sequence information such as historical interaction objects and object category sequences to guide the generation of recommendation results, and improving the accuracy of personalized recommendations for users in the specified recommendation scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:

[0081] Figure 1A The overall flow chart of an object recommendation method according to an embodiment of the present invention is schematically shown;

[0082] Figure 1B A flowchart of an object recommendation method according to an embodiment of the present invention is schematically shown;

[0083] Figure 1C A schematic diagram of a Markov chain-based stepwise noise adding process according to an embodiment of the present invention is schematically shown;

[0084] Figure 1D A schematic diagram of a process of Markov chain-based stepwise inverse denoising and skip-step inverse denoising according to an embodiment of the present invention is schematically shown;

[0085] Figure 2 A flowchart for determining a Gaussian representation sequence corresponding to a historical interaction sequence according to an embodiment of the present invention is schematically shown;

[0086] Figure 3 Schematically shows a flow chart of generating a noisy Gaussian representation sequence of a historical interaction object sequence based on random noise according to an embodiment of the present invention;

[0087] Figure 4A A schematic diagram of a forward diffusion network according to an embodiment of the present invention is shown;

[0088] Figure 4B A schematic diagram of determining attention scores between interactive objects according to a historical interactive object sequence and an interactive object category sequence according to an embodiment of the present invention is schematically shown;

[0089] Figure 5 A training method for a forward diffusion network according to an embodiment of the present invention is schematically shown;

[0090] Figure 6 A block diagram of an object recommendation device according to an embodiment of the present invention is schematically shown;

[0091] Figure 7 A schematic diagram of a medium according to an embodiment of the present invention is schematically shown;

[0092] Figure 8 A schematic diagram of a computing device according to an embodiment of the present invention is schematically shown.

[0093] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0094] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0095] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present invention may be implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0096] According to an embodiment of the present invention, an object recommendation method, apparatus, medium and computing device are proposed.

[0097] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0098] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.

[0099] The generative model assumes that real data follows an unknown probability distribution, and models the evolution of user interests through a learning generation process. It represents user preferences as a distribution in the latent feature space to predict the user's next possible interaction objects, thereby capturing the uncertainty and dynamics of the prevalent user preferences, achieving accurate modeling and prediction, improving the recommendation system's ability to mine user preferences, and improving user satisfaction.

[0100] For generative models, the generative model based on GAN (Generative Adversarial Networks) uses the generator to learn the correlation distribution of user interests and uses adversarial training to optimize the parameters, but this model has problems such as overfitting risk and gradient vanishing; the generative model based on VAE (Variational Autoencoder) uses the encoder to generate latent factors to capture the nonlinear patterns of users and latent space, but this model has problems such as limited feature expression ability and inability to effectively approximate the latent distribution of real data.

[0101] The diffusion model can capture the complex structure and potential associations in the data by introducing noise and using the diffusion process to propagate information. It adds noise to corrupt the input data in the forward process and infers the future state based on the damaged data in the reverse process, thereby reconstructing and generating the data. Object-based recommendation is based on the inference of user future behavior based on the noisy user interaction sequence. The reverse process of the diffusion model is suitable for object recommendation needs.

[0102] Related technologies propose a personalized recommendation method based on users and items. By acquiring item datasets and user datasets of different popularity and establishing a hyperparameter balanced diffusion model, a personalized recommendation list based on users and items is generated according to the diffusion model. This scheme uses hyperparameters to suppress mass diffusion, traverses hyperparameters to achieve the best recommendation results, and suppresses excessive diffusion between people and items by adjusting popular users and items at the same time, thereby improving the diversity of recommendation results.

[0103] However, the diffusion model has the problem of uncontrollable recommendation results without supervision. The above solution uses hyperparameters and diffusion models for personalized recommendations, which increases the computational cost of generating recommended objects that meet user preferences in recommendation scenarios. In addition, since the hyperparameter selection is affected by multiple factors and the diffusion model is unsupervised, it is impossible to accurately generate recommendation results for users in recommendation scenarios.

[0104] Another method for recommending image generation models proposed in the related art first obtains multiple interest and hobby data and multiple initial images, uses the data to train a comparative learning image-text model, and uses massive images to train a diffusion model, and combines the two sets of trained models to obtain an image generation model; the collected user interest and hobby data and attribute data are input into the image generation model, and recommendations are made through combining three methods, namely, interest and hobby corresponding recommendation, matrix decomposition recommendation, and collaborative filtering based on group features, to obtain a recommendation list that meets the user's interests and needs.

[0105] However, this solution is suitable for image recommendation scenarios. The recommendation accuracy may be affected when it is migrated to other recommendation scenarios. In addition, this method requires obtaining a recommendation list based on group features, which requires a lot of calculations and analysis under many application conditions. Its recommendation takes a long time and requires a lot of computing resources.

[0106] In summary, the object recommendation method provided in the related art has high computational cost and uncontrollable recommendation results, which affects the accuracy of the recommendation results. In view of this, in order to solve this technical problem, the present invention proposes an object recommendation method, which is aimed at sequence recommendation. By constructing an attention layer based on the historical sequence of the user's historical interaction objects and the historical sequence of the interaction object category in the forward diffusion network, a diffusion network architecture suitable for the historical interaction object category information sequence is designed, which improves the controllability of the diffusion process. Based on the forward diffusion network, the user's historical interaction object sequence and the corresponding historical interaction object category sequence are modeled as a Gaussian distribution, and according to the historical interaction sequence and Gaussian noise, the object recommendation is performed through the forward diffusion network and the corresponding inverse denoising network. The diffusion network that processes the continuous domain is applied to the recommendation scenario based on discrete data, and the generation of recommendation results is guided by the historical sequence, so that the diffusion network can better learn the user's interest changes and evolution laws, thereby improving the accuracy and personalization of the recommendation system. Among them, the "historical interaction object sequence" involved is a series of object sequences with a chronological order formed by the user's interactive operations on different objects in the recommendation scenario within the historical period under the specified recommendation scenario. It can reflect the user's behavior path and decision-making process when using the product or service in the recommendation scenario, and is used to analyze the user's preferences, behavior patterns and the laws of information dissemination. The corresponding "historical interaction object category sequence" refers to the sequence formed by the category information of the objects involved in the user's interaction process. This sequence can reflect the user's interaction behavior between objects of different categories, so as to identify the user's preferences and interests in objects of different categories.

[0107] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.

[0108] Exemplary Methods

[0109] The object recommendation method provided by the present invention can be applied to recommendation scenarios of various types of items or content, for example, product recommendations in scenarios such as e-commerce platforms or shopping websites, song recommendations in services such as music platforms or online music players, video recommendations in video website scenarios, food recommendations in catering applications, and other recommendation scenarios. It is understandable that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present invention, and the embodiments of the present invention are not limited in this respect. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.

[0110] Next, combine Figure 1A-Figure 8The flowchart of an object recommendation method according to an embodiment of the present invention is schematically shown to illustrate the object recommendation method provided by the present invention. The object recommendation method of the present invention is implemented based on a pre-trained forward diffusion network, which at least includes a noise addition layer for performing forward noise addition processing, and an attention layer for fusing historical interaction object sequences with corresponding interaction object category sequence information, and includes other network layers required for implementing forward diffusion; wherein the forward noise addition processing refers to the Markov chain (x0→x i →...→x t ) Add Gaussian noise to x0 gradually in t steps to generate x t process.

[0111] Based on the above pre-trained forward diffusion network, such as Figure 1A In the overall flow chart shown, the random embedding layer is used to convert discrete data into Gaussian representation, so as to model the user's historical interaction sequence and the corresponding historical interaction object category sequence as a Gaussian distribution; the construction of the noisy historical sequence is used to inject random noise into the historical interaction object sequence; the forward diffusion model is used to calculate the attention score of the two input sequences and perform information aggregation; the reverse generation result step is used to perform reverse denoising on the output of the forward diffusion model; the prediction step is used to determine the recommended object from the set of candidate objects and generate a recommendation result based on the Gaussian representation of the predicted object output by the denoising process.

[0112] Combination Figure 1A The overall framework diagram and the forward diffusion network shown in FIG. Figure 1B As shown, the object recommendation method provided by the present invention may at least include the following steps:

[0113] S101, obtaining a target user's historical interaction object sequence in a specified recommendation scenario and a corresponding historical interaction object category sequence;

[0114] The designated recommendation scenario refers to the recommendation scenario to which the object recommendation method is currently being applied, and the designated recommendation scenario includes but is not limited to song recommendation, video recommendation, product recommendation, advertisement recommendation, food recommendation, tourist attraction recommendation, article recommendation and other recommendation scenarios.

[0115] The target user refers to the user who needs to receive the recommendation service in the specified recommendation scenario. In the recommendation scenario, there are usually multiple users, each of whom has his or her own preferences, behavior patterns and needs. The target user refers to the user who is currently performing the recommendation operation. The recommendation results in the recommendation scenario need to be generated for the target user based on his or her personalized needs and historical behavior data.

[0116] The technical meaning of the historical interaction object sequence and the historical interaction object category sequence depends on the specified recommendation scenario and the target user itself. The historical interaction object sequence is a sequence of objects with a chronological order formed by the user's interaction operations with different objects in the recommendation scenario in the historical period before the current system time, which can reflect the user's object preferences and interest behaviors in the specified recommendation scenario in the historical period. For example, for a song recommendation scenario, the historical interaction sequence may include songs that the user likes in the historical period, or songs that are effectively played, arranged in the order of the historical period to form a song sequence; accordingly, the historical interaction object category sequence refers to a sequence composed of the categories to which each interaction object belongs in the historical interaction object sequence, such as in a song recommendation scenario, the historical interaction object category sequence may include a time sequence of song types for each interaction object.

[0117] S102, respectively determining an object Gaussian representation sequence of the historical interaction object sequence and a category Gaussian representation sequence of the historical interaction pair category sequence;

[0118] Gaussian representation is used to convert discrete information into continuous embedding vectors, and data points can be mapped into feature vectors of Gaussian distribution, that is, the mean vector and covariance vector are used as Gaussian representation to control the position and distribution shape of data points in the feature space, and accurately distinguish the similarities and differences between different objects. In this embodiment, the corresponding Gaussian representation sequence is obtained by converting discrete historical interaction objects and their categories into corresponding Gaussian representations, wherein the Gaussian representation can be an elliptical Gaussian representation.

[0119] Based on this, the object Gaussian representation sequence refers to a sequence composed of the Gaussian representation of each interactive object in the historical interactive object sequence, and correspondingly, the category Gaussian representation sequence refers to a sequence composed of the Gaussian representation of each interactive object category in the historical interactive object category sequence. Wherein, the sequence element includes any one of the interactive objects or interactive object categories, and the Gaussian representation of the sequence element can be implemented in any of the following ways:

[0120] The Gaussian representation of the sequence element can be obtained through two steps: element vector representation, mean and covariance calculation: first, each sequence element belonging to the same interaction sequence is represented as a vector, which can contain various feature information of the sequence element, such as the word vector describing the text included in the element, the feature vector of the element itself, etc. The feature information is used to capture the position and attributes of the element in the multidimensional space; then, according to the vectors of all sequence elements of the same interaction sequence, the mean vector and covariance vector corresponding to the sequence element are calculated to obtain the Gaussian representation of the sequence element;

[0121] Alternatively, you can use generative models such as Gaussian mixture models or Figure 1A The random embedding layer shown is used to learn the representation of the mean and covariance of the elements. Through modeling and training with sufficient training data, the generative model can automatically determine the optimal mean and covariance parameters for each input sequence element.

[0122] For example, for user u, the historical interaction object sequence is S u =[s1,s2,...,s n ], the corresponding historical interaction object category sequence is C u =[c1,c2,...,c n ], based on the above, we can know that the object Gaussian representation sequence includes the object mean sequence composed of the mean of each interactive object and the object covariance sequence consisting of the covariance of each interaction object Refer to the following expression (1), in the object mean sequence Represents the interactive object s n The mean of the object covariance sequence Represents the interactive object s n The covariance of is:

[0123]

[0124] Similarly, the category Gaussian representation includes the category mean sequence With the category covariance series

[0125] S103, injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain a noisy Gaussian representation sequence; the noise information includes a noisy Gaussian representation after the random noise that conforms to the Gaussian distribution is subjected to noise processing, and an embedding vector corresponding to the number of noise processing steps; the noise processing is implemented by a noise layer of a pre-trained forward diffusion network;

[0126] The forward diffusion network refers to a network used to implement the forward process of the diffusion network. The forward diffusion network includes a noise adding layer, which is used to process the input information through a Markov chain (x0→x i →...→x t ) generates t-step noise. For any diffusion step number t, the following forward diffusion formula can be used to directly calculate x after t-step noise addition from the input x0. t , the size and direction of the noise are affected by and β s This parameter and hyperparameter can be adjusted to control the characteristics of the generation process, such as the amplitude and convergence of the noise:

[0127]

[0128] α s =1-β s

[0129]

[0130] in, It is subject to mean μ and variance σ 2 Gaussian distribution, I is the identity matrix; represents the cumulative noise coefficient from the initial to the tth step, by dividing the α of each step by s Multiplication; β s is the noise added in the sth step, which is controlled by the hyperparameters a, b, and the maximum number of diffusion steps T. s >1, reduce it to 0.1 times of the original value, that is, β s =0.1*β s .

[0131] The above-mentioned random noise that conforms to the Gaussian distribution refers to the noise generated by random variables that obey the Gaussian distribution, which is used to simulate the randomness and uncertainty in the real world and can be obtained in the following ways: it can be obtained by using a function or method that can generate random numbers that conform to the Gaussian distribution; or, random variables with known distributions can be appropriately transformed to obtain random noise that conforms to the Gaussian distribution, such as converting uniformly distributed random variables into random variables that conform to the standard Gaussian distribution through the Box-Muller transformation; or, random noise that conforms to the Gaussian distribution can be obtained by direct sampling in combination with techniques such as numerical integration or inverse transformation.

[0132] In this embodiment, the random noise is first converted into an initial Gaussian representation, including a mean vector and the corresponding covariance vector According to the above forward diffusion formula, s steps of noise are added respectively to obtain the noise Gaussian representation of the output of the noise adding layer, see Figure 1C The noise addition process shown in the figure, after s steps of noise addition, the noise Gaussian representation is expressed as and

[0133]

[0134]

[0135] The embedding vector corresponding to the number of noise addition processing steps can reflect the noise addition situation, and is used to represent the number of noise addition processing steps of random noise and some dynamic characteristics of the noise addition process, such as the frequency and amplitude of the noise addition. The length of the embedding vector is the same as the length of the mean or covariance vector in the noisy Gaussian representation, and the acquisition method can be obtained by using different encoding methods according to the number of noise addition processing steps and the position of each element of the embedding vector according to the parity, such as using sin function and cos function encoding.

[0136] For the noisy Gaussian representation after the random noise is added, the noisy Gaussian representation is used to adjust the Gaussian representation of each interactive object in the object Gaussian representation sequence of the aforementioned historical interactive objects. Specifically, for the Gaussian representation of each interactive object, the embedding vector corresponding to the number of noise addition processing steps of the random noise and the noisy Gaussian representation are combined with the Gaussian representation of each interactive object to obtain the Gaussian representation of each interactive object after the noise addition information is injected. The interaction sequences of each interactive object are arranged to generate a corresponding noisy Gaussian representation sequence, including the Gaussian representation of each interactive object after the noise addition information is injected. Among them, the acquisition of the noisy Gaussian representation sequence can also be set to be automatically processed by the noisy layer of the forward diffusion network, that is, the object Gaussian representation sequence and the random noise are input into the noisy layer of the forward diffusion network, and the noisy layer first performs noise processing on the initial Gaussian representation of the random noise to obtain the noisy Gaussian representation of the random noise, and at the same time generates an embedding vector of the corresponding number of noise processing steps, and the noisy layer completes the process of injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence, and obtains the noisy Gaussian representation sequence output by the noisy layer. When the embedded vector and the noisy Gaussian representation are injected into the Gaussian representation sequence of each interactive object, the injection degree of the embedded vector and the noisy Gaussian representation into the Gaussian representation of the interactive object can be adjusted by controlling parameters.

[0137] Based on the noise Gaussian representation comprising a first mean vector and the first covariance vector The Gaussian representation of the interacting object includes the object mean vector and the object covariance vector When the noise Gaussian representation, the embedding vector and the Gaussian representation of the interactive object are combined, the first mean vector can be converted into The embedding vector is the same as the object mean vector Combined with the first covariance vector The embedding vector and the object covariance vector By combining, the noisy mean sequence and the noisy covariance sequence corresponding to the historical interaction object sequence after the noise information is injected are obtained respectively, and the two constitute the noisy Gaussian representation sequence.

[0138] By introducing the embedding vector of the noise processing steps and the noisy Gaussian representation of random noise into the historical interaction object sequence, the forward diffusion network can better understand the changes in the historical interaction object sequence and improve the ability to understand user behavior, thereby more accurately capturing the changing patterns of user behavior.

[0139] S104, inputting the noisy Gaussian representation sequence and the class Gaussian representation sequence into the attention layer of the forward diffusion network; the attention layer is used to perform sequence information aggregation processing on the noisy Gaussian representation sequence and the class Gaussian representation sequence;

[0140] That is, the noisy Gaussian representation corresponding to the historical interaction object sequence outputted in step S103 and the category Gaussian representation corresponding to the historical interaction object category sequence determined in step S102 are used as inputs of the attention layer of the forward diffusion network. The attention layer is used to calculate the attention scores between the interaction objects in the historical interaction object sequence, and to normalize and aggregate the attention scores obtained for each interaction object. The noisy Gaussian representation sequence is fused with the category information of the interaction object, so that the last Gaussian representation in the Gaussian representation sequence finally outputted by the forward diffusion network aggregates the information of the entire sequence. The last Gaussian representation integrates the user's various behavioral information and preference characteristics as a comprehensive representation of the user's overall preference.

[0141] Among them, when calculating the attention score of the first interactive object to the second interactive object in the sequence, the attention score can be determined based on the Gaussian representation of the first interactive object in the category Gaussian representation sequence and the Gaussian representation of the second interactive object in the noisy Gaussian representation sequence, combined with the learnable parameter vector and the linear unit activation function.

[0142] The attention scores are normalized to balance the attention weights between different interacting objects, ensuring that the sum of the attention scores of all interacting objects is 1, so as to better focus on important positions or features; the information aggregation processing is performed based on the output result of the normalization processing, and is used to integrate the Gaussian representation information of each interacting object according to the attention weight, and obtain the weighted sum of the output embedding representation of the interacting object at each position, so as to better capture the association and feature information between the interacting objects.

[0143] S105, inputting the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network into the reverse diffusion network to obtain a predicted Gaussian representation of the predicted object; the reverse diffusion network has the same structure and parameters as the forward diffusion network;

[0144] After the noisy Gaussian representation sequence and the category Gaussian representation sequence are processed by the forward diffusion network, the forward diffusion network finally outputs a Gaussian representation sequence. Based on the information aggregation processing of the attention layer, the last Gaussian representation of the Gaussian representation sequence output by the last layer integrates the information of the entire sequence and contains the key features and context information in the sequence. Therefore, after the last Gaussian representation is denoised by the reverse diffusion network, the processing result is determined as the Gaussian representation of the predicted interactive object.

[0145] The reverse diffusion network is used to perform the reverse denoising process of the diffusion model. Its input x t is a noise that obeys a Gaussian distribution. t Iterative denoising generates the true value x0(x t →x t-1 →...→x0), by x t Generate x t-1 The calculation formula is as follows:

[0146]

[0147] Among them, x′0 is the prediction of x by the neural network. t The fully denoised result can be predicted using the inverse diffusion network, α t-1 Used to represent the observed value x at the current moment of the true value x′0 at the previous step t- The proportion of t is Gaussian random noise, is defined as:

[0148]

[0149] Among them, η is a hyperparameter with a value range of [0,1], which controls the added random noise ∈ t degree.

[0150] The reverse diffusion network used in the present invention refers to a network with the same structure and parameters as the forward diffusion network, that is, the reverse diffusion network is the reverse operation of the forward diffusion network, and its network parameter values ​​are the same as those of the forward diffusion network. In the iterative denoising process, α t-1 The value of is the α at the t-1th step of the noise layer of the forward diffusion network. t-1 .

[0151] Based on the above content, after the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network is input into the reverse diffusion network, the reverse diffusion network iteratively denoises the last Gaussian representation, and can use the above Markov chain to gradually process and generate the predicted Gaussian representation. The reverse diffusion network first obtains the Gaussian representation x′0 of the last Gaussian representation after completely denoising, and substitutes it into the above formula to calculate x t-1 , in calculating x t-2 When x′0 is the predicted value for x t-1 Fully denoised result.

[0152] Based on this last Gaussian representation including the mean With covariance It is assumed that the inverse diffusion network predicts the mean and covariance of the last Gaussian representation after complete denoising as and According to the above formula, the last Gaussian representation x is input t Predict x t-1 The formula is:

[0153]

[0154]

[0155] See also Figure 1D The mean iterative denoising process ① shown in the figure is based on the maximum denoising step length of random noise in the forward denoising process, which is s steps. Therefore, the reverse diffusion network needs to iterate the mean of the last Gaussian representation of the input s times to obtain the mean of the predicted Gaussian representation. Similarly, the same iterative denoising process is applied to the covariance (not shown in the figure) to obtain the corresponding covariance

[0156] The number of iterations in the reverse diffusion phase will affect the time it takes to generate results. In order to increase the generation speed without losing the accuracy of the recommendation, the diffusion process is not restricted to a Markov chain, and a smaller number of sampling steps is used to speed up the generation process. See Figure 1D In the iterative denoising process ② shown, the last Gaussian representation is subjected to a jump reverse diffusion process to generate the predicted Gaussian representation; the number of steps of the reverse diffusion is calculated based on the number of steps of the denoising process and the set skip sampling step size; the skip sampling step size refers to the unit step size skipped by the reverse diffusion.

[0157] For example, for Markov chain diffusion, t and t-1 in the formula are two numbers that differ by 1 in mathematical sense, such as t = 9, t-1 = 8, and the diffusion sequence is (x 15 →x 14→...→x0); when using the jump reverse diffusion process, assuming that the number of diffusion steps is 16, in order to achieve accelerated generation, the jump sampling step is 4, then the diffusion sequence is (x 15 →x 14 →...→x0) becomes (x 12 →x8→x4→...→x0), at this time t=16 and t-1=12.

[0158] S106, determining, according to the predicted Gaussian representation of the predicted object, a recommendation result of the interactive object for the target user in the specified recommendation scenario from a candidate object set; the candidate object set refers to a set of all selectable objects for recommendation in the specified recommendation scenario.

[0159] The candidate object set includes all potential recommendation objects that can be selected in the recommendation scenario, and the specific meaning of the candidate object is associated with the recommendation scenario. In the commodity recommendation scenario, the candidate object refers to all commodities that can be selected as recommendation options; in the song recommendation scenario, the candidate object refers to all songs in the music library that can be recommended objects. Correspondingly, the interactive object recommendation result refers to the interactive object that meets the user's preference in the recommendation scenario selected from the candidate object set based on the predicted user preference, so as to meet the personalized recommendation needs of the target user. Determine the interactive object recommendation result for the target user in the specified recommendation scenario from the candidate object set, that is, select the candidate object that is most relevant to the predicted object from the candidate object set, and determine the interactive object recommendation result for the target user by calculating the matching degree of each candidate object in the candidate object set with the predicted object and sorting them in descending order based on the matching degree. The degree of match can be represented by calculating the distance between the Gaussian representation of each candidate object and the predicted Gaussian representation, and converting the distance into a probability value, which is used to represent the degree of match between the candidate object and the predicted object. The greater the distance, the smaller the corresponding probability value. Further, all candidate objects are sorted according to the probability value, and the candidate objects ranked first with a set number of digits are returned to the target user as recommendation results and displayed for the target user to browse and refer to.

[0160] According to the iterative denoising steps described above, the predicted Gaussian representation of the predicted object includes the mean With covariance Assume that the Gaussian representation of the i-th candidate in the candidate set includes the mean representation With covariance representation The Wasserstein distance can be used to measure the match between the predicted object and the Gaussian distribution of each candidate object, that is, the match between the predicted object and the i-th candidate object can be expressed as the following prediction probability p i , the p iThe calculation formula is as follows:

[0161]

[0162] In an embodiment of the present invention, for sequence recommendation, by constructing an attention layer based on interaction objects and interaction object category sequences in a forward diffusion network, the controllability of the diffusion process is improved. Based on the forward diffusion network, the user's historical interaction object sequence and the corresponding historical interaction object category sequence are modeled as a Gaussian distribution, and the diffusion network that processes continuous domains is applied to recommendation scenarios based on discrete data. The reverse diffusion network is set to use the same structure and parameters as the forward diffusion network, and according to the historical interaction sequence and the introduced Gaussian noise, a Gaussian representation of the predicted object is generated through the forward diffusion network and the corresponding reverse denoising network, so that object recommendation is performed based on the Gaussian representation, and the use of multiple historical sequence information such as historical interaction objects and object category sequences to guide the generation of recommendation results is achieved, thereby improving the accuracy of personalized recommendations for target users in specified recommendation scenarios and increasing the degree of personalization of recommendations; and parameter sharing realizes shared computing resources, avoids repeated calculations, and reduces the computing cost of interactive object recommendations for target users.

[0163] In some optional embodiments, for the object Gaussian representation sequence of the historical interaction object sequence and the category Gaussian representation sequence of the historical interaction object category sequence respectively determined in the aforementioned step S102, the Gaussian representation of each interaction object in the historical interaction object sequence of the target user can be obtained to constitute the object Gaussian representation sequence, and similarly, the Gaussian representation of each interaction object category itself can be obtained to constitute the category Gaussian representation sequence.

[0164] Alternatively, see Figure 2 As shown, for the historical interaction object sequence or the historical interaction object category sequence, the corresponding Gaussian representation sequence can be obtained in the following manner:

[0165] S201, determining the Gaussian representation of each element in a target interaction sequence; the target interaction sequence includes any one of the historical interaction object sequence and the historical interaction object category sequence;

[0166] For each element in the target interaction sequence itself, the element itself is represented as an element Gaussian representation, including the mean and covariance of the element, indicating the prediction and uncertainty degree of the element.

[0167] For user u in the above embodiment, the historical interaction object sequence is S u =[s1,s2,...,s n ] as an example, the Gaussian representation of the elements of the i-th interaction object itself can include the mean With covariance

[0168] S202, determining a position Gaussian representation corresponding to the sequence position of the element.

[0169] In sequence data, each element has its position information, such as the time point in a time series, the word position in a text sequence, etc. In an embodiment of the present invention, each element in the target interaction sequence has a corresponding sequence position in the sequence, and the position Gaussian representation corresponding to the sequence position of the element is obtained to consider the positional relationship between the elements, thereby better capturing the structural information in the sequence data.

[0170] Still taking the user u described in the above embodiment as an example, the historical interaction object sequence is S u =[s1,s2,...,s n ] as an example, the Gaussian representation of the position of the i-th interaction object can include the mean With covariance

[0171] S203, sorting the addition result of the element Gaussian representation and the position Gaussian representation of each element in sequence order to obtain a Gaussian representation sequence corresponding to the target interaction sequence.

[0172] The element Gaussian representation and the position Gaussian representation of the same element are added to obtain a new Gaussian representation of the element, and the sequence formed by the new Gaussian representation of each element in the target interaction sequence is the Gaussian representation sequence corresponding to the target interaction sequence.

[0173] For the above user u, the historical interaction object sequence is S u =[s1,s2,...,s n ], based on the Gaussian representation of the elements of the i-th interaction object itself, including the mean With covariance The corresponding position Gaussian representation includes the mean With covariance As shown in the following expression, the mean and covariance of the element Gaussian representation and the position Gaussian representation of the same element are added together to obtain the new Gaussian representation of the element. and The object Gaussian representation sequence corresponding to the historical interaction object sequence is:

[0174]

[0175]

[0176] in, represents the object mean sequence, represents the object covariance sequence, and the two constitute the object Gaussian representation sequence.

[0177] The above-mentioned method of obtaining the Gaussian representation of the element or the Gaussian representation of the position may refer to the method of obtaining the Gaussian representation of the sequence element recorded in the aforementioned embodiment, and the present invention will not be repeated here.

[0178] In an embodiment of the present invention, by introducing the Gaussian representation of the element itself and the Gaussian representation of the element sequence position, each element in the Gaussian representation sequence corresponding to the target interaction sequence simultaneously considers the uncertainty of its own value and position information, and combines the value and position information of the element through a Gaussian process to obtain a comprehensive sequence Gaussian representation, so as to better capture the element value information and the correlation and structural information of the element position; and, for the object recommendation scenario, it is necessary to consider giving different weights to objects at different times to avoid the problem of inaccurate recommendations due to changes in user interests over time. The position-based Gaussian representation can provide the importance information of the element in the sequence, thereby adjusting the weight assignment, so that the object recommendation better reflects the user's current interests and preferences, and avoids recommending outdated content.

[0179] In some alternative embodiments, see Figure 3 As shown, for the aforementioned step S103 of injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain the noisy Gaussian representation sequence, the noisy Gaussian representation sequence corresponding to the aforementioned object Gaussian representation sequence injected with noise information can be obtained by introducing control parameters and by the following method, which method may include the following steps:

[0180] S301, adding the noise Gaussian representation to the embedding vector to obtain a first Gaussian representation;

[0181] The embedding vector corresponding to the number of noise processing steps is the same as the mean or covariance length in the noise Gaussian representation. For the embedding vector of the number of noise processing steps t, the sine function and the cosine function can be used for encoding based on the parity of the element position in the vector, such as encoding the odd position of the embedding vector using the cosine function, and encoding the even position of the embedding vector using the sine function, thereby obtaining the embedding vector of the number of noise processing steps t according to the encoding results of the sine function and the cosine function. See the sine and cosine function encoding process shown in the following expression:

[0182] l t (2j) = sin(t / 10000 2j / d ),

[0183] l t (2j+1)=cos(t / 10000 (2j+1) / d),0≤j <d / 2

[0184] Wherein, t represents the number of noise adding steps, 2j and (2j+1) are respectively used to represent that the element position of the embedding vector of the noise adding step t is an even position and an odd position, and d is the mapping dimension of the mean vector or the covariance vector in the noise adding Gaussian representation.

[0185] For example, assuming that the number of steps for adding noise to the random noise is 5, and the value of d is 2, the embedded vector is represented as [x, y], where x is the value of the even number 0 position, and x=l t (0) = sin(5 / 10000 0 / 2 ), y is the value of the odd 1 position y=l t (1) = cos(5 / 10000 1 / 2 ).

[0186] The Gaussian representation of the noise output after random noise is processed by the noise layer of the forward diffusion network includes the mean representation And covariance representation Based on the embedding vector corresponding to the above-mentioned number of noise processing steps, the mean in the first Gaussian representation is expressed as The covariance is expressed as

[0187] S302, performing element-by-element multiplication of the control parameter corresponding to the interactive object and the first Gaussian representation to obtain a second Gaussian representation of the interactive object; the control parameter is sampled from a Gaussian distribution whose mean and variance are hyperparameters;

[0188] The control parameter is used to control the degree of injection of the noise Gaussian distribution and the noise processing step number information into the historical interaction object sequence. The control parameter can be sampled from the Gaussian distribution whose value is a hyperparameter, and sampling is performed once for each interaction object, that is, each interaction object corresponds to a control parameter.

[0189] After obtaining the control parameter and the first Gaussian representation, the control parameter and the vector element are multiplied element by element for the mean representation and the covariance representation in the first Gaussian representation to obtain a second Gaussian representation. The mean representation of the i-th interactive object in the second Gaussian representation is: The covariance is expressed as

[0190] S303: Add the second Gaussian representation and the Gaussian representation of the interactive object to generate the noisy Gaussian representation sequence.

[0191] For each interactive object in the historical interactive object sequence, the Gaussian representation of the interactive object is added to the second Gaussian representation corresponding to the interactive object to obtain a noisy Gaussian representation of the interactive object, and the noisy Gaussian representations of all interactive objects form the noisy Gaussian representation sequence. Specifically, the Gaussian representation of the interactive object includes a mean and a covariance, then the mean of the interactive object is added to the mean in the corresponding second Gaussian representation, and the covariance of the interactive object is added to the covariance in the corresponding second Gaussian representation.

[0192] The historical interaction object sequence of user u is S u =[s1,s2,…,s n ], whose object mean sequence is The object covariance sequence is For example, the noisy Gaussian representation sequence can be obtained by the following formula. The noisy Gaussian representation sequence includes the noisy pair

[0193] Image mean sequence With the noisy covariance series

[0194]

[0195]

[0196] The noise-added mean of the i-th interactive object in the noise-added mean sequence is expressed as The sum of the mean of the Gaussian representation of the i-th interaction object and the second Gaussian representation is obtained. n The noisy mean of constitutes the noisy mean sequence:

[0197]

[0198]

[0199] Similarly, the noise covariance of the ith interactive object in the noise covariance sequence is expressed as The interactive objects s1 to s n The noise-added covariance of constitutes the noise-added covariance sequence.

[0200] In an embodiment of the present invention, by introducing Gaussian noise, scaling factors and periodic signals, the Gaussian representation of objects in a historical interaction object sequence is gradually evolved into a noisy representation that contains noise and contextual information. The scaling factor is sampled from a Gaussian distribution with mean and variance as hyperparameters. Different randomness is introduced in the process of injecting noise information, so that the noise weighting coefficient of each interaction object is different, thereby achieving personalized processing of noise, so as to better capture the relationship and dynamic changes between objects, and thus more accurately predict the characteristics and behaviors of objects.

[0201] In some alternative embodiments, see Figure 4A The forward diffusion network structure shown in the figure, the attention layer of the forward diffusion network may include a self-attention layer and a cross-attention aggregation layer; the input of the self-attention layer includes a noisy Gaussian representation sequence after the historical interaction object sequence is injected with noise information, and a category Gaussian representation sequence of the historical interaction object category sequence, and the output of the self-attention layer is used as the input of the cross-attention aggregation layer. The noisy Gaussian representation sequence includes a noisy mean representation sequence and a noisy covariance representation sequence, and the category Gaussian representation sequence includes a category mean sequence and a category covariance sequence.

[0202] The self-attention layer is used to determine the attention score of the p-th interactive object to the q-th interactive object in the noisy Gaussian representation sequence according to the category Gaussian representation to which the p-th interactive object belongs and the noisy Gaussian representation of the q-th interactive object, combined with the learnable parameter vector and the exponential linear unit activation function; wherein p is less than or equal to q;

[0203] The cross-attention aggregation layer is used to normalize the attention scores of the interactive objects, and utilize the cross-attention mechanism to aggregate information of the interactive objects according to the normalized results of the attention scores and the category Gaussian representation sequence.

[0204] For the self-attention layer:

[0205] Attention based on dot products cannot satisfy the triangle inequality and guarantee the controllability of the diffusion process, such as Figure 4B As shown, the present invention uses the 2-Wasserstein distance calculation formula W2(·,·) and the cross attention mechanism to calculate the attention score A∈R^(n×n) between sequential items. Figure 4B shown and represents the pth interaction object i p , and Represents the qth interaction object i q , when p is 1 and q is n, it is necessary to calculate the relationship between i1 and i1.n n A pq Similarly, for p = 2, we need to calculate the value of i2 for i2 to i n (n-1) A pq .

[0206] Calculate the pth interaction object i p For the qth interaction object i q The attention score A pq When using i p The category Gaussian representation and i q The noisy Gaussian representation can be calculated by the following formula:

[0207]

[0208]

[0209]

[0210] in, is a learnable parameter, trace(·) is the calculation matrix trace, diag represents the operation of converting the vector into a matrix with the vector as the diagonal, and ELU is the exponential linear unit activation function, which maps the input to [-1, -∞]. The calculation formula is as follows:

[0211]

[0212] That is, after receiving the noisy Gaussian representation sequence and the class Gaussian representation sequence, the self-attention layer can obtain the attention score A through the following steps: pq :

[0213] (1) For the pth interacting object:

[0214] Based on i p The mean of the class Gaussian representations in the sequence of class Gaussian representations With covariance Using learnable parameters and Determine the mean of the category information representation required for attention score calculation With covariance

[0215] (2) For the qth interaction object i q :

[0216] Based on i q Mean of the noisy Gaussian representation in the noisy Gaussian representation sequence With covariance Using learnable parameters and Determine the mean of the noisy information representation required for attention score calculation With covariance

[0217] (3) Calculate the interaction object i p to i q The 2-Wasserstein distance W2(i p ,i q ),in, Represents the square of the Euclidean distance between two parameters;

[0218] (4) Determine the attention score A of the pth interacting object to the qth interacting object in the sequence pq =-(W2(i p ,i q )).

[0219] For the criss-cross attention layer:

[0220] For each interactive object in the historical interactive object sequence, a new information parameter is determined based on the Gaussian representation of the interactive object in the category Gaussian representation and the preset learnable parameters. The information parameter is multiplied by the normalized result of the attention score corresponding to the interactive object, and the sum is obtained to obtain the Gaussian representation after aggregation processing.

[0221] The normalization operation is to ensure that the sum of the attention scores is 1, so that the information of each item can be correctly weighted in the subsequent aggregation operation. pq Divide by all attention scores A pq The sum of , get the normalized attention score Indicates the importance between items. This normalization can be achieved by the following formula:

[0222]

[0223] After the normalization operation is completed, the information of each interactive object in the historical interactive object sequence is aggregated according to the cross attention machine system. The information aggregation is used to weighted sum the normalized attention score and the Gaussian representation of the category of the interactive object. The information of the qth interactive object is aggregated as shown in the following formula to obtain the aggregate mean With aggregate covariance The calculation process:

[0224]

[0225]

[0226] in, is a learnable parameter, Represents the normalized result of the attention score.

[0227] That is, by multiplying the mean and covariance of the Gaussian representation of each interactive object by the corresponding learnable parameters, and taking the normalized attention score as the weight for weighted summation, we can obtain the aggregate mean sequence after information aggregation processing: With aggregate covariance series As the output result of the attention layer of the forward diffusion network, the output result is processed by other network layers after the attention layer to obtain the Gaussian representation sequence of the last layer output of the forward diffusion network. As shown in the following expressions, the aggregate mean sequence and the aggregate covariance sequence respectively include the aggregate mean and aggregate covariance of each interactive object:

[0228]

[0229] In an embodiment of the present invention, by introducing a self-attention layer and a cross-attention layer in the forward diffusion network to perform attention score calculation and information aggregation under the cross-attention mechanism, the intrinsic relationship and importance between the interacting objects in the sequence can be effectively learned, and the last Gaussian representation in the Gaussian representation sequence output by the network aggregates the information of the entire sequence; and, the Gaussian representation of the historical interactive object sequence and the category Gaussian representation of the category sequence are combined to comprehensively consider the sequence information, category information and the correlation between objects, and integrate information of different dimensions, which can better capture user behavior characteristics and interest preferences, thereby improving the accuracy and personalization of object recommendations.

[0230] In some alternative embodiments, such as Figure 4A As shown, the forward diffusion network may include a feedforward neural network layer in addition to the attention layer; the feedforward neural network layer is used to perform post-processing operations on the aggregate mean sequence and the aggregate covariance sequence output by the attention layer respectively; the post-processing operations include at least one of normalization operations and introduction of nonlinear information processing operations. Among them, the normalization operation can be implemented using LayerNorm(), so the introduction of nonlinear information processing operations can be implemented through a feedforward neural network (MLP) and Dropout operations. Referring to the post-processing operation shown in the following formula, normalization and introduction of nonlinear information are performed at the same time:

[0231] The output of the self-attention layer of the forward diffusion network is the aggregate mean sequence after information aggregation processing With aggregate covariance series Post-process the aggregate mean sequence and aggregate covariance sequence separately:

[0232]

[0233]

[0234]

[0235]

[0236] in, and It is a learnable parameter, * can represent μ and ∑; LayerNorm() is used to implement normalization operation; ELU function is an exponential linear unit function, which can make nonlinear changes to the input and thus be used to introduce nonlinear transformation in the neural network; Dropout operation is used to introduce randomness to reduce overfitting.

[0237] In an embodiment of the present invention, a feedforward neural network is introduced to further normalize the output results of the attention layer and introduce nonlinear information processing, so that the forward diffusion network can capture high-order features and complex relationships in the data, improve the data representation capability, and enhance the generalization ability of the network.

[0238] In some optional embodiments, for the forward diffusion network used in the above embodiments, see Figure 5 The forward diffusion network training flowchart shown in the figure can be trained in the following way:

[0239] S501, obtaining training samples, including a historical interaction object sequence and a historical interaction object category sequence of each sample user in the specified recommendation scenario, and a target interaction object at the next moment of the last interaction moment in the historical interaction object sequence;

[0240] S502, constructing a Gaussian representation sequence of sample objects of the historical interaction object sequence and a Gaussian representation sequence of sample categories of the historical interaction object category sequence;

[0241] During the training process of the forward diffusion network, the historical interaction object sequence and the historical interaction object category sequence of the user in the specified recommendation scenario within the set historical period are known, and the user interaction object at the next moment of the sequence is also known. The training goal is to expect the last Gaussian representation of the Gaussian representation sequence output by the last layer of the network to be infinitely close to the known user interaction object at the next moment, so as to achieve the prediction of future user interaction objects based on the historical interaction object sequence and the corresponding category sequence, and achieve the goal of object recommendation.

[0242] In this embodiment, the user interacts with the same or different objects in chronological order. The object sequence interacted before time t is called the historical interaction object sequence, and the object interacted at time t+1 is called the target interaction object. For each sample user, the historical interaction object and the category information of the object are obtained at the same time to generate a historical interaction object sequence and a historical interaction object category sequence. For the historical interaction object sequence of the root user, the Gaussian representation of each interaction object in the sequence is determined to form the sample object Gaussian representation sequence. Similarly, the Gaussian representation of each object category in the historical interaction object category sequence is determined to form the sample category Gaussian representation sequence. The sample object Gaussian representation sequence and the sample category Gaussian representation sequence can be obtained in the manner described in the above embodiment, which will not be repeated here.

[0243] S503, inputting the third Gaussian representation of the target interactive object into the noise layer of the forward diffusion network, and injecting the fourth Gaussian representation output by the noise layer and the embedding vector corresponding to the number of noise processing steps of the noise layer as noise information into the sample object Gaussian representation sequence to generate a corresponding noisy sample Gaussian representation sequence;

[0244] The process of generating the Gaussian representation sequence of noisy samples refers to the implementation process recorded in the aforementioned embodiment. Through this step, multiple potential meanings of random noise are injected into the historical interaction object sequence as auxiliary semantic signals, and the expression of each interaction object in the historical interaction object sequence is converted from a fixed-form vector to an expression containing uncertainty. The injection of diffusion step information helps to better control the diffusion step number and guide the subsequent model training process to better balance local and global information.

[0245] S504, input the noisy sample Gaussian representation sequence and the sample category Gaussian representation sequence into the attention layer, and adjust the network parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network until the training convergence condition is met.

[0246] During the training phase, after the training samples are processed by the forward diffusion network, the last Gaussian representation in the result Gaussian representation sequence output by the last layer of the network integrates the information of the entire historical interaction object sequence and the object category sequence. Therefore, the last Gaussian representation is used as the mean and covariance representation of the predicted object, and its similarity with the target interaction object described in the aforementioned step S501 is evaluated. The loss function is calculated based on the similarity, and the network parameters of each network layer of the forward diffusion network are adjusted through the back propagation algorithm to minimize the loss function.

[0247] For the difference between the last Gaussian representation and the third Gaussian representation of the target interactive object, the Wasserstein distance can be used to measure the similarity between the Gaussian distributions of the predicted object and the target interactive object, that is, the mean and covariance of the last Gaussian representation and the mean and covariance of the third Gaussian representation are used as input parameters for the Wasserstein distance calculation to obtain a distance value indicating the difference.

[0248] Assume that the last Gaussian representation includes the mean With covariance The third Gaussian representation of the target interaction object includes the mean With covariance See the similarity calculation method shown in the following formula:

[0249]

[0250] The Wasserstein distance d 2 The smaller the distance is, the more similar the predicted object indicated by the last Gaussian representation is to the Gaussian distribution of the target interaction object in the sample. Based on this, you can set -d 2 Represents the prediction score, -d 2 The larger the value, the corresponding prediction score p i The higher.

[0251] In this embodiment, the loss function may adopt a cross entropy loss function, and the expression of the loss function is as follows:

[0252]

[0253] Among them, N represents the sequence length of the output Gaussian representation sequence, y i represents the true label of the target interaction object, p i Represents the prediction score.

[0254] In an embodiment of the present invention, by introducing an attention layer into the forward diffusion network, and taking the sample user's historical interaction object sequence, historical interaction object category sequence and the known interaction object at the next moment as the training input of the forward diffusion network, it is possible to fully utilize the known interaction object information and historical sequence information for training, and pay more attention to the contribution of the historical interaction object sequence and the interaction object category representation sequence to the prediction result during the learning process, so that the forward diffusion network can better understand the association between the target object and the historical sequence, and improve the model's prediction ability for future interaction objects, thereby obtaining a diffusion network that can realize object prediction and recommendation based on the user's historical interaction object sequence and historical interaction object category sequence.

[0255] Next, in order to facilitate a more intuitive understanding of the present invention, the object recommendation method provided by the present invention is exemplarily described below by taking the designated recommendation scene as a song recommendation scene as an example.

[0256] A large number of sample users' historical sequences of liked songs and historical sequences of liked songs categories, as well as known liked songs at the next moment of the historical sequences of liked songs, are obtained in advance as training samples, and the forward diffusion network is trained according to the training steps described in the aforementioned embodiment to obtain a pre-trained forward diffusion network.

[0257] When you need to recommend songs to target user A, you can do it through the following steps:

[0258] First, obtain the user-liked song sequence and the corresponding user-liked song category sequence of the target user A in the historical period before the current system time;

[0259] Next, the Gaussian representation of each song in the user-liked song sequence is determined by a random embedding layer or other means to form a song Gaussian representation sequence, and the Gaussian representation of each song category in the user-liked song category sequence is simultaneously determined to form a category Gaussian representation sequence;

[0260] Then, the Gaussian representation of random noise that conforms to the Gaussian distribution is input into the noise-adding layer of the forward diffusion network, and the noisy Gaussian representation output by the noise-adding layer, the song Gaussian representation sequence, and the embedding vector of the number of noise-adding processing steps of the noise-adding layer are combined together to inject noise information into the song Gaussian representation sequence and generate the corresponding noisy song Gaussian representation sequence;

[0261] Subsequently, the noisy song Gaussian representation sequence and the category Gaussian representation sequence are used as inputs of the attention layer of the forward diffusion network, and the last Gaussian representation in the output sequence of the forward diffusion network is input into the reverse diffusion network with the same structure and parameters to obtain the Gaussian representation of the predicted song;

[0262] Finally, the Gaussian representation of the predicted song is matched with the Gaussian representations of all candidate songs in the existing candidate song set in the song recommendation scenario, and the songs are sorted from high to low according to the matching degree. A set number of songs with high rankings, such as the first 30 candidate songs, are determined as recommended songs and the song recommendation results for the target object are generated and displayed on the recommendation page of the target user for the user to browse.

[0263] In the above process, each step can be set to be processed by a corresponding neural network structure layer, and the present invention is not limited to this.

[0264] Exemplary Devices

[0265] After introducing the method of the exemplary embodiment of the present invention, next, refer to Figure 6 A device according to an exemplary embodiment of the present invention is described.

[0266] The implementation process of the functions and effects of each module in the following device is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here. For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment.

[0267] Figure 6 An object recommendation device according to an embodiment of the present invention is schematically shown, the device comprising:

[0268] The historical interaction information acquisition module 601 is used to acquire the historical interaction object sequence of the target user in the specified recommendation scenario and the corresponding historical interaction object category sequence;

[0269] A Gaussian representation sequence acquisition module 602, configured to respectively determine an object Gaussian representation sequence of the historical interaction object sequence and a category Gaussian representation sequence of the historical interaction object category sequence;

[0270] A forward noise processing module 603 is used to inject noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain a noisy Gaussian representation sequence; the noise information includes a noisy Gaussian representation after the random noise that conforms to the Gaussian distribution is subjected to noise processing, and an embedding vector corresponding to the number of noise processing steps; the noise processing is implemented by a noise layer of a pre-trained forward diffusion network;

[0271] A forward diffusion module 604 is used to input the noisy Gaussian representation sequence and the class Gaussian representation sequence into the attention layer of the forward diffusion network; the attention layer is used to perform sequence information aggregation processing on the noisy Gaussian representation sequence and the class Gaussian representation sequence;

[0272] A reverse diffusion module 605 is used to input the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network into the reverse diffusion network to obtain a predicted Gaussian representation of the predicted object; the reverse diffusion network has the same structure and parameters as the forward diffusion network;

[0273] The recommendation result acquisition module 606 is used to determine the interactive object recommendation result for the target user in the specified recommendation scenario from the candidate object set according to the predicted Gaussian representation of the predicted object; the candidate object set refers to the set of all selectable objects for recommendation in the specified recommendation scenario.

[0274] In some optional implementations, the Gaussian representation sequence acquisition module is specifically used for:

[0275] Determine the Gaussian representation of each element in the target interaction sequence; the target interaction sequence includes any one of the historical interaction object sequence and the historical interaction object category sequence;

[0276] Determine a positional Gaussian representation corresponding to the sequence position of the element;

[0277] The sum of the element Gaussian representation and the position Gaussian representation of each element is sorted in sequence order to obtain a Gaussian representation sequence corresponding to the target interaction sequence.

[0278] In some optional implementations, the forward noise processing module is specifically used to:

[0279] Adding the noisy Gaussian representation to the embedding vector to obtain a first Gaussian representation;

[0280] Multiplying the control parameter corresponding to the interactive object by the first Gaussian representation element by element to obtain a second Gaussian representation; the control parameter is sampled from a Gaussian distribution whose mean and variance are hyperparameters;

[0281] The second Gaussian representation is added to the Gaussian representation of the interactive object to generate a noisy Gaussian representation sequence.

[0282] In some optional embodiments, the embedding vector has the same length as the noise Gaussian representation; the apparatus further includes a step of acquiring the embedding vector, comprising:

[0283] Encoding the odd positions of the embedded vector using a cosine function, and encoding the even positions of the embedded vector using a sine function;

[0284] An embedding vector is obtained according to the encoding results of the sine function and the cosine function.

[0285] In some optional embodiments, the noisy Gaussian representation includes a first mean vector and a first covariance vector; the Gaussian representation of the interactive object includes an object mean vector and an object covariance vector; the noisy Gaussian representation sequence includes a noisy mean sequence and a noisy covariance sequence;

[0286] The forward noise adding processing module is specifically used for:

[0287] Combining the first mean vector, the embedding vector and the object mean vector to obtain the noisy mean sequence;

[0288] The first covariance vector, the embedding vector and the object covariance vector are combined to obtain the noisy covariance sequence.

[0289] In some optional embodiments, the noisy Gaussian representation sequence includes a noisy Gaussian representation of each interactive object; the category Gaussian representation sequence includes a category Gaussian representation of the category to which each interactive object belongs; the attention layer of the forward diffusion network includes a self-attention layer and a cross-attention aggregation layer;

[0290] The self-attention layer is used to determine the attention score of the p-th interactive object to the q-th interactive object according to the category Gaussian representation to which the p-th interactive object belongs and the noisy Gaussian representation of the q-th interactive object for multiple interactive objects in the noisy Gaussian representation sequence; wherein p is less than or equal to q;

[0291] The cross-attention aggregation layer is used to normalize the attention scores of the interactive objects, and utilize the cross-attention mechanism to aggregate information of the interactive objects according to the normalized results of the attention scores and the category Gaussian representation sequence.

[0292] In some optional embodiments, the forward diffusion network also includes a feedforward neural network layer; the feedforward neural network layer is used to perform post-processing operations on the mean and covariance in the aggregated vector respectively; the post-processing operations include at least: normalization operation, introduction of nonlinear information processing operation.

[0293] In some optional embodiments, the reverse diffusion network is used to perform jump reverse diffusion processing on the last Gaussian representation to generate the predicted Gaussian representation; the number of steps of the reverse diffusion is calculated based on the number of noise addition processing steps and the set skip sampling step size.

[0294] In some optional embodiments, the apparatus further comprises a training step of the forward diffusion network, the training step comprising:

[0295] A training sample acquisition module, used to acquire training samples, including a historical interaction object sequence and a historical interaction object category sequence of each sample user in the specified recommendation scenario, and a target interaction object at the next moment of the last interaction moment in the historical interaction object sequence;

[0296] A Gaussian representation sequence construction module, used to construct a Gaussian representation sequence of sample objects of the historical interaction object sequence and a Gaussian representation sequence of sample categories of the historical interaction object category sequence;

[0297] a noisy sample sequence generation module, configured to input the third Gaussian representation of the target interactive object into the noisy layer of the forward diffusion network, and inject the fourth Gaussian representation output by the noisy layer and the embedding vector corresponding to the number of noisy processing steps of the noisy layer as noisy information into the sample object Gaussian representation sequence, to generate a corresponding noisy sample Gaussian representation sequence;

[0298] A training module is used to input the noisy sample Gaussian representation sequence and the sample category Gaussian representation sequence into the attention layer, and adjust the network parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network until the training convergence condition is met.

[0299] In some optional embodiments, the training module, when used to adjust the parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the Gaussian representation sequence of the result output of the last layer of the forward diffusion network, includes:

[0300] Using the mean and covariance of the last Gaussian representation and the mean and covariance of the third Gaussian representation as input parameters for calculating the Wasserstein distance, to obtain a distance value indicating the difference;

[0301] According to the distance value and the cross entropy loss function, the network parameters of the forward diffusion network are adjusted.

[0302] Exemplary Media

[0303] After introducing the method and apparatus of the exemplary embodiment of the present invention, next, reference is made to Figure 7 A readable storage medium according to an exemplary embodiment of the present invention is described.

[0304] In this exemplary embodiment, the above method can be implemented by a program product, such as a portable compact disk read-only memory (CD-ROM) and including program code, and can be run on a device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device.

[0305] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0306] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0307] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RE, etc., or any suitable combination of the foregoing.

[0308] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0309] Exemplary Computing Devices

[0310] After introducing the method, apparatus and medium of the exemplary embodiments of the present invention, next, reference is made to Figure 8 A computing device according to an exemplary embodiment of the present invention is described.

[0311] Figure 8The computing device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0312] like Figure 8 As shown, the computing device 800 is in the form of a general computing device. The components of the computing device 800 may include but are not limited to: at least one processing unit 801, at least one storage unit 802, and a bus 803 connecting different system components (including the processing unit 801 and the storage unit 802).

[0313] The bus 803 includes a data bus, a control bus, and an address bus.

[0314] The storage unit 802 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 8021 and / or a cache memory 8022 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 8023 .

[0315] The storage unit 802 may also include a program / utility 8025 having a set (at least one) of program modules 8024, such program modules 8024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0316] The computing device 800 may also communicate with one or more external devices 804 (eg, a keyboard, pointing device, etc.).

[0317] Such communication may be performed via input / output (I / O) interface 805. Furthermore, computing device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via network adapter 806. Figure 8 As shown, the network adapter 806 communicates with other modules of the computing device 800 via the bus 803. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computing device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0318] It should be noted that although several units / modules or sub-units / modules of the object recommendation device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for concretization.

[0319] In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0320] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. An object recommendation method, characterized in that: The method comprises: Obtain the target user's historical interaction object sequence in the specified recommendation scenario and the corresponding historical interaction object category sequence; Determine the object Gaussian representation sequence of the historical interaction object sequence and the category Gaussian representation sequence of the historical interaction pair category sequence respectively; Injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain a noisy Gaussian representation sequence; the noise information includes a noisy Gaussian representation of random noise that conforms to the Gaussian distribution after being noised, and an embedding vector corresponding to the number of noised processing steps; the noised processing is implemented by a noised layer of a pre-trained forward diffusion network; the embedding vector is used to represent the number of noised processing steps of the random noise and the dynamic characteristics of the noised process; the dynamic characteristics at least include the frequency of the noised, or the amplitude of the noised; the length of the embedding vector is the same as the length of the mean vector or the covariance vector in the noisy Gaussian representation sequence; Inputting the noisy Gaussian representation sequence and the class Gaussian representation sequence into the attention layer of the forward diffusion network; the attention layer is used to perform sequence information aggregation processing on the noisy Gaussian representation sequence and the class Gaussian representation sequence; Inputting the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network into the reverse diffusion network to obtain the predicted Gaussian representation of the predicted object; the reverse diffusion network has the same structure and parameters as the forward diffusion network; According to the predicted Gaussian representation of the predicted object, the interactive object recommendation result for the target user in the specified recommendation scenario is determined from a candidate object set; the candidate object set refers to a set of all selectable objects for recommendation in the specified recommendation scenario.

2. The method according to claim 1, characterized in that The determining of the object Gaussian representation sequence of the historical interaction object sequence and the category Gaussian representation sequence of the historical interaction object category sequence respectively includes: Determine the Gaussian representation of each element in the target interaction sequence; the target interaction sequence includes any one of the historical interaction object sequence and the historical interaction object category sequence; Determine a positional Gaussian representation corresponding to the sequence position of the element; The sum of the element Gaussian representation and the position Gaussian representation of each element is sorted in sequence order to obtain a Gaussian representation sequence corresponding to the target interaction sequence.

3. The method according to claim 1, characterized in that The injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain the noisy Gaussian representation sequence includes: Adding the noisy Gaussian representation to the embedding vector to obtain a first Gaussian representation; Multiplying the control parameter corresponding to the interactive object by the first Gaussian representation element by element to obtain a second Gaussian representation; the control parameter is sampled from a Gaussian distribution whose mean and variance are hyperparameters; The second Gaussian representation is added to the Gaussian representation of the interactive object to generate the noisy Gaussian representation sequence.

4. The method according to claim 3, characterized in that The embedding vector has the same length as the noise Gaussian representation; the method further includes a step of acquiring the embedding vector, including: Encoding the odd positions of the embedded vector using a cosine function, and encoding the even positions of the embedded vector using a sine function; An embedding vector is obtained according to the encoding results of the sine function and the cosine function.

5. The method according to claim 1, characterized in that The noisy Gaussian representation includes a first mean vector and a first covariance vector; the Gaussian representation of the interactive object includes an object mean vector and an object covariance vector; the noisy Gaussian representation sequence includes a noisy mean sequence and a noisy covariance sequence; The injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain the noisy Gaussian representation sequence includes: Combining the first mean vector, the embedding vector and the object mean vector to obtain the noisy mean sequence; The first covariance vector, the embedding vector and the object covariance vector are combined to obtain the noisy covariance sequence.

6. The method according to claim 1, characterized in that The noisy Gaussian representation sequence includes the noisy Gaussian representation of each interactive object; the category Gaussian representation sequence includes the category Gaussian representation of the category to which each interactive object belongs; the attention layer of the forward diffusion network includes a self-attention layer and a cross-attention aggregation layer; The self-attention layer is used to determine the attention score of the p-th interactive object to the q-th interactive object according to the category Gaussian representation to which the p-th interactive object belongs and the noisy Gaussian representation of the q-th interactive object for multiple interactive objects in the noisy Gaussian representation sequence; wherein p is less than or equal to q; The cross-attention aggregation layer is used to normalize the attention scores of the interactive objects, and utilize the cross-attention mechanism to aggregate the sequence information of the interactive objects according to the normalized results of the attention scores and the category Gaussian representation sequence.

7. The method according to claim 6, characterized in that The forward diffusion network also includes a feedforward neural network layer; the feedforward neural network layer is used to perform post-processing operations on the aggregated mean sequence and the aggregated covariance sequence output by the attention layer respectively; the post-processing operations include at least: normalization operation, introduction of nonlinear information processing operation, at least one of the operations.

8. The method according to claim 1, characterized in that: The reverse diffusion network is used to perform a jump reverse diffusion process on the last Gaussian representation to generate the predicted Gaussian representation; the number of steps of the reverse diffusion is calculated based on the number of steps of the noise addition process and the set skip sampling step size.

9. The method according to claim 1, characterized in that: The method further comprises a training step of the forward diffusion network, wherein the training step comprises: Acquire training samples, including a historical interaction object sequence and a historical interaction object category sequence of each sample user in the specified recommendation scenario, and a target interaction object at the next moment of the last interaction moment in the historical interaction object sequence; Constructing a Gaussian representation sequence of sample objects of the historical interaction object sequence and a Gaussian representation sequence of sample categories of the historical interaction object category sequence; Input the third Gaussian representation of the target interactive object into the noise layer of the forward diffusion network, and inject the fourth Gaussian representation output by the noise layer and the embedding vector corresponding to the number of noise processing steps of the noise layer as noise information into the sample object Gaussian representation sequence to generate a corresponding noisy sample Gaussian representation sequence; The noisy sample Gaussian representation sequence and the sample category Gaussian representation sequence are input into the attention layer, and according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network, the network parameters of the forward diffusion network are adjusted until the training convergence conditions are met.

10. The method according to claim 9, characterized in that According to the difference between the last Gaussian representation in the Gaussian representation sequence of the result output of the last layer of the forward diffusion network and the third Gaussian representation, adjusting the network parameters of the forward diffusion network includes: Using the mean and covariance of the last Gaussian representation and the mean and covariance of the third Gaussian representation as input parameters for calculating the Wasserstein distance, to obtain a distance value indicating the difference; According to the distance value and the cross entropy loss function, the network parameters of the forward diffusion network are adjusted.

11. An object recommendation device, characterized in that: The device comprises: A historical interaction information acquisition module is used to acquire the target user's historical interaction object sequence in a specified recommendation scenario and the corresponding historical interaction object category sequence; a Gaussian representation sequence acquisition module, used to respectively determine the object Gaussian representation sequence of the historical interaction object sequence and the category Gaussian representation sequence of the historical interaction object category sequence; A forward noise processing module, used for injecting noise information into the Gaussian representation of each interactive object in the object Gaussian representation sequence to obtain a noisy Gaussian representation sequence; the noise information includes a noisy Gaussian representation of random noise that conforms to the Gaussian distribution after being noised, and an embedding vector corresponding to the number of noise processing steps; the noise processing is implemented by a noise layer of a pre-trained forward diffusion network; the embedding vector is used to represent the number of noise processing steps of the random noise and the dynamic characteristics of the noise process; the dynamic characteristics at least include the frequency of the noise or the amplitude of the noise; the length of the embedding vector is the same as the length of the mean vector or the covariance vector in the noisy Gaussian representation sequence; A forward diffusion module, used for inputting the noisy Gaussian representation sequence and the class Gaussian representation sequence into the attention layer of the forward diffusion network; the attention layer is used for performing sequence information aggregation processing on the noisy Gaussian representation sequence and the class Gaussian representation sequence; A reverse diffusion module, used for inputting the last Gaussian representation in the Gaussian representation sequence output by the last layer of the forward diffusion network into the reverse diffusion network to obtain a predicted Gaussian representation of the predicted object; the reverse diffusion network has the same structure and parameters as the forward diffusion network; A recommendation result acquisition module is used to determine the interactive object recommendation result for the target user in the specified recommendation scenario from a candidate object set based on the predicted Gaussian representation of the predicted object; the candidate object set refers to the set of all selectable objects for recommendation in the specified recommendation scenario.

12. The device according to claim 11, characterized in that The Gaussian representation sequence acquisition module is specifically used for: Determine the Gaussian representation of each element in the target interaction sequence; the target interaction sequence includes any one of the historical interaction object sequence and the historical interaction object category sequence; Determine a positional Gaussian representation corresponding to the sequence position of the element; The sum of the element Gaussian representation and the position Gaussian representation of each element is sorted in sequence order to obtain a Gaussian representation sequence corresponding to the target interaction sequence.

13. The device according to claim 11, characterized in that The forward noise adding processing module is specifically used for: Adding the noisy Gaussian representation to the embedding vector to obtain a first Gaussian representation; Multiplying the control parameter corresponding to the interactive object by the first Gaussian representation element by element to obtain a second Gaussian representation; the control parameter is sampled from a Gaussian distribution whose mean and variance are hyperparameters; The second Gaussian representation is added to the Gaussian representation of the interactive object to generate a noisy Gaussian representation sequence.

14. The device according to claim 13, characterized in that The embedding vector has the same length as the noise Gaussian representation; the apparatus further includes a step of acquiring the embedding vector, including: Encoding the odd positions of the embedded vector using a cosine function, and encoding the even positions of the embedded vector using a sine function; An embedding vector is obtained according to the encoding results of the sine function and the cosine function.

15. The device according to claim 11, characterized in that The noisy Gaussian representation includes a first mean vector and a first covariance vector; the Gaussian representation of the interactive object includes an object mean vector and an object covariance vector; the noisy Gaussian representation sequence includes a noisy mean sequence and a noisy covariance sequence; The forward noise adding processing module is specifically used for: Combining the first mean vector, the embedding vector and the object mean vector to obtain the noisy mean sequence; The first covariance vector, the embedding vector and the object covariance vector are combined to obtain the noisy covariance sequence.

16. The device according to claim 11, characterized in that The noisy Gaussian representation sequence includes the noisy Gaussian representation of each interactive object; the category Gaussian representation sequence includes the category Gaussian representation of the category to which each interactive object belongs; the attention layer of the forward diffusion network includes a self-attention layer and a cross-attention aggregation layer; The self-attention layer is used to determine the attention score of the p-th interactive object to the q-th interactive object according to the category Gaussian representation to which the p-th interactive object belongs and the noisy Gaussian representation of the q-th interactive object for multiple interactive objects in the noisy Gaussian representation sequence; wherein p is less than or equal to q; The cross-attention aggregation layer is used to normalize the attention scores of the interactive objects, and utilize the cross-attention mechanism to aggregate information of the interactive objects according to the normalized results of the attention scores and the category Gaussian representation sequence.

17. The device according to claim 16, characterized in that The forward diffusion network also includes a feedforward neural network layer; the feedforward neural network layer is used to perform post-processing operations on the aggregated mean sequence and the aggregated covariance sequence output by the attention layer respectively; the post-processing operations include at least: normalization operation, introduction of nonlinear information processing operation, at least one of the operations.

18. The device according to claim 11, characterized in that The reverse diffusion network is used to perform a jump reverse diffusion process on the last Gaussian representation to generate the predicted Gaussian representation; the number of steps of the reverse diffusion is calculated based on the number of steps of the noise addition process and the set skip sampling step size.

19. The device according to claim 11, characterized in that The apparatus further comprises a training step of the forward diffusion network, wherein the training step comprises: A training sample acquisition module, used to acquire training samples, including a historical interaction object sequence and a historical interaction object category sequence of each sample user in the specified recommendation scenario, and a target interaction object at the next moment of the last interaction moment in the historical interaction object sequence; A Gaussian representation sequence construction module, used to construct a Gaussian representation sequence of sample objects of the historical interaction object sequence and a Gaussian representation sequence of sample categories of the historical interaction object category sequence; a noisy sample sequence generation module, configured to input the third Gaussian representation of the target interactive object into the noisy layer of the forward diffusion network, and inject the fourth Gaussian representation output by the noisy layer and the embedding vector corresponding to the number of noisy processing steps of the noisy layer as noisy information into the sample object Gaussian representation sequence, to generate a corresponding noisy sample Gaussian representation sequence; A training module is used to input the noisy sample Gaussian representation sequence and the sample category Gaussian representation sequence into the attention layer, and adjust the network parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the result Gaussian representation sequence output by the last layer of the forward diffusion network until the training convergence condition is met.

20. The device according to claim 19, characterized in that The training module, when used to adjust the network parameters of the forward diffusion network according to the difference between the last Gaussian representation and the third Gaussian representation in the Gaussian representation sequence of the result output of the last layer of the forward diffusion network, includes: Using the mean and covariance of the last Gaussian representation and the mean and covariance of the third Gaussian representation as input parameters for calculating the Wasserstein distance, to obtain a distance value indicating the difference; According to the distance value and the cross entropy loss function, the network parameters of the forward diffusion network are adjusted.

21. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

22. A computing device, characterized in that include: Processor, memory; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 10 by calling the computer program.

Citation Information

Patent Citations

  • Sequence recommendation method based on sequential dependency enhanced self-attention network

    CN115687772A

  • Method and system for relation learning by multi-hop attention graph neural network

    US20220092413A1