CN117407714A - Method and device for training user behavior characterization model and predicting user behavior - Google Patents

Method and device for training user behavior characterization model and predicting user behavior Download PDF

Info

Publication number
CN117407714A
CN117407714A CN202311370158.3A CN202311370158A CN117407714A CN 117407714 A CN117407714 A CN 117407714A CN 202311370158 A CN202311370158 A CN 202311370158A CN 117407714 A CN117407714 A CN 117407714A
Authority
CN
China
Prior art keywords
behavior
current
user
user behavior
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311370158.3A
Other languages
Chinese (zh)
Inventor
傅驰林
吴伟昌
张晓露
周俊
李长升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202311370158.3A priority Critical patent/CN117407714A/en
Publication of CN117407714A publication Critical patent/CN117407714A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Embodiments of the present specification provide a method and apparatus for training a user behavior characterization model. In the method for training the user behavior characterization model, aiming at each current training sample in a current training sample set, providing a user history behavior sequence of the current training sample in a preset period as a sample input part for the current user behavior characterization model to obtain a corresponding user behavior sequence characterization vector; providing the obtained user behavior sequence characterization vector to a current behavior distribution prediction model to obtain a corresponding user behavior distribution prediction result; determining a predicted loss value according to the difference between the obtained predicted result of the user behavior distribution and the corresponding behavior distribution indicated by the subsequent historical behavior sequence serving as a tag part; and under the condition that the training ending condition is not met, adjusting parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value.

Description

