Sequence recommendation method based on adaptive global graph modeling and intention contrast learning

Through adaptive global graph modeling and intent comparison learning, the lack of generalization ability caused by single analysis dimensions in the prior art is solved, and better recommendation results and user experience are achieved.

CN119577240AActive Publication Date: 2025-03-07SOUTHWEST UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411617808.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-07
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

The existing sequence recommendation technology has a single dimension, which leads to insufficient generalization ability of recommendation results, affecting user behavior prediction and user experience.

Method used

A sequence recommendation method based on adaptive global graph modeling and intent comparison learning is adopted. By obtaining user historical behavior data, the association graph is constructed, and the outputs of local and global modules are integrated, and intent comparison learning is performed to optimize the recommendation results.

Benefits of technology

It improves the recommendation effect in the case of noise and data sparseness, improves the user experience, and enhances the robustness and generalization ability of the sequence recommendation method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577240A_ABST
    Figure CN119577240A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence optimization operation systems, and particularly discloses a sequence recommendation method based on adaptive global graph modeling and intention contrast learning, the method comprises the steps of sequence global graph construction, module output fusion, sequence recommendation learning and recommendation result optimization, and the method comprises the steps of firstly obtaining a user historical behavior sequence; the method comprises the following steps: constructing an association graph, improving and optimizing the association graph to obtain and record a user behavior sequence global graph, and respectively injecting the user behavior sequence global graph into a local module and a global module of a sequence encoder, so that the outputs of the local module and the global module are fused, and the sequence encoder can comprehensively learn intentions with more expressive power, so as to carry out intention contrast learning; according to the method, the sequence recommendation of the user is comprehensively obtained, the user is predicted, the sequence recommendation of adaptive global graph modeling and intention contrast learning is completed, the recommendation effect under the noise condition and the data sparse condition is improved, the user experience is improved, and the robustness and generalization ability of the sequence recommendation method are enhanced in multiple dimensions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence optimized operating systems, and specifically to a sequence recommendation method based on adaptive global graph modeling and intent contrast learning. Background Art

[0002] With the widespread application of online recommendation systems, how to accurately capture user intentions and provide personalized recommendations has become an important research direction. Traditional recommendation systems mostly rely on users' historical behavior data. However, this approach often ignores the deep meaning of user intentions and the high-order relationships between items. Therefore, it is particularly important to study a recommendation model that combines global information and personalized features.

[0003] For example, the invention patent with announcement number CN111967941B announces a method for constructing a sequence recommendation model and a sequence recommendation method. The method for constructing a sequence recommendation model includes: constructing a first sequence recommendation model and a second sequence recommendation model, wherein the first sequence recommendation model is provided with a plurality of hole convolution residual blocks, and the second sequence recommendation model comprises lightweight hole convolution residual blocks corresponding one to one to the first sequence recommendation model; training the first sequence recommendation model to obtain a pre-trained first sequence recommendation model; collaboratively training the second sequence recommendation model and the pre-trained first sequence recommendation model, and making the second sequence recommendation model learn the behavior of the pre-trained first sequence recommendation model; and constructing a sequence recommendation model for predicting recommendation items based on the collaboratively trained second sequence recommendation model.

[0004] For example, the invention patent with announcement number CN113762477B announces a method for constructing a sequence recommendation model and a sequence recommendation method, including: constructing an adaptive adjacency matrix of the input sequence, and constructing the first embedding of the project based on the adaptive adjacency matrix; constructing the second embedding of the project based on the adjacency matrix of the graph neural network; constructing the user's local interest model through the attention mechanism based on the first embedding of the project and the second embedding of the project; constructing the user's global interest model and the embedding of the target sequence, and constructing a sequence recommendation model based on the embedding of the target sequence, the user's local interest model and the global interest model; constructing the loss function of the sequence recommendation model based on gradient descent and Bayesian personalized sorting.

[0005] Combining the above technical solutions, it is found that there are sequential recommendation technical solutions, whose analysis dimension of sequential recommendation is relatively single, which may lead to insufficient generalization ability of recommendation results, thus affecting the prediction of user behavior and ultimately affecting user usage. Summary of the invention

[0006] In view of the deficiencies in the prior art, the present invention provides a sequence recommendation method based on adaptive global graph modeling and intent contrast learning, which can effectively solve the problems involved in the above-mentioned background technology.

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a sequence recommendation method based on adaptive global graph modeling and intention contrast learning, including: S1. Acquire historical interaction data between users and items, and sort them based on rules to obtain user historical behavior sequences, construct them into association graphs, improve and optimize the association graphs, obtain and record them as user behavior sequence global graphs; S2. Divide the user behavior sequence global graph into user behavior sequence subgraphs, combine them with user embedding, and inject them into the local module of the sequence encoder, inject the user behavior sequence global graph into the global module of the sequence encoder, fuse the outputs of the local module and the global module, and obtain the representation of the user behavior sequence; S3. Through the sequence encoder, extract the user intent from the user behavior sequence, compare and learn with the representation of the user behavior sequence, compare and learn the representation of the user behavior sequence with the representations of other user behavior sequences, and comprehensively obtain the user's sequence recommendation; S4. Based on the user's sequence recommendation, predict the user, and optimize the sequence recommendation according to the prediction results, so as to complete the sequence recommendation of adaptive global graph modeling and intention contrast learning.

