Method and device for predicting user behavior

By introducing neighborhood selection strategies and silent attenuation mechanisms in user behavior prediction, and using time sequence to aggregate information, the problem of poor prediction performance in the prior art is solved, and higher prediction accuracy and timeliness are achieved.

CN119760342APending Publication Date: 2025-04-04ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When predicting user behavior, it is difficult for the prior art to effectively capture dynamic characteristics and local dynamic patterns in the timing chart, resulting in poor prediction performance.

Method used

By introducing neighborhood selection strategies and silent decay mechanisms, information is preserved and utilized. The specific method includes obtaining the behavior sequence formed by the target user's recent interaction behavior, forming a feature sequence, and determining the attenuation state vector based on the silent duration, inputting it into the LSTM neural network for sequence processing, and generating user representations for prediction.

Benefits of technology

It significantly improves the accuracy of user behavior prediction, captures the timing aggregation information in the user interaction rhythm, and enhances the timeliness and accuracy of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760342A_ABST
    Figure CN119760342A_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a method and device for predicting user behavior. The method includes: obtaining a first behavior sequence formed by the target user's most recent m interactive behaviors before a target moment, and forming a first feature sequence based on the first behavior sequence; determining a first decay state vector based on the target user's silence duration, wherein the silence duration is the duration from the last interactive event of the user before the target moment to the target moment; using the first decay state vector as the unit state vector of the LSTM unit, and using the second feature sequence determined based on the first feature sequence as the sequence to be processed, and inputting them together into a long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence; determining the user representation of the target user at the target moment based on the first output feature sequence; and predicting the target user's interactive behavior at the target moment based on the user representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of machine learning, and more particularly, to a method and apparatus for predicting user behavior using machine learning. Background Art

[0002] In many real-world scenarios, user behavior changes dynamically over time, which can be modeled as a temporal graph. In order to effectively capture the dynamic characteristics of temporal graphs, Temporal Graph Networks (TGNs) were developed. TGNs can deeply explore the temporal and topological information in temporal graphs, thereby promoting representation learning.

[0003] TGNs can be used for various downstream prediction tasks. For example, link prediction tasks are used to predict whether future links exist between pairs of potential interactive nodes. This has wide applications in many real-world systems, such as predicting users’ future purchase behavior in recommendation systems to improve user experience, or predicting potential transactions between two parties on payment platforms to prevent money laundering.

[0004] However, there is still a need for a user behavior prediction scheme that can improve the prediction performance. Summary of the invention

[0005] This specification uses one or more embodiments to describe a solution for predicting user behavior, which significantly improves the accuracy of user behavior prediction by introducing a neighborhood selection strategy and a silent attenuation mechanism, retaining and utilizing time series aggregation information.

[0006] According to a first aspect, a method for predicting user behavior is provided, including: obtaining a first behavior sequence formed by the most recent m interactive behaviors of a target user before a target moment, and forming a first feature sequence according to the first behavior sequence; determining a first decay state vector according to the silence duration of the target user, wherein the silence duration is the duration from the last interactive event of the user before the target moment to the target moment; using the first decay state vector as a unit state vector of an LSTM unit, and using a second feature sequence determined according to the first feature sequence as a sequence to be processed, both of which are input into a long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence; determining a user representation of the target user at the target moment according to the first output feature sequence; and predicting the interactive behavior of the target user at the target moment according to the user representation.

[0007] According to one embodiment, the method is performed based on a timing graph, which includes at least a user node and a connection edge with a timestamp representing the interaction behavior; obtaining a first behavior sequence formed by the target user's most recent m interaction behaviors before a target moment, specifically including: from the connection edges of the target node representing the target user in the timing graph, selecting m connection edges whose timestamps are before the target moment and closest to the target moment, and forming a connection edge sequence in the order of the timestamps, which represents the first behavior sequence.

[0008] Furthermore, forming a first feature sequence according to the first behavior sequence specifically includes: forming at least one subsequence and concatenating the subsequences to obtain the first feature sequence; forming at least one subsequence includes: forming an edge feature sequence as a subsequence according to the edge features of the m connecting edges; and / or forming a neighbor feature sequence as a subsequence according to the node features of the neighbor nodes corresponding to each connecting edge; encoding the difference between the timestamp of each connecting edge and the target time to obtain a time coding sequence as a subsequence.

[0009] In one embodiment, the method further includes: performing a first processing on the first feature sequence through a first neural network to obtain a third feature sequence; and performing a second processing on the third feature sequence through a second neural network to obtain the second feature sequence.

[0010] In a further embodiment, the first neural network includes a first normalized layer and a feedforward neural network, and the first processing specifically includes: processing the first feature sequence in turn through the first normalized layer and the feedforward neural network to obtain a first intermediate sequence; and using the superposition result of the first feature sequence and the first intermediate sequence as the third feature sequence.

[0011] In a further embodiment, the second neural network includes a second normalization layer, and the second processing specifically includes: processing the third feature sequence through the second normalization layer to obtain the second feature sequence.

