A set-based conversational recommendation method

By employing a self-supervised multi-stage set expansion method, combining global and recent interests, and utilizing a permutation-invariant Transformer encoder and summation decoder, the problem of order sensitivity and inefficiency in long sequences and dynamic interest changes in conversational recommendation models is solved, achieving higher recommendation accuracy and stability.

CN119829831BActive Publication Date: 2026-01-13UNIV OF SHANGHAI FOR SCI & TECH
View PDF 2 Cites -1 Cited by

Patent Information

Application Number
CN202411862522.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2026-01-13
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

Existing conversational recommendation models suffer from order sensitivity and inefficiency when dealing with long sequences of user behavior and dynamic changes in interests, making it difficult to accurately capture users' global preferences and real-time changes in interests.

Method used

A self-supervised multi-stage set expansion method is adopted to divide the session into multiple sub-sessions. By combining global preferences and recent interests, the embedding layer and expansion layer are optimized through self-supervised learning. The permutation-invariant Transformer encoder and summation decoder are used to capture the long-term and short-term behavioral features of users, so as to achieve dynamic adaptation of the recommendation process.

Benefits of technology

It improves the accuracy and efficiency of recommendations, maintains the stability and precision of recommendations when user behavior changes, significantly improves the performance metrics of P@K and MRR@K, and adapts to the recommendation needs of different datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829831B_ABST
    Figure CN119829831B_ABST
Patent Text Reader

Abstract

The application provides a conversation recommendation method based on self-supervised multi-stage set expansion, which combines the global preference and recent interest of the user in the conversation to realize recommendation. In order to capture the global preference, a multi-stage self-supervised method is used to simulate dynamic recommendation behavior, and the conversation is divided into multiple gradually expanding sub-conversations, each of which represents a gradually accumulated user interaction history, thereby simulating different stages in the recommendation process. In order to obtain the recent interest of the user, the application adopts a method of extracting the last item in the conversation to generate an embedding. The last interaction of the user in the conversation often reflects their current immediate interest and demand. By taking the last item as a representative of the recent interest, the model can quickly adapt to the immediate changes in user interest, and finally combine the global preference and the recent interest to obtain accurate recommendation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of recommender systems, and in particular to a session recommendation method based on self-supervised multi-stage set expansion. Background Technology

[0002] Recommendation systems (RS) play a crucial role in e-commerce, streaming media, and search engines. However, most existing recommendation systems rely on long-term historical user data and explicit user profiles. This reliance leads to a significant drop in recommendation accuracy when user identity information is unavailable or long-term behavioral data is lacking. Therefore, session-based recommendation (SBR), which predicts a user's likely next action by analyzing their behavior during a single visit, has attracted widespread attention in the industry.

[0003] Existing SBR models are mainly divided into three categories: conventional recommendation models, sequence-based recommendation models, and graph neural networks (GNN).

[0004] Traditional recommendation models primarily rely on Markov chain methods, which predict a user's next action by modeling the sequence of user actions as transition probabilities between states. However, because Markov chains only consider the relationship between the current state and the next state, ignoring the long-term dependencies of user actions, they are insufficient for handling complex and long sequences of user behavior.

[0005] Sequence-based recommendation models effectively capture long-term dependencies in user behavior using techniques such as Recurrent Neural Networks (RNNs) and Long Short-Term Memory Networks (LSTMs). However, these models are highly sensitive to the order of user actions, meaning even small changes in the order can lead to significantly different recommendation results. In real-world scenarios, however, small changes in user behavior should not cause significant differences. This is because user behavior in session data typically exhibits high consistency. For example, on an e-commerce platform, suppose a user wants to buy a set of Apple electronic devices. The user has already purchased an iPhone, a Macbook, and an iPad. Regardless of whether the purchase order is "iPhone→Macbook→iPad" or "iPhone→iPad→Macbook," the recommendation system should ultimately recommend AirPods, not offer completely different product recommendations based on the order.