Method and device for training user behavior characterization model and predicting user behavior
Technical Field
Embodiments of the present specification relate generally to the field of computer technology, and more particularly, to methods and apparatus for training a user behavior characterization model, and methods and apparatus for predicting user behavior.
Background
With the rapid development of artificial intelligence technology, how to accurately describe a behavior sequence of a user in different scenes becomes a problem to be solved. At present, a method for referencing natural language processing technology is generally adopted to construct a masked behavior prediction (Masked Behavior Prediction, MBP) or next behavior prediction (Next Behavior Prediction, NBP) task. However, compared with the grammar structure of the relative specification which is often followed by human language, the user behavior sequence has great randomness, so that the effect of the task which is suitable for text tasks and is masked by context prediction or the content of the text after the context prediction on the representation of the user behavior sequence is still to be improved.
Disclosure of Invention
In view of the foregoing, embodiments of the present specification provide a method and apparatus for training a user behavior characterization model, and a method and apparatus for predicting user behavior. By using the method and the device, the characterization effect on the user behavior sequence can be improved, and a basis is provided for more accurate prediction.
According to an aspect of embodiments of the present specification, there is provided a method for training a user behavior characterization model, comprising: the following model training process is circularly performed using a training sample set, each training sample in which includes a user history behavior sequence for a predetermined period as a sample input section and a subsequent history behavior sequence as a tag section, until a training end condition is satisfied: aiming at each current training sample in the current training sample set, providing a user history behavior sequence in a preset period of the current training sample for a current user behavior characterization model to obtain a corresponding user behavior sequence characterization vector; providing the obtained characterization vectors of the user behavior sequences for the current behavior distribution prediction model to obtain user behavior distribution prediction results corresponding to the current training samples; determining a predicted loss value of the current model training process according to the difference between the obtained predicted result of the user behavior distribution and the behavior distribution indicated by the corresponding subsequent historical behavior sequence; and in response to not satisfying the training end condition, adjusting parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value.
According to another aspect of embodiments of the present specification, there is provided a method for predicting user behavior, comprising: acquiring a historical behavior sequence of a target user; providing the historical behavior sequence to a user behavior characterization model to obtain a corresponding behavior sequence characterization vector, wherein the user behavior characterization model is trained based on the prediction of the distribution of the future behaviors of the user; and providing the behavior sequence characterization vector to a corresponding downstream prediction task model to obtain a corresponding prediction result.
According to still another aspect of embodiments of the present specification, there is provided an apparatus for training a user behavior characterization model, the apparatus being configured to perform a model training process by a training unit cyclically using a training sample set until a training end condition is satisfied, each training sample in the training sample set including a user history behavior sequence for a predetermined period as a sample input section and a subsequent history behavior sequence as a tag section, the training unit including: the sequence vectorization module is configured to provide a user history behavior sequence in a preset period of the current training sample for each current training sample in the current training sample set to the current user behavior characterization model to obtain a corresponding user behavior sequence characterization vector; the prediction module is configured to provide the obtained characterization vectors of the user behavior sequences for the current behavior distribution prediction model respectively to obtain user behavior distribution prediction results corresponding to the current training samples; the loss determination module is configured to determine a predicted loss value of the current model training process according to the difference between the obtained predicted result of the user behavior distribution and the behavior distribution indicated by the corresponding subsequent historical behavior sequence; the apparatus further comprises: and a parameter adjustment unit configured to adjust parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value in response to the training end condition not being satisfied.
According to a further aspect of embodiments of the present specification, there is provided an apparatus for predicting user behavior, comprising: a sequence acquisition unit configured to acquire a history behavior sequence of a target user; a sequence characterization unit configured to provide the historical behavior sequence to a user behavior characterization model to obtain a corresponding behavior sequence characterization vector, wherein the user behavior characterization model is trained based on a prediction of a distribution of future behaviors of a user; and the result prediction unit is configured to provide the behavior sequence characterization vector for the corresponding downstream prediction task model to obtain a corresponding prediction result.
According to another aspect of embodiments of the present specification, there is provided an apparatus for training a user behavior characterization model, comprising: at least one processor, and a memory coupled with the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method for training a user behavior characterization model as described above.
According to another aspect of embodiments of the present specification, there is provided an apparatus for predicting user behavior, comprising: at least one processor, and a memory coupled to the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method for predicting user behavior as described above.
According to another aspect of embodiments of the present specification, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements a method for training a user behavior characterization model and/or a method for predicting user behavior as described above.
According to another aspect of embodiments of the present specification, there is provided a computer program product comprising a computer program for execution by a processor to implement a method for training a user behavior characterization model and/or a method for predicting user behavior as described above.
Drawings
A further understanding of the nature and advantages of the present description may be realized by reference to the following drawings. In the drawings, similar components or features may have the same reference numerals.
FIG. 1 illustrates an exemplary architecture of a method and apparatus for training a user behavior characterization model, a method and apparatus for predicting user behavior, according to an embodiment of the present description.
FIG. 2 illustrates a flowchart of one example of a method for training a user behavior characterization model according to embodiments of the present description.
Fig. 3 shows a flowchart of one example of a determination process of a user behavior sequence characterization vector according to an embodiment of the present description.
Fig. 4 shows a flowchart of still another example of a determination process of a user behavior distribution prediction result according to an embodiment of the present specification.
FIG. 5 shows a schematic diagram of yet another example of a method for training a user behavior characterization model according to an embodiment of the present description.
Fig. 6 shows a schematic diagram of one example of a method for predicting user behavior according to an embodiment of the present description.
FIG. 7 illustrates a block diagram of one example of an apparatus for training a user behavior characterization model in accordance with an embodiment of the present description.
Fig. 8 shows a block diagram of one example of an apparatus for predicting user behavior according to an embodiment of the present description.
FIG. 9 illustrates a block diagram of one example of an apparatus for training a user behavior characterization model in accordance with an embodiment of the present description.
Fig. 10 shows a block diagram of one example of an apparatus for predicting user behavior according to an embodiment of the present description.
Detailed Description
The subject matter described herein will be discussed below with reference to example embodiments. It should be appreciated that these embodiments are discussed only to enable a person skilled in the art to better understand and thereby practice the subject matter described herein, and are not limiting of the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements discussed without departing from the scope of the embodiments herein. Various examples may omit, replace, or add various procedures or components as desired. In addition, features described with respect to some examples may be combined in other examples as well.
As used herein, the term "comprising" and variations thereof mean open-ended terms, meaning "including, but not limited to. The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment. The term "another embodiment" means "at least one other embodiment". The terms "first," "second," and the like, may refer to different or the same object. Other definitions, whether explicit or implicit, may be included below. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout this specification.
Methods and apparatuses for training a user behavior characterization model, and methods and apparatuses for predicting user behavior according to embodiments of the present specification will be described in detail below with reference to the accompanying drawings.
FIG. 1 illustrates an exemplary architecture 100 of a method and apparatus for training a user behavior characterization model, a method and apparatus for predicting user behavior, according to an embodiment of the present description.
In fig. 1, a network 110 is employed to interconnect between a terminal device 120 and an application server 130.
Network 110 may be any type of network capable of interconnecting network entities. The network 110 may be a single network or a combination of networks. In terms of coverage, network 110 may be a Local Area Network (LAN), wide Area Network (WAN), or the like. In terms of a carrier medium, the network 110 may be a wired network, a wireless network, or the like. In terms of data switching technology, the network 110 may be a circuit switched network, a packet switched network, or the like.
Terminal device 120 may be any type of electronic computing device capable of connecting to network 110, accessing servers or websites on network 110, processing data or signals, and the like. For example, the terminal device 120 may be a desktop computer, a notebook computer, a tablet computer, a smart phone, or the like. Although only one terminal device is shown in fig. 1, it should be understood that there may be a different number of terminal devices connected to the network 110.
In one embodiment, the terminal device 120 may be used by a user. Terminal device 120 may include an application client (e.g., application client 121) that may provide various services to a user. In some cases, application client 121 may interact with application server 130. For example, the application client 121 may transmit a message input by a user to the application server 130 and receive a response associated with the message from the application server 130. In this context, a "message" may refer to any input information, such as a historical behavior sequence of a user, etc.
The application server 130 may be connected to a training sample database 131. Wherein each training sample in the training sample database 131 includes a user historical behavior sequence for a predetermined period as a sample input section and a subsequent historical behavior sequence as a tag section. The application server 130 may be trained to obtain a user behavior characterization model using a training sample set in the training sample database 131. However, it should be understood that in other cases, the training sample set in the training sample database 131 may be used by other servers to train to obtain the user behavior characterization model, and the obtained model parameters may be transmitted to the application server 130.
It should be appreciated that all network entities shown in fig. 1 are exemplary and that any other network entity may be involved in architecture 100, depending on the particular application requirements.
FIG. 2 illustrates a flow chart of a method 200 for training a user behavior characterization model according to an embodiment of the present description.
As shown in FIG. 2, at 210, the model training processes 220-250 described below are performed in a loop using a training sample set until a training end condition is met.
In this embodiment, each training sample in the training sample set may include a user history behavior sequence for a predetermined period as the sample input section and a subsequent history behavior sequence as the tag section. In one example, the predetermined period may be expressed as (0, T]A section, within which a user history behavior sequence can be expressed as s t ={x 1 ,x 2 ,…,x t-1 ,x t }. Wherein x is i May be used to represent the ith behavior in the sequence. In one example, the categories of user history behavior may be K. For example, s t = {2,3,1,2,1} may represent that during history (0, t]In this, the user has performed actions 2,3,1,2, and 1 in this order. In one example, the subsequent historical behavior sequence may be represented at (T, T+W]Sequences of actions occurring during the period, e.g. { x }, of the user t+1 ,x t+2 ,…,x t+w }。
Alternatively, the subsequent historical behavior sequence of each training sample may correspond to a time window. In one example, W may have different values. For example, corresponds to a value in (T, T+W) 1 ]The subsequent historical behavior sequence during can be expressed as { x } t+1 ,x t+2 Corresponding to the sequence in (T, T+W) 2 ]The subsequent historical behavior sequence during can be expressed as { x } t+1 ,x t+2 ,x t+3 ,x t+4 ,x t+5 Corresponding to the sequence in (T, T+W) 3 ]The subsequent historical behavior sequence during can be expressed as { x } t+1 ,x t+2 ,x t+3 ,x t+4 ,x t+5 ,x t+6 }。
At 220, for each current training sample in the current training sample set, the user historical behavior sequence within a predetermined period of the current training sample is provided to the current user behavior characterization model to obtain a corresponding user behavior sequence characterization vector.
In this embodiment, the current training sample set may refer to a batch (batch) of training samples selected from the training sample set in the current iterative process (iteration). The current training sample set contains a number of current training samples that is comparable to a predetermined batch size (batch size). In one example, the user behavior sequence characterization vector may be represented as v t =f(s t ). Where f (-) may be used to represent a user behavior characterization model, which may include various models that can be used to vectorize sequences, such as a transformer-based model, a recurrent neural network (Recurrent Neural Network, RNN), a Long short-term memory (LSTM) network, and the like. In this embodiment, the user behavior sequence characterization vector may be considered as a representation of a low-dimensional space (e.g., feature space) of the input user history behavior sequence.
Optionally, with continued reference to fig. 3, fig. 3 shows a flowchart of one example of a process 300 of determining a user behavior sequence characterization vector according to an embodiment of the present description. The user behavior characterization model may include a behavior embedding layer and a behavior sequence characterization model.
At 310, the user historical behavior sequence within a predetermined period of the current training sample is provided to the current behavior embedding layer, and a characterization vector corresponding to each behavior in the corresponding user historical behavior sequence is obtained.
In one example, a corresponding user history behavior sequence s t ={x 1 ,x 2 ,…,x t-1 ,x t The token vector corresponding to each behavior in the sequence may be represented as e st ={e 1 ,e 2 ,…,e t-1 ,e t }。
At 320, the characterization vector corresponding to each behavior in the user historical behavior sequence corresponding to the current training sample is provided to the current behavior sequence characterization model, so as to obtain a corresponding user behavior sequence characterization vector.
In this embodiment, the model parameters of the behavior embedding layer and the behavior sequence characterization model may be adjusted along with the model training process.
Returning to fig. 2, at 230, the obtained characterization vectors of the user behavior sequences are respectively provided to the current behavior distribution prediction model, so as to obtain the user behavior distribution prediction result corresponding to each current training sample.
In one example, the user behavior distribution prediction results may be used to represent a probability distribution that a user will take place in various known behaviors (e.g., the K behaviors described above) over a period of time in the future (e.g., the time window W described above). In one example, the user behavior distribution prediction result may be expressed asI.e. the probability of the user to take place the kth action within the time window W. Wherein g k (. Cndot.) can be used to represent behavioral distribution prediction models, which can include various models for classification, such as deep neural networks with fully connected layers (Deep Neural Networks, DNN).
Optionally, with continued reference to fig. 4, fig. 4 shows a flowchart of yet another example of a process 400 for determining a user behavior distribution prediction result according to an embodiment of the present disclosure.
As shown in fig. 4, at 410, the time windows associated with each current training sample in the current training sample set are provided to the current time window representation model to obtain time window representation vectors corresponding to each time window.
In this embodiment, the model parameters of the time window characterization model may be adjusted along with the model training process. In one example, each current training sample in the current training sample set involves a total of 3 time windows W 1 、W 2 、W 3 . W can be obtained by using the current time window characterization model 1 、W 2 、W 3 The corresponding time window characterizes the vector.
Alternatively, the time window corresponding to each training sample is determined by determining the maximum allowable time window (e.g., W max Represented) are randomly sampled over successive time periods. In one example, for each training sample,can be distributed uniformly (0, W max ]And obtaining a corresponding time window by random sampling. In one example, multiple samples may be performed on the same training sample, resulting in corresponding M time windows.
At 420, for each current training sample in the current training sample set, the user behavior sequence characterization vector and the corresponding time window characterization vector of the current training sample are provided to the current behavior distribution prediction model to obtain a corresponding user behavior distribution prediction result.
In one example, the user behavior distribution prediction result may be expressed asI.e. in time window W m The probability of the kth action occurring for the inner user. Wherein g k (. Cndot.) can be used to represent behavior distribution prediction model, (. Cndot.)>Can be used to represent a time window W m The corresponding time window characterizes the vector.
Based on the scheme, the learning process of the user behavior sequence characterization can be introduced into the multi-scale time window, so that the limitation of generalization of the learned characterization by adopting a single fixed time window is broken through, explosive increase of the number of tasks caused by enumerating as many time windows as possible by using a multi-task mode is avoided, and the learned characterization can keep good effect when being applied to tasks of different downstream time windows.
Returning to FIG. 2, at 240, a predictive loss value for the current model training process is determined based on the difference between the resulting user behavior profile predictions and the behavior profile indicated by the corresponding subsequent historical behavior sequence.
In this embodiment, according to the subsequent historical behavior sequences corresponding to each current training sample, a corresponding behavior distribution may be obtained. Various loss functions (e.g., cross entropy, KL divergence, etc.) that measure the difference between two probability distributions may be utilized to determine the predicted loss value for the current model training process.
In one example, the predictive loss value for the current model training process may be expressed as Wherein (1)>And->May be used to represent a tag and a predicted value, respectively, of whether the kth action occurred within the time window w. S may be used to represent the current training sample set. The meaning of the remaining symbols may be referred to in the foregoing.
In one example, if the current training samples are distributed from uniform (0, W max ]M time windows are randomly sampled, the predictive loss value corresponding to the current training sample can be expressed asWherein (1)>And->Can be used to represent the time window W m Labels and predictors of whether or not the kth behavior occurs. The meaning of the remaining symbols may be referred to in the foregoing. It can be understood that the predicted loss value corresponding to the current training process can be obtained by calculating the predicted loss value corresponding to each current training sample in the current training sample set.
At 250, a determination is made as to whether the training end condition is satisfied.
In one example, whether the training end condition is satisfied may be determined by determining whether the number of iterations reaches a preset number of times, whether the training duration reaches a preset duration, whether the loss value converges, and the like.
If not, at 260, parameters of the current user behavior characterization model and the current behavior distribution prediction model are adjusted according to the determined prediction loss value.
In this embodiment, the user behavior characterization model and the behavior distribution prediction model after model parameter adjustment may serve as a current user behavior characterization model and a current behavior distribution prediction model in the next model training process. Thereafter, the current training sample set may be re-determined using the training sample set described above, and the model training processes 220-250 may continue until the training end condition is met.
And if yes, determining the current user behavior characterization model as the trained user behavior characterization model. Therefore, the training completed user behavior characterization model can be utilized to obtain the corresponding user behavior sequence characterization vector, and the corresponding prediction result is further determined.
Optionally, parameters of the current user behavior characterization model and the current behavior distribution prediction model may also be adjusted according to the determined predicted loss value and the regular loss value. In this embodiment, the above-mentioned regular loss value may be used to avoid overfitting the model when predicting the future behavior distribution, so that the model can pay attention to the key information that represents the user attribute in the user behavior sequence. In one example, the canonical loss value may be determined based on the contrast loss. In one example, this may be based on To adjust model parameters of the current user behavior characterization model and the current behavior distribution prediction model simultaneously. Where λ may be used to represent a preset weighting factor, typically between 0 and 1. />And->May be used to represent the determined predicted loss value and regular loss value, respectively.
Alternatively, the above-described canonical loss value may be determined by the following steps 242-244.
At 242, the characterization vectors corresponding to each behavior in the masked historical behavior sequence of the user corresponding to the current training sample are provided to the current behavior sequence characterization model to obtain corresponding characterization vectors of the masking sequence of the user behavior.
In one example, the mask-processed characterization vectors corresponding to respective behaviors in the sequence of user-historic behaviors (e.g., may be usedTo represent) may be obtained by randomly masking portions (e.g., replacing the original token vector with a mask) on the basis of token vectors corresponding to respective behaviors in the original sequence of user historical behaviors. The corresponding user behavior mask sequence characterization vector may be expressed as +.>
At 244, a canonical penalty value is determined from the differences between the obtained user behavior sequence characterization vector and the corresponding user behavior mask sequence characterization vector.
In one example, the canonical loss value may be determined using various functions that determine similarity between vectors (e.g., cosine similarity). In one example, the canonical loss value for a single current training sample may be represented as Wherein I 2 For representing the L2 norm. The meaning of the remaining symbols may be referred to in the foregoing. It can be understood that the regular loss value corresponding to the current training process can be obtained by calculating the regular loss value corresponding to each current training sample in the current training sample set.
Based on the method, the regular loss is built based on the fact that the random shielding of a small amount of behaviors does not change the integral characterization of the user when the characterization is learned from the user behavior sequence, and good effects are achieved.
Referring now to FIG. 5, FIG. 5 shows a schematic diagram of yet another example of a method 500 for training a user behavior characterization model according to an embodiment of the present description.
As shown in FIG. 5, (0, T)]User history behavior sequence s in period t ={x 1 ,x 2 ,…,x t-1 ,x t As a sample input portion of the training sample. The behavior embedding layer is utilized to obtain the characterization vector { e } corresponding to each behavior in the corresponding user history behavior sequence 1 ,e 2 ,…,e t-1 ,e t }. Then, the corresponding user behavior sequence characterization vector v can be obtained by using the behavior sequence characterization model t . And obtaining a user behavior distribution prediction result corresponding to the training sample by using the behavior distribution prediction model. Accordingly, (T, T+W]Subsequent historical behavior sequence s within a period t ={x 1 ,…,x t+w As part of the label of the training sample. Next, a predicted loss value corresponding to the training sample may be determined based on a difference between the obtained user behavior distribution prediction result and a behavior distribution indicated by the corresponding subsequent historical behavior sequence. Then, a predicted loss value for the current model training process may be determined. And further, model parameters of the behavior embedding layer, the behavior sequence characterization model and the behavior distribution prediction model can be adjusted according to the prediction loss value.
Alternatively, the W may have different values, e.g. W 1 、W 2 、W 3 . Accordingly, a sequence of subsequent historical behaviors corresponding to different periods can be obtained. Alternatively, the W may be derived using a time window characterization model 1 、W 2 、W 3 Corresponding time window characterization vectorsIn one example, when W is selected 1 At this time, the user behavior sequence characterization vector v may be t And->Providing the behavior distribution prediction model to obtain the training sample corresponding to the time window W 1 The user behavior distribution prediction result of (a). At this time, it is possible to correspond to the time window W based on the obtained 1 User behavior distribution prediction result of (C) and (T, T+W) 1 ]And determining the predicted loss value corresponding to the training sample according to the difference between the behavior distribution indicated by the subsequent historical behavior sequence. Similarly, other time windows may also be selected.
Optionally, a characterization vector { e } corresponding to each behavior in the user's historical behavior sequence may also be used 1 ,e 2 ,…,e t-1 ,e t Performing shielding treatment, and providing the characterization vectors corresponding to each behavior in the user history behavior sequence after the shielding treatment to the behavior sequence characterization model to obtain the corresponding user behavior shielding sequence characterization vectorsThe vector v may then be characterized according to the resulting sequence of user actions t Mask sequence characterization vector +.>And (3) determining the regular loss value according to the difference between the two. Further, model parameters of the behavior embedding layer, the behavior sequence characterization model, and the behavior distribution prediction model may be adjusted according to the predicted loss value and the regular loss value.
By using the method for training the user behavior characterization model disclosed in fig. 1-5, the influence of the randomness of the user behavior on the behavior sequence characterization is greatly reduced by converting the traditional next specific behavior of the predicted user into the distribution of the occurrence probability of the overall behavior of the predicted user in a future period of time, so that the method has stronger robustness.
Referring now to fig. 6, fig. 6 shows a schematic diagram of one example of a method 600 for predicting user behavior in accordance with an embodiment of the present disclosure.
As shown in fig. 6, the historical behavior sequence of the target user may be as shown at 610 in fig. 6. In one example, the historical behavior sequence of the target user may be provided to the user behavior characterization model 620 for a corresponding behavior sequence characterization vector 630, wherein the user behavior characterization model is trained based on predictions of a distribution of future behaviors of the user.
Alternatively, the historical behavior sequence corresponding to the period (0, T+W) may be used as a training sample to train the user behavior characterization model and the behavior distribution prediction model, wherein the historical behavior sequence 660 corresponding to the period (0, T) may be used as a sample input part and the historical behavior sequence corresponding to the period (T, T+W) may be used as a tag part.
Based on the above, the user behavior feature representation method applicable to a plurality of downstream subtasks is provided, which can be well represented in the case of crossing different scenes (such as the aspect that the post-credit repayment probability prediction focuses more on the user behavior, and the anti-fraud model is biased to the aspect that the user behavior is bad), and different time windows (such as the post-credit repayment estimation model needs to predict the repayment willingness of the user in the future of 5 days, 30 days and even 120 days), and has better robustness.
With continued reference to fig. 7, fig. 7 shows a block diagram of one example of an apparatus 700 for training a user behavior characterization model according to an embodiment of the present description. The apparatus embodiment may correspond to the method embodiments shown in fig. 2-5, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 7, the apparatus 700 for training a user behavior characterization model is configured to perform the model training process described below by the training unit 710 using a training sample set loop until a training end condition is satisfied. Each training sample in the training sample set includes a user historical behavior sequence for a predetermined period as a sample input portion and a subsequent historical behavior sequence as a tag portion. The training unit 710 may include: a sequence vectorization module 711, a prediction module 712, and a loss determination module 713.
The sequence vectorization module 711 is configured to provide, for each current training sample in the current training sample set, a user history behavior sequence within a predetermined period of the current training sample to the current user behavior characterization model, so as to obtain a corresponding user behavior sequence characterization vector.
In one example, the user behavior characterization model includes a behavior embedding layer and a behavior sequence characterization model. The sequence vectorization module 711 may be further configured to provide the user history behavior sequence in the predetermined period of the current training sample to the current behavior embedding layer, so as to obtain a characterization vector corresponding to each behavior in the corresponding user history behavior sequence; and providing the characterization vectors corresponding to the behaviors in the user historical behavior sequence corresponding to the current training sample for the current behavior sequence characterization model to obtain corresponding user behavior sequence characterization vectors.
And the prediction module 712 is configured to provide the obtained characterization vectors of the user behavior sequences to the current behavior distribution prediction model to obtain the user behavior distribution prediction result corresponding to each current training sample.
In one example, the subsequent historical behavior sequence of each training sample corresponds to a time window. The prediction module 712 may be further configured to: providing the time windows related to each current training sample in the current training sample set for a current time window representation model to obtain time window representation vectors corresponding to each time window; and aiming at each current training sample in the current training sample set, providing the user behavior sequence characterization vector and the corresponding time window characterization vector of the current training sample for the current behavior distribution prediction model to obtain a corresponding user behavior distribution prediction result.
In one example, the time window for each training sample is obtained by randomly sampling from consecutive time periods that are provided with a maximum allowed time window.
A loss determination module 713 configured to determine a predicted loss value for the current model training process based on differences between the obtained user behavior distribution predictions and behavior distributions indicated by the corresponding subsequent historical behavior sequences.
In one example, the loss determination module 713 may be further configured to: providing the characterization vectors corresponding to the behaviors in the shielded user historical behavior sequences corresponding to the current training samples for the current behavior sequence characterization model to obtain corresponding user behavior shielding sequence characterization vectors; and determining a regular loss value of the current model training process according to the difference between the obtained user behavior sequence representation vector and the corresponding user behavior shielding sequence representation vector.
The apparatus 700 for training a user behavior characterization model may further include: and a parameter adjustment unit 720 configured to adjust parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value in response to the training end condition not being satisfied.
In one example, the parameter adjustment unit 720 may be further configured to adjust parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined predicted loss value and the regular loss value in response to not satisfying the training end condition.
The specific operations of the sequence vectorizing module 711, the predicting module 712, the loss determining module 713, and the parameter adjusting unit 720 included in the training unit 710 may refer to the specific descriptions of the corresponding steps in the embodiments of fig. 2-5, which are not repeated here
Referring now to fig. 8, fig. 8 illustrates a block diagram of one example of an apparatus 800 for predicting user behavior in accordance with an embodiment of the present disclosure. The embodiment of the apparatus may correspond to the embodiment of the method shown in fig. 6, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 8, an apparatus 800 for predicting user behavior may include a sequence acquisition unit 810, a sequence characterization unit 820, and a result prediction unit 830.
A sequence acquisition unit 810 configured to acquire a history behavior sequence of the target user.
The sequence characterization unit 820 is configured to provide the historical behavior sequence to the user behavior characterization model, so as to obtain a corresponding behavior sequence characterization vector. Wherein the user behavior characterization model is trained based on predictions of a distribution of future behaviors of the user.
The result prediction unit 830 is configured to provide the behavior sequence characterization vector to a corresponding downstream prediction task model, so as to obtain a corresponding prediction result.
The specific operations of the sequence acquisition unit 810, the sequence characterization unit 820 and the result prediction unit 830 may refer to the specific descriptions of the corresponding steps in the embodiment of fig. 6, which are not repeated here
Embodiments of a method and apparatus for training a user behavior characterization model, and a method and apparatus for predicting user behavior according to embodiments of the present specification are described above with reference to fig. 1 through 8.
The means for training the user behavior characterization model and the means for predicting the user behavior of the embodiments of the present disclosure may be implemented in hardware, or may be implemented in software, or a combination of hardware and software. Taking software implementation as an example, the device in a logic sense is formed by reading corresponding computer program instructions in a memory into a memory by a processor of a device where the device is located. In the embodiments of the present description, the means for training the user behavior characterization model and the means for predicting the user behavior may be implemented, for example, with an electronic device.
FIG. 9 illustrates a block diagram of one example of an apparatus 900 for training a user behavior characterization model in an embodiment of the present description.
As shown in fig. 9, an apparatus 900 for training a user behavior characterization model may include at least one processor 910, a memory (e.g., a non-volatile memory) 920, a memory 930, and a communication interface 940, with the at least one processor 910, memory 920, memory 930, and communication interface 940 being connected together via a bus 950. The at least one processor 910 executes at least one computer-readable instruction (i.e., the elements described above as being implemented in software) stored or encoded in memory.
In one embodiment, computer-executable instructions are stored in memory that, when executed, cause the at least one processor 910 to: a method for training a user behavior characterization model as described above is performed.
It should be appreciated that the computer-executable instructions stored in the memory, when executed, cause the at least one processor 910 to perform the various operations and functions described above in connection with fig. 1-5 in various embodiments of the present description.
Fig. 10 shows a block diagram of one example of an apparatus 1000 for predicting user behavior in an embodiment of the present description.
As shown in fig. 10, an apparatus 1000 for predicting user behavior may include at least one processor 1010, a memory (e.g., non-volatile memory) 1020, a memory 1030, and a communication interface 1040, with the at least one processor 1010, memory 1020, memory 1030, and communication interface 1040 being connected together via a bus 1050. The at least one processor 1010 executes at least one computer-readable instruction (i.e., the elements described above as being implemented in software) stored or encoded in memory.
In one embodiment, computer-executable instructions are stored in memory that, when executed, cause the at least one processor 1010 to: a method for predicting user behavior as described above is performed.
It should be appreciated that the computer-executable instructions stored in the memory, when executed, cause the at least one processor 1010 to perform the various operations and functions described above in connection with fig. 6 in various embodiments of the present specification.
According to one embodiment, a program product, such as a computer readable medium, is provided. The computer-readable medium may have instructions (i.e., elements implemented in software as described above) that, when executed by a computer, cause the computer to perform the various operations and functions described above in connection with fig. 1-6 in various embodiments of the present specification.
In particular, a system or apparatus provided with a readable storage medium having stored thereon software program code implementing the functions of any of the above embodiments may be provided, and a computer or processor of the system or apparatus may be caused to read out and execute instructions stored in the readable storage medium.
In this case, the program code itself read from the readable medium may implement the functions of any of the above-described embodiments, and thus the machine-readable code and the readable storage medium storing the machine-readable code form part of the present invention.
Computer program code required for operation of portions of the present description may be written in any one or more programming languages, including an object oriented programming language such as Java, scala, smalltalk, eiffel, JADE, emerald, C ++, c#, VB, NET, python and the like, a conventional programming language such as C language, visual Basic 2003, perl, COBOL 2002, PHP and ABAP, a dynamic programming language such as Python, ruby and Groovy, or other programming languages and the like. The program code may execute on the user's computer or as a stand-alone software package, or it may execute partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any form of network, such as a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet), or the connection may be made to the cloud computing environment, or for use as a service, such as software as a service (SaaS).
Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-R, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs), magnetic tapes, nonvolatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or cloud by a communications network.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Not all steps or units in the above-mentioned flowcharts and system configuration diagrams are necessary, and some steps or units may be omitted according to actual needs. The order of execution of the steps is not fixed and may be determined as desired. The apparatus structures described in the above embodiments may be physical structures or logical structures, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or may be implemented jointly by some components in multiple independent devices.
The term "exemplary" used throughout this specification means "serving as an example, instance, or illustration," and does not mean "preferred" or "advantageous over other embodiments. The detailed description includes specific details for the purpose of providing an understanding of the described technology. However, the techniques may be practiced without these specific details. In some instances, well-known structures and devices are shown in block diagram form in order to avoid obscuring the concepts of the described embodiments.
The alternative implementation manner of the embodiment of the present disclosure has been described in detail above with reference to the accompanying drawings, but the embodiment of the present disclosure is not limited to the specific details of the foregoing implementation manner, and various simple modifications may be made to the technical solution of the embodiment of the present disclosure within the scope of the technical concept of the embodiment of the present disclosure, and all the simple modifications belong to the protection scope of the embodiment of the present disclosure.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (11)