[0012] In a further embodiment, the user representation of the target user at the target time is determined based on the first output feature sequence, including: taking the superposition result of the first output feature sequence and the third feature sequence as the result feature sequence; and mapping and transforming each result feature vector in the result feature sequence and averaging them to obtain the user representation.

[0013] According to one embodiment, determining a first attenuation state vector according to the silence duration of the target user specifically includes: processing an original state vector through a second neural network to obtain a first state vector; substituting the silence duration into a preset attenuation function to obtain an attenuation coefficient; based on the original state vector, subtracting the product of the first state vector and the attenuation coefficient to obtain the first attenuation state vector.

[0014] Furthermore, the original state vector is a preset value; or; the original state vector is a state vector output by the LSTM neural network in the process of determining the user representation of the target user at the previous moment.

[0015] According to one embodiment, the method further includes: obtaining an object representation of the target object at the target moment; predicting the interaction behavior of the target user at the target moment based on the user representation, including: combining the user representation and the object representation, and determining whether the target user will perform the interaction behavior with the target object at the target moment based on the combined representation.

[0016] Furthermore, obtaining the object representation of the target object at the target moment specifically includes: obtaining a second behavior sequence formed by the most recent m interactive behaviors of the target object before the target moment, and forming a fourth feature sequence according to the second behavior sequence; determining a second decay state vector according to the silence duration of the target object; using the second decay state vector as the unit state vector of the LSTM unit, and using the fifth feature sequence determined according to the fourth feature sequence as a sequence to be processed, and inputting them into a long short-term memory LSTM neural network for sequence processing to obtain a second output feature sequence; determining the object representation of the target object at the target moment according to the second output feature sequence.

[0017] Furthermore, the target object is one of the following: a commodity, a content object, or another user different from the target user.

[0018] According to a second aspect, a device for predicting user behavior is provided, comprising: an acquisition unit, configured to acquire a first behavior sequence formed by the most recent m interactive behaviors of a target user before a target moment, and to form a first feature sequence based on the first behavior sequence; a first determination unit, configured to determine a first decay state vector based on the silence duration of the target user, wherein the silence duration is the duration from the last interactive event of the user before the target moment to the target moment; a first processing unit, configured to use the first decay state vector as a unit state vector of an LSTM unit, and a second feature sequence determined based on the first feature sequence as a sequence to be processed, and to input both of them into a long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence; a second determination unit, configured to determine a user representation of the target user at the target moment based on the first output feature sequence; and a prediction unit, configured to predict the interactive behavior of the target user at the target moment based on the user representation.

[0019] According to a third aspect, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0020] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.

[0021] According to a fifth aspect, a computing device is provided, comprising a memory and a processor, wherein an executable code is stored in the memory, and when the processor executes the executable code, the method of the first aspect is implemented.

[0022] In the embodiments of the present specification, by focusing on sampling from the user's most recent historical interaction behavior and using the first decay state vector determined according to the target user's silence duration as the unit state vector of the LSTM unit, the LSTM neural network can pay more attention to recent activity patterns, while effectively utilizing the temporal aggregation information in the user's interaction rhythm, thereby improving the prediction performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0024] Figure 1 The macroscopic distribution of the silence duration of the nodes across the entire timeline is shown.

[0025] Figure 2 The microscopic distribution of the node's silence duration over time steps is shown.

[0026] Figure 3 A schematic diagram of the technical concept of predicting user behavior is shown.

[0027] Figure 4 A flow chart showing a method for predicting user behavior according to one embodiment.

[0028] Figure 5 A schematic diagram showing the structure of an apparatus for predicting user behavior according to an embodiment. DETAILED DESCRIPTION

[0029] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0030] In the description of this specification, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary", "for example" or "for example" in this specification should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0031] In the description of this specification, the term "and / or" is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more.

[0032] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying a relative order, relative importance, or implicitly indicating the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0033] As mentioned above, the user's interactive behavior that changes dynamically over time can be modeled as a time series graph for analysis. Through the study and analysis of the time series graph, the inventors noticed that in the time series graph containing user nodes, there is a significant temporal clustering phenomenon in the node interaction rhythm. The temporal clustering phenomenon refers to analyzing the interaction pattern of a node in the time series graph in the time dimension and identifying their interaction phenomena in different periods. The temporal clustering phenomenon can reveal the node behavior patterns that change over time in dynamic networks, thereby providing insights into the prediction of neighboring edges in the time series graph.

[0034] For example, users shop more frequently during holidays or promotions, but less frequently during other periods. That is, there is a temporal clustering phenomenon in the shopping rhythm pattern of users.

[0035] In order to intuitively illustrate the phenomenon of temporal clustering in node interaction rhythm, this manual conducts a lot of data analysis work from both macro and micro levels to study various data sets in the real world. Specifically, this manual uses a visualization method to compare the interaction rhythm patterns of two types of nodes: nodes with real interactive behaviors and randomly selected nodes, to analyze the differences between these two types of nodes and their potential impact.

[0036] Figure 1 The macroscopic distribution of the silence duration of the nodes across the entire timeline is shown.

[0037] Figure 2 The microscopic distribution of the node's silence duration over time steps is shown.

