Sequence recommendation method combining ordinary differential equation and time-guided diffusion generation

By constructing user-specific sequence diagrams and cross-sequence evolution diagrams, combining ordinary differential equations and time-guided diffusion generators, the irregular time intervals and time-perception problems in sequence recommendations are solved, and the matching and personalization of the recommendation system are improved.

CN119179813APending Publication Date: 2024-12-24BEIJING INST OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411243950.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Existing sequence recommendation methods ignore irregular time intervals and time-aware project popularity, resulting in inaccurate user preference for learning and degrading recommendation performance.

Method used

Combining the methods of ordinary differential equations and time-guided diffusion generation, a user-specific sequence diagram and cross-sequence evolution diagram are constructed, and time-conscious augmented map is constructed through the time-guided diffusion generator to alleviate the problem of data sparseness and improve the recommended matching degree.

Benefits of technology

Effectively capture changes in user personalized interests and item popularity, improve the matching degree between recommendation results and users, accurately generate time-aware project representations, explore potential evolutionary laws, and enhance the personalization and accuracy of the recommendation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179813A_ABST
    Figure CN119179813A_ABST
Patent Text Reader

Abstract

The invention provides a sequence recommendation method combined with an ordinary differential equation and time-guided diffusion generation, which comprises the following steps of: firstly, simulating a continuous time evolution process of interactive data, and constructing a user specific sequence diagram and a cross-sequence evolution diagram, the former is used for capturing the change of personal user preference, and the latter focuses on exploring the item representation of time perception; secondly, filling and expanding an evolutionary graph by applying time-guided diffusion generation so as to reduce the sparsity of the data; and finally, using a neural ODE learner based on the dual-channel graph to obtain user interests at a specific time. Therefore, the matching degree between the recommendation result and the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of recommendation systems, and in particular relates to a sequence recommendation method combining ordinary differential equations and time-guided diffusion generation. Background Art

[0002] In order to capture the dynamic sequence interaction history of users, the Sequence Recommendation (SR) task has spawned many methods. In early studies, Markov chains were used to model sequence information, and the FPMC model was a pioneering work in this field. With the rise of deep neural network technology, some methods began to use RNN (recurrent neural network) to meet the challenges of sequence recommendation, such as GRU4Rec, which significantly improved the model's adaptability to recommendation tasks by incorporating the entire session-level modeling into the GRU (gated recurrent unit)-based RNN model.

[0003] In recent years, as the Multi-Head Self-Attention Module was introduced and quickly became a powerful tool for capturing spatiotemporal sequence information, some studies have attempted to apply the Multi-Head Self-Attention Module to sequential recommendation tasks. The SASRec model is a typical example, which explores the balance between capturing long-term semantics of sequences based on RNN and relying on attention mechanisms to predict limited actions, which not only strengthens the characterization of user preferences, but also improves the ability to model contextual information. These advances not only demonstrate the transition from traditional methods to deep learning methods, but also reflect the great potential of attention mechanisms in processing sequential data, further promoting the development of sequential recommendation systems towards more accurate and personalized directions.

[0004] Although existing sequential recommendation methods can effectively capture the order relationship within user sequences, they still have two important flaws: (i) Ignoring irregular time intervals. General sequence modeling assumes that users interact regularly over time, which is inconsistent with the actual situation of real-world recommendation systems. Analysis of real-world datasets shows that the number of interactions over the entire sequence follows a highly uneven distribution. Since user preferences are learned from interaction sequences, simply assuming regular interactions without considering the inherent irregular time intervals will inevitably lead to inaccurate learned preferences, thereby reducing recommendation performance. (ii) Ignoring time-aware item popularity. Further analysis results show that different items appear at different concentrations at different time slices in the sequence, indicating that item popularity changes over time. In other words, the popularity of items is unexpectedly driven by time and relatively independent of users. Given that users' future choices are deeply influenced by item popularity, incorporating this time-aware item information into preference learning is crucial for recommendation systems. Summary of the invention

[0005] To solve the above problems, the present invention provides a sequence recommendation method combining ordinary differential equations and time-guided diffusion generation, constructs two graphs to capture the changes in user personalized interests and item popularity, and designs a time-guided diffusion generator to construct a time-aware augmented graph, so as to alleviate the serious data sparsity problem and improve the matching degree between recommendation results and users.

[0006] A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation, comprising the following steps:

[0007] S1: According to each user s in the user set m The historical items selected within the set time period construct the user-specific sequence graph G corresponding to the user set us The cross-sequence evolution graph G corresponding to the user set cs , where the user-specific sequence graph G us is the set of all user subgraphs, m=1,2,…,M, where M is the number of users in the user set, and user s m User subgraph The node in is user s m If two historical items are adjacent, there is an edge between the nodes corresponding to the two items, and the weight of the edge is the weight of the two items in the user s m The number of times G appears as an adjacent item in the selection; cs The nodes in are the historical items selected by all users in the user set. If two historical items are adjacent items, there is an edge between the nodes corresponding to the two items, and the weight of the edge is the number of times the two items appear as adjacent items in the selections of all users;

[0008] S2: Use the time-sequence graph attention mechanism to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention encoding representation of each node in cs and e us ;

[0009] S3: The attention encoding of each node is represented by e cs and e us Input the trained time-guided diffusion model to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us Enhanced graph of and