1. A method for training a user behavior characterization model, comprising:
the following model training process is circularly performed using a training sample set, each training sample in which includes a user history behavior sequence for a predetermined period as a sample input section and a subsequent history behavior sequence as a tag section, until a training end condition is satisfied:
Aiming at each current training sample in the current training sample set, providing a user history behavior sequence in a preset period of the current training sample for a current user behavior characterization model to obtain a corresponding user behavior sequence characterization vector;
providing the obtained characterization vectors of the user behavior sequences for the current behavior distribution prediction model to obtain user behavior distribution prediction results corresponding to the current training samples;
determining a predicted loss value of the current model training process according to the difference between the obtained predicted result of the user behavior distribution and the behavior distribution indicated by the corresponding subsequent historical behavior sequence; and
and in response to the training ending condition not being met, adjusting parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value.
2. The method of claim 1, wherein the subsequent historical behavior sequence of each training sample corresponds to a time window, the model training process further comprising:
providing the time windows related to each current training sample in the current training sample set to the current time window representation model to obtain time window representation vectors corresponding to each time window,
Providing the obtained characterization vectors of the user behavior sequences for the current behavior distribution prediction model respectively to obtain user behavior distribution prediction results corresponding to the current training samples, wherein the user behavior distribution prediction results comprise;
and aiming at each current training sample in the current training sample set, providing the user behavior sequence characterization vector and the corresponding time window characterization vector of the current training sample for the current behavior distribution prediction model to obtain a corresponding user behavior distribution prediction result.
3. The method of claim 2, wherein the time window for each training sample is obtained by randomly sampling from consecutive time periods provided with a maximum allowed time window.
4. The method of any one of claim 1 to 3, wherein the user behavior characterization model comprises a behavior embedding layer and a behavior sequence characterization model,
providing the user history behavior sequence in the preset period of the current training sample to the current user behavior characterization model, and obtaining the corresponding user behavior sequence characterization vector comprises the following steps:
providing the user history behavior sequence in the preset period of the current training sample to a current behavior embedding layer to obtain characterization vectors corresponding to all behaviors in the corresponding user history behavior sequence; and
And providing the characterization vectors corresponding to the behaviors in the user historical behavior sequence corresponding to the current training sample for the current behavior sequence characterization model to obtain corresponding user behavior sequence characterization vectors.
5. The method of claim 4, wherein said adjusting parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined predictive loss value comprises:
and adjusting parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value and the regular loss value.
6. The method of claim 5, wherein the canonical loss value is determined by:
providing the characterization vectors corresponding to the behaviors in the shielded user historical behavior sequences corresponding to the current training samples for the current behavior sequence characterization model to obtain corresponding user behavior shielding sequence characterization vectors; and
and determining a regular loss value of the current model training process according to the difference between the obtained user behavior sequence representation vector and the corresponding user behavior shielding sequence representation vector.
7. A method for predicting user behavior, comprising:
acquiring a historical behavior sequence of a target user;
Providing the historical behavior sequence to a user behavior characterization model to obtain a corresponding behavior sequence characterization vector, wherein the user behavior characterization model is trained based on the prediction of the distribution of the future behaviors of the user; and
and providing the behavior sequence characterization vector to a corresponding downstream prediction task model to obtain a corresponding prediction result.
8. An apparatus for training a user behavior characterization model, the apparatus being configured to perform a model training process by a training unit in a loop using a training sample set, each training sample in the training sample set including a user historical behavior sequence for a predetermined period as a sample input portion and a subsequent historical behavior sequence as a tag portion, until a training end condition is satisfied, the training unit comprising:
the sequence vectorization module is configured to provide a user history behavior sequence in a preset period of the current training sample for each current training sample in the current training sample set to the current user behavior characterization model to obtain a corresponding user behavior sequence characterization vector;
the prediction module is configured to provide the obtained characterization vectors of the user behavior sequences for the current behavior distribution prediction model respectively to obtain user behavior distribution prediction results corresponding to the current training samples;
The loss determination module is configured to determine a predicted loss value of the current model training process according to the difference between the obtained predicted result of the user behavior distribution and the behavior distribution indicated by the corresponding subsequent historical behavior sequence; and
the apparatus further comprises:
and a parameter adjustment unit configured to adjust parameters of the current user behavior characterization model and the current behavior distribution prediction model according to the determined prediction loss value in response to the training end condition not being satisfied.
9. An apparatus for predicting user behavior, comprising:
a sequence acquisition unit configured to acquire a history behavior sequence of a target user;
a sequence characterization unit configured to provide the historical behavior sequence to a user behavior characterization model to obtain a corresponding behavior sequence characterization vector, wherein the user behavior characterization model is trained based on a prediction of a distribution of future behaviors of a user;
and the result prediction unit is configured to provide the behavior sequence characterization vector for the corresponding downstream prediction task model to obtain a corresponding prediction result.
10. An apparatus for training a user behavior characterization model, comprising: at least one processor, a memory coupled with the at least one processor, and a computer program stored on the memory, the at least one processor executing the computer program to implement the method of any one of claims 1 to 6.
11. An apparatus for predicting user behavior, comprising: at least one processor, a memory coupled with the at least one processor, and a computer program stored on the memory, the at least one processor executing the computer program to implement the method of claim 7.
CN202311370158.3A 2023-10-20 2023-10-20 Method and device for training user behavior characterization model and predicting user behavior Pending CN117407714A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311370158.3A CN117407714A (en) 2023-10-20 2023-10-20 Method and device for training user behavior characterization model and predicting user behavior

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311370158.3A CN117407714A (en) 2023-10-20 2023-10-20 Method and device for training user behavior characterization model and predicting user behavior