[0038] Figure 1 , Figure 2 The four views in the figure correspond to data sets from four different sources. Figure 1 , Figure 2 A in the equation refers to the user node that actually interacts with the user. Figure 1 , Figure 2 The B in the above equation refers to the randomly selected user node. Only a small number of randomly selected nodes actually have interactive behaviors, and the randomly selected nodes can also be regarded as nodes without interactive behaviors. Figure 1 , Figure 2 The vertical axes of the four views in FIG. 1 represent the silence duration. Figure 1 The horizontal axis in reflects the node statistics corresponding to the silence duration. Figure 2 The horizontal axis in reflects the time step at the micro level. Among them, the silence duration of a node refers to the difference between the time when the node's last historical interaction behavior occurred and the current time.

[0039] Figure 1Violin Plots are used to visualize the distribution of the silence duration of all nodes. Figure 1 As shown, the distribution of silence duration of nodes with real interactive behaviors is obviously different from that of randomly selected nodes. Specifically, most nodes with real interactive behaviors have shorter silence durations, while most randomly selected nodes have longer silence durations.

[0040] Figure 2 The distribution of silence duration of nodes with real interactive behavior and randomly selected nodes at each time step is shown. Figure 2 As shown, in most time steps, nodes with real interactive behaviors always show short-term interaction bursts (i.e., shorter silence periods), while randomly selected nodes show long-term inactivity (i.e., longer silence periods).

[0041] The results of both macro-level and micro-level analysis show that nodes with real interactive behaviors tend to show short-term interactive bursts (i.e., shorter silence durations), resulting in temporal clustering in the interaction rhythms of these nodes. This sharp contrast between nodes with real interactive behaviors and nodes with fake interactive behaviors prompts this specification to make full use of the temporal clustering information in the node interaction rhythm to improve the prediction performance of downstream prediction tasks.

[0042] Based on the unique "time series aggregation" feature described above in the time series diagram, the embodiment of this specification proposes a novel user behavior prediction scheme, which retains and utilizes the time series aggregation information of user interactions by introducing a neighborhood selection strategy and a silent attenuation mechanism, thereby significantly improving the accuracy of user behavior prediction.

[0043] The neighborhood selection strategy focuses on sampling from the user's recent historical interaction behaviors. This design ensures that the user's current interaction rhythm pattern is preserved, providing a valuable basis for predicting future user behavior. By focusing on recent interactions, the strategy can capture immediate dynamic changes, thereby enhancing the timeliness and accuracy of the prediction model.

[0044] The silent decay mechanism explicitly penalizes users for long periods of inactivity and is implemented in a decaying manner, which means that over time, the influence of a user's past activity on current predictions gradually decreases. In this way, the model can pay more attention to recent activity patterns while effectively utilizing the temporal aggregation information in the user's interaction rhythm to improve prediction performance.

[0045] In contrast, existing TGNs are designed to capture dynamic and topological information in temporal graphs. In order to effectively capture basic temporal dependencies, most TGNs (such as temporal graph convolution models, temporal random walk models, and sequence models) focus on global topology and temporal information, but lack effective capture and modeling of local dynamic structures (such as changes in dynamic aggregation), which may lead to the neglect of important local interaction patterns.

[0046] Different from the existing TGNs, this specification aims to propose a user behavior prediction method that can fully consider the characteristics of time series aggregation, and improve the prediction performance by more effectively capturing local dynamic patterns in time series graphs, which has important practical significance and broad application prospects for application scenarios such as recommendation systems and financial risk detection.

[0047] In this specification, user behavior prediction tasks include node prediction tasks and edge prediction tasks. Node prediction tasks refer to predicting the target user's interactive behavior at the target time based on the learned user representation of the target user. For example, predicting the probability of the target user performing a specific behavior at the target time, predicting the type of user behavior performed by the target user at the target time, and so on. Edge prediction tasks refer to predicting the probability of the target user interacting with the target object at the target time based on the learned user representation of the target user and the object representation of the target object, that is, predicting the possibility of a connecting edge between the target user node in the time series graph and the target object node at the target time.

[0048] Figure 3 A schematic diagram showing a specific implementation of the technical concept of predicting user behavior.

[0049] See also Figure 3 For the target user u, first select the target user u’s recent multiple (e.g., m) interaction behaviors before the target time t to obtain the behavior sequence S u ; Then, for the behavior sequence S u For each sequence element (i.e., each interaction behavior) in , construct neighbor node features, edge features, and time coding features; if S u The number of sequence elements in S is less than m, then S is filled u The number of sequence elements in is expanded to m, and the neighbor node features, edge features, and time coding features of the filled sequence elements can be vectors with all elements zero; then, these features are mapped to a unified dimension, and the three features corresponding to the same sequence element and with a unified dimension are concatenated into a feature vector to obtain the feature sequence Z u .

[0050] Get the feature sequence Z u Then, the feature sequence Z uIt is processed in turn by the Token Mixer and the Temporal Mixer in the Mixer Encoder.

[0051] Word mixing means that Z u After being processed by a layer normalization and a feed-forward neural network, an intermediate sequence is obtained and Z u Add the result of element-by-element addition of the intermediate sequence to obtain a new feature sequence Z u,token .