[0010] S4: Translate the sequence evolution graph G cs The corresponding enhanced graph As the input of one channel of the dual-channel graph neural network ODE, the user-specific sequence graph G us The corresponding enhanced graph As the input of the other channel of the dual-channel graph neural network ODE, the dual-channel graph neural network ODE outputs the cross-sequence evolution graph G cs and user-specific sequence diagram G us The final representation of each node and

[0011] S5: Translate the sequence evolution graph G cs and user-specific sequence diagram G us The final representation of each node and They are sent to a decoder respectively and then merged to obtain the sequence representation h of each user s :

[0012]

[0013] Among them, Decoder represents a decoder that uses the Transformer method for decoding, and ||·|| represents L2 regularization;

[0014] S6: Based on the sequence representation h of each user s And the final value represented Calculate the prediction score for each historical item

[0015]

[0016] S7: From the sequence representation h of each user s Extract the representation of the user k to be recommended from And from the prediction score Get the scores of all items for the user k to be recommended Will The largest top P items in are recommended to the user k to be recommended.

[0017] Furthermore, in step S2, the cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention encoding representation e of any node i cs and e us The method to obtain is as follows:

[0018] S21: Get the neighbor node set of node i in, is the cross-sequence evolution graph G of node i cs The set of neighbor nodes in For node i in the user-specific sequence graph Gus The set of neighbor nodes in ;

[0019] S22: Get node i for any neighbor node The attention weight α ij :

[0020] α ij =Sigmod(a T [W Q x i ,W K x j ,b·△t])

[0021] Among them, x i represents the one-hot encoding representation of the item corresponding to node i, x j represents the unique hot encoding representation of the item corresponding to node j, Δt represents the time difference between the user selecting the item corresponding to node i and the item corresponding to node j, a, b, W Q , W K They are all different weight matrices, and T represents transpose;

[0022] S23: Each node i is transformed into a cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention weights of all neighbor nodes are summed to obtain the cross-sequence evolution graph G of node i cs and user-specific sequence diagram G us Attention encoding representation cs and e us :

[0023]

[0024]

[0025] Among them, W V and W l are different weight matrices set.

[0026] Furthermore, in step S3, the cross-sequence evolution graph G cs and user-specific sequence diagram G us Enhanced graph of and The method to obtain is as follows:

[0027] S31: Filter out m times without interaction records And use multi-layer perceptron to convert time t p Respectively with the attention encoding representation of each node e cs and e us Encode and obtain the time-guided embedding representation c corresponding to each nodepcs 、c pus ;

[0028] S32: Treat a standard normal distribution of noise ∈ as a noisy variable Will With c pcs , With c pus are respectively sent into the neural network of the time-guided diffusion model to obtain the predicted adjacency matrix z pcs 、z pus ;

[0029] S33: The latest predicted adjacency matrix z pcs With c pcs 、z pus With c pus The time-guided diffusion model is fed into the neural network to generate a new prediction adjacency matrix; step S33 is repeated K2 times to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us At time t p The final adjacency matrix generated by in, The cross-sequence evolution graph G is cs In time The adjacency matrix of The cross-sequence evolution graph G is us In time The adjacency matrix under ;

[0030] S34: The adjacency matrix The corresponding initial enhancement graphs are recorded as in, The cross-sequence evolution graph G is cs In time The initial enhancement graph below, The cross-sequence evolution graph G is us In time Initial enhancement diagram below;

[0031] S35: respectively convert the initial enhanced image and the cross-sequence evolution graph G cs Merge, initial enhancement graph and the cross-sequence evolution graph G us Merge to get the final enhanced image and as follows:

[0032]

[0033]

[0034] Among them, topK means only selecting the edges with the largest values ​​in the adjacency matrix of the graph and removing the other edges.

[0035] Furthermore, in step S33, the cross-sequence evolution graph G cs and user-specific sequence diagram G us The adjacency matrix of The method to obtain is as follows:

[0036] S331: Set the adjacency matrix A of the current graph to the initial state z0, and superimpose the noise that conforms to the standard normal distribution on the initial state z0 using the following formula: Until the upper limit K1 times is superimposed, the state corresponding to the adjacency matrix z0 with K1 times of noise superimposed is obtained

[0037]

[0038] in, is the state obtained by the K1th superposition, and the noise variable α of the kth superposition k =1-β k , β k represents the Gaussian noise added at each step k, the multiplicative noise variable

[0039] S332: Change the status And the time-guided embedding representation c corresponding to all nodes in the current graph t Input to a MLP neural network with a time-guided diffusion model Among them, θ is the network parameter of the MLP neural network, z k-1 Represents the predicted adjacency matrix of the next superposition output by the MLP neural network, and each time the MLP neural network is input A predicted adjacency matrix is ​​obtained; from the state Start with K1 MLP neural network After that, we get the final adjacency matrix

[0040] Furthermore, the training method of the time-guided diffusion model is:

[0041] S332a: The initial adjacency matrix states corresponding to the two graphs and And the time-guided embedding representation c corresponding to all nodes of the two graphs t As the input of the time-guided diffusion model, the predicted adjacency matrix of the two graphs at time t is obtained and

[0042] S332b: Calculate the loss function based on the difference between the predicted adjacency matrix corresponding to all graphs output by the time-guided diffusion model and the label values ​​of the adjacency matrix corresponding to all graphs

[0043] S332c: Determine the loss function Is it less than the set value? If yes, the time-guided diffusion model at this time is the trained time-guided diffusion model. If no, go to step S332d;

[0044] S332d: Change the parameters of the time-guided diffusion model, and then re-execute steps S332a to S332c based on the time-guided diffusion model with changed parameters until the loss function When the value is less than the set value, the training of the time-guided diffusion model is completed.