[0008] As a further method, the rule-based sorting is performed to obtain a user historical behavior sequence, which is constructed as an association graph. The specific analysis process is as follows: the rule is specifically sorted according to the time sequence of each historical interaction time point; the historical interaction data between the user and the item is specifically the interaction data between the user and the item at each historical interaction time point; the user historical behavior sequence is obtained, specifically the interaction data between the user and the item at each historical interaction time point is sorted according to the time sequence of each historical interaction time point, and obtained and recorded as each user historical behavior subsequence, so that the set of each user historical behavior subsequence is called the user historical behavior sequence; the user historical behavior sequence is divided into a project set and a relationship set between the user and the project; the construction is specifically connected to connect the project set in the user historical behavior sequence and the relationship set between the user and the project in a predefined manner, and the specific expression is: association graph G = (V, E), where V is the project set, E = e(i, j is the relationship set between the user and the project, e(i, j) represents the relationship between vertex i and vertex j of the e-th edge in the association graph, e = 1, 2, 3, ..., E.

[0009] As a further method, the association graph is improved and optimized to obtain and record as a global graph of user behavior sequence. The specific analysis process is as follows: the association graph is improved and optimized, specifically, the association graph is optimized by using a lightweight graph convolutional network as a graph encoder to obtain and record as a global graph of user behavior sequence; the global graph representation of the user behavior sequence is obtained by embedding the association graphs from each L layer of the lightweight graph convolutional network through the graph encoder, as shown below:

[0010]

[0011] In the formula, is the global graph representation of user behavior sequence, E (0) is the association graph representation of the 0th layer, E (r) Represented as the association graph representation of the rth layer, E (L) is the association graph representation of the Lth layer, L is the specific level representation in the lightweight graph convolutional network, r = 0, 2, 3, ..., L, r represents any level in the lightweight graph convolutional network.

[0012] As a further method, the output of the local module and the global module are fused to obtain the representation of the user behavior sequence. The specific analysis process is: obtain the position weight of each position point p in the global graph of the user behavior sequence, denoted as I p ; The output representation of the fusion layer is constructed as:

[0013]

[0014] In the formula, H u is the output of the fusion layer, I p is the importance of the item at position p for predicting user intent, Denoted as the local module output of the sequence encoder, is the global module output of the sequence encoder; the representation of the user behavior sequence is obtained, specifically The last vector in is used as the representation of user sequence, where

[0015] As a further method, the user intention is compared with the representation of the user behavior sequence. The specific analysis process is as follows: two vectors of the global graph of the user behavior sequence in the vector space are obtained, which are recorded as h1 and h2 respectively; the intention prototype with the smallest distance from the vectors h1 and h2 in the vector space is used as the intentions i1 and i2 of the two vectors respectively; the comparison learning task between the representation of the user behavior sequence and the user intention is constructed as follows:

[0016] L Intent_cl =L cl (h1,i1)+Lcl (h2,i2);

[0017] Where, L Intent_cl It is represented as the contrastive learning between the representation of user behavior sequence and user intention, L cl It is represented as a user behavior sequence, h1 and h2 are represented as the distance in the vector space, i1 and i2 are represented as the intention prototypes with the smallest distance to h1 and h2, and are taken as user intentions.

[0018] As a further method, the representation of the user behavior sequence is compared with the representation of other user behavior sequences. The specific analysis process is: obtain the current sequence of the user behavior sequence, recorded as S1; for the current sequence S1, randomly sample from the sequence with the same label to obtain the sequence S2 with the same intention, which is used as the comparison between the sequences. The learning task is constructed as follows:

[0019] L Seq_cl =L cl (h1,h2);

[0020] Where, L Seq_cl is the comparison between user behavior sequences, L cl is a user behavior sequence, h1 and h2 are represented as two vectors in the vector space.

[0021] As a further method, the user-based sequence recommendation predicts the user, and the specific analysis process is: the user prediction is specifically given a sequence representation h u and the item embedding matrix V, the prediction score is calculated as follows:

[0022]

[0023] in is the prediction score, h u For a given sequence representation, V T is the transpose of the item embedding matrix, R V| is the determinant representation of the target embedding matrix, softmax is represented as the normalization function; the cross entropy loss is optimized to maximize the probability of correct prediction:

[0024]

[0025] Where, L Rec is the accuracy of the prediction for the user, g∈V is the real item of the next interaction of user u, j is the predicted item of the next interaction of user u, j∈V.

[0026] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

[0027] (1) The present invention provides a sequence recommendation method based on adaptive global graph modeling and intent contrast learning. First, the user's historical behavior sequence is obtained, constructed as an association graph and improved and optimized, and the global graph of the user behavior sequence is obtained and recorded. The global graph is injected into the local module and the global module of the sequence encoder respectively, so that the outputs of the local module and the global module are fused, so that the sequence encoder can comprehensively learn more expressive intentions, thereby performing intent contrast learning, comprehensively obtaining the user's sequence recommendation, and predicting the user, completing the sequence recommendation of adaptive global graph modeling and intent contrast learning, improving the recommendation effect in noisy and data sparse conditions, improving the user experience, and enhancing the robustness and generalization ability of the sequence recommendation method in multiple dimensions.

[0028] (2) The present invention divides the global graph of user behavior sequences into sub-graphs of user behavior sequences, combines them with user embedding, and injects them into the local module of the sequence encoder. The outputs of the local module and the global module are fused to obtain a representation of the user behavior sequence. The global information between sequences is effectively utilized rather than just the local information within the sequence, thereby improving the ability to capture complex user intentions and enhancing the efficiency of recommendations.

[0029] (3) The present invention extracts user intent from user behavior sequences through a sequence encoder, performs comparative learning on the representation of user behavior sequences, and compares the representation of user behavior sequences with the representation of other user behavior sequences to comprehensively obtain user sequence recommendations. By performing sequence-level and intent-level comparative self-supervised learning tasks, user intent is modeled from different dimensions, aiming to reveal semantic patterns in user behavior and improve the accuracy and performance of sequence recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.

[0031] Figure 1 It is a schematic diagram of the method flow of the present invention.

[0032] Figure 2 A simplified diagram of the association graph.

[0033] Figure 3 A detailed statistics table of the dataset.

[0034] Figure 4 The following is a comparison chart of performance comparison results.

[0035] Figure 5 The following is a comparison chart of the visual results. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0037] The embodiments of the present invention can be applied to platforms including but not limited to e-commerce platforms, video website platforms, online advertising platforms, social platforms, etc., which need to form rich sequence data based on the user's historical data. Through adaptive global graph modeling, the global correlation between users and items and the user's potential intentions can be captured to recommend users' favorites. Intention contrast learning can help the platform understand the changes in users' interests in different time periods and recommend content that is more in line with the user's current mood and interests.

[0038] In order to efficiently capture the high-order transformation relationship of items and accurately learn user intent, we propose IC4SRec (a sequential recommendation method based on adaptive global graph modeling and intention contrast learning), which fully integrates the project collaboration information and user intent information into the sequential recommendation model from a global and local perspective. Specifically, in the embodiment of the present invention, a global graph information learner is first proposed, which adaptively learns the improved graph from the transformation correlation between all items and seamlessly integrates it into the item embedding. Then, a subgraph is extracted from the global graph corresponding to the user sequence, combined with the user embedding, and injected into the local module of the sequence encoder in the form of relative position encoding to promote the learning of personalized intent. At the same time, in order to avoid paying too much attention to the most recent interaction, a global module with shared parameters for all sequences is also designed in the embodiment of the present invention. With high-quality item embedding and an encoder that integrates global and local information, the present invention learns accurate user intent from the interaction sequence through clustering. Through the sequence-level contrastive self-supervised learning task, we close the sequences with the same intent in the latent space. At the same time, the intent-level contrastive self-supervised learning task makes the sequence closer to the intent prototype, so as to model the most suitable latent intent for the current user sequence. Finally, the embodiment of the present invention jointly optimizes the entire prediction process in an end-to-end manner through multi-task learning.