[0052] Temporal mixing refers to the use of silence attenuation mechanism based on the silence duration s of user u. u The original cell state vector C of the LSTM cell u Perform attenuation processing and convert the state vector C obtained after attenuation u,decay With Z u,token The results after the normalization layer are used as the input of the LSTM unit. Finally, Z u,token Add the feature sequence output by LSTM element by element as output Z u,temporal .

[0053] Getting Z u,temporal After that, the decoder can be used to process Z u,temporal The prediction result of the target user's interactive behavior at the target time is obtained. The decoder can be based on Z u,temporal Generate a user representation of the target user, and predict the target user's interaction behavior at the target time based on the user representation.

[0054] Therefore, the embodiments of this specification design a more effective user behavior prediction scheme based on the time series aggregation characteristics in the time series graph. This scheme innovatively retains and utilizes the time series aggregation information of node interactions through the neighborhood selection strategy of recent historical link sampling and the time mixer module with silent decay mechanism, significantly improving the accuracy of future link prediction in the time series graph. Experimental data show that this scheme achieves better performance on multiple real data sets, and has faster convergence speed, stronger generalization ability and higher efficiency.

[0055] The specific implementation process of the above technical concept is described below.

[0056] Figure 4A flowchart of a method for predicting user behavior according to an embodiment is shown. It should be understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. In addition, the model architecture corresponding to the technical concept of the method will be used in both the training stage and the use stage. Figure 4 The forward inference process shown makes predictions.

[0057] like Figure 4 As shown, in step S41, a first behavior sequence formed by the target user's most recent m interactive behaviors before the target moment is obtained, and a first feature sequence is formed according to the first behavior sequence.

[0058] m can be a pre-set value. For example, m can be a pre-set hyperparameter. Interaction behavior refers to the behavior of a target user interacting with an object in a specific type (such as purchase, collection, add-to-cart, transfer, etc.). The object can refer to but is not limited to a product, a content object, or another user different from the target user.

[0059] In some embodiments, Figure 4 The method shown can be performed based on a timing diagram.

[0060] A timing graph is a graph model that can capture changes in graph structure in the time dimension. The nodes in the timing graph represent objects, and the edges with timestamps represent the interactions between objects at a specific time. Timing graphs are suitable for reflecting dynamically changing relationships and events in the real world. The timing graph can change dynamically over time. For example, the nodes in the timing graph and the edges between nodes can be dynamically updated over time. The timing graph in the embodiments of this specification includes at least user nodes (such as multiple user nodes representing multiple users including the target user), and connecting edges with timestamps representing interactive behaviors. Exemplarily, in addition to user nodes, the nodes in the timing graph may also include one or more non-user nodes. The objects represented by the non-user nodes may be, but are not limited to, commodities and content objects.

[0061] From the connection edges of the target node representing the target user u in the time sequence graph, m connection edges with timestamps before the target time T and closest to the target time T can be selected to form a connection edge sequence in the order of timestamps, which represents the first behavior sequence. The first behavior sequence can be recorded as S u .

[0062] At least one subsequence describing the features can be formed for the first behavior sequence, and the subsequences can be concatenated to obtain the first feature sequence. Different subsequences can be regarded as feature sequences composed of high-dimensional feature vectors obtained by converting the attribute features of different dimensions of each sequence element in the first behavior sequence.

[0063] Exemplarily, the subsequence may include, but is not limited to, one or more of an edge feature sequence, a neighbor feature sequence, and a time encoding sequence. The edge feature sequence refers to a feature sequence formed according to the edge features of m connecting edges. The neighbor feature sequence refers to a feature sequence formed according to the node features of the neighbor nodes corresponding to each connecting edge. The time encoding sequence refers to a feature sequence obtained by encoding the difference between the timestamp of each connecting edge and the target time T.

[0064] As described above, m may be a preset fixed value. If the number of interaction behaviors of the target user before the target time T is less than or equal to m, that is, the number of sequence elements in S u is less than or equal to m, then the number of sequence elements (i.e., feature vectors) in the subsequence will be less than or equal to m. At this time, the subsequence can be padded to make the number of sequence elements in the subsequence m. The padded sequence elements can be located at the head or tail of the subsequence, and the padded sequence elements (such as edge features, neighbor features, and time encodings) can all be all-zero vectors in which all element values in the vector are zero.

[0065] The unpadded neighbor feature sequence can be denoted as The edge feature sequence can be denoted as The time encoding sequence can be denoted as where, |S u | represents the number of sequence elements in the first row of the sequence S u , d N represents the vector dimension representing the node feature, d L represents the vector dimension representing the edge feature, d T represents the vector dimension representing the time encoding feature. If |S u | < m, then the neighbor feature sequence, edge feature sequence, and time encoding sequence after the padding operation can be denoted as Finally, these subsequences can be encoded into a feature sequence with a unified dimension using projection layers. Among them, the padding operation is mainly used to unify the dimension and also facilitate the statistical neighbor frequency.

[0066] Exemplarily, the following formula (1) can be used to encode different subsequences into a feature sequence with a unified dimension,

[0067] Z u,* = P u,* W * + b * ∈ R m×d , (1)