[0006] In recent years, Graph Neural Networks (GNNs) have become an important tool in the field of session recommendation due to their ability to capture the complex relationships between user behaviors through graph structures, demonstrating outstanding performance. However, although GNN models can solve the order sensitivity problem to some extent, they still have shortcomings in handling dynamic changes in user interests. In particular, when the amount of session data increases or the time span is large, user interests often drift, and GNNs based on static graphs struggle to accurately capture such dynamic changes. Although some researchers have attempted to address this problem by offline retraining or modeling all historical sessions at once, these methods are often inefficient and unable to respond to rapid changes in user interests in real time. Summary of the Invention

[0007] This invention provides a recommendation method based on a collection-based session, comprising the following steps:

[0008] Step S1: Initialize the embedding layer E and the extension layer SE, wherein the extension layer SE includes an encoder and a decoder, and the extension layer SE has permutation invariance;

[0009] Step S2: Set the session s = {v1, v2, ... v} n The recommendation phase is divided into n-1 sub-sessions s1, s2…s n-1 ; where session s includes n interactions v, and sub-sessions s i Including v1 to v i+1 All interactions, where i is a natural number, 0 <i≤n-1;

[0010] Step S3: For each sub-session s i Conceal its last item v i+1 The input is fed into the embedding layer E to obtain the corresponding sub-session feature X. i That is, X i =E(s) i );

[0011] Step S4: Input the session s into the embedding layer E to obtain the global session features X. g , that is, X g =E(s); The last item v in session s n The input is fed into the embedding layer E to obtain the most recent conversation feature X. l , that is, X l =E({v n});

[0012] Step S5: Extract the feature X of each sub-session i Global Session Features X gThe input is fed into the extended layer SE to obtain the feature X for each sub-session. i The corresponding recommendation r i Global preference r g The most recent conversation feature X1 is embedded into the layer to obtain the most recent preference r1, i.e.: r i =SE(X) i ), r g =SE(X) g ), r1=E(X1);

[0013] Step S6: Set global preference r g With recent preference r l By concatenating and reducing the dimensionality, we obtain the combined interest r representing the complex relationships in the conversation. c :

[0014]

[0015] in, This represents a linear transformation operation. This represents the concatenation between embeddings, where α is a learning parameter, 0 < α < 1, used to control the degree of influence of recent interests on the session representation;

[0016] Step S7: Optimize the parameters of the embedding layer E and the extension layer SE through a self-supervised learning mechanism;

[0017] Step S8: Using the optimized embedding layer E and extension layer SE, obtain the predicted interaction score vector.

[0018]

[0019] Among them: W p and b p These are the weight matrix and bias vector of the linear layer, respectively;

[0020] Then use the softmax function to... Convert to interaction probability

[0021]

[0022] Interaction probability This represents the probability of the next interaction occurring in session s, and the one with the highest probability is selected as the predicted interaction result.

[0023] Further, in step S1, the encoder is a Transformer encoder that removes the position encoding and dropout layer, and the decoder is a summation operation.

[0024] Furthermore, in step S7, the loss function is defined in the self-supervised learning mechanism:

[0025] L loss =L rec +βL self

[0026] Among them, L rec For the recommendation loss function, L self Let β be the self-supervised loss function, where β represents the proportion of the self-supervised task, and 0 < β < 1.

[0027]

[0028] L rec This is the Top1Loss function.

[0029] Furthermore,

[0030]

[0031] Where N is The vector dimension is defined by target, where σ is the sigmoid function.