[0039] In the embodiment of the present invention, the sequential recommendation method predicts the items that the user will interact with in the next moment based on the historical interaction sequence of the user with time sequence information. Assume that the user set and the item set are represented as U and V respectively, and the interaction sequence of each user u∈U is sorted in chronological order, and the historical interaction sequence of user u is represented as Su =[v1,...,v i ,...,v t ], where v i ∈V represents the item that user u interacts with for the i-th time, and t is the maximum length of the sequence.

[0040] Reference Figure 1 As shown, the present invention provides a sequence recommendation method based on adaptive global graph modeling and intention contrast learning, including: S1. Acquire historical interaction data between users and items, and sort them based on rules to obtain user historical behavior sequences, construct them into association graphs, improve and optimize the association graphs, and obtain and record them as user behavior sequence global graphs.

[0041] The historical interaction data between the above-mentioned users and items can be extracted from the user information database of the Internet service provider.

[0042] Specifically, the rule-based sorting is performed to obtain the user's historical behavior sequence, which is constructed into a correlation graph. The specific analysis process is as follows:

[0043] The rule is specifically to sort the historical interaction time points in chronological order, wherein the chronological order is the order of the corresponding time points of the interaction behaviors.

[0044] The above historical interaction time points are the historical interaction time points between users and items, which are extracted from the user information database of the Internet service provider.

[0045] The historical interaction data between the user and the item is specifically the interaction data between the user and the item at each historical interaction time point, wherein the historical interaction data may include playing games at historical interaction time point 1, listening to music at historical interaction time point 2, playing football at historical interaction time point 3, and swimming at historical interaction time point 4.

[0046] The user historical behavior sequence is obtained by sorting the interaction data between the user and the item at each historical interaction time point according to the time sequence of each historical interaction time point to obtain each user historical behavior subsequence, and thus the set of each user historical behavior subsequence is called a user historical behavior sequence.

[0047] The user historical behavior sequence is divided into an item set and a relationship set between the user and the item.

[0048] The above user historical behavior sequence contains a large amount of interaction data between users and items, such as objects. All items that have appeared are extracted from the user historical interaction data, and duplicate items are removed to form an item set. For each record in the user historical interaction data, it is classified into the corresponding user and item according to its user ID and item ID. At the same time, the behavior type and behavior time are recorded to form a complete relationship set.

[0049] The construction is an association graph, specifically, the user's historical behavior sequence is divided into a set of items and a set of relationships between users and items, and connected in a predefined manner. The specific expression is:

[0050] The association graph G = (V, E), where V is the item set, E = e(i, j) is the set of relationships between users and items in all sequences, that is, the edge set, e(i, j) represents the relationship between vertex i and vertex j of the e-th edge in the association graph, e = 1, 2, 3, ..., E, vertex i can be represented as the starting point of the relationship, and vertex j can be represented as the end point of the relationship.

[0051] The connection is performed in a predefined manner, which may be:

[0052] u1: v1→v2→v3→v4; u2: v2→v5→v4; u3: v4→v3; u4: v1→v5→v2,

[0053] Then the items v corresponding to users u1 to u4 are connected according to their existing relationships, as shown by the arrows, such as Figure 2 As shown, Figure 2 A simplified diagram of the association graph.

[0054] Depend on Figure 2 It can be seen that the association graph is an undirected graph, which means that there may be repeated relationships between users and items in the user's historical behavior sequence, which will cause interference to the sequence recommendation when learning user intentions. Therefore, it is necessary to optimize the association graph to effectively reduce the impact of such repeated relationships on the learning effect, thereby providing users with more personalized and high-quality recommendation services.

[0055] It should be explained that the above historical interaction data only include user interaction records. In order to obtain a global perspective that can effectively capture the commonalities and correlations in user behaviors, the graph structure learning (GSL) method is introduced in this embodiment to learn an adaptive and personalized association graph. Through the GSL method, the association graph obtained in this embodiment can adaptively detect and remove noise edges, and identify potential valid edges.

[0056] Taking the user historical behavior sequence S as an example, for each item pair (V i ,V i+t ) Update the edge weights to Where t is set to 2, which is a suitable window size. According to the lightweight graph convolutional network, It can be regarded as a semantic relevance measure of the current item to its t-hop neighbors in the sequence. In this embodiment, the above operation is performed on all user sequences, and then the edge weights are normalized as follows:

[0057]

[0058] where deg(·) is the degree of the node in the connection graph G, V i Represented as the i-th vertex in the item set V, V j Represented as the j-th vertex in the item set V, since the association graph can also be regarded as a kind of global collaborative information, and global collaborative information emphasizes the interaction and association between different users and behavioral items, considering the association graph as global collaborative information helps to capture and represent the comprehensive impact of intention in the overall system, which helps to understand the intention more accurately and consider its complex relationship with other sequences. Global collaborative information is usually dynamic and can reflect the changes in the interaction between users and behavioral items over time. In intent modeling, this helps to capture the evolution and changes of user intentions, so as to adapt to different application scenarios more flexibly. In summary, in this embodiment, the association graph helps to better carry out subsequent intent modeling.

[0059] Furthermore, the association graph is improved and optimized to obtain and record as a global graph of user behavior sequence. The specific analysis process is as follows:

[0060] The above-mentioned improvement and optimization of the association graph is to optimize the association graph through a lightweight graph convolutional network as a graph encoder to obtain and record it as a global graph of user behavior sequence.

[0061] The above optimization can be specifically performed by the graph encoder to perform structural learning on the association graph, wherein the structural learning of the association graph can enhance the representation ability and robustness of the association graph. Therefore, in this embodiment, partial structural perturbation is used to improve the association graph, and the adjacency matrix of the association graph can be regarded as a free variable, which is formalized as follows:

[0062]

[0063] in is the global graph of user behavior sequences, G∈R |V|*|V| is a relational graph, is a learnable perturbation map, ∈ is the perturbation intensity, R |V|*|V| It is a matrix representation of |V| rows and |V| columns, where |V| is the specific value of the item set.

[0064] In a specific embodiment, assume that there is an association graph G, including 4 vertices V = {v1, v2, v3, v4}, that is, the item set includes 4 items, and 4 edges E = {(v1, v2), (v1, v3), (v2, v4), (v3, v4)}, that is, there are 4 types of relationships between users and items, then the relationship of the association graph adjacency matrix A is shown in Table 1 below, which can be expressed as:

[0065] Table 1 Relationship of adjacency matrix A

[0066] v1 v2 v3 v4 v1 0 1 1 0 v2 1 0 0 1 v3 1 0 0 1 v4 0 1 1 0