[0068] where, W * ∈ Rd * ×d , b * ∈R d , W * and b * They are all trainable parameters in the mapping layer, and * represents N, L or T.

[0069] After unifying the dimensions of the neighbor feature sequence, edge feature sequence, and time coding sequence, they can be concatenated to obtain the first feature sequence. The first feature sequence can be denoted as Z u . Z u =Z u,N ‖Z u,L ‖Z u,T ∈R m×3d Among them, Z u,N , Z u,L , Z u,T They represent the neighbor feature sequence, edge feature sequence and time coding sequence after dimensionality unification, and the symbol “‖” represents the concatenation operation. In this way, the first feature sequence can be understood as a sequence of feature vectors with a length of m, each of which corresponds to a comprehensive representation vector of an interaction behavior.

[0070] In step S42, a first attenuation state vector is determined according to the silence duration of the target user.

[0071] The silence duration is the duration from the last interaction event before the target time T to the target time T. In other words, the silence duration is the duration from the timestamp corresponding to the last interaction behavior of the target user before the target time to the target time.

[0072] In step S43, the first decay state vector is used as the unit state vector of the LSTM unit, and the second feature sequence determined according to the first feature sequence is used as the sequence to be processed, and both are input into the long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence.

[0073] The long short-term memory LSTM neural network consists of several LSTM units, each of which processes the m feature vectors of the input sequence in m time steps. Specifically, at each time step t, the LSTM unit processes the m feature vectors of the input sequence according to the latent vector h of the previous time step t-1. t-1 , the cell state vector C at the previous time step t-1 t-1 , the feature vector z input at the current time step t t , calculate the hidden vector h of the current time step t t , the cell state vector C at the current time step t t , where the latent vector h of the current time step is tIt can be used as the output vector corresponding to time step t. Generally, the LSTM unit can have an initial unit state vector through training or setting, and the unit state vector will be continuously updated and transferred during the sequence processing. The update and transfer of the unit state vector depends on the sequence processing mechanism of the long short-term memory LSTM neural network itself.

[0074] The embodiments of this specification do not involve changes to the sequence processing mechanism of the LSTM neural network, nor do they seek to modify the update logic of the unit state vector during the sequence processing. Instead, the silent decay mechanism is used to determine the initial unit state vector to be provided to the LSTM neural network. In other words, the first decay state vector C is determined according to the silence duration. u,decay , used as the cell state vector (cell state) of the LSTM neural network for sequence element processing at the first time step. Since the first decay state vector C u,decay It is determined according to the silence duration of the target user, which enables the LSTM neural network to capture the temporal aggregation in the sequence to be processed.

[0075] In some embodiments, the first decay state vector C u,decay It can be the original state vector C of the long short-term memory LSTM neural network using the silence duration u The original state vector C is obtained by attenuation. u It refers to the initial unit state vector set for user u when using the long short-term memory LSTM neural network to process sequence data. That is, the embodiment of this specification can set the initial unit state vector C of the LSTM neural network for user u based on the silence duration. u Attenuation is performed, and the attenuated unit state vector is provided to the LSTM neural network as the new initial unit state vector. The original state vector C u It can be a preset value. Or, the original state vector C u Alternatively, it may be the state vector last updated or output by the LSTM neural network during the process of determining the user representation of the target user u at the last moment (such as the target moment corresponding to the last execution of the user behavior prediction task).

[0076] Exemplarily, the original state vector C can be processed by a third neural network u , get the first state vector; substitute the silence duration into the preset attenuation function to get the attenuation coefficient; based on the original state vector C u , minus the product of the first state vector and the attenuation coefficient, to obtain the first attenuation state vector C u,decay Among them, the attenuation coefficient is positively correlated with the silence duration.

[0077] Exemplarily, the first decay state vector C is determined based on the original state vector and the silence duration. u,decay The process can be expressed as formula (2) and formula (3):

[0078] C u,temp =Tanh(C u W decay +b decay )∈R 1×3d (2)

[0079] C u,decay =C u -g(s u )C u,temp (3)

[0080] In formula (2), W decay and b decay All of them can be trainable parameters, and Tanh is the activation function. Through these parameters, the original state vector C u Processing is performed to obtain the first intermediate vector C u,temp In formula (3), s u is the silence duration of user u, and g(.) is a preset attenuation function. In a specific example, the attenuation function may be in the form of: g(s u )=1-Exp{-2·s u / T max}, T max is the preset maximum silence duration. Therefore, substituting the silence duration into the attenuation function to obtain g(s u ) is the attenuation coefficient, g(s u )∈(0,1). In other examples, other forms of attenuation functions may also be used, but it should be ensured that the obtained attenuation coefficient is positively correlated with the silence duration. The first state vector C is processed based on the attenuation coefficient. u,temp , and then with the original state vector C u Superposition, get the first decay state vector C u,decay .

[0081] On the other hand, the second feature sequence F input into the LSTM neural network u According to the first characteristic sequence Z u In one embodiment, the second feature sequence can be the first feature sequence itself, that is, the Figure 3 The word unit mixing and other operations in the first feature sequence Z u Enter the LSTM neural network.