[0045] Furthermore, the loss function The calculation method is:

[0046] The loss function of the two graphs is calculated based on the difference between the predicted adjacency matrix corresponding to the two graphs output by the time-guided diffusion model and the label values ​​of the adjacency matrix corresponding to the two graphs. and as follows:

[0047]

[0048]

[0049]

[0050]

[0051] Where θ represents the model parameters of the time-guided diffusion model, Indicates that k is uniformly distributed from the interval [1, K1] Randomly selected from represents the expected value, represents the noise variable calculated by S331, and C is a constant;

[0052] according to and Get the loss function of the time-guided diffusion model for:

[0053]

[0054] in, Represents the predicted adjacency matrix The element in the i-th row and j-th column of ; Represents the predicted adjacency matrix The element in the i-th row and j-th column of .

[0055] Further, in step S4, the final representation is and The method to obtain is as follows:

[0056]

[0057]

[0058]

[0059]

[0060] Where ODESolver represents the Runge-Kutta method for solving ordinary differential equations, and f cs and f us The cross-sequence evolution graph G is cs and user-specific sequence diagram G us In the encoder within the channel, g(t) is the variable encoded by the MLP neural network at time t, W a , W b , W c , W d are the parameter matrices to be learned, and Respectively represent the enhanced graph and The adjacency matrix of and are the representations of the two attention codes in the l-th iteration of Runge-Kutta at the t-th moment, and are the representations of the two attention codes in the l+1th iteration of the Runge-Kutta layer at the tth moment, and σ is the sigmoid activation function.

[0061] Furthermore, the training method of the dual-channel graph neural network ODE is:

[0062] S8: Prediction scores based on each historical project Construct loss function with label score y as follows:

[0063]

[0064] Where V is the total number of historical items;

[0065] S9: Determine the loss function Is it less than the set value? If yes, the dual-channel graph neural network ODE is the final dual-channel graph neural network ODE. If no, go to step S12;

[0066] S10: Modify the parameters of the dual-channel graph neural network ODE, and then re-execute steps S4 to S10 based on the dual-channel graph neural network ODE with modified parameters until the loss function Less than the set value.

[0067] Beneficial effects:

[0068] 1. The present invention provides a sequence recommendation method combining ordinary differential equations and time-guided diffusion generation. First, the continuous time evolution process of interaction data is simulated, and a user-specific sequence graph and a cross-sequence evolution graph are constructed. The former is used to capture the changes in individual user preferences, and the latter focuses on exploring time-aware item representations. Secondly, time-guided diffusion generation is applied to fill and expand the evolution graph to alleviate the sparsity of the data. Finally, a neural ODE learner based on a dual-channel graph is used to obtain user interests at a specific time. Therefore, the present invention can improve the matching degree between the recommendation results and the user.

[0069] 2. The present invention provides a sequence recommendation method combining ordinary differential equations and time-guided diffusion generation, designs a time-guided diffusion generator, which is more capable of mining potential evolution laws and constructing enhanced graphs, thereby promoting the application of ODE methods.

[0070] 3. The present invention provides a sequence recommendation method that combines ordinary differential equations and time-guided diffusion generation. The designed ODE model can effectively capture the irregular time dynamics of the two graphs and accurately generate time-aware project representations that can encode dynamic user preferences and time-driven project popularity information. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 A flowchart of a sequence recommendation method combining ordinary differential equations and time-guided diffusion generation provided by the present invention. DETAILED DESCRIPTION

[0072] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0073] The overall framework of the present invention is as follows Figure 1As shown in Figure 2. The overall algorithm consists of three components and is uniformly trained through a multi-task learning framework. The details of these three core modules are as follows: (i) Item Transition Dependency Module, which builds two different levels of graphs to mine item transitions in time. The global graph considers all sessions, while the local graph only focuses on the current session. (ii) Semantic Dependency Module, which uses the interaction matrix to learn item co-occurrence information across sessions. (iii) Cross View, which optionally connects modules (i) and (ii) and acts as a bridge for parameter sharing between them. In addition, self-supervised learning methods are attached to modules (i) and (ii). It should be noted that self-supervised learning plays different roles in these two modules. In module (i), the two levels of item transitions are organically integrated through a contrastive learning scheme. In contrast, in module (ii), the original interaction matrix performs data augmentation for contrastive learning and alleviates data sparsity. Next, we elaborate on the specific design of each module in detail.

[0074] A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation, comprising the following steps:

[0075] S1: According to each user s in the user set m The historical items selected within the set time period construct the user-specific sequence graph G corresponding to the user set us The cross-sequence evolution graph G corresponding to the user set cs , where the user-specific sequence graph G us is the set of all user subgraphs, m=1,2,…,M, where M is the number of users in the user set, and user s m User subgraph The node in is user s m If two historical items are adjacent, there is an edge between the nodes corresponding to the two items, and the weight of the edge is the weight of the two items in the user s m The number of times G appears as an adjacent item in the selection; cs The nodes in are the historical items selected by all users in the user set. If two historical items are adjacent items, there is an edge between the nodes corresponding to the two items, and the weight of the edge is the number of times the two items appear as adjacent items in the selections of all users;

[0076] It should be noted that in order to effectively capture the subtle dynamics of user preferences over time, it is necessary to effectively model the continuous item interactions. To this end, the present invention designs a continuous time process, such as Figure 1 As shown. First, starting from the set S = {s1, s2, ..., sM} of all user sequences, the present invention integrates these sequences along a unified time axis and aligns their time occurrence. Next, the present invention constructs two key graph structures:

[0077] 1.1 User-specific sequence diagram This graph captures the variation of preferences of a single user. It is defined as in, represents the node set of each item in the user sequence S, and ε us ={(vi, vj, t)|vi, vj∈s} represents the set of transition relations between two items in the sequence and marks their corresponding interaction time.

[0078] 1.2 Cross-sequence evolution graph This diagram depicts the overall temporal representation of the items in all sequences. Its structure is Here, Contains all items, and Indicates that in the entire sequence set The interaction that occurs at time t.

[0079] The unique focus of these graphs lies in their respective emphasis on the evolution of user preferences and global item dynamics. By jointly considering changes in user interests and item popularity, these graphical representations enable a deeper understanding of how specific timestamps affect subsequent item interactions.

[0080] S2: Use the time-sequence graph attention mechanism to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention encoding representation of each node in cs and e us ;

[0081] After constructing the sequence graph and the evolution graph, obtaining accurate initial state features is the key to in-depth learning of system dynamics. For this reason, the present invention learns through the diffusion module and the Neural ODE module. Therefore, the present invention uses a graph encoder to derive the potential representation of the project as the initial embedding of the two modules. In order to efficiently capture timestamp information and temporality, the present invention refers to TGAT (Inductive Representation Learning on Temporal Graphs) as the graph encoder of the present invention.

[0082] Specifically, the cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention encoding representation e of any node i cs and e us The method to obtain is as follows:

[0083] S21: Get the neighbor node set of node i in, is the cross-sequence evolution graph G of node ics The set of neighbor nodes in For node i in the user-specific sequence graph G us The set of neighbor nodes in ;

[0084] S22: Get node i for any neighbor node The attention weight αij is:

[0085] α1j=Sigmod(aWQxi,WKxj,b·△t)

[0086] Among them, xi represents the unique hot encoding representation of the project corresponding to node i, and x j represents the one-hot encoding representation of the item corresponding to node j, Δt represents the time difference between the user selecting the item corresponding to node i and the item corresponding to node j, a, b, WQ, WK are all different weight matrices, and T represents transposition;

[0087] S23: Each node i is transformed into a cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention weights of all neighbor nodes are summed to obtain the cross-sequence evolution graph G of node i cs and user-specific sequence diagram G us Attention encoding representation cs and e us :

[0088]

[0089]

[0090] Among them, WV and Wl are different weight matrices set.

[0091] It can be seen that by applying the graph encoder, the one-hot encoded item embedding x is transformed into the initial attention encoding representation e cs and e us , focusing on the changes in user interests and the evolution of item popularity, respectively. Afterwards, these two initial representations are input into the diffusion generation process of the time-guided dual-channel graph neural ODE model of the present invention.

[0092] S3: The attention encoding of each node is represented by e cs and e us Input the trained time-guided diffusion model to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us Enhanced graph of and

[0093] Furthermore, the cross-sequence evolution graph Gcs and user-specific sequence diagram G us Enhanced graph of and The method to obtain is as follows:

[0094] S31: Filter out m times without interaction records And use multi-layer perceptron to convert time t p Respectively with the attention encoding representation of each node e cs and e us Encode and obtain the time-guided embedding representation c corresponding to each node pcs 、c pus ;

[0095] S32: Treat a standard normal distribution of noise ∈ as a noisy variable Will With c pcs , With c pus are respectively sent into the neural network of the time-guided diffusion model to obtain the predicted adjacency matrix z pcs 、z pus ;

[0096] S33: The latest predicted adjacency matrix z pcs With c pcs 、z pus With c pus The time-guided diffusion model is fed into the neural network to generate a new prediction adjacency matrix; step S33 is repeated K2 times to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us At time t p The final adjacency matrix generated by in, The cross-sequence evolution graph G is cs In time The adjacency matrix of The cross-sequence evolution graph G is us In time The adjacency matrix under ;

[0097] Specifically, the cross-sequence evolution graph G cs and user-specific sequence diagram G us The adjacency matrix of The method to obtain is as follows:

[0098] S331: Set the adjacency matrix A of the current graph to the initial state z0, and superimpose the noise that conforms to the standard normal distribution on the initial state z0 using the following formula: Until the upper limit K1 times is superimposed, the state corresponding to the adjacency matrix z0 with K1 times of noise superimposed is obtained

[0099]

[0100] in, is the state obtained by the K1th superposition, and the noise variable α of the kth superposition k =1-β k , β k represents the Gaussian noise added at each step k, the multiplicative noise variable

[0101] S332: Change the status And the time-guided embedding representation c corresponding to all nodes in the current graph t Input to a MLP neural network with a time-guided diffusion model Among them, θ is the network parameter of the MLP neural network, z k-1 Represents the predicted adjacency matrix of the next superposition output by the MLP neural network, and each time the MLP neural network is input A predicted adjacency matrix is ​​obtained; from the state Start with K1 MLP neural network After that, we get the final adjacency matrix

[0102] The training method of the time-guided diffusion model is:

[0103] S332a: The initial adjacency matrix states corresponding to the two graphs and And the time-guided embedding representation c corresponding to all nodes of the two graphs t As the input of the time-guided diffusion model, the predicted adjacency matrix of the two graphs at time t is obtained and

[0104] S332b: Calculate the loss function based on the difference between the predicted adjacency matrix corresponding to all graphs output by the time-guided diffusion model and the label values ​​of the adjacency matrix corresponding to all graphs