[0067] Then the association graph adjacency matrix A is expressed as: In this matrix, A[1][2]=1 indicates that there is an edge between vertex v1 and vertex v2; A[2][4]=1 indicates that there is an edge between vertex v2 and vertex v4, and so on.

[0068] At the same time, since the above perturbation graph is a dense graph, in order to reduce the expression The computational complexity of the perturbation graph is reduced in this embodiment. Specifically, in this embodiment, only a few dominant singular values ​​of the global graph of the user behavior sequence are modeled to learn its SVD decomposition, i.e., singular value decomposition, which is an important matrix decomposition method. Specifically, a matrix is ​​decomposed into the product of three matrices. The three matrices are: an orthogonal matrix, a diagonal matrix, and the transpose of another orthogonal matrix. The formula is as follows:

[0069]

[0070] in is a learnable perturbation graph, A is the adjacency matrix of the association graph, and W U ∈R |V|*d' and W V ∈R |V|*d' are all learnable matrices, d′ is a hyperparameter that determines the rank of the decomposed perturbation graph, AW U Represented as matrix A and matrix W U The product of AW V Represented as matrix A and matrix W V The product of (AW V ) T Represented as matrix A and matrix W V After the above operations are completed, this embodiment uses a proven useful lightweight graph convolutional network as a graph encoder to capture the global collaboration relationship and rewrites its message passing as follows:

[0071]

[0072] E (L) is the association graph representation of the Lth layer, E (L-1) It is the association graph representation of the L-1 layer.

[0073] The global graph representation of the user behavior sequence is obtained by embedding the weighted sum of the association graphs from each L layer of the lightweight graph convolutional network through the graph encoder, as shown below:

[0074]

[0075] In the formula, is the global graph representation of user behavior sequence, E (0) is the association graph representation of the 0th layer, E (r) Represented as the association graph representation of the rth layer, E (L) is the association graph representation of the Lth layer, L is the specific level representation in the lightweight graph convolutional network, r = 0, 2, 3, ..., L, r represents any level in the lightweight graph convolutional network.

[0076] It should be explained that a single association graph only has explicit project relationships and will be affected by noise. In this embodiment, self-supervised contrastive learning is used to model the improved global graph of user behavior sequences to mine implicit relationships between projects and generate high-quality project representations.

[0077] Although the graph encoder explicitly models global information through indirect dependencies, directly applying them to the sequence context requires the help of self-supervised learning. Considering that the association graph or the global graph of the user behavior sequence should have similar information, this embodiment also incorporates the refined global collaborative information into the item representation through the mutual information maximization criterion (MIM), which can be achieved by modifying the InfoNCE function, as shown in the following expression:

[0078]

[0079] Where L Graph_ce It is represented as the global information encoding loss, S is the user behavior sequence, L is the representation of a specific level in the lightweight graph convolutional network, i is the number of samples in a batch, i=1,2,3,...,B, B is the number of samples in a batch, τ is the temperature coefficient, and this objective function obtains high-quality item embeddings containing global collaborative information, which helps to better perform intent modeling and sequence modeling in the future.

[0080] The above InfoNCE function is a loss function commonly used in contrastive learning. Its goal is to maximize the similarity between similar samples (positive samples) and minimize the similarity between non-similar samples (negative samples). It enables the model to learn more discriminative feature representations through contrastive learning. Specifically, suppose there is a set of samples represented by {x1,x2,...,x N}, and a positive sample pair (x i , x i+ ) and negative sample pairs (x i , x j- ), where x i+ is with x i Similar positive samples, x j-is with x i For dissimilar negative samples, the formula for InfoNCE loss can be expressed as:

[0081]

[0082] Among them, sim(x i ,x j ) represents x i and x j The similarity between them is usually calculated using cosine similarity; τ is a temperature parameter used to adjust the scale of similarity in contrastive learning to avoid gradient vanishing or gradient exploding problems.

[0083] S2. Divide the global graph of user behavior sequences into sub-graphs of each user behavior sequence, combine them with user embedding, and inject them into the local module of the sequence encoder. Inject the global graph of user behavior sequences into the global module of the sequence encoder, fuse the outputs of the local module and the global module, and obtain the representation of the user behavior sequence.

[0084] Specifically, the global graph of user behavior sequences is divided into subgraphs of user behavior sequences, combined with user embedding, and injected into the local module of the sequence encoder. The specific analysis process is as follows:

[0085] It should be explained that the purpose of sequence recommendation is to provide personalized suggestions for specific users based on item relationships, and to obtain the user's personalized information based on the global graph of the user's behavior sequence. The user's personalized information refers to a collection of information that is synthesized based on the user's unique identity, historical behavior, interest preferences, social relationships and other data. This information can be used to distinguish the differences between different users and is the basis for realizing personalized information services. It can be extracted from the user's browsing history on the website or application.

[0086] The above-mentioned personalized information of the user may specifically be user identity characteristics: such as age, gender, occupation, region and other basic information, which can reflect the basic attributes and social background of the user.

[0087] Historical behavior data: including users’ browsing history, purchase history, search history, etc. on websites or apps. These data can reflect users’ interests and needs.

[0088] Interest preference: the user's preference for specific content, products or services, such as favorite movie types, music styles, shopping categories, etc.

[0089] Social relationships: user’s friendships and interactions on social media. This information can reflect the user’s social circle and influence.

[0090] In order to make the result of the sequence encoder more consistent with the user's intention, we extract the subgraph of the user sequence from the improved global graph Where R t*t It is represented as a sequence matrix with t rows and t columns, where t represents the maximum length of the sequence. In order to measure the importance of each user u in the improvement graph, that is, the global graph of user behavior sequences, an adaptor is designed in the embodiment of the present invention. The adaptor introduces a personalized local vector L for each user. u ∈R 1*d , where R 1*d It is represented as a sequence matrix with 1 row and d columns, where d represents the maximum length of the local vector, and is projected into a scalar through a multi-layer perceptron:

[0091]

[0092] Among them l u Represented as a local vector L u The initial representation of , MLP stands for multi-layer perceptron.

[0093] Then, in order to inject local graph relations into the sequence representation, we propose to involve the user's personalized information in the self-attention mechanism in the form of relative position encoding, as shown in the following formula:

[0094]

[0095] Among them, Attention local (Q, K, V) represents the user's personalized information being involved in the self-attention mechanism in the form of relative position encoding. Q, K, and V refer to the three input representation vectors used in the self-attention mechanism. Q represents the query vector, K represents the key vector, and V represents the numerical vector. σ represents the softmax operation, which is a function that converts a set of numerical values ​​into a probability distribution. K T represents the transpose of the key vector, QK T represents the product of the transpose of the query vector and the key vector, and d represents the maximum length of the local vector.