[0082] In another embodiment, the second feature sequence F u It can be achieved by using a neural network to analyze the first feature sequence Z uThe feature sequence obtained after processing, for example, using Figure 3 The word unit mixer and normalization layer are used to calculate the first feature sequence Z u Processed.

[0083] In some embodiments, the neural network that processes the first feature sequence to obtain the second feature sequence may include a first neural network and a second neural network. Thus, the method further includes: performing a first process on the first feature sequence by the first neural network to obtain a third feature sequence; performing a second process on the third feature sequence by the second neural network to obtain a second feature sequence.

[0084] Exemplarily, the first neural network includes a first normalization layer and a feedforward neural network, such as Figure 3 As shown in the word unit mixer in FIG. Accordingly, the first processing includes: converting the first feature sequence Z u After being processed by the first normalization layer and the feedforward neural network in turn, the first intermediate sequence is obtained; the superposition result of the first feature sequence and the first intermediate sequence is used as the third feature sequence Z u,token The superposition of the first characteristic sequence and the first intermediate sequence may refer to adding the corresponding sequence elements in the first characteristic sequence and the first intermediate sequence one by one.

[0085] Exemplarily, the calculation formula of the third feature sequence can be expressed as formula (4):

[0086]

[0087] Among them, Z u,token represents the third characteristic sequence, Z u represents the first feature sequence, is a weight matrix, for example, it can represent the weight matrix of two fully connected layers, GeLU is a nonlinear activation function, LayerNorm is a normalized layer (i.e., the first normalized layer), Equivalent to the first intermediate sequence mentioned above, the symbol “+” represents adding the corresponding sequence elements in the two characteristic sequences one by one.

[0088] Exemplarily, the second neural network includes a second normalization layer, such as Figure 3 The second processing includes: processing the third feature sequence through a second normalization layer to obtain a second feature sequence. In this example, the second feature sequence can be recorded as F u =LayerNorm(Z u,token ).

[0089] In other embodiments, the first feature sequence Z may also be processed by other neural network processing methods. u Perform preliminary processing to obtain the second feature sequence Fu .

[0090] After the first decay state vector and the second feature sequence are determined through the above process, the second feature sequence can be used as the sequence to be processed, and the first decay state vector can be used as the unit state vector of the LSTM unit, and they can be input into the long short-term memory LSTM neural network for sequence processing. LSTM processes each time step according to the input feature sequence and the input state vector to obtain the first output feature sequence.

[0091] Next, in step S44, the user representation of the target user at the target time is determined according to the first output feature sequence.

[0092] There are many ways to determine the user representation based on the first output feature sequence. For example, the feature vectors in the first output feature sequence can be directly averaged to obtain the user representation. For another example, the feature vectors in the first output feature sequence can be averaged after being mapped and transformed to obtain the user representation.

[0093] In some embodiments, the first output feature sequence can be combined with the aforementioned third feature sequence Z u,token The superposition result is taken as the result feature sequence. Then, each result feature vector in the result feature sequence is mapped and transformed and averaged to obtain the user representation.

[0094] For example, the resulting feature sequence Z u,temporal The calculation formula can be expressed as formula (5):

[0095] Z u,temporal =Z u,token +LSTM(C u,decay ,LayerNorm(Z u,token )) (5)

[0096] Among them, LSTM (C u,decay ,LayerNorm(Z u,token )) represents the output of the LSTM neural network, that is, the first output feature sequence.

[0097] For example, the user representation h u The calculation formula can be expressed as formula (6):

[0098] h u =Mean(Z u,temporal ·W out +b out ) (6)

[0099] in, W out With b out are all trainable parameters, dO represents the output dimension, b out To be applied to the output sequence (Z u,temporal ·W out ), and Mean represents the average. In this way, the user representation of the target user u at the target time T is determined.

[0100] In step S45, the interaction behavior of the target user at the target time is predicted based on the above user representation.

[0101] In some embodiments, user behavior prediction may refer to node prediction, and the user representation may be input into a prediction module, and the output of the prediction module is the prediction result of the target user's interactive behavior at the target time. The prediction result may represent the probability of the target user performing one or more interactive behaviors at the target time. The prediction module may be, but is not limited to, a multilayer perceptron (MLP).

[0102] In some other embodiments, user behavior prediction may refer to edge prediction, that is, predicting whether the target user will interact with the target object at the target time. Figure 2 The method of determining the user representation of the target user at the target time described above obtains the object representation of the target object at the target time, then combines the user representation and the object representation, and finally determines whether the target user will interact with the target object at the target time based on the combined representation. Exemplarily, the user representation and the object representation can be spliced ​​into a combined representation. Based on the combined representation, a multilayer perceptron can be used to predict the probability that the user will interact with the target object at the target time.

[0103] The following is an exemplary description of the process of obtaining the object representation of the target object at the target time. It should be noted that the details involved can be found in the above combined Figure 2 A description of how to obtain a user representation of a target user.