[0105] Loss Function The calculation method is:

[0106] The loss function of the two graphs is calculated based on the difference between the predicted adjacency matrix corresponding to the two graphs output by the time-guided diffusion model and the label values ​​of the adjacency matrix corresponding to the two graphs. and as follows:

[0107]

[0108]

[0109]

[0110]

[0111] Where θ represents the model parameters of the time-guided diffusion model, Indicates that k is uniformly distributed from the interval [1, K1] Randomly selected from represents the expected value, represents the noise variable calculated by S331, and C is a constant;

[0112] according to and Get the loss function of the time-guided diffusion model for:

[0113]

[0114] in, Represents the predicted adjacency matrix The element in the i-th row and j-th column of ; Represents the predicted adjacency matrix The element in the i-th row and j-th column of .

[0115] S332c: Determine the loss function Is it less than the set value? If yes, the time-guided diffusion model at this time is the trained time-guided diffusion model. If no, go to step S332d;

[0116] S332d: Change the parameters of the time-guided diffusion model, and then re-execute steps S332a to S332c based on the time-guided diffusion model with changed parameters until the loss function When the value is less than the set value, the training of the time-guided diffusion model is completed.

[0117] S34: The adjacency matrix The corresponding initial enhancement graphs are recorded as in, The cross-sequence evolution graph G is cs In time The initial enhancement graph below, The cross-sequence evolution graph G is us In time Initial enhancement diagram below;

[0118] S35: respectively convert the initial enhanced image and the cross-sequence evolution graph G cs Merge, initial enhancement graph and the cross-sequence evolution graph G us Merge to get the final enhanced image and as follows:

[0119]

[0120]

[0121] Among them, topK means only selecting the edges with the largest values ​​in the adjacency matrix of the graph and removing the other edges.

[0122] S4: Translate the sequence evolution graph G cs The corresponding enhanced graph As the input of one channel of the dual-channel graph neural network ODE, the user-specific sequence graph G us The corresponding enhanced graph As the input of the other channel of the dual-channel graph neural network ODE, the dual-channel graph neural network ODE outputs the cross-sequence evolution graph G cs and user-specific sequence diagram G us The final representation of each node and

[0123]

[0124]

[0125]

[0126]

[0127] Where ODESolver represents the Runge-Kutta method for solving ordinary differential equations, and f cs and f us The cross-sequence evolution graph G is cs and user-specific sequence diagram G us In the encoder within the channel, g(t) is the variable encoded by the MLP neural network at time t, W a , W b , W c , W d are the parameter matrices to be learned, and Respectively represent the enhanced graph and The adjacency matrix of and are the representations of the two attention codes in the l-th iteration of Runge-Kutta at the t-th moment, and are the representations of the two attention codes in the l+1th iteration of the Runge-Kutta layer at the tth moment, and σ is the sigmoid activation function.

[0128] S5: Translate the sequence evolution graph G cs and user-specific sequence diagram G us The final representation of each node and They are sent to a decoder respectively and then merged to obtain the sequence representation h of each user s :

[0129]

[0130] Among them, Decoder represents a decoder that uses the Transformer method for decoding, and ||·|| represents L2 regularization;

[0131] S6: Based on the sequence representation h of each user s And the final value represented Calculate the prediction score for each historical item

[0132]

[0133] S7: From the sequence representation h of each user s Extract the representation of the user k to be recommended from And from the prediction score Get the scores of all items for the user k to be recommended Will The largest top P items in are recommended to the user k to be recommended.

[0134] Furthermore, the training method of the dual-channel graph neural network ODE is:

[0135] S8: Prediction scores based on each historical project Construct loss function with label score y as follows:

[0136]

[0137] Where V is the total number of historical items;

[0138] S9: Determine the loss function Is it less than the set value? If yes, the dual-channel graph neural network ODE is the final dual-channel graph neural network ODE. If no, go to step S12;

[0139] S10: Modify the parameters of the dual-channel graph neural network ODE, and then re-execute steps S4 to S10 based on the dual-channel graph neural network ODE with modified parameters until the loss function Less than the set value.

[0140] The basic principle of the time-guided diffusion generator of the present invention is described in detail below.

[0141] Differential equations can model irregular continuous time states, but when faced with sparse data in recommendation systems, it is difficult to construct the complete system dynamics. Inspired by the diffusion model in the field of denoising and generation, we propose a time-guided diffusion generator. Different from the generation methods in current recommendation systems, we focus on generating extended data corresponding to timestamps. For a graph with an adjacency matrix A Our generator aims to create a ext Extended diagram of These extended graphs are interpolated at specific timestamps to reduce data sparsity, allowing the Neural ODE module to better model the dynamic evolution of the graph.

[0142] To accurately generate these expansion graphs, we encode the initial state embedding e and the current timestamp t (the generation time of each item) through a multi-layer perceptron (MLP) to generate a time-guided embedding c t Then, the present invention uses a conditional diffusion model to guide the generation process with time-guided embedding as a conditional vector. The time-guided diffusion model of the present invention includes a forward process and a reverse process, which is similar to a general diffusion model.

[0143] Forward process

[0144] In order to perform the forward process, the present invention sets the adjacency matrix A (the adjacency matrices of both graphs must be operated in this way) to the initial state z0. According to the method provided by DDPM (Denoising Diffusion Probabilistic Models), the present invention can directly set the adjacency matrix A to the initial state z0. k The forward process to z0 is parameterized as follows:

[0145]

[0146]

