Training methods for sequence recommendation models, sequence recommendation methods, and electronic devices
By integrating user and merchant interaction behaviors, time and location information into the Transformer model, a contextualized event sequence is constructed. The model is then trained using a target loss function, which solves the overfitting problem in the recommender system and achieves accurate prediction of user interests.
Patent Information
- Application Number
- CN202511204491.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-27
AI Technical Summary
Existing Transformer models suffer from overfitting in the recommendation field, making it difficult to accurately predict user interests in sparse user behavior data, and simply increasing the depth and width fails to effectively improve performance.
By generating sample data, integrating user and merchant interaction behaviors, time and location information, a contextualized event sequence is constructed, and a target loss function is used to iteratively train a neural network model to predict user interest representation and click-through rate.
It improves the model's perception capabilities at every moment, captures the dynamic evolution of user interests, and enables the accurate prediction of user interests based on specific contexts.
Smart Images

Figure CN120688586B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method for a sequence recommendation model, a sequence recommendation method, and an electronic device. Background Technology
[0002] In modern large-scale industrial recommender systems, accurately capturing and predicting user interests is crucial for improving user experience and business efficiency. Sequence recommendation, which models the dynamic evolution of user interests by chronologically ordered sequences of actions (such as clicks, purchases, and browsing), has become the mainstream paradigm in recommender systems. In recent years, deep learning models, represented by Transformer, have achieved great success in NLP (Natural Language Processing) thanks to their powerful sequence modeling capabilities. However, applying Transformer to discriminative tasks in recommender systems faces significant challenges: First, user behavior data in recommender systems is typically highly sparse, with a limited number of interactions between each user and item. This makes deep, complex Transformer models highly susceptible to overfitting during training, resulting in generalization capabilities on validation and test sets that are even inferior to shallower models. Second, simply increasing the depth and width of the Transformer model in discriminative recommender tasks often fails to provide sustained performance improvements and instead exacerbates the overfitting problem.
[0003] Therefore, there is an urgent need to provide a training method for deep learning models that can accurately predict user interests and focus on the final application goals. Summary of the Invention
[0004] This application provides a training method for a sequence recommendation model, a sequence recommendation method, and an electronic device to alleviate or solve one or more technical problems existing in the prior art.
[0005] In a first aspect, embodiments of this application provide a training method for a sequence recommendation model, comprising:
[0006] Sample data is generated based on user behavior sequences within historical time periods; the user behavior sequences are used to represent user interaction behavior with sample merchants at multiple time steps; the sample data includes: sample merchant attribute information of the sample merchants, sample time information of user interaction with the sample merchants, and sample location information of the sample merchants.
[0007] The sample data is input into a neural network model to be trained. The neural network model fuses the sample merchant attribute information, the sample time information, and the sample location information to obtain a fused sample composite behavior sequence. Based on the sample composite behavior sequence, the user's interest representation sequence at the next time step is predicted. The interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant are fused to obtain fused information. Based on the fused information, the user's click-through rate on the exposed merchant is predicted. The interest representation sequence is used to represent the merchant attribute information that the user is interested in.
[0008] Based on the interest representation sequence, the click-through rate, and the sample data, a target loss function for the neural network model is determined. The neural network model is then iteratively trained based on the target loss function to obtain a sequence recommendation model. The target loss function represents at least one of the following: the prediction accuracy of the neural network model for the interest representation sequence and the prediction accuracy of the neural network model for the click-through rate.
[0009] Optionally, the step of fusing the sample merchant attribute information, the sample time information, and the sample location information to obtain the fused sample composite behavior sequence includes:
[0010] According to preset rules, the sample merchant attribute information, sample time information and sample location information corresponding to the first time step are concatenated to obtain the sample composite behavior sequence of the first time step; the first time step is any one of the plurality of time steps.
[0011] Optionally, predicting the user's interest representation sequence at the next time step based on the sample composite behavior sequence includes:
[0012] Based on the sample composite behavior sequence at the first time step and the sample composite behavior sequences corresponding to each time step preceding the first time step, the user's interest representation sequence at the second time step is predicted; the second time step is the next time step after the first time step.
[0013] Optionally, the neural network model includes: a generative network and a classification network;
[0014] The step of determining the target loss function of the neural network model based on the interest representation sequence, the click-through rate, and the sample data, and iteratively training the neural network model according to the target loss function to obtain a sequence recommendation model includes:
[0015] Based on the interest representation sequence, the click rate, and the sample data, the target loss function of the neural network model is determined. Based on the target loss function, the network parameters of the generator network and the classification network are iteratively adjusted to obtain the sequence recommendation model.
[0016] The target loss function includes a first loss function and a second loss function; the first loss function is used to represent the prediction accuracy of the generative network for the interest representation sequence; and the second loss function is used to represent the prediction accuracy of the classification network for the click rate.
[0017] Optionally, the step of determining the target loss function of the neural network model based on the interest representation sequence, the click-through rate, and the sample data, and iteratively adjusting the network parameters of the generator network and the classification network based on the target loss function to obtain the sequence recommendation model includes:
[0018] At any of the plurality of time steps, the first loss function is determined based on the interest representation sequence corresponding to the time step and the sample merchant attribute information in the sample data corresponding to the time step.
[0019] The second loss function is determined based on the click-through rate corresponding to the time step and the sample merchant attribute information in the sample data corresponding to the time step.
[0020] The target loss function is determined based on the first loss function and the second loss function;
[0021] The network parameters of the generator network and the classification network are adjusted according to the target loss function to obtain the sequence recommendation model.
[0022] Optionally, the step of determining the target loss function of the neural network model based on the interest representation sequence, the click-through rate, and the sample data, and iteratively adjusting the network parameters of the generator network and the classification network based on the target loss function to obtain the sequence recommendation model includes:
[0023] Based on the interest representation sequence and the sample merchant attribute information, the first loss function is determined, and the network parameters of the generator network are iteratively adjusted according to the first loss function to obtain the trained generator network.
[0024] Freeze the network parameters of the trained generative network;
[0025] With the network parameters of the trained generator network frozen, the second loss function is determined based on the click-through rate and the sample merchant attribute information. The network parameters of the classification network are then iteratively adjusted based on the second loss function to obtain the sequence recommendation model.
[0026] Secondly, embodiments of this application provide a sequence recommendation method, including:
[0027] Acquire the target user's pending data; the pending data includes: the target user's user behavior sequence within a historical time period, the merchant attribute information of the exposed merchants, the location information of the exposed merchants, and the current time information;
[0028] The data to be processed is input into a pre-trained sequence recommendation model for processing to obtain the click-through rate of the target user for the exposed merchant; wherein, the sequence recommendation model is trained according to the sequence recommendation model training method described in any of the above aspects;
[0029] Based on the click-through rate, merchants are recommended to the target users.
[0030] Thirdly, embodiments of this application provide a training apparatus for a sequence recommendation model, comprising:
[0031] The generation module is used to generate sample data based on user behavior sequences within a historical time period; the user behavior sequences are used to represent the user's interaction behavior with sample merchants at multiple time steps; the sample data includes: sample merchant attribute information of the sample merchants, sample time information of the user's interaction with the sample merchants, and sample location information of the sample merchants.
[0032] The prediction module is used to input the sample data into a neural network model to be trained, and to fuse the sample merchant attribute information, sample time information, and sample location information through the neural network model to obtain a fused sample composite behavior sequence; based on the sample composite behavior sequence, to predict the user's interest representation sequence at the next time step; to fuse the interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant to obtain fused information; and to predict the user's click-through rate on the exposed merchant based on the fused information; the interest representation sequence is used to represent the merchant attribute information that the user is interested in.
[0033] The training module is used to determine the target loss function of the neural network model based on the interest representation sequence, the click rate, and the sample data, and to iteratively train the neural network model according to the target loss function to obtain a sequence recommendation model; the target loss function is used to represent at least one of the following: the prediction accuracy of the neural network model for the interest representation sequence, and the prediction accuracy of the neural network model for the click rate.
[0034] Fourthly, embodiments of this application provide a sequence recommendation device, comprising:
[0035] The acquisition module is used to acquire the data to be processed of the target user; the data to be processed includes: the user behavior sequence of the target user in a historical time period, the merchant attribute information of the exposed merchant, the location information of the exposed merchant, and the current time information;
[0036] The processing module is used to input the data to be processed into a pre-trained sequence recommendation model for processing, so as to obtain the click-through rate of the target user for the exposed merchant; wherein the sequence recommendation model is trained according to the training method of the sequence recommendation model described in any of the above aspects;
[0037] The recommendation module is used to recommend merchants to the target user based on the click-through rate.
[0038] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the methods of embodiments of this application when executing the computer program.
[0039] Sixthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of any one of the embodiments of this application.
[0040] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method of any one of the embodiments of this application.
[0041] According to the technical solution of this application embodiment, sample data is first generated based on user behavior sequences within a historical time period. The user behavior sequences represent user interactions with sample merchants at multiple time steps. The sample data includes sample merchant attribute information, sample time information of user interactions with sample merchants, and sample merchant location information. Next, the sample data is input into a neural network model to be trained. The neural network model fuses the sample merchant attribute information, sample time information, and sample location information to obtain a fused composite behavior sequence. Based on this composite behavior sequence, the user's interest representation sequence for the next time step is predicted. This interest representation sequence represents the merchant attribute information that the user is interested in. The interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant are fused to obtain fused information. Then, the click-through rate of the exposed merchant is predicted based on the fused information. Finally, based on the interest representation sequence, click-through rate, and sample data, the target loss function of the neural network model is determined. The neural network model is iteratively trained based on the target loss function to obtain a sequence recommendation model. As can be seen, when training the sequence recommendation model, this application not only relies on the interaction behavior information between users and merchants, but also deeply integrates the time information of user-merchant interaction and the location information of merchants into the interaction behavior information to construct a contextualized event sequence. This enables the neural network model to directly perform calculations on the complete information unit of "what the user interacted with in what context" at every moment, ensuring that the model can perceive "what the user interacted with" and "in what context" at every moment. This allows the model to capture the dynamic evolution pattern of user interests more accurately, and further enables the trained sequence recommendation model to accurately predict user interests based on specific contexts.
[0042] The technical solution of this application can be applied to the transaction and delivery services of instant e-commerce platforms, such as Taobao Flash Sale, Taoxianda, Ele.me takeaway and retail.
[0043] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0044] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments according to this application and should not be construed as limiting the scope of this application.
[0045] Figure 1A flowchart illustrating the training method of the sequence recommendation model provided in an embodiment of this application is shown;
[0046] Figure 2 A schematic diagram illustrating the training method of the sequence recommendation model provided in this application embodiment is shown.
[0047] Figure 3 A schematic diagram illustrating the prediction method of the generative network provided in the embodiments of this application is shown.
[0048] Figure 4 A schematic diagram illustrating the prediction method of the classification network provided in the embodiments of this application is shown.
[0049] Figure 5 The diagram illustrates the principle of training a sequence recommendation model using a joint training method, as provided in an embodiment of this application.
[0050] Figure 6 A flowchart of the sequence recommendation method provided in an embodiment of this application is shown;
[0051] Figure 7 A block diagram of the training apparatus for the sequence recommendation model provided in an embodiment of this application is shown;
[0052] Figure 8 A block diagram of the training apparatus for the sequence recommendation model provided in an embodiment of this application is shown;
[0053] Figure 9 A block diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0054] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0055] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.
[0056] The following terms will be used in the following text:
[0057] NLP: Natural Language Processing. NLP is an important branch of artificial intelligence that mainly studies the interaction between computers and human natural language, including the techniques and methods for enabling computers to understand, interpret, generate, and respond to human language.
[0058] CTR: Click-Through Rate. CTR is a core performance metric in recommendation systems, advertising, and internet products, used to quantify the intensity of a user's immediate interest in recommended content or advertisements.
[0059] MLP: Multilayer Perceptron, a feedforward artificial neural network that maps a set of input vectors to a set of output vectors.
[0060] As mentioned earlier, applying the Transformer model to discriminative tasks in the recommendation field currently faces significant challenges, resulting in poor training and transfer performance. To address this, a generative pre-training framework has been proposed. First, the Transformer model is pre-trained on a large-scale, self-supervised generative task, allowing it to learn general and robust knowledge about user behavior sequences. Second, the pre-trained model parameters, especially the sparse embedding layers representing item IDs (Identity Documents), are transferred to the downstream discriminative task. Since the training objective is to generate the probability distribution of the entire sequence, and techniques such as negative sampling alleviate the data sparsity problem, generative models typically do not suffer from severe overfitting and exhibit good model scalability. However, this training method relies solely on a single item ID sequence, and the lack of contextual information leads to coarse interest modeling. Because each user interaction may contain drastically different intentions in different contexts, the model learns an averaged and fuzzy set of user interests, resulting in insufficient precision in the pre-training task itself and limiting the quality of the model's learned representations.
[0061] To address the aforementioned issues, this application aims to provide a training method for a sequence recommendation model. This method allows the model to compute on complete semantic units, learning more accurate dynamic interest evolution patterns while consistently focusing on the final application goal. When training the sequence recommendation model, this application not only relies on the interaction behavior information between users and merchants but also deeply integrates the time information of user-merchant interactions and the location information of merchants into the interaction behavior information, constructing a contextualized event sequence. This enables the neural network model to directly compute on complete information units of "what the user interacted with in what context," ensuring that the model can perceive "what the user interacted with" and "in what context" at every moment. This allows for the capture of more accurate dynamic interest evolution patterns, further enabling the trained sequence recommendation model to accurately predict user interests based on specific contexts.
[0062] It should be noted that the application scenarios or examples provided in the embodiments of this application are for ease of understanding, and the embodiments of this application do not specifically limit the application of the technical solutions. In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0063] The technical solution of this application and how it solves the aforementioned technical problems are described in detail below with specific embodiments. The listed specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0064] Figure 1 A flowchart illustrating the training method of the sequence recommendation model provided in this application embodiment is shown, as follows: Figure 1 As shown, the method may include steps S101, S102 and S103.
[0065] Step S101: Generate sample data based on the user behavior sequence within the historical time period; the user behavior sequence is used to represent the user's interaction behavior with the sample merchant at multiple time steps; the sample data includes: the sample merchant attribute information of the sample merchant, the sample time information of the user's interaction with the sample merchant, and the sample location information of the sample merchant.
[0066] The sample merchants refer to those who have interacted with users during a historical period, such as merchants that users have clicked on or purchased from. Sample merchant attribute information may include at least one of the following: merchant name, merchant unique identifier, merchant category, etc. Sample time information can be represented in at least one of the following ways: week, hour, day. For example, sample time information represented as "20250101" means that the user interacted with the sample merchant on January 1, 2025.
[0067] Step S102: Input the sample data into the neural network model to be trained, and fuse the sample merchant attribute information, sample time information, and sample location information through the neural network model to obtain the fused sample composite behavior sequence; predict the user's interest representation sequence at the next time step based on the sample composite behavior sequence; fuse the interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant to obtain fused information; predict the user's click rate on the exposed merchant based on the fused information.
[0068] The interest representation sequence is used to represent merchant attribute information that users are interested in. For example, it may include at least one of the following: merchant name, merchant unique identifier, merchant category, etc. Click-through rate (CTR) can be used to represent this.
[0069] The first merchant attribute information may include at least one of the following: merchant name, merchant unique identifier, merchant category, etc.
[0070] Step S103: Based on the interest representation sequence, click rate, and sample data, determine the target loss function of the neural network model, and iteratively train the neural network model according to the target loss function to obtain the sequence recommendation model.
[0071] The objective loss function is used to represent at least one of the following: the accuracy of the neural network model in predicting the interest representation sequence, and the accuracy of the neural network model in predicting the click rate.
[0072] According to the technical solution of this application embodiment, sample data is first generated based on user behavior sequences within a historical time period. The user behavior sequences represent user interactions with sample merchants at multiple time steps. The sample data includes sample merchant attribute information, sample time information of user interactions with sample merchants, and sample merchant location information. Next, the sample data is input into a neural network model to be trained. The neural network model fuses the sample merchant attribute information, sample time information, and sample location information to obtain a fused composite behavior sequence. Based on this composite behavior sequence, the user's interest representation sequence for the next time step is predicted. This interest representation sequence represents the merchant attribute information that the user is interested in. The interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant are fused to obtain fused information. Then, the click-through rate of the exposed merchant is predicted based on the fused information. Finally, based on the interest representation sequence, click-through rate, and sample data, the target loss function of the neural network model is determined. The neural network model is iteratively trained based on the target loss function to obtain a sequence recommendation model. As can be seen, when training the sequence recommendation model, this application not only relies on the interaction behavior information between users and merchants, but also deeply integrates the time information of user-merchant interaction and the location information of merchants into the interaction behavior information to construct a contextualized event sequence. This enables the neural network model to directly perform calculations on the complete information unit of "what the user interacted with in what context" at every moment, ensuring that the model can perceive "what the user interacted with" and "in what context" at every moment. This allows the model to capture the dynamic evolution pattern of user interests more accurately, and further enables the trained sequence recommendation model to accurately predict user interests based on specific contexts.
[0073] Figure 2 The diagram illustrates the principle of the training method for the sequence recommendation model provided in this application embodiment, as shown below. Figure 2 As shown, the neural network model to be trained includes an embedding network, a generative network, and a classification network. The embedding network (also known as Embedding Lookup) is configured with a pre-trained embedding table. After inputting sample data, the embedding network can look up the corresponding vector representation of the sample data from the pre-trained embedding table based on the discrete features of the sample data, thereby transforming the discrete features into continuous low-dimensional vectors. This allows the neural network module to perform subsequent feature learning and computation based on the low-dimensional vectors. In this embodiment, the embedding network is also used to fuse the various input sample data to obtain a composite sample behavior sequence. The generative network (such as a Transformer) is used to perform generative tasks, i.e., predicting the user's interest representation sequence at the next time step based on the composite sample behavior sequence, and transmitting the predicted interest representation sequence to the embedding network. The embedding network then fuses the interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant to obtain fused information, which is then transmitted to the classification network (such as a Rank Head). The classification network is used to perform discriminative tasks, i.e., predicting the user's click-through rate for the exposed merchant based on the fused information.
[0074] In some embodiments, step S103 may be performed as follows: determining the target loss function of the neural network model based on the interest representation sequence, click-through rate, and sample data; iteratively adjusting the network parameters of the generator network and the classification network based on the target loss function to obtain a sequence recommendation model. The target loss function includes a first loss function and a second loss function. The first loss function represents the prediction accuracy of the generator network for the interest representation sequence, and the second loss function represents the prediction accuracy of the classification network for the click-through rate.
[0075] Figure 2 The neural network model shown can be trained using either joint training or a two-stage training approach. Joint training involves training the generative network's generative task and the classification network's discriminative task together end-to-end. At each time step of model training, the interest representation sequence generated by the generative network is passed to the classification network, allowing the generative and discriminative tasks to share contextual information such as time, merchant attributes, and spatial location, thus achieving end-to-end optimization of user interest representations. Two-stage training involves first pre-training the generative network separately. After pre-training, the network parameters of the generative network are frozen, and the frozen generative network is then transferred to the discriminative task to fine-tune the network parameters of the classification network.
[0076] The following will be based on Figure 2 The model structure of the neural network model is shown, and the training process of the sequence recommendation model is explained in detail, including joint training and two-stage training methods.
[0077] In some embodiments, when the neural network model fuses sample merchant attribute information, sample time information, and sample location information, it performs the following steps: according to preset rules, it concatenates the sample merchant attribute information, sample time information, and sample location information corresponding to the first time step to obtain the sample composite behavior sequence of the first time step. Here, the first time step can be any one of multiple time steps.
[0078] Taking any time step t as an example, the neural network model transforms the sample merchant attribute information, sample time information, and sample location information at time t into vector forms respectively, and then concatenates the vectors corresponding to the sample merchant attribute information, sample time information, and sample location information into a unified composite vector. That is, the sample merchant attribute information, sample time information, and sample location information corresponding to any time step will be concatenated into a composite vector by the neural network model, thereby ensuring that the neural network can perceive what the user "interacted with" and "in what context" at every moment.
[0079] The preset rules can be pre-defined concatenation rules, such as concatenating sample merchant attribute information, sample time information, and sample location information sequentially to obtain a composite behavioral sequence. Alternatively, the preset rules can be pre-defined transformation and concatenation rules, such as converting the sample merchant attribute information, sample time information, and sample location information into hash value representations, and then concatenating the hash values corresponding to these information in the order they appear to be to obtain the composite behavioral sequence.
[0080] Optionally, when the neural network model predicts the user's interest representation sequence at the next time step based on the sample composite behavior sequence, it performs the following steps: predicting the user's interest representation sequence at the second time step based on the sample composite behavior sequence at the first time step and the sample composite behavior sequences corresponding to each time step preceding the first time step. Here, the second time step is the next time step after the first time step.
[0081] In this embodiment, by fusing sample merchant attribute information, sample time information of user interactions with sample merchants, and sample merchant location information, the generation network can better understand when and where users interacted with which merchants. This allows for more accurate prediction of users' next points of interest, i.e., interest representation sequences. Furthermore, it supplements the classification network with contextual information; for example, users in "weekends + specific areas" may have higher click-through rates for certain categories of merchants. Rich contextual features enable the neural network model to learn more granular and realistic user interests.
[0082] In some embodiments, to train a powerful generative network, the generative network can employ an efficient Transformer structure. Furthermore, the Transformer structure uses Pre-Normalization and RMSNorm (Root Mean Square Normalization) to avoid gradient explosion or vanishing during training, ensuring model stability and convergence speed during training.
[0083] Furthermore, the positional encoding in the Transformer structure can use RoPE (Rotated Position Encoding) to adapt to user behavior sequences of different lengths and enhance the modeling of relative positional relationships, such as the correlation between the composite behavior sequence at time step t and the composite behavior sequence at time step t-3, thus better reflecting the temporal characteristics of user behavior sequences. The activation function in the Transformer structure can employ SwiGLU to improve nonlinear expressive power.
[0084] Optionally, in terms of training, the self-attention mechanism in the generative network employs a causal mask. The causal mask ensures that when predicting position t, the generative network can only rely on historical information from time step 1 to time step t-1, becoming a one-way generator. The optimization objective of the generative network is to predict the interest point at time step t, i.e., the interest representation sequence, based on the user's composite behavioral sequence over the previous t-1 time steps.
[0085] Figure 3 The diagram illustrates the principle of the prediction method of the generative network provided in the embodiments of this application, as follows: Figure 3As shown, time1, time2, and time3 represent consecutive time steps in the model training process. The circles labeled s1, s2, and s3 represent the merchant attribute information of the samples at different time steps, and the circles labeled f1, f2, and f3 represent the sample time information and sample location information at different time steps, respectively. The circles with diagonal lines represent information that cannot be "seen" by the generative network. For example, at time step 1, the generator network predicts the interest representation sequence x2 corresponding to time step 2 based on the sample merchant attribute information s1, sample time information, and sample location information f1 of t1; at time step 2, the generator network predicts the interest representation sequence x3 corresponding to time step 3 based on the sample merchant attribute information s1, sample time information, and sample location information f1 of t1, and the sample merchant attribute information s2, sample time information, and sample location information f2 of t2; at time step 3, the generator network predicts the interest representation sequence x4 corresponding to time step 4 based on the sample merchant attribute information s1, sample time information, and sample location information f1 of t1, the sample merchant attribute information s2, sample time information, and sample location information f2 of t2, and the sample merchant attribute information s3, sample time information, and sample location information f3 of t3; and so on.
[0086] In some embodiments, after the generator network transmits the predicted interest representation sequence to the embedding network, the embedding network fuses the interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant. The fusion method used here is the same as the fusion method used to fuse the sample merchant attribute information, sample time information, and sample location information, to ensure that the neural network model can perform calculations based on the composite behavioral sequence and fused information in a consistent format, which is beneficial for the model to converge quickly.
[0087] The embedded network transmits the fused information to the classification network, which then predicts the click-through rate (CTR) of users for the exposed merchants. Optionally, in each iteration, after receiving the fused information, the classification network performs a forward propagation based on the fused information and outputs the CTR of users for the exposed merchants. The classification network can be a fully connected MLP.
[0088] Figure 4 The diagram illustrates the principle of the prediction method of the classification network provided in the embodiments of this application, as follows: Figure 4As shown, time1, time2, and time3 represent the time steps in the model training process. The circles labeled s1, s2, and s3 represent the first merchant attribute information of the exposed merchants at different time steps, respectively. The circles labeled f1, f2, and f3 represent the current time information and the first position information of the exposed merchants at different time steps, respectively. The circles with diagonal lines represent information that cannot be "seen" by the classification network. For example, at time step 1, the classification network predicts the user's click-through rate for the exposed merchant based on the first merchant attribute information s1 of the exposed merchant at time t1, the current time information, the first location information f1 of the exposed merchant, and the predicted interest representation sequence x2 for the next time step; at time step 2, the classification network predicts the user's click-through rate for the exposed merchant based on the first merchant attribute information s2 of the exposed merchant at time t2, the current time information, the first location information f2 of the exposed merchant, and the predicted interest representation sequence x3 for the next time step; at time step 3, the classification network predicts the user's click-through rate for the exposed merchant based on the first merchant attribute information s3 of the exposed merchant at time t3, the current time information, the first location information f3 of the exposed merchant, and the predicted interest representation sequence x4 for the next time step; and so on. Figure 4 The click-through rates shown (e.g., 0.65, 0.12, 0.83) are merely illustrative examples and are not intended to be limiting.
[0089] Figure 5 The diagram illustrates the principle of training a sequence recommendation model using a joint training method, as provided in an embodiment of this application. Figure 5 As shown, the neural network model to be trained includes an embedding network, a generative network, and a classification network. The roles and functions of each network are explained below. Figure 2 The corresponding networks in the neural network model shown have the same function, so it will not be repeated here. During training, sample data is first input into the embedding network. The embedding network fuses the sample data for each time step to obtain a composite behavior sequence for each time step, and then transmits this composite behavior sequence to the generator network. Assume the embedding network fuses the sample data for time step t to obtain a composite behavior sequence for time step t, and then transmits this sequence to the generator network. Next, the generator network predicts the interest representation sequence for the next time step t+1 based on the composite behavior sequence for any given time step t, and transmits this sequence to the embedding network. The embedding network then fuses the interest representation sequence for the next time step t+1, the merchant attribute information of the exposed merchants at the current time step t, the location information of the exposed merchants, and the current time information to obtain the fused information for the current time step t, and transmits this fused information to the classification network. The classification network predicts the click-through rate of users for the exposed merchants based on the fused information for the current time step t.
[0090] In this embodiment, when executing step S103, the following steps A1 to A4 are performed:
[0091] Step A1: At any time step among multiple time steps, determine the first loss function based on the interest representation sequence corresponding to that time step and the sample merchant attribute information in the sample data corresponding to that time step.
[0092] Optionally, the first loss function can be calculated using the negative log-likelihood loss method.
[0093] Step A2: Determine the second loss function based on the click-through rate corresponding to the time step and the merchant attribute information of the sample data corresponding to the time step.
[0094] Step A3: Determine the target loss function based on the first loss function and the second loss function.
[0095] Optionally, the target loss function can be obtained by weighting the first loss function and the second loss function according to their respective weights.
[0096] Step A4: Adjust the network parameters of the generator network and the classification network according to the objective loss function to obtain the sequence recommendation model.
[0097] As can be seen, in the joint training method, the neural network model treats the generative task and the discriminative task as a multi-task learning problem. The model's total loss function is composed of a weighted sum of the first loss function of the generative network and the second loss function of the classification network. This allows the gradient from the downstream discriminative task to propagate back and update the network parameters of the entire generative network.
[0098] In the two-stage training approach, the first stage is an independent pre-training process for the generative network. The second stage involves transferring the pre-trained generative network to the downstream discriminative task, adjusting only the network parameters of the classification network. In the second stage, input sample data is fed into the embedding network, which fuses the sample data for each time step to obtain the composite behavior sequence for each time step. This composite behavior sequence is then transmitted to the pre-trained generative network. Subsequently, the pre-trained generative network predicts the interest representation sequence for the next time step t+1 based on the composite behavior sequence of the samples at any given time step t. Because the generative network is pre-trained, it possesses strong context awareness capabilities, acting solely as a static feature extractor to provide the downstream classification model with the user's interest representation sequence at each time step.
[0099] In this embodiment, when executing step S103, the following steps B1 to B3 are performed:
[0100] Step B1: Determine the first loss function based on the interest representation sequence and the sample merchant attribute information, and iteratively adjust the network parameters of the generator network according to the first loss function to obtain the trained generator network.
[0101] Step B2: Freeze the network parameters of the generated network after training.
[0102] Step B3: With the network parameters of the generator network frozen after training, determine the second loss function based on the predicted click-through rate and sample merchant attribute information. Iteratively adjust the network parameters of the classification network according to the second loss function to obtain the sequence recommendation model.
[0103] As can be seen, in the two-stage training approach, the generator network is first pre-trained separately. After pre-training, the network parameters of the generator network are frozen. The generator network with frozen parameters is then transferred to the discriminative task, and only the network parameters of the classification network are fine-tuned. This approach can significantly alleviate the overfitting problem caused by the downstream classification network learning sparse features from scratch, and significantly accelerate the convergence speed. Furthermore, this training method gives the model stronger generalization ability. For cold-start or low-frequency merchants, the model can activate historical interests in similar situations through their contextual features, achieving cross-merchant knowledge transfer.
[0104] Figure 6 A flowchart of the sequence recommendation method provided in an embodiment of this application is shown, as follows: Figure 6 As shown, the method may include steps S601, S602 and S603.
[0105] Step S601: Obtain the target user's pending data, which includes: the target user's user behavior sequence in the historical time period, the merchant attribute information of the exposed merchant, the location information of the exposed merchant, and the current time information.
[0106] The target user can be any user. The user behavior sequence represents the target user's interaction behavior with at least one merchant across multiple time steps. Based on the user behavior sequence, the target user's first data within a historical time period can be generated. The first data includes the merchant attribute information of the first merchant that the target user interacted with at multiple time steps, the time information of the interaction with the first merchant, and the location information of the first merchant.
[0107] Merchant attribute information may include at least one of the following: merchant name, merchant unique identifier, merchant category, etc.
[0108] Step S602: Input the data to be processed into a pre-trained sequence recommendation model for processing to obtain the click-through rate of the target user for the exposed merchant.
[0109] The sequence recommendation model is trained according to the training method of the sequence recommendation model provided in any of the above embodiments.
[0110] Optionally, when the sequence recommendation model receives the data to be processed, it first fuses the merchant attribute information of the first merchant, the time information of the interaction between the target user and the first merchant, and the location information of the first merchant through an embedding network to obtain a composite behavior sequence of the target user. This composite behavior sequence is then transmitted to a generator network. Based on the composite behavior sequence of the target user, the generator network predicts the target user's next point of interest, i.e., the interest representation sequence for the next time step. This predicted interest representation sequence is then transmitted to the embedding network, which fuses the predicted interest representation sequence, the merchant attribute information of the exposed merchants, the location information of the exposed merchants, and the current time information to obtain fused information. This fused information is then transmitted to a classification network. Finally, based on the fused information, the classification network predicts the target user's click-through rate for the exposed merchants.
[0111] Step S603: Recommend merchants to the target users based on their click-through rate on the exposed merchants.
[0112] According to the technical solution of the embodiments of this application, since the sequence recommendation model has a strong context awareness capability, it can perceive what the user "interacted with" and "in what context" based on the user behavior sequence within a historical period. Therefore, it can capture the dynamic interest evolution pattern of the user more accurately, thereby accurately predicting the user's next point of interest and accurately recommending merchants that the user is interested in.
[0113] Corresponding to the application scenarios and methods provided in the embodiments of this application, the embodiments of this application also provide a training device for a sequence recommendation model and a sequence recommendation device.
[0114] Figure 7 A block diagram of the training apparatus for the sequence recommendation model provided in an embodiment of this application is shown, as follows: Figure 7 As shown, the training apparatus for the sequence recommendation model includes:
[0115] The generation module 71 is used to generate sample data based on the user behavior sequence within a historical time period; the user behavior sequence is used to represent the user's interaction behavior with the sample merchant at multiple time steps; the sample data includes: the sample merchant attribute information of the sample merchant, the sample time information of the user's interaction with the sample merchant, and the sample location information of the sample merchant.
[0116] The prediction module 72 is used to input the sample data into a neural network model to be trained, and to fuse the sample merchant attribute information, the sample time information, and the sample location information through the neural network model to obtain a fused sample composite behavior sequence; based on the sample composite behavior sequence, to predict the user's interest representation sequence at the next time step; to fuse the interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant to obtain fused information; and to predict the user's click-through rate on the exposed merchant based on the fused information; the interest representation sequence is used to represent the merchant attribute information that the user is interested in.
[0117] Training module 73 is used to determine the target loss function of the neural network model based on the interest representation sequence, the click rate, and the sample data, and to iteratively train the neural network model according to the target loss function to obtain a sequence recommendation model; the target loss function is used to represent at least one of the following: the prediction accuracy of the neural network model for the interest representation sequence, and the prediction accuracy of the neural network model for the click rate.
[0118] Optionally, when the prediction module 72 fuses the sample merchant attribute information, the sample time information, and the sample location information to obtain the fused sample composite behavior sequence, it performs the following steps:
[0119] According to preset rules, the sample merchant attribute information, sample time information and sample location information corresponding to the first time step are concatenated to obtain the sample composite behavior sequence of the first time step; the first time step is any one of the plurality of time steps.
[0120] Optionally, when predicting the user's interest representation sequence at the next time step based on the sample composite behavior sequence, the prediction module 72 performs the following steps:
[0121] Based on the sample composite behavior sequence at the first time step and the sample composite behavior sequences corresponding to each time step preceding the first time step, the user's interest representation sequence at the second time step is predicted; the second time step is the next time step after the first time step.
[0122] Optionally, the neural network model includes: a generative network and a classification network;
[0123] When the training module 73 determines the target loss function of the neural network model based on the interest representation sequence, the click rate, and the sample data, and iteratively trains the neural network model according to the target loss function to obtain the sequence recommendation model, it performs the following steps:
[0124] Based on the interest representation sequence, the click rate, and the sample data, the target loss function of the neural network model is determined. Based on the target loss function, the network parameters of the generator network and the classification network are iteratively adjusted to obtain the sequence recommendation model.
[0125] The target loss function includes a first loss function and a second loss function; the first loss function is used to represent the prediction accuracy of the generative network for the interest representation sequence; and the second loss function is used to represent the prediction accuracy of the classification network for the click rate.
[0126] Optionally, when the training module 73 determines the target loss function of the neural network model based on the interest representation sequence, the click rate, and the sample data, and iteratively adjusts the network parameters of the generator network and the classification network based on the target loss function to obtain the sequence recommendation model, it performs the following steps:
[0127] At any of the plurality of time steps, the first loss function is determined based on the interest representation sequence corresponding to the time step and the sample merchant attribute information in the sample data corresponding to the time step.
[0128] The second loss function is determined based on the click-through rate corresponding to the time step and the sample merchant attribute information in the sample data corresponding to the time step.
[0129] The target loss function is determined based on the first loss function and the second loss function;
[0130] The network parameters of the generator network and the classification network are adjusted according to the target loss function to obtain the sequence recommendation model.
[0131] Optionally, when the training module 73 determines the target loss function of the neural network model based on the interest representation sequence, the click rate, and the sample data, and iteratively adjusts the network parameters of the generator network and the classification network based on the target loss function to obtain the sequence recommendation model, it performs the following steps:
[0132] Based on the interest representation sequence and the sample merchant attribute information, the first loss function is determined, and the network parameters of the generator network are iteratively adjusted according to the first loss function to obtain the trained generator network.
[0133] Freeze the network parameters of the trained generative network;
[0134] With the network parameters of the trained generator network frozen, the second loss function is determined based on the click-through rate and the sample merchant attribute information. The network parameters of the classification network are then iteratively adjusted based on the second loss function to obtain the sequence recommendation model.
[0135] According to the apparatus of this application embodiment, sample data is first generated based on user behavior sequences within a historical time period. The user behavior sequences represent user interactions with sample merchants at multiple time steps. The sample data includes sample merchant attribute information, sample time information of user interactions with sample merchants, and sample merchant location information. Next, the sample data is input into a neural network model to be trained. The neural network model fuses the sample merchant attribute information, sample time information, and sample location information to obtain a fused composite behavior sequence. Based on the composite behavior sequence, the user's interest representation sequence for the next time step is predicted. This interest representation sequence represents the merchant attribute information that the user is interested in. The interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant are fused to obtain fused information. Then, the click-through rate of the exposed merchant is predicted based on the fused information. Finally, based on the interest representation sequence, click-through rate, and sample data, the target loss function of the neural network model is determined. The neural network model is iteratively trained based on the target loss function to obtain a sequence recommendation model. As can be seen, when training the sequence recommendation model, this application not only relies on the interaction behavior information between users and merchants, but also deeply integrates the time information of user-merchant interaction and the location information of merchants into the interaction behavior information to construct a contextualized event sequence. This enables the neural network model to directly perform calculations on the complete information unit of "what the user interacted with in what context" at every moment, ensuring that the model can perceive "what the user interacted with" and "in what context" at every moment. This allows the model to capture the dynamic evolution pattern of user interests more accurately, and further enables the trained sequence recommendation model to accurately predict user interests based on specific contexts.
[0136] The functions of each module in each device in the embodiments of this application can be found in the corresponding description in the above method, and they have corresponding beneficial effects, which will not be repeated here.
[0137] Figure 8A block diagram of the training apparatus for the sequence recommendation model provided in an embodiment of this application is shown, as follows: Figure 8 As shown, the training apparatus for the sequence recommendation model includes:
[0138] The acquisition module 81 is used to acquire the pending data of the target user; the pending data includes: the user behavior sequence of the target user in the historical time period, the merchant attribute information of the exposed merchant, the location information of the exposed merchant, and the current time information;
[0139] The processing module 82 is used to input the data to be processed into a pre-trained sequence recommendation model for processing, so as to obtain the click-through rate of the target user for the exposed merchant; wherein, the sequence recommendation model is trained according to the training method of the sequence recommendation model described in any of the above embodiments;
[0140] The recommendation module 83 is used to recommend merchants to the target user based on the click-through rate.
[0141] According to the apparatus of this application embodiment, since the sequence recommendation model has a strong context awareness capability, it can perceive what the user "interacted with" and "in what context" based on the user behavior sequence within a historical period. Therefore, it can capture the dynamic interest evolution pattern of the user more accurately, thereby accurately predicting the user's next point of interest and accurately recommending merchants that the user is interested in.
[0142] The functions of each module in each device in the embodiments of this application can be found in the corresponding description in the above method, and they have corresponding beneficial effects, which will not be repeated here.
[0143] Figure 9 This is a block diagram for implementing the electronic device provided in the embodiments of this application. Figure 9 As shown, the electronic device includes a memory 901 and a processor 902. The memory 901 stores a computer program that can run on the processor 902. When the processor 902 executes the computer program, it implements the method described in the above embodiments. The number of memories 901 and processors 902 can be one or more. In a specific implementation, the electronic device may also include a communication interface 903 for communicating with external devices and exchanging data.
[0144] In practical implementation, if the memory 901, processor 902, and communication interface 903 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0145] Optionally, in a specific implementation, if the memory 901, processor 902, and communication interface 903 are integrated on a single chip, then the memory 901, processor 902, and communication interface 903 can communicate with each other through an internal interface.
[0146] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this application.
[0147] This application provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in this application.
[0148] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform the method provided in this application.
[0149] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.
[0150] It should be understood that the aforementioned processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (ARM) architecture.
[0151] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0152] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0153] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0154] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0155] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0156] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0157] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0158] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0159] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A training method for a sequence recommendation model, characterized in that, include: Generate sample data based on user behavior sequences within historical time periods; The user behavior sequence is used to represent the user's interaction behavior between multiple time steps and sample merchants; The sample data includes: the sample merchant attribute information of the sample merchant, the sample time information of the interaction between the user and the sample merchant, and the sample location information of the sample merchant. The sample data is input into a neural network model to be trained. The neural network model fuses the sample merchant attribute information, the sample time information, and the sample location information to obtain a fused sample composite behavior sequence. Based on the sample composite behavior sequence, the user's interest representation sequence at the next time step is predicted. The interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant are fused to obtain fused information. Based on the fused information, the user's click-through rate on the exposed merchant is predicted. The interest representation sequence is used to represent the merchant attribute information that the user is interested in. Based on the interest representation sequence, the click-through rate, and the sample data, a target loss function for the neural network model is determined. The neural network model is then iteratively trained based on the target loss function to obtain a sequence recommendation model. The target loss function represents at least one of the following: the prediction accuracy of the neural network model for the interest representation sequence and the prediction accuracy of the neural network model for the click-through rate.
2. The method according to claim 1, characterized in that, The process of fusing the sample merchant attribute information, the sample time information, and the sample location information to obtain the fused sample composite behavior sequence includes: According to preset rules, the sample merchant attribute information, sample time information and sample location information corresponding to the first time step are concatenated to obtain the sample composite behavior sequence of the first time step; the first time step is any one of the plurality of time steps.
3. The method according to claim 2, characterized in that, The step of predicting the user's interest representation sequence at the next time step based on the sample composite behavior sequence includes: Based on the sample composite behavior sequence at the first time step and the sample composite behavior sequences corresponding to each time step preceding the first time step, the user's interest representation sequence at the second time step is predicted; the second time step is the next time step after the first time step.
4. The method according to claim 1, characterized in that, The neural network model includes: a generative network and a classification network; The step of determining the target loss function of the neural network model based on the interest representation sequence, the click-through rate, and the sample data, and iteratively training the neural network model according to the target loss function to obtain a sequence recommendation model includes: Based on the interest representation sequence, the click rate, and the sample data, the target loss function of the neural network model is determined. Based on the target loss function, the network parameters of the generator network and the classification network are iteratively adjusted to obtain the sequence recommendation model. The target loss function includes a first loss function and a second loss function; the first loss function is used to represent the prediction accuracy of the generative network for the interest representation sequence; and the second loss function is used to represent the prediction accuracy of the classification network for the click rate.
5. The method according to claim 4, characterized in that, The step of determining the target loss function of the neural network model based on the interest representation sequence, the click-through rate, and the sample data, and iteratively adjusting the network parameters of the generator network and the classification network based on the target loss function to obtain the sequence recommendation model includes: At any of the plurality of time steps, the first loss function is determined based on the interest representation sequence corresponding to the time step and the sample merchant attribute information in the sample data corresponding to the time step. The second loss function is determined based on the click-through rate corresponding to the time step and the sample merchant attribute information in the sample data corresponding to the time step. The target loss function is determined based on the first loss function and the second loss function; The network parameters of the generator network and the classification network are adjusted according to the target loss function to obtain the sequence recommendation model.
6. The method according to claim 4, characterized in that, The step of determining the target loss function of the neural network model based on the interest representation sequence, the click-through rate, and the sample data, and iteratively adjusting the network parameters of the generator network and the classification network based on the target loss function to obtain the sequence recommendation model includes: Based on the interest representation sequence and the sample merchant attribute information, the first loss function is determined, and the network parameters of the generator network are iteratively adjusted according to the first loss function to obtain the trained generator network. Freeze the network parameters of the trained generative network; With the network parameters of the trained generator network frozen, the second loss function is determined based on the click-through rate and the sample merchant attribute information. The network parameters of the classification network are then iteratively adjusted based on the second loss function to obtain the sequence recommendation model.
7. A sequence recommendation method, characterized in that, include: Obtain the target user's pending data; The data to be processed includes: the user behavior sequence of the target user in the historical time period, the merchant attribute information of the exposed merchant, the location information of the exposed merchant, and the current time information; The data to be processed is input into a pre-trained sequence recommendation model for processing to obtain the click-through rate of the target user for the exposed merchant; wherein, the sequence recommendation model is trained according to the training method of the sequence recommendation model according to any one of claims 1 to 6; Based on the click-through rate, merchants are recommended to the target users.
8. A training device for a sequence recommendation model, characterized in that, include: The generation module is used to generate sample data based on user behavior sequences within historical time periods; The user behavior sequence is used to represent the user's interaction behavior between multiple time steps and sample merchants; The sample data includes: the sample merchant attribute information of the sample merchant, the sample time information of the interaction between the user and the sample merchant, and the sample location information of the sample merchant. The prediction module is used to input the sample data into a neural network model to be trained, and to fuse the sample merchant attribute information, sample time information, and sample location information through the neural network model to obtain a fused sample composite behavior sequence; based on the sample composite behavior sequence, to predict the user's interest representation sequence at the next time step; to fuse the interest representation sequence, the first merchant attribute information of the exposed merchant, the current time information, and the first location information of the exposed merchant to obtain fused information; and to predict the user's click-through rate on the exposed merchant based on the fused information; the interest representation sequence is used to represent the merchant attribute information that the user is interested in. The training module is used to determine the target loss function of the neural network model based on the interest representation sequence, the click rate, and the sample data, and to iteratively train the neural network model according to the target loss function to obtain a sequence recommendation model; the target loss function is used to represent at least one of the following: the prediction accuracy of the neural network model for the interest representation sequence, and the prediction accuracy of the neural network model for the click rate.
9. A sequence recommendation device, characterized in that, include: The acquisition module is used to acquire the data to be processed from the target user. The data to be processed includes: the user behavior sequence of the target user in the historical time period, the merchant attribute information of the exposed merchant, the location information of the exposed merchant, and the current time information; A processing module is used to input the data to be processed into a pre-trained sequence recommendation model for processing, so as to obtain the click-through rate of the target user for the exposed merchant; wherein the sequence recommendation model is trained according to the training method of the sequence recommendation model according to any one of claims 1 to 6; The recommendation module is used to recommend merchants to the target user based on the click-through rate.
10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.
12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multimedia resource recommendation method and device and storage medium
CN109189951A
Recommendation model training method and device, content recommendation method and device and electronic equipment
CN115329216A