[0096] The encoder and decoder in the self-attention mechanism process the subgraphs of each user behavior sequence, that is, the Transformer operation. After the Lth layer of Transformer, the output of the local module is as follows:

[0097]

[0098] In the formula, Represented as the local module output of the sequence encoder, Transformer local Represented as the Transformer operation of the local module, S uis the historical interaction sequence representation of user u, where u represents the user, u=1,2,3,…,U.

[0099] It should be explained that the encoder and decoder in the Transformer model process the subgraphs of each user behavior sequence through the self-attention mechanism and the feedforward neural network layer. Specifically, the encoder captures the dependencies and semantic information of the input sequence, while the decoder generates a new symbol sequence based on the encoder's output and the previously generated output. This structure makes the Transformer model powerful in processing long sequences and capturing complex dependencies.

[0100] Furthermore, the global graph of user behavior sequences is injected into the global module of the sequence encoder. The specific analysis process is as follows:

[0101] Acquire collaborative information of the global graph of user behavior sequences, where collaborative information specifically refers to features, patterns or relationships shared or related between different sequences. This collaborative information helps the model understand the intrinsic connections between sequences, thereby improving the modeling and prediction capabilities of sequence data. For example, in an embodiment of the present invention, the purchase history sequences of different users may all contain a preference for a certain type of product. This preference is a global feature. The collaborative information of the global graph of user behavior sequences can be extracted from the user's behavior log on the website or application.

[0102] The global module specifically uses a global query matrix shared by all sequences to learn the collaborative information of the global graph of user behavior sequences. The output structure of the global module is as follows:

[0103]

[0104] In the formula, is the global module output of the sequence encoder, σ is the softmax operation, Q g is the global Query matrix, W k ∈R d*d is the learnable parameter matrix, W V ∈R d*d is the learnable parameter matrix, E∈R t*d is the embedding matrix of the current sequence, R d*d and R t*d Both represent matrices, and dropout represents regularization.

[0105] Specifically, the outputs of the local module and the global module are fused to obtain a representation of the user behavior sequence. The specific analysis process is as follows:

[0106] The position weight of each position point p in the global graph of user behavior sequence is obtained, wherein the position weight can be determined according to the importance of the node by using relevant algorithms in graph theory, such as PageRank, to analyze the global graph of user behavior sequence.

[0107] The PageRank algorithm calculates the position weight, and its process is as follows: for each position point in the global graph of the user behavior sequence, an initial PageRank value is assigned to it. This initial value is usually set to 1 / N, where N is the total number of all position points. This setting is to ensure that at the beginning of the algorithm, each position point has the same starting point, which is convenient for subsequent iterative calculations; determine the damping coefficient. The damping coefficient d is a constant between 0 and 1. It represents the probability that the user will continue to execute the current interaction relationship when interacting with the item. Usually d is set to 0.85, which means that the user has an 85% probability of interacting with the item at the current position point, and the remaining 15% probability of randomly jumping to other positions; iterative calculation is performed according to the PageRank calculation formula. The formula is as follows:

[0108]

[0109] Among them, PR(A) represents the PageRank value of vertex A, d is the damping coefficient, N is the total number of all vertices, T1, T2, ..., Tn are the edges pointing to location point A (that is, the relationship where A exists), C(T1), C(T2), ..., C(Tn) are the edges connected to location point A (that is, how many other locations location point A points to).

[0110] In each iteration, the new PageRank value of each location point is calculated based on the previous PageRank value and the above formula. The iterative calculation will continue until the difference between the PageRank values ​​of all location points in the two previous iterations is less than a predetermined threshold (that is, convergence is reached). This threshold is usually a very small positive number to ensure the stability and accuracy of the algorithm.

[0111] In order to avoid over-emphasizing the recent intention, the embodiment of the present invention introduces I p To measure the importance of the item at position p for predicting user intent, it is constructed as follows:

[0112]

[0113] in

[0114] In the formula, key p It is represented as the key vector of the position point p, and Query is represented as the query vector of the current position point p. is the global representation, is a local representation, W∈R d*d , t and ψ p ∈R d ,φ∈R d Both are learnable parameters. LN refers to layer normalization, and ReLU is represented as an activation function. Its mathematical expression is f(x)=max(0,x), that is, for input x, if x is greater than 0, then output x; if x is less than or equal to 0, then output 0.

[0115] In order to fuse the information obtained by modeling the global and local modules to enhance the ability to extract user intent, the output representation of the fusion layer is constructed as follows:

[0116]

[0117] In the formula, H u is the output of the fusion layer, I p is the importance of the item at position p for predicting user intent, Denoted as the local module output of the sequence encoder, is the global module output of the sequence encoder.

[0118] The representation of the user behavior sequence is obtained, specifically: The last vector in is used as the representation of user sequence, where

[0119] S3. Through the sequence encoder, the user intention is extracted from the user behavior sequence, and compared with the representation of the user behavior sequence. The representation of the user behavior sequence is compared with the representation of other user behavior sequences to comprehensively obtain the user's sequence recommendation.

[0120] It should be explained that in order to overcome data sparsity and construct the intention self-supervised learning signal, the data enhancement method is used in this embodiment to divide the prefix of the original sequence into a new training sequence. The operation structure is as follows:

[0121]

[0122] Among them, Aug represents data enhancement. is the label of each subsequence. In this embodiment, it is considered that subsequences with the same label have similar intentions, so subsequences with the same label are divided into the same category.

[0123] In a specific embodiment, it can be expressed as:

[0124] Original sequence: 6410 11091 5596 4981 8566 1996 11045 1976

[0125] After data enhancement: 6410 11091 5596 4981 6410 11091 5596 4981 8566 6410 11091 5596 4981 8566 1996 6410 11091 5596 4981 8566 1996 11045 6410 11091 5596 4981 8566 1996 11045 1976

[0130] Specifically, the representation of the user behavior sequence is compared with the representation of other user behavior sequences for learning, and the specific analysis process is as follows:

[0131] User intent can be viewed as collaborative information mined from the collective historical behaviors of all users. In order to mutually promote sequence representation learning and intent learning, in this embodiment, the cluster center of the subsequence representation is regarded as the intent prototype.

[0132] First, comparative learning is performed between user behavior sequences to enhance the model's ability to understand and distinguish user intent. Different behavior sequences with the same label may have the same intent. Therefore, the goal of this embodiment is to bring sequences with the same intent closer together in the vector space, while moving sequences with different intents further apart.

[0133] The current sequence of the user behavior sequence is obtained, which is denoted as S1, wherein the current sequence of the user behavior sequence refers to obtaining a subsequence with a specific label or intention in the user behavior sequence, which can be obtained by dividing the user behavior sequence.