[0147] Among them, q(z k |z0) represents the k-th step adjacency matrix z under z0 k Comply with the distribution; under the condition of z0, z k Belongs to the standard normal distribution, is a standard noise; where αk =1-β k , for β k represents the Gaussian noise added at each step k.

[0148] Reverse process

[0149] The reverse process is also affected by the conditional probability of the time-guided embedding, from z K First, we gradually remove the noise through the neural network and restore the adjacency graph of the item sequence:

[0150]

[0151] Among them, μ θ (z k , c t , k) and ∑ θ (z k , c t , k) represents the Gaussian parameters generated by the neural network.

[0152] optimization

[0153] To optimize the parameters θ in the neural network, the diffusion model's main goal is to maximize the evidence lower bound (ELBO) associated with the initial state z0. The main part of the process uses the Kullback-Leibler (KL) divergence to approximate the fitted distribution to a manageable distribution q(z k-1 |z k , z0). According to previous work, the present invention uses To optimize the second term of step k:

[0154]

[0155] in, is obtained by taking the input vector z k The predicted value obtained by inputting the time embedding of the kth step into the MLP to predict z0. C represents a constant that is only related to the first z1 and the initial state z0.

[0156] As can be seen from the above formula, the present invention can be achieved by utilizing Optimize ELBO. In actual implementation, the uniform sampling step of the present invention To optimize The formalization is as follows:

[0157]

[0158] In order to prevent the generated graph from being too smooth, the present invention hopes to increase the differences between the nodes in the graph. extFinally, a possible method is to minimize the smallest eigenvalue of the Laplacian matrix. Since this method significantly increases the time complexity, the present invention indirectly increases the irregularity of the graph by regularizing the edge weights.

[0159] Finally, the overall loss function of the time-guided diffusion module of the present invention is:

[0160]

[0161] Generation process

[0162] After training the temporal guided diffusion model, we perform K′ sampling steps and inference to obtain the expanded adjacency matrix at timestamp t However, the expanded adjacency matrix represents the predicted possible interactions, in which there are a large number of false and irrelevant interactions. Generating too many edges will increase the smoothness of the graph and reduce the utilization of the real interactions in the original graph. and the original image Generate a suitable graph

[0163] Specifically, we select m timestamps t = {t1, t2, ..., t m} and select the expanded graph for each timestamp The top K probability interaction edges with the highest scores in . Therefore, the enhanced graph desired by the present invention can be obtained by merging the edge sets of the above graphs:

[0164]

[0165] Dual-channel graph neural ODE modeling

[0166] With the help of diffusion generation methods, user interactions are usually limited to a specific time period, but are extended to globally possible probabilistic interactions. Therefore, the present invention uses a graph-based neural ordinary differential equation (ODE) module to learn the evolution of project representations over the entire timeline, thereby modeling the dynamic changes of user interests and project popularity. Next, the present invention first introduces the neural ODE process and then describes the time graph ODE solving function of the present invention in detail.

[0167] Neural ODE Process

[0168] Based on the initial embedding e obtained from the time-sensitive latent state encoder, the present invention adopts a neural ODE framework to capture the continuous dynamic behavior of users and the evolution of item popularity. Initially, the present invention proposes an ODE solution function f θ To predict the derivative of the item state embedding e(t) at any given time $t$

[0169]

[0170] Where θ represents the parameters of the neural network. This process simulates the trajectory of item representation changes over time. The final state of the embedded representation at any time t can be obtained by the integral form of the initial time t0:

[0171]

[0172] Drawing on the existing neural ODE method, the present invention uses ODESolver (ODE solver), where the Runge-Kutta method is selected to solve the ordinary differential equation:

[0173] e(t)=ODESolver(f θ ,e(t0),t0,t).

[0174] Through the neural ODE process, the present invention is able to infer the evolution state of the project at any time, so when a target time t is given n+1 When you use the command, you can get the entire project status at the next interaction moment.

[0175] Time Graph ODE Solver Function

[0176] In order to accurately capture the dynamic evolution of item representation in continuous time, we propose a time graph ODE solution function f θ To simulate the derivatives in the ODE process. In order to accurately predict the item representation at any time, we encode the timestamp and the corresponding graph structure in the ODE solution function, where And g(t) represents the timestamp encoding function.

[0177] Before encoding the timestamp t, in order to maintain the stability of the ODE, the present invention normalizes all timestamps to the range of [0,1]. Considering the translation invariance of neighbor nodes with different timestamps in the graph, the present invention introduces sinusoidal position coding to encode the current timestamp t, and the timestamp coding function g is:

[0178]

[0179] Here i represents the position in input time and d represents the embedding dimension.

[0180] After obtaining accurate time embedding T through position encoding, the present invention considers explicit connection relationships in sequence and evolution graphs. Given the enhanced adjacency matrix A aug and the corresponding degree matrix D aug , the present invention selects the normalized adjacency matrix To promote the transmission of neighbor information between graph nodes. It is worth noting that as time passes in ODE, multiple layers are stacked, and normalization is effective in alleviating the potential gradient explosion problem. Given the directedness of the two graphs, the present invention uses D -1 A instead of To normalize. The ODE solution function is defined as follows:

[0181]

[0182] Where W a and W b represents the trainable parameter matrix, σ represents the activation function, Representing a subgraph After L layers of graph convolution, the final project is represented as As the number of network layers L increases, the receptive field of the project node expands and more neighbor information can be aggregated, but too many network layers can easily lead to over-smoothing, thereby weakening the model performance.

[0183] Model prediction and optimization

[0184] By evolving the states of the two graphs in a dual-channel neural ODE process, the present invention is able to obtain the final project representation at the target time. The final item vector is then processed through a multi-head self-attention mechanism, which is defined as follows:

[0185]

[0186]

[0187]

[0188] Among them, Attention h By Q h and K h Perform scaled dot product attention calculation V between h The weighted sum of , d is the dimension, and H is the number of heads of the self-attention mechanism. By the matrix Then, the output is passed through a weight matrix and the bias vector Next, the outputs from L such blocks are stacked to obtain a vector h∈{h us ,h cs}.

[0189] Finally, the final sequence representation is obtained by combining the two output vectors: s=||h us ||+||h cs ||,||·|| denotes the L2 norm.

[0190] In order to predict the interaction probability between a user sequence and a specific item v, the present invention calculates the user sequence embedding h s (representing this user) and the target project embedding The dot product between (items) to assess their relevance:

[0191]

[0192] The present invention uses the cross entropy loss function to calculate the optimization target of the main recommendation task, which is defined as follows:

[0193]

[0194] The loss function here is to train the model. In fact, the present invention predicts the probability of all items Sort by size, and select the most likely top K recommended items (K is the required number of recommendations) as the recommendation result of the present invention.

[0195] In summary, the present invention proposes a novel sequential recommendation framework that combines the Neural Ordinary Differential Equation (ODE) and the diffusion module, namely DiffODE; the framework effectively captures the changes in user-specific preferences and the global time-aware item popularity by constructing two evolution graphs: the user-specific sequence graph and the cross-sequence evolution graph; at the same time, the present invention also designs a time-guided diffusion generator to alleviate the serious data sparsity problem in the sequence graph. By fusing the item embeddings encoded from the evolution graph, the diffusion method of the present invention is more capable of mining the potential evolutionary laws and constructing an enhanced graph, thereby promoting the application of the ODE method; finally, the present invention proposes a neural ODE model based on a dual-channel graph to learn the irregular temporal dynamics of the enhanced graph and generate time-aware item representations. Specifically, the representation learned by the present invention not only encodes dynamic user preferences, but also contains time-driven item popularity information.

[0196] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may certainly make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.

Claims

1. A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation, characterized in that: The following steps are involved: S1: According to each user s in the user set m The historical items selected within the set time period construct the user-specific sequence graph G corresponding to the user set us The cross-sequence evolution graph G corresponding to the user set cs , where the user-specific sequence graph G us is the set of all user subgraphs, M is the number of users in the user set, user s m User subgraph The node in is user s m If two historical items are adjacent, there is an edge between the nodes corresponding to the two items, and the weight of the edge is the weight of the two items in the user s m The number of times G appears as an adjacent item in the selection; cs The nodes in are the historical items selected by all users in the user set. If two historical items are adjacent items, there is an edge between the nodes corresponding to the two items, and the weight of the edge is the number of times the two items appear as adjacent items in the selections of all users; S2: Use the time-sequence graph attention mechanism to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention encoding representation of each node in cs and e us ; S3: The attention encoding of each node is represented by e cs and e us Input the trained time-guided diffusion model to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us Enhanced graph of and S4: Translate the sequence evolution graph G cs The corresponding enhanced graph As the input of one channel of the dual-channel graph neural network ODE, the user-specific sequence graph G us The corresponding enhanced graph As the input of the other channel of the dual-channel graph neural network ODE, the dual-channel graph neural network ODE outputs the cross-sequence evolution graph G cs and user-specific sequence diagram G us The final representation of each node and S5: Translate the sequence evolution graph G cs and user-specific sequence diagram G us The final representation of each node and They are sent to a decoder respectively and then merged to obtain the sequence representation h of each user s : Among them, Decoder represents a decoder that uses the Transformer method for decoding, and ||·|| represents L2 regularization; S6: Based on the sequence representation h of each user s And the final value represented Calculate the prediction score for each historical item S7: From the sequence representation h of each user s Extract the representation of the user k to be recommended from And from the prediction score Get the scores of all items for the user k to be recommended Will The largest top P items in are recommended to the user k to be recommended.

2. A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 1, characterized in that: In step S2, the cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention encoding representation e of any node i cs and e us The method to obtain is as follows: S21: Get the neighbor node set of node i in, is the cross-sequence evolution graph G of node i cs The set of neighbor nodes in For node i in the user-specific sequence graph G us The set of neighbor nodes in ; S22: Get node i for any neighbor node The attention weight α ij : Among them, x i represents the one-hot encoding representation of the item corresponding to node i, x j represents the unique hot encoding representation of the item corresponding to node j, Δt represents the time difference between the user selecting the item corresponding to node i and the item corresponding to node j, a, b, W Q , W K They are all different weight matrices, and T represents transpose; S23: Each node i is transformed into a cross-sequence evolution graph G cs and user-specific sequence diagram G us The attention weights of all neighbor nodes are summed to obtain the cross-sequence evolution graph G of node i cs and user-specific sequence diagram G us Attention encoding representation e cs and e us : Among them, W V and W l are different weight matrices set.