[0032] The method of this invention treats sessions as sets, thereby avoiding excessive reliance on the order of interactions for recommendation results. Furthermore, it combines users' global preferences and recent interests within a session to achieve recommendations. To capture global preferences, a multi-stage self-supervised approach is used to mimic dynamic recommendation behavior, dividing the session into multiple progressively expanding sub-sessions. Each sub-session represents a gradually accumulating user interaction history, thus simulating different stages in the recommendation process. To obtain users' recent interests, this invention employs a method of extracting the last item in the session to generate an embedding. The last interaction of a user in a session often reflects their current immediate interests and needs. By using the last item as a representative of recent interests, the model can quickly adapt to real-time changes in user interests, ultimately combining global preferences and recent interests to obtain accurate recommendation results. Attached Figure Description

[0033] Figure 1 This is a flowchart of the method recommended in this invention;

[0034] Figure 2 This is the architecture diagram of the recommended model of this invention. Detailed Implementation

[0035] This invention is a session recommendation method based on self-supervised multi-stage set expansion. Its core idea is to combine the user's global preferences and recent interests in the session to achieve recommendation.

[0036] To capture global preferences, directly embedding and extracting the entire session might overlook the dynamic changes in user interests, as user behavior preferences may differ between the early and later stages of a session. To mitigate this issue, this invention introduces self-supervised learning and utilizes a multi-stage self-supervision approach to mimic dynamic recommendation behavior. Multi-stage self-supervision is achieved through multi-stage self-prediction of the session. The main idea of ​​this method is to divide the session into multiple progressively expanding sub-sessions, each representing a gradually accumulating user interaction history, thereby simulating different stages of the recommendation process.

[0037] Global preferences reflect the dynamic changes that user interests may undergo as the conversation progresses. By gradually expanding the user's sub-conversations, the model can incorporate more historical information and extract embedded representations of the user's overall behavioral trends, thereby more comprehensively depicting the user's long-term interests.

[0038] See Figure 1-2 The recommendation method based on aggregated sessions of this invention specifically includes the following steps:

[0039] Step S1: Initialize the embedding layer E and the extension layer SE, wherein the extension layer SE includes an encoder and a decoder. The encoder is a Transformer encoder that removes the positional encoding and dropout layers, and the decoder of the extension layer is a summation operation.

[0040] In this invention, when a set is the object being processed, the model is required to possess permutation invariance. Therefore, the encoder and decoder described above need to constitute a permutation-invariant network, meaning that the model output remains consistent regardless of the interaction order within the set (Lee J, Lee Y, Kim J, et al. Set transformer: A framework for attention-based permutation-invariant neural networks [C] / / International conference on machine learning.PMLR, 2019: 3744-3753). It can be written as:

[0041] SL({x1, x2, ..., x n})=σ({ρ(x1),ρ(x2),…ρ(x n )})

[0042] Here, SL(·) represents the set learning method, ρ(·) represents the extraction of the element embeddings, and σ(·) represents the output of the extracted embeddings. Zaheer et al. proved that when ρ(·) is a continuous function and σ(·) is a summation operator, it can represent any permutation-invariant function (Zaheer M, Kottur S, Ravanbakhsh S, et al. Deep sets[J]. Advances in neural information processing systems, 2017, 30).

[0043] Therefore, the extended layer SE can be deconstructed into a combination of an encoder and a decoder. The encoder is used for element embedding, and the decoder is used for aggregating the output.

[0044] Furthermore, Zaheer et al. found that when the encoder exhibits permutation equivariance, the decoder's output also maintains permutation invariance. Permutation equivariance refers to a property where, as the order of elements in the input data changes, the model's output changes accordingly, maintaining consistency with the permutation relationship of the input.

[0045] Self-attention mechanisms can capture complex information in interactions, and are therefore widely used in conversational recommendation systems. It can be proven that self-attention mechanisms possess permutation invariance or permutation equivariance, thus meeting the requirements of the desired encoder. The proof is as follows: Starting from the formula of the self-attention mechanism, for a given input sequence X = [x1, x2, ..., x...]... n The query key and value are Q = XW. Q K = XW K V = XW V W Q W K W V This is a learnable weight matrix. The attention output is:

[0046]

[0047] Where Att(·) represents the attention output, d k It is the dimension of the key vector.

[0048] Suppose we use a permutation matrix P (where the rows and columns of the permutation matrix are permutations of the standard basis vectors) to permute the input sequence X, resulting in a new sequence X′ = [x θ(1) x θ(2) , ..., x θ(n) ], where θ is a permutation. This leads to a new query, key, and value. The query is:

[0049] Q′=X′W Q =PXW Q =PQ

[0050] Similarly, K′ = PK, V′ = PV. Therefore, the output of attention is:

[0051]

[0052] Since P is a permutation matrix, its transpose P T It is also a permutation matrix, and P T P = I. This formula can be simplified to:

[0053]

[0054] The Transformer architecture is a successful application of the self-attention mechanism. However, positional encoding in the standard Transformer introduces sequential information into the input data, which is incompatible with the requirements of set-based input problems. Furthermore, random dropout of data can lead to information loss, affecting the permutation invariance of the encoder-decoder framework. Therefore, referring to the research of Dai et al. (Dai Z, Yang Z, Yang Y, et al. Transformer-xl: Attentive language models beyond a fixed-length context[J]. arXiv preprint arXiv:1901.02860,2019), a Transformer variant with positional encoding and dropout layers removed was used as the encoder for the set-based extension layer to better adapt to the characteristics of set-based input problems. The research of Haviv et al. confirmed that the above removal operation has almost no impact on the performance of the Transformer (Haviv A, Ram O, Press O, et al. Transformer language models without positional encodings still learn positional information[J]. arXiv preprint arXiv:2203.16634,2022.).

[0055] Regarding the choice of decoder, common feature aggregation methods include taking the mean or maximum of the feature vector dimensions, or directly using a summation operation. The summation operation possesses natural permutation invariance; the summation result is the same regardless of the order of the feature vectors. Therefore, the combined encoder and decoder structure meets the requirements of a permutation-invariant network.

[0056] Step S2: Set the session s = {v1, v2, ... v}n}Divided into n - 1 sub - sessions s1, s2…s according to the recommendation stage n-1 ; where s represents the input session, which includes n interactions v, and the sub - session s i includes all interactions from v1 to v i+1 , where i is a natural number, 0 < i ≤ n - 1. For example, s1 = {v1, v2}, s2 = {v1, v2, v3}, s n-1 = {v1, v2,…v n};

[0057] Step S3: For each sub - session s i , mask its last item v i+1 , input it into the embedding layer E, and obtain its corresponding sub - session feature X i , that is, X i = E(s i );

[0058] For each set of sub - sessions s i , its last item v i+1 itself is affected by v1 to v i . Therefore, in order to be able to correct the parameters of the embedding layer E later, it is necessary to mask its last item v i+1 .

[0059] Step S4: Input the session s into the embedding layer E to obtain the global session feature X g , that is, X g = E(s); Input the last item v n of the session s into the embedding layer E to obtain the nearest session feature X l , that is, X l = E({v n});

[0060] Step S5: Input each sub - session feature X i , the global session feature X g into the extension layer SE, and respectively obtain the recommendation r i corresponding to each sub - session feature X i , the global preference r g , input the nearest session feature X l into the value embedding layer to obtain the nearest preference r l , that is: r i = SE(X i ), r g = SE(X g ), r l = E(X l );

[0061] Step S6: The global preference rg With recent preference r l By concatenating and reducing the dimensionality, we obtain the combined interest r representing the complex relationships in the conversation. c The formula is as follows:

[0062]

[0063] in This represents a linear transformation operation. This represents the concatenation between embeddings, where α is a learning parameter, 0 < α < 1, used to control the degree of influence of recent interests on the session representation;

[0064] Step S7: Optimize the parameters of the embedding layer E and the extended layer SE through a self-supervised learning mechanism, wherein, during the learning process, the total loss function L... loss Defined as:

[0065] L loss =L rec +βL self

[0066] Among them, L rec For the recommendation loss function, L self Let β be the self-supervised loss function, where β represents the proportion of the self-supervised task, and 0 < β < 1.

[0067] For the self-supervised loss function L self Defined as:

[0068]

[0069] Also about to E(v i+1 ) as a sub-session set s i The corresponding expected output.

[0070] For the recommended loss function L rec Using the Top1Loss function commonly used in the recommender system field

[0071]

[0072] in:

[0073]

[0074] To predict the interaction score vector, W p and b p These are the weight matrix and bias vector of the linear layer, respectively; N is... The vector dimension, target is the specified target index, and σ is the Sigmoid function.

[0075] Step S8: Calculate the results of the predicted interaction:

[0076] Through a self-supervised learning mechanism, after obtaining the final embedding layer E and extension layer SE, a softmax function is used to predict the interaction score vector. Convert to interaction probability

[0077]

[0078] Interaction probability This represents the probability of the next interaction occurring in session s, and the one with the highest probability is selected as the predicted interaction result.

[0079] For the method validation and evaluation of this invention, the real datasets Yoochoose and Diginetica were used. The Yoochoose dataset comes from the RecSys 2015 challenge, and its training set consists of session events collected from e-commerce websites. The Diginetica dataset originates from the CIKM Cup 2016, and only transaction data was used in this study. For ease of comparison, sessions with only one item were first filtered out. Secondly, the items in the sessions were processed chronologically. Because the Yoochoose dataset is very large, model training efficiency is low. Considering that training on the most recent data yields better results than training on the complete dataset, the most recent 1 / 64 of the session data, i.e., Yoochoose1 / 64, was used. Data statistics are shown in Table 1.

[0080] Table 1. Statistics of the datasets used in the experiment.

[0081]

[0082] The performance of the above methods is compared using the following evaluation metrics, which have been widely used in the field of conversation recommendation.

[0083] P@K: P@K scores are widely used in the field of conversational recommender systems to evaluate prediction accuracy. P@K represents the proportion of test cases that contain the correct recommendation in the top K positions of the sorted list. The formula is:

[0084]

[0085] Where N represents the number of samples used for the session recommendation task in the test, n hit This represents the number of samples containing the target item in the top K rankings. A prediction is considered accurate when the target item is in the top K positions of the ranking list. In this paper, we use P@10 and P@20 to evaluate the performance on all test sets.

[0086] MRR@K: MRR (mean reciprocal rank) is the average of the reciprocals of the expected recommended item rankings. If the ranking exceeds K, the reciprocal rank is set to 0. In this paper, we use MRR@10 and MRR@20. The definition of MRR@K is:

[0087]

[0088] Where Rank(v) t ) is project v t Rank in total itemset V.

[0089] Both P and MRR are normalized scores ranging from [0,1]. An increase in their values ​​reflects the expectation that more recommendations will be placed in the ranked list, indicating that the corresponding recommender system performs better.

[0090] Table 2: Performance comparison of the method of the present invention with existing advanced recommendation methods on different datasets

[0091]

[0092]

[0093] As shown in the table above, the session recommendation method based on self-supervised multi-stage set expansion proposed in this invention achieves state-of-the-art performance on both P@K and MRR@K datasets. The presented methods cover classic recommendation methods (such as POP and Item-KNN) as well as recent deep learning-based sequence recommendation models (such as GRU4REC, STAMP, SR-GNN, etc.), which verifies the effectiveness of the proposed method.

[0094] On the Yoochoose 1 / 64 dataset, this invention achieves significant advantages across multiple metrics, including P@10, MRR@1, P@20, and MRR@2, particularly reaching 74.32% for P@20, while other methods do not exceed 73%. This demonstrates that this invention outperforms current state-of-the-art methods in terms of accuracy and ranking quality for short-term sequence recommendation. In particular, compared to representative sequence recommendation algorithms such as GRU4REC and SR-GNN, this invention exhibits higher recommendation accuracy and ranking robustness.

[0095] On the Diginica dataset, this invention also demonstrates strong generalization ability, with P@10 and P@20 reaching 41.04% and 60.12% respectively, significantly higher than mainstream methods such as SR-GNN (36.86% and 56.07%) and STAMP (33.98% and 45.64%), indicating its superior adaptability across datasets. Furthermore, the improved MRR@1 and MRR@2 metrics show that this invention performs well in ranking the top recommendations, further validating the recommendation effectiveness of the method.

[0096] The above tables and detailed description of the comparison results fully demonstrate the superior performance of the method of the present invention on different datasets, proving its effectiveness and robustness in recommender systems.

[0097] In the training process of this invention, the data preprocessing stage does not split the session; instead, the entire session is processed through a multi-stage training strategy to preserve its integrity. This training method can fully preserve the continuous intent of the session, thereby enhancing the model's ability to capture complex interaction relationships and meeting the requirements for recommendation accuracy in practical applications.

[0098] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of recommending based on a set-type session, characterized by, Comprising the steps of: Step S1: initializing an embedding layer E and an extension layer SE, wherein the extension layer SE comprises an encoder and a decoder, the extension layer SE has permutation invariance; Step S2: Set the session s = {v1, v2, ... v} n The recommendation phase is divided into n-1 sub-sessions s1, s2…s n-1 ; where session s includes n interactions v, and sub-sessions s i Including v1 to v i+1 All interactions, where i is a natural number, 0 <i≤n-1; Step S3: For each sub-session s i , mask its last item v i+1 , input to embedding layer E to get its corresponding sub-session feature X i , i.e., X i = E(s i ); Step S4: input the session s to the embedding layer E to obtain the global session feature X g , i.e., X g = E(s); input the last item v n of the session s to the embedding layer E to obtain the recent session feature X l , i.e., X l = E({v n}) Step S5: input each sub-session feature X i , global session feature X g to the expansion layer SE, respectively to obtain each sub-session feature X i , corresponding recommendation r i , global preference r g ; input the recent session feature X l to the value embedding layer to obtain the recent preference r l , that is: r i = SE(X i ), r g = SE(X g ), r l = E(X l ); Step S6: combine global preferences r g with recent preferences r l in series and reduce dimensionality to obtain a combined interest r c representing complex relationships in a conversation wherein, denotes a linear transformation operation, denotes a concatenation between embeddings, a is a learning parameter, 0 < a < 1, for controlling the degree of influence of recent interests on the session representation; Step S7: optimizing the parameters of the embedding layer E and the extension layer SE through a self-supervised learning mechanism; Step S8: Obtain the predicted interaction score vector by using the optimized embedding layer E and the expansion layer SE Wherein: W p and b p are the weight matrix and bias vector of the linear layer, respectively; And then using the softmax function, we convert into interaction probabilities Interaction probability represents the probability of the occurrence of the next interaction in the session s, the maximum probability is selected as the result of the predicted interaction.

2. The method of claim 1, wherein, In step S1, the encoder is a Transfomer encoder with position encoding and dropout layer removed, and the decoder is a summation operation.

3. The method of claim 1, wherein, In step S7, in the self-supervised learning mechanism, a loss function is defined: L loss = L rec + βL self wherein L rec is a recommendation loss function, L self is a self-supervised loss function, and β represents the proportion of the self-supervised task, 0 < β < 1. L rec Top1Loss is the Top1Loss function.

4. The method of claim 3, wherein: where N is Vector dimension, target is the set target index, and σ is the Sigmoid function.

Citation Information

Patent Citations

  • Session recommendation method, system and equipment based on self-supervised graph learning

    CN114969561A

  • User preference prediction method based on graph neural network session recommendation system

    CN116680456A