[0134] For the current sequence S1, randomly sample from sequences with the same label to obtain sequence S2 with the same intent as the comparison between sequences. The learning task is constructed as follows:

[0135] L Seq_cl =L cl (h1,h2);

[0136] in

[0137] Where, L Seq_cl is the sequence-level contrast loss between user behavior sequences, L clis the contrast representation of sample pairs, h1 and h2 are represented as two vectors in the vector space, (x, y) is a pair of positive samples, f(·) is the inner product, F is the set of users with the same label as the two positive samples in a mini-batch, and z is the representation of the sequence of a user in the user set that does not have the same label.

[0138] In addition, in the embodiment of the present invention, comparative learning is performed between the user behavior sequence and the user intention to further collaborate intention learning and behavior learning.

[0139] Furthermore, the user intention is compared with the representation of the user behavior sequence for learning, and the specific analysis process is as follows:

[0140] In real life, the intention behind purchasing the same item may vary in different situations. After all sequences are encoded by the intention encoder that shares parameters with the sequence encoder, this embodiment uses K-means to cluster the output sequence representation to obtain K types of user intentions that reflect user interaction behavior decisions. The intention is formalized as And the intentions behind the same behavior may be different.

[0141] Get two vectors of the global graph of user behavior sequence in the vector space, denoted as h1 and h2 respectively. This vector represents the position of the user behavior sequence in the vector space.

[0142] The intention prototype with the smallest distance to vectors h1 and h2 in the vector space is taken as the intentions i1 and i2 of the two vectors respectively.

[0143] The intention with the smallest distance mentioned above, where the distance can be calculated by Euclidean distance, specifically, the square root of the sum of the squares of the differences between each corresponding position of the calculation vector and the intention.

[0144] The contrastive learning task between the representation of user behavior sequences and user intentions is constructed as follows:

[0145] L Intent_cl =L cl (h1,i1)+L cl (h2,i2);

[0146] Where, L Intent_cl It is expressed as the contrast loss at the intent level between the user behavior sequence and the user intent, L cl For the contrast representation of sample pairs, h1 and h2 are represented as two vectors in the vector space, and i1 and i2 are represented as the user intentions corresponding to vectors h1 and h2.

[0147] This embodiment regards the sequence representation and the corresponding nearest intent center as positive pairs, and regards other intent centers as negative pairs. At the same time, this embodiment also excludes sequences with the same intent in a small batch to avoid false negative samples.

[0148] S4. Based on user sequence recommendation, predict users and optimize the sequence recommendation according to the prediction results, so as to complete the sequence recommendation of adaptive global graph modeling and intent contrast learning.

[0149] Furthermore, the user-based sequence recommendation predicts the user, and the specific analysis process is as follows:

[0150] It should be explained that the next item prediction learning in sequential recommendation can be summarized as a classification task for the entire item set.

[0151] The prediction of the user is specifically given a sequence representation h u and the item embedding matrix V, the prediction score is calculated as follows:

[0152]

[0153] in is the prediction score, h u For a given sequence representation, V T is the transpose of the item embedding matrix, R |V| is the determinant representation of the target embedding matrix, and softmax is represented as the normalization function.

[0154] The cross entropy loss is optimized to maximize the probability of correct prediction:

[0155]

[0156] Where, L Rec To ensure the accuracy of prediction for users, It is expressed as the prediction score of the real item g, g∈v is the real item of the next interaction of user u, g∈V, j is the predicted item of the next interaction of user u, j∈V, Denote as the prediction score of the predicted item g.

[0157] Specifically, the optimization of sequence recommendation according to the prediction results is specifically to jointly optimize multiple prediction tasks using a multi-task training strategy.

[0158] In order to enhance the model's ability to capture global and local information from the graph and learn the user's main intention, this embodiment adopts a multi-task training strategy to jointly optimize multiple tasks. The specific optimization is to calculate the linear weighted sum based on the joint loss in this embodiment:

[0159] L=L Rec +α*L Graph_ce +β*L Seq_cl +γ*L Intent_cl ;

[0160] Among them, L represents the joint loss, L Rec is the accuracy of predicting the user, L Graph_ce is the global information encoding loss, L Seq_cl is the sequence-level contrast loss between user behavior sequences, L Intent_cl is the intent-level contrastive loss between the user behavior sequence and the user intent. α, β, and γ are the hyperparameters that control the loss of each contrastive learning task, specifically those important parameters that affect the calculation and behavior of the loss function, such as the temperature parameter (τ), learning rate, batch size, etc. These hyperparameters are not derived through the training process, but are pre-set before the training starts.

[0161] In order to verify the effectiveness of the embodiments of the present invention, the present invention conducts experiments on three public data sets from the real world: Beauty data set, Sports data set and Toys data set. These data are derived from user review data collected from Amazon. Amazon is one of the largest e-commerce companies in the United States. Figure 3 Detailed statistics for all datasets are listed in Figure 3 Detailed statistical data table of the dataset shown, where |U| represents the specific number of user sets, |V| represents the number of project sets, Iterations represents the number of iterations, Avg.length / U (average length / number of users) represents the average value of a certain metric of the interaction between users (U) and projects (V) (such as ratings, comment length, browsing time, etc.), Avg.length / V (average length / number of visitors) represents the value of the user interaction metric attracted by each project on average for all projects, and Sparsity represents sparsity.

[0162] Depend on Figure 3 It can be seen that the three data sets differ in average length and number of interactions, but their sparsity is very high, indicating that there are a large number of missing values ​​or no interactions in these data sets, so the three data sets need to be preprocessed.

[0163] The above preprocessing, in this embodiment, only uses the "5-core" data set, excluding inactive users and unpopular items with less than 5 interactions. The leave-one-out evaluation method is used to segment the data to evaluate the sequential recommendation model. For example, given a sequence S u =[v1,...,v i ,...,v i-3 ,vt-2 ,v t-1 ,v t ], in this embodiment, ([v1,...,v t-3 ],v t-2 ) for training, ([v1,...,v t-2 ],v t-1 ) is used for verification, ([v1,...,v t-1 ],v t ) for testing.

[0164] In order to comprehensively evaluate the proposed model and baseline, this example uses the top K hit rate (HR@K) and top K normalized discounted cumulative gain (NDCG@K) widely used in sequential recommendation as evaluation indicators of recommendation performance, where K∈{5,10,20}. HR measures the accuracy of real items appearing in the top K recommendations, and NDCG is a ranking loss that evaluates the position of real items in the top K recommendations. Generally speaking, higher HR@K and NDCG@K metrics indicate better model performance.

[0165] To demonstrate the effectiveness of the embodiments of the present invention, the performance of the embodiments is compared with 13 popular recommendation models, covering a variety of recommendation methods, which can be divided into four categories: (1) non-sequential models; (2) general sequence models; (3) sequence models based on self-supervised learning; (4) intent-oriented sequence models. The specific information about the baselines is as follows:

[0166] BPR: Proposes a general Bayesian optimization criterion and learning algorithm for personalized ranking from implicit feedback.

[0167] GRU4Rec: This model uses gated recurrent units to represent user behavior sequences.

[0168] Caser: This method uses convolutional neural networks to extract sequential patterns from recent interactions as local features.

[0169] SASRec: adopts the self-attention mechanism to capture the dynamic interest patterns in the user behavior sequence and considers the information of the entire sequence when processing the data at each time step.

[0170] BERT4Rec: This model uses bidirectional self-attention to model user sequences.

[0171] S 3 -Rec MIP : The mutual information maximization principle is used to learn the association between different data. Our experiments only used the masked item prediction (MIP) task.

[0172] CL4SRec: This model incorporates contrastive learning into sequential recommendation to alleviate the problem of data sparsity.

[0173] CoSeRec: This model proposes novel data augmentation techniques to alleviate the cold start problem.

[0174] DuoRec: This method utilizes the dropout technique to better preserve the semantics of augmented data, thereby improving the distribution of item embeddings.

[0175] MCLRec: This framework introduces learnable model enhancements and proposes a meta-update method.

[0176] ICLRec: This model learns the user’s intent distribution function and incorporates these intents into the sequence model using self-supervised learning.

[0177] IOCRec: This method aims to identify the user’s main intent from multiple intents to reduce noise.

[0178] SparseEnNet: This model adopts adversarial learning and clustering-based self-training methods to enhance recommendation performance.

[0179] The overall performance of all baselines is compared with the method of the embodiment of the present invention. The comparison results are as follows: Figure 4 As shown, Figure 4 Performance comparison results comparison chart shows the main experimental data.

[0180] Depend on Figure 4 , we can draw the following conclusions:

[0181] (1) Sequential patterns are indispensable for recommendation systems. GRU4Rec and Caser, which integrate user sequence information, outperform the non-sequential method BPR in recommendation performance. This shows that sequential information is helpful in capturing users' dynamic preferences. In addition, Transformer-based SASRec further improves performance compared to traditional models, demonstrating the strength of the attention mechanism in extracting sequence features.

[0182] (2) SSL-based sequence models usually outperform general sequence methods. 3 -Rec MIPThe performance on some indicators is slightly lower than SASRec, but this difference may be caused by the mismatch between the goals of the cloze task and the next item prediction task. Models based on the self-supervised learning paradigm effectively alleviate the data sparsity problem in sequence recommendation. CL4SRec and CoSeRec further effectively capture the deep features of user behavior through data augmentation methods and contrastive learning paradigm. One possible reason why DuoRec performs better than CoSeRc is that it regards sequences with the same next item in contrastive learning as positive samples, which enhances the distinction of sequence semantics.

[0183] (3) Intent-oriented sequence models show improvements over most SSL-based models such as CL4SRec and CoSeRc. By comparing ICLRec and CL4SRec, it can be observed that incorporating intent can improve performance. The comparison between ICLRec and IC4SRec shows that incorporating global graph information can further improve performance. ICLRec, IOCRec, and SparseEnNet all construct contrastive self-supervised learning between user representations and their corresponding intent representations to improve the quality of user representations and thus improve recommendation performance. The reason why they are not as effective as MCLRec may be that the noise introduced by random data augmentation perturbs the original intent of the sequence. The method proposed in this paper avoids this situation.

[0184] (4) By comparing the proposed IC4SRec with all baselines, it can be found that IC4SRec outperforms existing models on all datasets. Compared with the best baseline, IC4SRec improves by 8.84% to 28.66% on HR and by 29.15% to 48.01% on NDCG. The reasons can be summarized as follows: (1) IC4SRec extracts global collaborative information from the refined graph to improve sequence encoding, producing higher quality user representations compared to ICLRec, IOCRec, and SparseEnNet. (2) Our method alleviates the false negative problem while maintaining a high degree of semantic consistency between the sequence and its corresponding intent through a contrastive learning paradigm, further improving the robustness and performance of the model.

[0185] In order to further analyze the impact of global collaborative information and contrastive learning on embedding learning, the visualization results of the embedding matrices learned by different models on the Beauty and Toys datasets are compared, as shown in the figure below. Figure 5 As shown, the color bar on the right represents the frequency of items in the dataset. This comparison involves ICLRec and the method proposed in this embodiment.

[0186] Depend on Figure 5From the comparison of visualization results, we can see that in (a) and (c), ICLRec’s embedding presents a relatively narrow and concentrated cone distribution in the latent space. This indicates that ICLRec tends to focus on high-frequency items, resulting in poor balance in item representation. Rare items may be marginalized and thus cannot be effectively recommended to users. The concentrated distribution of points shows that ICLRec has difficulty in effectively distinguishing high-frequency and low-frequency items, resulting in insufficient generalization of the entire item spectrum.

[0187] In contrast, Figures (b) and (d) show the embedding distributions generated by our model, showing a more balanced distribution over high-frequency and low-frequency items. The embeddings cover a wider range in the latent space, indicating that our model effectively exploits contrastive learning and global information to provide a more uniform distribution. This balanced embedding distribution shows that our model is able to capture subtle relationships between items, thereby improving the performance of sequence recommendation tasks. The color bar in each figure represents the frequency of the item, further illustrating the advantage of our model over ICLRec when dealing with rare items.

[0188] Overall, these visualization results show that the model proposed in this example generates higher quality item embeddings, which are characterized by a more even distribution of items in the latent space. This balanced distribution meets the goal of intent contrastive learning and effectively improves the performance of the recommendation system, enabling better handling of popular and rare items.

[0189] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the present invention, they should all fall within the protection scope of the present invention.

Claims

1. A sequence recommendation method based on adaptive global graph modeling and intent contrastive learning, characterized in that: include: S1. Obtain historical interaction data between users and items, sort them based on rules, obtain user historical behavior sequences, construct them into association graphs, improve and optimize the association graphs, obtain and record them as user behavior sequence global graphs; S2. Divide the global graph of user behavior sequence into sub-graphs of each user behavior sequence, combine them with user embedding, and inject them into the local module of the sequence encoder. Inject the global graph of user behavior sequence into the global module of the sequence encoder, fuse the outputs of the local module and the global module, and obtain the representation of the user behavior sequence. S3. Through the sequence encoder, the user intention is extracted from the user behavior sequence, and the representation of the user behavior sequence is compared and learned. The representation of the user behavior sequence is compared and learned with the representation of other user behavior sequences to comprehensively obtain the user's sequence recommendation; S4. Based on user sequence recommendation, predict users and optimize the sequence recommendation according to the prediction results, so as to complete the sequence recommendation of adaptive global graph modeling and intent contrast learning.

2. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 1, characterized in that: The rule-based sorting is performed to obtain the user's historical behavior sequence, which is constructed into an association graph. The specific analysis process is as follows: The rule specifically sorts the historical interaction time points in chronological order; The historical interaction data between the user and the item, specifically the interaction data between the user and the item at each historical interaction time point; The obtaining of the user historical behavior sequence specifically involves sorting the interaction data between the user and the item at each historical interaction time point in the chronological order of each historical interaction time point to obtain and record each user historical behavior subsequence, whereby the set of each user historical behavior subsequence is called the user historical behavior sequence; The user historical behavior sequence is divided into a set of items and a set of relationships between users and items; The construction is an association graph, specifically, the item set in the user's historical behavior sequence and the relationship set between the user and the item are connected in a predefined manner. The specific expression is: The association graph G = (V, E), where V is the project set, E = e(i, j) is the relationship set between users and projects, e(i, j) represents the relationship between vertex i and vertex j of the e-th edge in the association graph, e = 1, 2, 3, ..., E.

3. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 2, characterized in that: The association graph is improved and optimized to obtain and record as a global graph of user behavior sequence. The specific analysis process is as follows: The above-mentioned improvement and optimization of the association graph is to optimize the association graph through a lightweight graph convolutional network as a graph encoder to obtain and record it as a global graph of user behavior sequence; The global graph representation of the user behavior sequence is obtained by embedding the weighted sum of the association graphs from each L layer of the lightweight graph convolutional network through the graph encoder, as shown below: In the formula, is the global graph representation of user behavior sequence, E (0) is the association graph representation of the 0th layer, E (r Represented as the association graph representation of the rth layer, E (L) is the association graph representation of the Lth layer, L is the specific level representation in the lightweight graph convolutional network, r = 0, 2, 3, ..., L, r represents any level in the lightweight graph convolutional network.

4. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 1, characterized in that: The global graph of user behavior sequences is divided into sub-graphs of user behavior sequences, combined with user embedding, and injected into the local module of the sequence encoder. The specific analysis process is as follows: Obtain personalized information about users based on the global graph of user behavior sequences; The above is combined with user embedding and injected into the local module of the sequence encoder. Specifically, the user's personalized information is involved in the self-attention mechanism in the form of relative position encoding of the global graph of the user behavior sequence. The encoder and decoder in the self-attention mechanism process the subgraphs of each user behavior sequence, that is, the Transformer operation. After the Lth layer of Transformer, the output of the local module is as follows: In the formula, Represented as the local module output of the sequence encoder, Transformer local Represented as the Transformer operation of the local module, S u is the historical interaction sequence representation of user u, where u represents the user, u=1,2,3,…,U.

5. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 1, characterized in that: The global graph of user behavior sequences is injected into the global module of the sequence encoder. The specific analysis process is as follows: Obtain collaborative information of the global graph of user behavior sequences; The global module specifically uses a global query matrix shared by all sequences to learn the collaborative information of the global graph of user behavior sequences. The output structure of the global module is as follows: In the formula, is the global module output of the sequence encoder, σ is the softmax operation, Q g is the global Query matrix, W k ∈R d*d is the learnable parameter matrix, W V ∈R d*d is the learnable parameter matrix, E∈R t*d is the embedding matrix of the current sequence, R d*d and R t*d Both represent matrices, and dropout represents regularization.

6. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 5, characterized in that: The outputs of the local module and the global module are fused to obtain the representation of the user behavior sequence. The specific analysis process is as follows: Get the position weight of each position point p in the global graph of user behavior sequence, denoted as I p ; The output representation of the fusion layer is constructed as: In the formula, H u is the output of the fusion layer, I p is the importance of the item at position p for predicting user intent, Denoted as the local module output of the sequence encoder, is the global module output of the sequence encoder; The representation of the user behavior sequence is obtained, specifically: The last vector in is used as the representation of user sequence, where 7. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 1, characterized in that: The user intention is compared with the representation of the user behavior sequence for learning. The specific analysis process is as follows: Obtain two vectors of the global graph of user behavior sequence in the vector space, denoted as h1 and h2 respectively; The intention prototype with the smallest distance to vectors h1 and h2 in the vector space is taken as the intentions i1 and i2 of the two vectors respectively; The contrastive learning task between the representation of user behavior sequences and user intentions is constructed as follows: L Intent_cl =L cl (h1,i1)+L cl (h2,i2); Where, L Intent_cl It is represented as the contrastive learning between the representation of user behavior sequence and user intention, L cl It is represented as a user behavior sequence, h1 and h2 are represented as the distance in the vector space, i1 and i2 are represented as the intention prototypes with the smallest distance to h1 and h2, and are taken as user intentions.

8. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 7, characterized in that: The representation of the user behavior sequence is compared with the representation of other user behavior sequences. The specific analysis process is as follows: Get the current sequence of the user behavior sequence, denoted as S1; For the current sequence S1, randomly sample from sequences with the same label to obtain sequence S2 with the same intent as the comparison between sequences. The learning task is constructed as follows: L Seq_cl =L cl (h1,h2); Where, L Seq_cl is the comparison between user behavior sequences, L cl is the user behavior sequence, h1 and h2 are represented as two distances in the vector space.

9. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 1, characterized in that: The user-based sequence recommendation predicts the user, and the specific analysis process is as follows: The prediction of the user is specifically given a sequence representation h u and the item embedding matrix V, the prediction score is calculated as follows: in is the prediction score, h u For a given sequence representation, V T is the transpose of the item embedding matrix, R V| is the determinant representation of the target embedding matrix, and softmax is represented as a normalization function; The cross entropy loss is optimized to maximize the probability of correct prediction: Where, L Rec is the accuracy of the prediction for the user, g∈V is the real item of the next interaction of user u, j is the predicted item of the next interaction of user u, j∈V.

10. The sequence recommendation method based on adaptive global graph modeling and intention contrast learning according to claim 1, characterized in that: The optimization of sequence recommendation according to the prediction results specifically adopts a multi-task training strategy to jointly optimize multiple prediction tasks.

Citation Information

Patent Citations

  • A method for constructing a sequence recommendation model and a sequence recommendation method

    CN111967941B

  • A method for constructing a sequence recommendation model and a sequence recommendation method

    CN113762477B

  • Federated machine learning in adaptive training systems

    CA3193081A1

  • Graph contrast learning recommendation method, system and device based on global collaboration and medium

    CN117350803A

  • Business recommendation method and device, equipment and storage medium

    CN117541298A