[0104] Get the second behavior sequence S formed by the target object v's most recent m interactive behaviors before the target time v , according to the second line sequence S v Forming the fourth characteristic sequence Z v ; According to the target object's silence duration s v Determine the second decay state vector C v,decay ; The second decay state vector is used as the unit state vector of the LSTM unit, and the fourth feature sequence Z v The fifth characteristic sequence F is determined vAs the sequence to be processed, they are jointly input into the long short-term memory LSTM neural network for sequence processing to obtain a second output feature sequence; according to the second output feature sequence, the object representation h of the target object v at the target time is determined v .

[0105] Therefore, we can use the representation h of the target user u and the target object v at the target time T u and h v , predict whether the two will interact at the target time, and get the prediction result P u,v In one example, the prediction process can be expressed as:

[0106] P u,v =MLP(h u ||h v ) (7)

[0107] In this way, the interaction behavior between the target user and the specific target object at the target moment can be predicted in a targeted manner.

[0108] According to an embodiment of another aspect, an apparatus for predicting user behavior is provided. Figure 5 A schematic diagram of the structure of an apparatus for predicting user behavior according to an embodiment is shown. The apparatus can be deployed in any device, platform or device cluster with data storage, computing and processing capabilities.

[0109] like Figure 5 As shown, the device 500 for predicting user behavior includes:

[0110] An acquisition unit 51 is configured to acquire a first behavior sequence formed by the target user's most recent m interactive behaviors before a target time, and form a first feature sequence according to the first behavior sequence;

[0111] A first determining unit 52 is configured to determine a first decay state vector according to a silence duration of a target user, wherein the silence duration is a duration from the last interaction event before a target moment to the target moment;

[0112] The first processing unit 53 is configured to use the first decay state vector as the unit state vector of the LSTM unit, use the second feature sequence determined according to the first feature sequence as the sequence to be processed, and input them into the long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence;

[0113] A second determining unit 54 is configured to determine a user representation of a target user at a target time according to the first output feature sequence;

[0114] The prediction unit 55 is configured to predict the interaction behavior of the target user at the target time according to the user representation.

[0115] In some embodiments, the device 500 for predicting user behavior is performed based on a time sequence diagram. The acquisition unit 51 is specifically configured to: select m connection edges whose timestamps are before the target time and closest to the target time from the connection edges of the target node representing the target user in the time sequence diagram, and form a connection edge sequence in the order of the timestamps, which represents the first behavior sequence.

[0116] In some embodiments, the first determination unit 52 is specifically configured to: form at least one subsequence and concatenate the subsequences to obtain a first feature sequence. Forming at least one subsequence specifically includes: forming an edge feature sequence as a subsequence based on the edge features of the m connecting edges; and / or; forming a neighbor feature sequence as a subsequence based on the node features of the neighbor nodes corresponding to each connecting edge; encoding the difference between the timestamp of each connecting edge and the target time to obtain a time code sequence as a subsequence.

[0117] In some embodiments, the apparatus 500 for predicting user behavior may further include a second processing unit and a third processing unit.

[0118] The second processing unit is configured to perform a first processing on the first feature sequence through a first neural network to obtain a third feature sequence.

[0119] The third processing unit is configured to perform a second processing on the third feature sequence through a second neural network to obtain a second feature sequence.

[0120] In a further embodiment, the first neural network includes a first normalized layer and a feedforward neural network, and the second processing unit is specifically configured to: process the first feature sequence in turn through the first normalized layer and the feedforward neural network to obtain a first intermediate sequence; and use the superposition result of the first feature sequence and the first intermediate sequence as the third feature sequence.

[0121] In a further embodiment, the second neural network includes a second normalization layer, and the third processing unit is specifically configured to: process the third feature sequence through the second normalization layer to obtain a second feature sequence

[0122] In some embodiments, the second determination unit 54 is specifically configured to: use the superposition result of the first output feature sequence and the third feature sequence as a result feature sequence; perform mapping transformation on each result feature vector in the result feature sequence and then average them to obtain the user representation.

[0123] In some embodiments, the first determination unit 52 is specifically configured as follows: processing the original state vector through a third neural network to obtain a first state vector; substituting the silence duration into a preset attenuation function to obtain an attenuation coefficient; based on the original state vector, subtracting the product of the first state vector and the attenuation coefficient to obtain a first attenuated state vector.

[0124] In some embodiments, the device 500 for predicting user behavior further obtains the object representation of the target object at the target time. The prediction unit 55 is specifically configured to combine the user representation and the object representation, and determine whether the target user will interact with the target object at the target time according to the combined representation.

[0125] In a further embodiment, the acquisition unit 51 is further configured to acquire a second behavior sequence formed by the target object's most recent m interactive behaviors before the target time, and form a fourth feature sequence according to the second behavior sequence;

[0126] The first determining unit 52 is further configured to determine a second attenuation state vector according to the silence duration of the target object;

[0127] The first processing unit 53 is further configured to use the second decay state vector as the unit state vector of the LSTM unit, use the fifth feature sequence determined according to the fourth feature sequence as the sequence to be processed, and input them into the long short-term memory LSTM neural network for sequence processing to obtain a second output feature sequence;

[0128] The second determining unit 54 is further configured to determine the object representation of the target object at the target time according to the second output feature sequence.

