Time sequence social network interaction prediction method and system based on bidirectional selective state space model
Through the bidirectional selective state space model and multimodal embedding representation coding method, the problem of difficult to capture the long-term time dependence of user interaction sequences in social networks is solved, the accuracy and stability of prediction are improved, noise interference is reduced, and the More comprehensive user-embedded representations and more efficient prediction effects.
Patent Information
- Application Number
- CN202411262152.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art is difficult to effectively capture the long-term time dependence and global information of user interaction sequences in social networks, resulting in insufficient prediction accuracy and stability and being easily disturbed by noise and redundant information.
Using a bidirectional selective state space model combined with a multimodal embedding representation encoding method, a more comprehensive user embedding representation is generated to improve predictions by capturing the long-term time dependencies of sequences, using relative time encoding, common neighbor embedding representation and bidirectional selective state space model. accuracy.
It significantly improves the accuracy and stability of social network interaction prediction, reduces noise interference, and enhances the robustness and prediction reliability of the model.
Smart Images

Figure CN119130689A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for predicting future user interactions in a network in a temporal social network analysis, and in particular to a temporal social network interaction prediction method and system based on a bidirectional selective state space model. Background Art
[0002] In recent years, deep learning methods have attracted much attention in the field of social network link prediction. As an emerging deep learning model, the selective state space model is specially designed to process complex time series data and provides a new solution for predicting user-to-user interaction in social networks. User-to-user interaction prediction in social networks involves time-varying temporal networks, and the selective state space model is committed to capturing the long-term temporal dependence of users on interaction sequences, which can effectively solve this complex problem. Traditional methods are prone to gradient vanishing or gradient explosion problems when processing long sequences, which makes it difficult for the model to effectively learn early information in the sequence, thereby affecting the capture of long-sequence temporal dependencies. In addition, when processing sequence data, traditional methods will process all input information indiscriminately, which will cause the model to be easily disturbed by noise and redundant information when processing long sequences, affecting the prediction performance of the model. Therefore, for the task of predicting user-to-user interaction in social networks, it is necessary to study a new method that is superior to traditional methods, which can fully consider the long-term temporal dependence information of temporal networks, bring more accurate and stable solutions to the field of temporal network processing, and promote the further development of temporal network processing technology. Summary of the invention
[0003] Purpose of the invention: The purpose of the present invention is to overcome the above-mentioned defects and provide a method and system for predicting temporal social network interactions based on a bidirectional selective state-space model to improve the accuracy and stability of social network link prediction tasks.
[0004] Technical solution: To achieve the above-mentioned purpose of the invention, the present invention provides a new and more effective social network link prediction method. By combining the bidirectional selective state space model, the system can better understand the global information and long-term time dependency information of time series data, and further capture the correlation between user pairs through multimodal embedding representation encoding method, so as to fully grasp the correlation between user pairs in social networks, thereby improving the accuracy and stability of social network interaction prediction. The specific steps are as follows:
[0005] (1) For a continuous-time social network, for any pair of users u and v in the network, we sample the user IDs that they interacted with before time t in the order of their interaction time to construct an interaction sequence of equal length. Extract their respective user embedding representation matrices from And the interaction edge embedding representation matrix
[0006] (2) Based on the timestamp information of user u, v interacting with the users in their respective sequences, relative time encoding is used to encode the sequence Generate temporal embedding representation matrix
[0007] (3) By counting the sequence of users u and v The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation matrix
[0008] (4) Change the sequence The user embedding representation matrix, the interaction edge embedding representation matrix, the time embedding representation matrix and the common neighbor embedding representation matrix are segmented, reorganized and concatenated respectively;
[0009] (5) Sequence The new embedding representation matrices are dimensionally aligned, and then the sequence The aligned embedding representation matrices are concatenated separately, and then the sequences are connected Align the concatenated embedding representation matrix to get the sequence The joint embedding representation matrix
[0010] (6) Considering The internal and inter-sequential long-term temporal dependencies are captured using a bidirectional selective state space model to embed the sequence; the sequence is jointly embedded into the representation matrix Two selective state space models are input in the forward and reverse order of time respectively to capture the long-term temporal dependencies in both directions of the sequence, thereby obtaining two new sequence joint embedding representation matrices Then combine the two to get the final joint embedding representation matrix of the sequence
[0011] (7) Divide into sequences The respective embedding representations are aggregated by row average to obtain the final embedding representation of users u and v Then through the joint embedding representation for interactive prediction.
[0012] Furthermore, in step (1), for any pair of users u and v in the social network, the user IDs of the users that have interacted with each other before time t are sampled in the order of interaction time to construct an interaction sequence Specify sequence The number of sampled users If the number of users in the interaction record of user u or v does not meet the set sampling number requirement, the sequence or Missing user IDs are filled with 0.
[0013] Then, according to the obtained user sequence The user ID index and the recorded interaction time t′ are the sequence Generating User Embeddings Interaction edge embedding representation where d N is the dimension of user embedding representation, d E The dimension of the interaction edge embedding representation.
[0014] Furthermore, in step (2), the relative time encoding is used as the sequence according to the timestamp information of the user u, v interacting with the users in their respective sequences. Generating temporal embedding representations The temporal embedding representation generation method is denoted as:
[0015]
[0016] in d T Represents the temporal embedding representation matrix dimension, Δt′=tt′, t′ represents the interaction time, Represents a trainable weight parameter, and * represents user u or user v.
[0017] Furthermore, in step (3), by counting the user u, v sequences The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation of The calculation method is:
[0018]
[0019] Where f represents the activation function RELU, represents the neighbor appearance count matrix, The extracted data are each user ID in two sequences. and Number of occurrences.
[0020] Furthermore, in step (4), the sequence User embedding representation Interaction edge embedding representation Temporal Embedding Representation and common neighbor embedding representation The division, reorganization and splicing are performed respectively; the division method is: the number of divided blocks is P, and these P blocks are spliced in parallel to form a sequence The new multiple embedding representation matrix, the number of matrix rows is:
[0021]
[0022] After the above operations, we get the sequence New user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix Common neighbor embedding representation matrix Where * represents user u or user v.
[0023] Furthermore, in step (5), the sequence The new multiple embedding representation matrices are dimensionally aligned respectively, and the dimension alignment method is as follows:
[0024]
[0025] in represents the learnable weight matrix, represents the bias vector, d represents the dimension after alignment, and # represents the matrix subscript E, T, C, N.
[0026] Furthermore, in step (6), the sequence is jointly embedded into the representation matrix The row vectors of are input into a selective state space model in positive order. Construct the initial state matrix using the HiPPO method n represents the dimension of the hidden layer in the state space model, and initializes the hidden state representation matrix Generating input vectors Output vector Next, The state is updated in reverse iteration:
[0027]
[0028] in represents the hidden state at the last moment, express The updated state matrix is calculated as:
[0029]
[0030] for Updated input vector, used to represent the current input The direct impact on the internal state of the sequence is calculated as:
[0031]
[0032] I represents the identity matrix, represents the step vector, which is calculated as:
[0033]
[0034] Linear α (), Linear β (), Linear Δ () represents different linear mapping functions, τ Δ is the activation function Softplus. On this basis, a state representation containing long-term positive dependency information is generated. By vertical stacking Get the forward learned sequence joint embedding representation
[0035] On the other hand, in order to capture the indirect dependencies between sequence elements and to more comprehensively understand the intrinsic structure and deep laws of sequence data, a reverse sequence joint embedding representation matrix is constructed. The row vectors are sequentially input into another selective state-space model. For each row vector The HiPPO method is also used to construct the initial state matrix Initialize the hidden state representation matrix Generating input vectors Output vector Next, The state is updated in reverse iteration:
[0036]
[0037] express The updated state matrix is calculated as:
[0038]
[0039] for The updated input vector is calculated as:
[0040]
[0041] represents the step vector, which is calculated as:
[0042]
[0043] After obtaining the hidden state after propagation Then, add it to the output vector interact to generate state output representations that contain deep temporal dependencies Recorded as By vertical stacking Get the reverse learned sequence joint embedding representation
[0044] Then the sequence is jointly embedded into Flip it upside down and record it as:
[0045]
[0046] Finally, the fusion sequence is jointly embedded To capture the bidirectional temporal dependencies of sequences and generate a more informative and comprehensive joint embedding representation of sequences
[0047]
[0048] Furthermore, in step (7), Divide into sequences Their respective embedding representations The division method is recorded as:
[0049]
[0050]
[0051] in Representation is a joint embedding representation of sequence Before row vector, Representation is a joint embedding representation of sequence No. The vector after the row; on this basis, the sequence The embedding representation of Aggregate by row average to get the final embedding representation of user u and v The calculation is as follows:
[0052]
[0053]
[0054] in represents the weight matrix, represents the bias term, MEAN represents the average aggregation function, and d out Representation sequence The dimensionality of the final embedding representation.
[0055] Based on the same inventive concept, the present invention provides a time-series social network interaction prediction system based on a selective state space model, including:
[0056] The user pair interaction sequence extraction module is used to process and extract the interaction sequences of user pairs of equal length within a certain period of time. For continuous-time social networks, for any pair of users u and v in the network, the user IDs that have interacted with each other before time t are sampled in the order of interaction time to construct an interaction sequence of equal length. Extract their respective user embedding representation matrices from And the interaction edge embedding representation matrix
[0057] The sequence time embedding representation construction module is used to encode the sequence using relative time according to the timestamp information of user u, v interacting with each other in the sequence Generate temporal embedding representation matrix
[0058] Sequence common neighbor embedding representation construction module is used to count the sequences of users u and v The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation matrix
[0059] Segmentation, reassembly and splicing sequence embedding representation module is used to transform the sequence The user embedding representation matrix, the interaction edge embedding representation matrix, the time embedding representation matrix and the common neighbor embedding representation matrix are segmented, reorganized and concatenated respectively;
[0060] A preliminary joint embedding representation generation module for the sequence The new embedding representation matrices are dimensionally aligned, and then the sequence The aligned multiple embedding representation matrices are concatenated and connected to obtain the sequence The joint embedding representation of
[0061] The BISRU module (Bidirectional Interactive Sequence Expression Update Module) is used to take into account The internal and inter-sequential long-term temporal dependencies are captured using a bidirectional selective state space model to embed the sequence; the sequence is jointly embedded into the representation matrix Two selective state space models are input in the forward and reverse order of time respectively to capture the long-term temporal dependencies in both directions of the sequence, thereby obtaining two new sequence joint embedding representation matrices Then combine the two to get the final joint embedding representation matrix of the sequence
[0062] The embedding representation partitioning aggregation module is used to Divide into sequences The respective embedding representations are aggregated by row average to obtain the final embedding representation of users u and v
[0063] And the user-to-user interaction prediction module is used to combine the embedding representation of users u and v Perform interaction prediction and output the probability of user u and v interacting at time t.
[0064] Based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which implements the steps of the method when executed by a processor.
[0065] Beneficial effects: The present invention proposes a method for predicting time-series social network interactions based on a bidirectional selective state space model. Its advantages and effects are that by combining the bidirectional selective state space model and the multimodal embedding representation encoding method, a powerful tool is provided to more accurately predict the future interaction trends and relevance of users in social networks. The benefits are specifically manifested as follows:
[0066] (1) Reduce the interference of noise and redundant information: The bidirectional selective state space model introduces a selection mechanism to dynamically select propagation or forgetting information, focusing on processing key information that has a significant impact on the task, which can reduce the interference of noise and redundant information. In addition, by capturing the long-term temporal dependency of the sequence in a bidirectional manner, the model can reduce excessive reliance on single-direction information, making it more robust in the face of noise or outliers in the sequence, effectively improving the prediction accuracy and robustness of the model.
[0067] (2) Improve the interactive prediction effect of time-series social networks: The bidirectional selective state space model can comprehensively capture the long-term temporal dependencies and global information within and between sequences. By combining the multimodal embedding representation encoding method, it can deeply capture the correlation between user pairs from multiple aspects, deeply explore the potential laws and patterns hidden behind the sequence data, and accurately capture the spatiotemporal characteristics of time-series social networks, thereby improving the reliability and accuracy of predictions.
[0068] The present invention adopts a time-series social network interaction prediction method based on a bidirectional selective state space model to predict interactions on a data set. In view of the fact that existing methods cannot effectively capture the long-term temporal dependency and global information of users on sequences when predicting continuous-time social network data sets, a method combining a bidirectional selective state space model with a multimodal embedding representation encoding is proposed to obtain a more robust expression of temporal information, thereby improving the accuracy and reliability of predicting user interactions at unknown moments in a time-series social network. A large number of experiments have proved that the social network interaction prediction algorithm we proposed has better prediction performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 The figure is a schematic diagram of a method flow of an embodiment of the present invention.
[0070] Figure 2 for Figure 1 Schematic diagram of the BISRU module processing flow.
[0071] Figure 3 Schematic diagram of the segmentation and splicing operation in an embodiment of the present invention. DETAILED DESCRIPTION
[0072] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0073] The present invention adopts a time series social network interaction prediction method based on a bidirectional selective state space model to perform interaction prediction on a data set. In view of the fact that existing methods cannot effectively capture the long-term temporal dependency and global information of users on sequences when predicting continuous time social network data sets, a method combining a bidirectional selective state space model with a multimodal embedding representation encoding is proposed to maintain the robustness of the invention and improve the prediction performance. The invention is used to perform predictions and obtain prediction results for social network data. Figure 1 and Figure 2 As shown, a method for predicting time-series social network interactions based on a bidirectional selective state space model provided by an embodiment of the present invention mainly includes the following steps:
[0074] (1) Generate interaction sequences for user pairs: For a continuous-time social network, for any pair of users u and v in the network, sample the user IDs that each user has interacted with before a specific time t in order of interaction time to construct an interaction sequence of equal length. Sequence length Extract their respective user embedding representation matrices from And the interaction edge embedding representation matrix d N , d E are the dimensions of the user embedding representation matrix and the interaction edge embedding representation matrix respectively.
[0075] (2) Generate a temporal embedding representation of the interaction sequence: Based on the timestamp information of the interaction between users u and v in their respective sequences, use relative time encoding to encode the sequence Generate temporal embedding representation matrix d T is the dimension of the temporal embedding representation matrix.
[0076] (3) Generate common neighbor embedding representation by combining the number of common user IDs in the interaction sequence: By counting the sequence of users u and v The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation of d C Dimensions of the matrix for the common neighbor embedding representation.
[0077] (4) Various embedding representations of segmented, recombined, and spliced sequences: The user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix And the common neighbor embedding representation matrix Perform segmentation, reorganization and concatenation respectively to generate a new user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix and the common neighbor embedding representation matrix Where P is the number of partition blocks, The number of rows of the new sequence embedding representation matrix after concatenation.
[0078] (5) Align the new embedding representation dimensions of the sequences and further concatenate them to obtain the joint embedding representation of the sequences: The new embedding representation matrices are dimensionally aligned to generate the dimensionally aligned user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix And the common neighbor embedding representation matrix Where d is the dimension of the aligned embedding representation. Then the sequence The aligned multiple embedding representation matrices are concatenated separately to obtain Then, for the sequence Embedded representation after concatenation Perform the connection operation to obtain the sequence The joint embedding representation of
[0079] (6) Considering the long-term temporal dependencies within and between sequences, the bidirectional selective state space model is utilized to capture the embedded representation of the sequences. The sequence joint embedding representation matrix is respectively input into two selective state space models in the forward and reverse order of time to capture the long-term temporal dependencies in both directions of the sequence, thereby obtaining two new sequence joint embedding representation matrices Then, the two are fused to obtain the final joint embedding representation matrix of the sequence
[0080] (7) Generate the final interactive prediction for the user embedding representation: Divide into sequences and their respective embedding representations Aggregate them by row averaging to obtain the final embedding representations of users u and v where d out represents the output dimension, and then perform interactive prediction through the joint embedding representation .
[0081] The generation method of the interactive sequence of user pairs in step (1) is as follows:
[0082] First, for any pair of users u and v in the social network, sample the user IDs they interacted with before a specific time t in the order of interaction time to construct the interactive sequence The sequences are respectively denoted as:
[0083]
[0084]
[0085] where u′ and v′ respectively represent any user with whom users u and v interacted at any time t′ (t′ < t). For the convenience of data preprocessing and reducing computational complexity, it is stipulated that the number of sampled users in the sequences is equal, that is If the number of users in the interaction records of user u or v does not meet the set sampling quantity requirement, the missing user IDs in the sequences or are filled with 0.
[0086] Then, according to the user ID indexes in the obtained user sequences and the recorded interaction time t′, initialize the user embedding representation and the interaction edge embedding representation as the all-zero matrix O, where dN is the dimension of user embedding representation, d E The dimension of the interaction edge embedding representation.
[0087] The generation method of the temporal embedding representation of the interaction sequence in step (2) is as follows:
[0088] According to the timestamp information of user u, v interacting with each other in their respective sequences, relative time encoding is used as the sequence Generating temporal embedding representations This allows the model to adapt to data of different time scales and eliminate the impact of time offset. The generation method of time embedding representation is recorded as:
[0089]
[0090] in d T Represents the temporal embedding representation matrix The dimension of , Δt′=tt′, Represents a trainable weight parameter, and * represents a user, such as user u or user v.
[0091] The common neighbor embedding representation of the interaction sequence in step (3) is generated as follows:
[0092] By counting the user u, v sequence The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation of This is used to measure the correlation between them, and the calculation method is:
[0093]
[0094] Where f represents the activation function RELU, Represents the neighbor occurrence statistics matrix. The extracted data are each user ID in two sequences. and The number of occurrences. For example, the sequence are {a, b, a, c} and {b, b, a, c} respectively, The first user a in the two sequences The number of times they appear in are 2 and 1 respectively, recorded as [2,1]. Similarly, the neighbor appearance count matrix is Let it be [[2,1],[1,2],[2,1],[1,1]] T .
[0095] like Figure 3 , the various embedding representation processes of segmentation, recombination and splicing sequences in step (4) are as follows:
[0096] will sequence User embedding representation Interaction edge embedding representation Temporal Embedding Representation and common neighbor embedding representation Segmentation, reorganization and splicing are performed respectively. For long sequences, directly inputting the entire sequence into the model for embedding representation will result in a huge amount of calculation. By segmenting, the long sequence can be decomposed into multiple shorter blocks, thereby reducing the computational complexity and memory consumption. The segmentation method is: the number of segments is P, and these P blocks are spliced in parallel to form a sequence The new multiple embedding representation matrix, the number of matrix rows is:
[0097]
[0098] After the above operations, we get the sequence New user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix Common neighbor embedding representation matrix Where * represents user u or user v.
[0099] The process of aligning the new embedding representation dimensions of the sequences in step (5) and further concatenating them to obtain the joint embedding representation of the sequences is as follows:
[0100] Pair Sequence The new multiple embedding representation matrices are dimensionally aligned respectively, and the dimension alignment method is as follows:
[0101]
[0102] in represents the learnable weight matrix, represents the bias vector, d represents the dimension after alignment, and # represents the matrix subscript E, T, C, N.
[0103] In step (6), a bidirectional selective state space model is used to capture The long-term time dependencies within and between processes are as follows:
[0104] Jointly embed the sequence into a representation matrix The row vectors of are input into a selective state space model in positive order. (k=1…L), use HiPPO method to construct the initial state matrix d represents the dimension after alignment, n represents the dimension of the hidden layer in the state space model, and the hidden state representation matrix is initialized Generating input vectors Output vector Next, The state is updated in reverse iteration:
[0105]
[0106] in represents the hidden state at the last moment, express The updated state matrix is calculated as:
[0107]
[0108] for Updated input vector, used to represent the current input The direct impact on the internal state of the sequence is calculated as:
[0109]
[0110] I represents the identity matrix, represents the step vector, which is calculated as:
[0111]
[0112] Linear α (), Linear β (), Linear Δ () represents different linear mapping functions, τ Δ is the activation function Softplus. On this basis, a state representation containing long-term positive dependency information is generated. By vertical stacking Get the forward learned sequence joint embedding representation
[0113] On the other hand, in order to capture the indirect dependencies between sequence elements and to more comprehensively understand the intrinsic structure and deep laws of sequence data, a reverse sequence joint embedding representation matrix is constructed. The row vectors are sequentially input into another selective state-space model. For each row vector The HiPPO method is also used to construct the initial state matrix Initialize the hidden state representation matrix Generating input vectors Output vector Next, The state is updated in reverse iteration:
[0114]
[0115] express The updated state matrix is calculated as:
[0116]
[0117] for The updated input vector is calculated as:
[0118]
[0119] represents the step vector, which is calculated as:
[0120]
[0121] After obtaining the hidden state after propagation Then, add it to the output vector interact to generate state output representations that contain deep temporal dependencies Recorded as By vertical stacking Get the reverse learned sequence joint embedding representation
[0122] Then the sequence is jointly embedded into Flip it upside down and record it as:
[0123]
[0124] Finally, the fusion sequence is jointly embedded To capture the bidirectional temporal dependencies of sequences and generate a more informative and comprehensive joint embedding representation of sequences
[0125]
[0126] Constructing the initial state matrix using the HiPPO method The HiPPO method projects the historical state information of time series data into a finite-dimensional vector space, usually a square matrix, by constructing a special matrix, thus achieving information compression and storage. The way is written as:
[0127]
[0128] Where i and j represent the state matrix The row and column subscripts of .
[0129] The matrix constructed by this method can capture the long-term temporal dependencies within and between sequences. Compared with the traditional RNN (recurrent neural network), it has a longer memory length and can retain more historical state information.
[0130] The process of generating the final user interactive prediction of the embedded representation in step (7) is as follows:
[0131] Will Divide into sequences Their respective embedding representations The division method is recorded as:
[0132]
[0133]
[0134] in Representation is a joint embedding representation of sequence Before row vector, Representation is a joint embedding representation of sequence No. The vector after the row; on this basis, the sequence The embedding representation of Aggregate by row average to get the final embedding representation of user u and v The calculation is as follows:
[0135]
[0136]
[0137] in represents the weight matrix, represents the bias term, MEAN represents the average aggregation function, and d out Representation sequence The dimensionality of the final embedding representation.
[0138] Then combine the final embedding representation of users u and v The multi-layer perceptron (MLP) is used to analyze and calculate, thus obtaining the probability of user u and user v interacting at a specific time t. The probability calculation method is as follows:
[0139]
[0140] in is the predicted probability value, Softmax and RELU are the activation functions.
[0141] In this embodiment, the loss function is used to reversely optimize the model parameters. First, a binary cross entropy loss function is constructed. By optimizing the loss function, the parameters of the model are reversely optimized to improve the accuracy of the model in predicting the interaction between users u and v at time t. The binary cross entropy loss function is defined as follows:
[0142]
[0143] Where K is the number of positive samples or negative samples (the number of both is the same), S is the number of user pairs to be predicted in the social network, is the predicted value calculated by the model, y i To reflect the user's label of the actual interaction at time t, y i ∈{0, 1}, 0 means no interaction occurs, and 1 means interaction occurs.
[0144] Based on the same inventive concept, an embodiment of the present invention provides a temporal social network interaction prediction system based on a bidirectional selective state space model, comprising:
[0145] User pair interaction sequence extraction module: Process and extract the interaction sequences of user pairs in a certain period of time. For continuous time social networks, first, for any pair of users u and v in the social network, sample the user IDs that have interacted before a specific time t in the order of interaction time to construct an interaction sequence of equal length. If the number of users in the interaction record of user u or v does not meet the set sampling quantity requirement, the sequence or Missing user IDs are filled with 0. Then the system continues to obtain the user sequence The user ID index and the recorded interaction time t′ are preprocessed into a sequence Generating User Embeddings Interaction edge embedding representation
[0146] Sequence time embedding representation construction module: Based on the timestamp information of user u, v interacting with each other in their respective sequences, relative time encoding is used as the sequence Generating temporal embedding representations
[0147] Sequence common neighbor embedding representation construction module: by counting user u, v sequences The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation of This is used to measure the correlation between them.
[0148] Segmentation, reorganization and splicing sequence embedding representation module: Sequence The user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix And the common neighbor embedding representation matrix Perform segmentation, reorganization and concatenation respectively to generate a new user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix and the common neighbor embedding representation matrix
[0149] Preliminary Joint Embedding Representation Generation Module: The new embedding representation matrices are dimensionally aligned to generate the dimensionally aligned user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix And the common neighbor embedding representation matrix
[0150] will sequence The aligned multiple embedding representation matrices are concatenated separately to obtain Then, for the sequence Embedded representation after concatenation Perform the connection operation to obtain the sequence The joint embedding representation of
[0151] BISRU module (Bidirectional Interactive Sequence Representation Update Module): Based on the idea of bidirectional selective state space model, the sequence is jointly embedded into the representation Z t Each row vector of The input is respectively fed into two selective state space models in forward and reverse order, and the hidden states are propagated in the bidirectional state space respectively. By modeling the long-term bidirectional dependencies within and between sequences, the joint embedding expression of the sequences is captured. middle.
[0152] Embedding representation partitioning aggregation module: Divide into sequences The respective embedding representations are aggregated by row average to obtain the final embedding representation of users u and v
[0153] User-to-user interaction prediction module: Combines the embedding representation of user u and v The system performs interaction prediction and outputs the probability of user u and v interacting at time t.
[0154] Based on the same inventive concept, an embodiment of the present invention provides a computer program product, including a computer program / instruction, and the steps of the method are implemented when the computer program / instruction is executed by a processor.
[0155] To demonstrate the effect of the present invention, the present invention (Temporal Link Prediction based on Bidirectional Selective State Space Model, abbreviated as: TPL-BS3M) is compared with the existing methods on different temporal network datasets. Table 1 is an introduction to the datasets used, Table 2 is an introduction to the comparison algorithms, Table 3 shows the performance of the transductive link prediction of the present invention in three temporal network datasets, and Table 4 shows the performance of the inductive link prediction of the present invention in three temporal network datasets. Wikipedia is a social network dataset that contains more than 157,474 links of 9,227 nodes in 152,757 time periods (in seconds). The MOOC dataset contains 411,749 links of 7,144 nodes in 345,600 time periods (in seconds). The UCI dataset contains 59,835 links of 1,899 nodes in 58,911 time periods (in seconds). All algorithms use AP (Average Precision) percentage as the performance evaluation indicator.
[0156] Table 1: Dataset introduction
[0157]
[0158] Table 2: Introduction of compared algorithms
[0159]
[0160] Table 3: Comparison of the direct prediction performance (AP) of TPL-BS3M and other methods on three datasets
[0161]
[0162] Table 4: Comparison of inductive prediction performance (AP) of TPL-BS3M and other methods on three datasets
[0163]
[0164] It can be seen that the algorithm we proposed shows excellent prediction results for both inductive link prediction tasks and direct link prediction tasks, indicating that by combining multimodal encoding and bidirectional selective state space models, we can accurately capture the long-term temporal dependencies of sequences and thus make accurate link predictions.
Claims
1. A temporal social network interaction prediction method based on a bidirectional selective state space model, characterized in that: The steps include: (1) For a continuous-time social network, for any pair of users u and v in the network, we sample the user IDs that they interacted with before time t in the order of their interaction time to construct an interaction sequence of equal length. Extract their respective user embedding representation matrices from And the interaction edge embedding representation matrix (2) Based on the timestamp information of user u, v interacting with the users in their respective sequences, relative time encoding is used to encode the sequence Generate temporal embedding representation matrix (3) By counting the sequence of users u and v The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation matrix (4) Change the sequence The user embedding representation matrix, the interaction edge embedding representation matrix, the time embedding representation matrix and the common neighbor embedding representation matrix are segmented, reorganized and concatenated respectively; (5) Sequence The new embedding representation matrices are dimensionally aligned, and then the sequence The aligned embedding representation matrices are concatenated separately, and then the sequences are connected Align the concatenated embedding representation matrix to get the sequence The joint embedding representation matrix (6) Considering The long-term temporal dependencies within and between sequences are captured by the embedding expression of the sequence using a bidirectional selective state space model; Jointly embed the sequence into a representation matrix Two selective state space models are input in the forward and reverse order of time respectively to capture the long-term temporal dependencies in both directions of the sequence, thereby obtaining two new sequence joint embedding representation matrices Then combine the two to get the final joint embedding representation matrix of the sequence (7) Divide into sequences The respective embedding representations are aggregated by row average to obtain the final embedding representation of users u and v Then through the joint embedding representation for interactive prediction.
2. The method for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 1, characterized in that: In step (1), for any pair of users u and v in the social network, we first sample the user IDs that they interacted with before time t in the order of interaction time to construct an interaction sequence Specify sequence The number of sampled users If the number of users in the interaction record of user u or v does not meet the set sampling number requirement, the sequence or The missing user ID is filled with 0; then according to the obtained user sequence User ID index and recorded interaction time t ′ , is the sequence Generating User Embeddings Interaction edge embedding representation where d N is the dimension of user embedding representation, d E The dimension of the interaction edge embedding representation.
3. The method for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 1, characterized in that: In step (2), based on the timestamp information of user u, v interacting with each other in their respective sequences, relative time coding is used as the sequence Generating temporal embedding representations The temporal embedding representation generation method is denoted as: in d T Represents the temporal embedding representation matrix The dimension of Δt ′ =tt ′ , t ′ Indicates the interaction time, Represents a trainable weight parameter, and * represents user u or user v.
4. The method for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 1, characterized in that: In step (3), by counting the user u, v sequences The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation of The calculation method is: Where f represents the activation function RELU, represents the neighbor appearance count matrix, The extracted data are each user ID in two sequences. and Number of occurrences.
5. The method for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 1, characterized in that: In step (4), the sequence User embedding representation Interaction edge embedding representation Temporal Embedding Representation and common neighbor embedding representation The division, reorganization and splicing are performed respectively; the division method is: the number of divided blocks is P, and these P blocks are spliced in parallel to form a sequence The new multiple embedding representation matrix, the number of matrix rows is: After the above operations, we get the sequence New user embedding representation matrix Interaction edge embedding representation matrix Temporal Embedding Representation Matrix Common neighbor embedding representation matrix Where * represents user u or user v, d N , d E are the dimensions of the user embedding representation matrix and the interaction edge embedding representation matrix in step (1), respectively, T is the dimension of the time embedding representation matrix in step (2), d C is the dimension of the common neighbor embedding representation matrix in step (3).
6. The method for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 5, characterized in that: In step (5), the sequence The new multiple embedding representation matrices are dimensionally aligned respectively, and the dimension alignment method is as follows: in represents the learnable weight matrix, represents the bias vector, d represents the dimension after alignment, and # represents the matrix subscript E, T, C, N.
7. The method for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 6, characterized in that: In step (6), the sequence is jointly embedded into the representation matrix The row vector of Input into a selective state space model in positive order to capture the long-term causal dependencies between sequence elements; for each row vector of the input k=1…L, use HiPPO method to construct the initial state matrix n represents the dimension of the hidden layer in the state space model, and initializes the hidden state representation matrix Generating input vectors Output vector Next, The status is updated iteratively: in represents the hidden state at the last moment, express The updated state matrix is calculated as: for Updated input vector, used to represent the current input The direct impact on the internal state of the sequence is calculated as: I represents the identity matrix, represents the step vector, which is calculated as: Linear α (), Liner β (), Linear Δ () represents different linear mapping functions, τ Δ is the activation function Softplus; on this basis, a state representation containing long-term positive dependency information is generated By vertical stacking Get the forward learned sequence joint embedding representation On the other hand, construct the reverse sequence joint embedding representation matrix The row vectors are sequentially input into another selective state space model; for each row vector input k=L…1, and the initial state matrix is constructed using the HiPPO method. Initialize the hidden state representation matrix Generating input vectors Output vector Next, The state is updated in reverse iteration: express The updated state matrix is calculated as: for The updated input vector is calculated as: represents the step vector, which is calculated as: After obtaining the hidden state after propagation Then, add it to the output vector interact to generate state output representations that contain deep temporal dependencies Recorded as By vertical stacking Get the reverse learned sequence joint embedding representation Then the sequence is jointly embedded into Flip it upside down and record it as: Finally, the fusion sequence is jointly embedded To capture the bidirectional temporal dependencies of the sequence and generate a joint embedding representation of the sequence 8. The method and system for predicting temporal social network interactions based on a bidirectional selective state space model according to claim 1, characterized in that: In step (7), Divide into sequences Their respective embedding representations The division method is recorded as: in Representation is a joint embedding representation of sequence Before row vector, Representation is a joint embedding representation of sequence No. The vector after the row; on this basis, the sequence The embedding representation of Aggregate by row average to get the final embedding representation of user u and v The calculation is as follows: in represents the weight matrix, represents the bias term, MEAN represents the average aggregation function, and d out Representation sequence The dimensionality of the final embedding representation.
9. A temporal social network interaction prediction system based on a bidirectional selective state space model, characterized in that: include: The user pair interaction sequence extraction module is used to process and extract the interaction sequences of user pairs of equal length within a certain period of time. For continuous-time social networks, for any pair of users u and v in the network, the user IDs that have interacted with each other before time t are sampled in the order of interaction time to construct an interaction sequence of equal length. Extract their respective user embedding representation matrices from And the interaction edge embedding representation matrix The sequence time embedding representation construction module is used to encode the sequence using relative time according to the timestamp information of user u, v interacting with each other in the sequence Generate temporal embedding representation matrix Sequence common neighbor embedding representation construction module is used to count the sequences of users u and v The number of times the same user ID appears in the code is encoded to generate a sequence The common neighbor embedding representation matrix Segmentation, reassembly and splicing sequence embedding representation module is used to transform sequence The user embedding representation matrix, the interaction edge embedding representation matrix, the time embedding representation matrix and the common neighbor embedding representation matrix are segmented, reorganized and concatenated respectively; A preliminary joint embedding representation generation module is used to generate The new embedding representation matrices are dimensionally aligned, and then the sequence The aligned multiple embedding representation matrices are concatenated and connected to obtain the sequence The joint embedding representation of BISRU module is used to take into account The long-term temporal dependencies within and between sequences are captured by the embedding expression of the sequence using a bidirectional selective state space model; Jointly embed the sequence into a representation matrix Two selective state space models are input in the forward and reverse order of time respectively to capture the long-term temporal dependencies in both directions of the sequence, thereby obtaining two new sequence joint embedding representation matrices Then combine the two to get the final joint embedding representation matrix of the sequence The embedding representation partitioning aggregation module is used to Divide into sequences The respective embedding representations are aggregated by row average to obtain the final embedding representation of users u and v And the user-to-user interaction prediction module is used to combine the embedding representation of users u and v Perform interaction prediction and output the probability of user u and v interacting at time t.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