3. The sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 1, characterized in that: In step S3, the cross-sequence evolution graph G cs and user-specific sequence diagram G us Enhanced graph of and The method to obtain is as follows: S31: Filter out m times without interaction records And use multi-layer perceptron to convert time t p Respectively with the attention encoding representation of each node e cs and e us Encode and obtain the time-guided embedding representation c corresponding to each node pcs 、c pus ; S32: Treat a standard normal distribution of noise ∈ as a noisy variable z K2, will z K2 and c pcs , z K2 and c pus are respectively sent into the neural network of the time-guided diffusion model to obtain the predicted adjacency matrix z pcs 、z pus ; S33: The latest predicted adjacency matrix z pcs With c pcs 、z pus With c pus The time-guided diffusion model is fed into the neural network to generate a new prediction adjacency matrix; step S33 is repeated K2 times to obtain the cross-sequence evolution graph G cs and user-specific sequence diagram G us At time t p The final adjacency matrix generated by in, The cross-sequence evolution graph G is cs In time The adjacency matrix of The cross-sequence evolution graph G is us In time The adjacency matrix under ; S34: The adjacency matrix The corresponding initial enhancement graphs are recorded as in, The cross-sequence evolution graph G is cs In time The initial enhancement graph below, The cross-sequence evolution graph G is us In time Initial enhancement diagram below; S35: respectively convert the initial enhanced image and the cross-sequence evolution graph G cs Merge, initial enhancement graph and the cross-sequence evolution graph G us Merge to get the final enhanced image and as follows: Among them, topK means only selecting the edges with the largest values ​​in the adjacency matrix of the graph and removing the other edges.

4. A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 3, characterized in that: In step S33, the cross-sequence evolution graph G cs and user-specific sequence diagram G us The adjacency matrix of The method to obtain is as follows: S331: Set the adjacency matrix A of the current graph to the initial state z0, and superimpose the noise that conforms to the standard normal distribution on the initial state z0 using the following formula: Until the upper limit K1 times is superimposed, the state corresponding to the adjacency matrix z0 with K1 times of noise superimposed is obtained z K1: in, z K1 is the state obtained by the K1th superposition, and the noise variable α of the kth superposition k =1-β k , β k represents the Gaussian noise added at each step k, the multiplicative noise variable S332: Change the status z K1 and the time-guided embedding representation c corresponding to all nodes in the current graph t Input a time-guided diffusion model MLP neural network p θ (z k-1 |z k , c t ), where θ is the network parameter of the MLP neural network, z k-1 It represents the predicted adjacency matrix of the next superposition output by the MLP neural network, and each time the MLP neural network p is input θ (z k-1 |z k , c t ), we get a predicted adjacency matrix; from the state z Starting from K1, after K1 MLP neural networks After that, we get the final adjacency matrix 5. A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 4, characterized in that: The training method of the time-guided diffusion model is: S332a: The initial adjacency matrix states corresponding to the two graphs and And the time-guided embedding representation c corresponding to all nodes of the two graphs t As the input of the time-guided diffusion model, the predicted adjacency matrix of the two graphs at time t is obtained and S332b: Calculate the loss function based on the difference between the predicted adjacency matrix corresponding to all graphs output by the time-guided diffusion model and the label values ​​of the adjacency matrix corresponding to all graphs S332c: Determine the loss function Is it less than the set value? If yes, the time-guided diffusion model at this time is the trained time-guided diffusion model. If no, go to step S332d; S332d: Change the parameters of the time-guided diffusion model, and then re-execute steps S332a to S332c based on the time-guided diffusion model with changed parameters until the loss function When the value is less than the set value, the training of the time-guided diffusion model is completed.

6. A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 5, characterized in that: Loss Function The calculation method is: The loss function of the two graphs is calculated based on the difference between the predicted adjacency matrix corresponding to the two graphs output by the time-guided diffusion model and the label values ​​of the adjacency matrix corresponding to the two graphs. and as follows: Where θ represents the model parameters of the time-guided diffusion model, Indicates that k is uniformly distributed from the interval [1, K1] Randomly selected from represents the expected value, represents the noise variable calculated by S331, and C is a constant; according to and Get the loss function of the time-guided diffusion model for: in, Represents the predicted adjacency matrix The elements in the i-th row and j-th column of ; Represents the predicted adjacency matrix The element in the i-th row and j-th column of .

7. A sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 1, characterized in that: In step S4, the final representation is and The method to obtain is as follows: Where ODESolver represents the Runge-Kutta method for solving ordinary differential equations, and f cs and f us The cross-sequence evolution graph G is cs and user-specific sequence diagram G us In the encoder within the channel, g(t) is the variable encoded by the MLP neural network at time t, W a , W b , W c , W d are the parameter matrices to be learned, and Respectively represent the enhanced graph and The adjacency matrix of and are the representations of the two attention codes in the l-th iteration of Runge-Kutta at the t-th moment, and are the representations of the two attention codes in the l+1th iteration of the Runge-Kutta layer at the tth moment, and σ is the sigmoid activation function.

8. The sequence recommendation method combining ordinary differential equations and time-guided diffusion generation as claimed in claim 1, characterized in that: The training method of the dual-channel graph neural network ODE is: S8: Prediction scores based on each historical project Construct loss function with label score y as follows: Where V is the total number of historical items; S9: Determine the loss function Is it less than the set value? If yes, the dual-channel graph neural network ODE is the final dual-channel graph neural network ODE. If no, go to step S12; S10: Modify the parameters of the dual-channel graph neural network ODE, and then re-execute steps S4 to S10 based on the dual-channel graph neural network ODE with modified parameters until the loss function Less than the set value.

Citation Information

Cited By

  • Transform-based cross-sequence multi-behavior sequence recommendation method

    CN119988753A

  • A transformer-based cross-sequence multi-behavior sequence recommendation method

    CN119988753B

  • User potential intention modeling method and system based on continuous time dynamics

    CN121093798A