[0129] For specific implementation examples of each unit in the above device, please refer to the previous Figure 4 Description.

[0130] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 4 The method described.

[0131] According to another embodiment, a computer program product is also provided, including a computer program / instruction, which is executed by a processor to implement the aforementioned combination Figure 4 The method steps described.

[0132] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 4 The method described.

[0133] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0134] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for predicting user behavior, comprising: Acquire a first behavior sequence formed by the target user's most recent m interactive behaviors before a target time, and form a first feature sequence according to the first behavior sequence; Determine a first decay state vector according to the silence duration of the target user, wherein the silence duration is the duration from the last interaction event before the target moment to the target moment; The first decay state vector is used as the unit state vector of the LSTM unit, and the second feature sequence determined according to the first feature sequence is used as the sequence to be processed, and both are input into the long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence; determining, according to the first output feature sequence, a user representation of the target user at a target time; The interaction behavior of the target user at the target time is predicted according to the user representation.

2. The method according to claim 1, wherein: The method is performed based on a time sequence graph, wherein the time sequence graph at least includes a user node and a connection edge with a timestamp representing the interaction behavior; Get the first behavior sequence formed by the target user's most recent m interactive behaviors before the target time, including: From the connection edges of the target node representing the target user in the timing graph, m connection edges whose timestamps are before the target time and closest to the target time are selected, and a connection edge sequence is formed in the order of the timestamps, which represents the first behavior sequence.

3. The method according to claim 2, wherein: Forming a first feature sequence according to the first behavior sequence includes: Forming at least one subsequence, and concatenating the subsequences to obtain the first characteristic sequence; the forming at least one subsequence includes: According to the edge features of the m connecting edges, forming an edge feature sequence as a subsequence; and / or; According to the node features of the neighbor nodes corresponding to each connection edge, a neighbor feature sequence is formed as a subsequence; The difference between the timestamp of each connection edge and the target time is encoded to obtain a time encoding sequence as a subsequence.

4. The method according to claim 1, wherein: The method further comprises: Performing a first processing on the first feature sequence through a first neural network to obtain a third feature sequence; The third feature sequence is subjected to a second processing by a second neural network to obtain the second feature sequence.

5. The method according to claim 4, wherein: The first neural network includes a first normalization layer and a feedforward neural network, and the first processing includes: Processing the first feature sequence sequentially through the first normalization layer and the feedforward neural network to obtain a first intermediate sequence; A superposition result of the first characteristic sequence and the first intermediate sequence is used as the third characteristic sequence.

6. The method according to claim 4, wherein: Determining, according to the first output feature sequence, a user representation of the target user at a target time, comprising: Using the superposition result of the first output feature sequence and the third feature sequence as a result feature sequence; The result feature vectors in the result feature sequence are mapped and transformed, and then averaged to obtain the user representation.

7. The method according to claim 1, wherein: Determining a first attenuation state vector according to the silence duration of the target user includes: Processing the original state vector through a third neural network to obtain a first state vector; Substituting the silence duration into a preset attenuation function to obtain an attenuation coefficient; The first attenuated state vector is obtained by subtracting the product of the first state vector and the attenuation coefficient from the original state vector.

8. The method according to claim 7, wherein: The original state vector is a preset value; or; The original state vector is a state vector output by the LSTM neural network during the process of determining the user representation of the target user at the previous moment.

9. The method according to claim 1, wherein: The method further includes: obtaining an object representation of the target object at the target time; Predicting the target user's interactive behavior at the target time according to the user representation includes: The user representation and the object representation are combined, and based on the combined representation, it is determined whether the target user will have the interaction behavior with the target object at the target time.

10. The method according to claim 9, wherein: Obtaining an object representation of the target object at the target time includes: Acquire a second behavior sequence formed by the target object's most recent m interactive behaviors before the target time, and form a fourth feature sequence according to the second behavior sequence; Determining a second attenuation state vector according to the silence duration of the target object; The second decay state vector is used as the unit state vector of the LSTM unit, and the fifth feature sequence determined according to the fourth feature sequence is used as the sequence to be processed, and they are input into the long short-term memory LSTM neural network for sequence processing to obtain a second output feature sequence; An object representation of the target object at a target time is determined according to the second output feature sequence.

11. The method according to claim 9, wherein: The target object is one of the following: a commodity, a content object, or another user different from the target user.

12. A device for predicting user behavior, comprising: An acquisition unit configured to acquire a first behavior sequence formed by the target user's most recent m interactive behaviors before a target time, and form a first feature sequence according to the first behavior sequence; A first determining unit is configured to determine a first attenuation state vector according to a silence duration of the target user, wherein the silence duration is a duration from the last interaction event before the target moment to the target moment; A first processing unit is configured to use the first decay state vector as a unit state vector of an LSTM unit, use a second feature sequence determined according to the first feature sequence as a sequence to be processed, and input both of them into a long short-term memory LSTM neural network for sequence processing to obtain a first output feature sequence; a second determining unit, configured to determine a user representation of the target user at a target time according to the first output feature sequence; The prediction unit is configured to predict the interaction behavior of the target user at the target time according to the user representation.

13. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.

14. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 11 is implemented.