Publications (1)

Publication Number Publication Date
CN117407714A true CN117407714A (en) 2024-01-16

Family

ID=89495681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311370158.3A Pending CN117407714A (en) 2023-10-20 2023-10-20 Method and device for training user behavior characterization model and predicting user behavior

Country Status (1)

Country Link
CN (1) CN117407714A (en)

Similar Documents

Publication Publication Date Title
US11704409B2 (en) Post-training detection and identification of backdoor-poisoning attacks
CN110069709B (en) Intention recognition method, device, computer readable medium and electronic equipment
Hyvärinen Statistical models of natural images and cortical visual representation
CN110659742A (en) Method and device for acquiring sequence representation vector of user behavior sequence
CN112347361B (en) Method for recommending object, neural network, training method, training equipment and training medium thereof
WO2021012263A1 (en) Systems and methods for end-to-end deep reinforcement learning based coreference resolution
JP6971514B1 (en) Information processing equipment, information processing methods and programs
CA3117833A1 (en) Regularization of recurrent machine-learned architectures
CN115098789B (en) Multidimensional interest fusion recommendation method and device based on neural network and related equipment
CN114548300B (en) Method and device for explaining service processing result of service processing model
CN115965463A (en) Model training method and device, computer equipment and storage medium
CN111340245A (en) Model training method and system
CN116703457A (en) Prediction method and prediction device for life cycle value of user
CN117407714A (en) Method and device for training user behavior characterization model and predicting user behavior
CN111221896A (en) User behavior prediction method and device, electronic equipment and storage medium
Wu et al. Applying a Probabilistic Network Method to Solve Business‐Related Few‐Shot Classification Problems
CN114648070B (en) Critical behavior extraction network, and training method and device of critical attribute extraction network
CN117370652A (en) Model training and information recommending method and device
Han et al. Adaptive regularised l2‐boosting on clustered sparse coefficients for single image super‐resolution
CN116610783B (en) Service optimization method based on artificial intelligent decision and digital online page system
CN117520898A (en) Method for identifying sensitive samples, model training method and device
CN110674497B (en) Malicious program similarity calculation method and device
US20230019779A1 (en) Trainable differential privacy for machine learning
CN117875449A (en) Language model training method and device based on continuous pre-training
CN118155015A (en) Model training method and device for improving generalization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination