Mamba dual-channel denoising network session recommendation method and system based on hypergraph
By constructing a session hypergraph and a global graph, and combining hypergraph attention and the Mamba mechanism, the problems of high-order relationships and noise in many-to-many relationships within a session are solved, achieving high efficiency, accuracy and stability in session recommendation.
Patent Information
- Application Number
- CN202511962619.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-02-24
AI Technical Summary
Existing session recommendation technologies struggle to uniformly express many-to-many higher-order item relationships and local co-occurrence relationships within a session. In long session scenarios, computational overhead is high, and noisy behavior affects recommendation accuracy and robustness.
By constructing a session hypergraph that includes sequential transition hyperedges and locally co-occurring hyperedges, and combining hypergraph attention and Mamba mechanisms for message passing and aggregation, a session-level global graph is constructed and pruned and sparse attention is aggregated, thus fusing session representations of local and global channels.
It improves the integrity and distinguishability of the representation of interest structure within the conversation, reduces noise interference, and enhances the accuracy and stability of the recommendation results.
Smart Images

Figure CN121561198A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information retrieval technology, and in particular to a hypergraph-based Mamba dual-channel denoised network session recommendation method and a hypergraph-based Mamba dual-channel denoised network session recommendation system. Background Technology
[0002] Conversational recommendation systems are a type of recommendation technology that relies solely on a user's current conversational behavior and predicts the items a user will interact with next, even in the absence of long-term user profiles. They are widely used in e-commerce, content aggregation, and short video applications. By modeling short conversation sequences of anonymous users, the data sparsity and cold-start problems inherent in traditional personalized recommendations can be alleviated to some extent. Therefore, conversational recommendation has become an important technical means to improve conversion and retention rates.
[0003] Existing session recommendation methods can be broadly categorized into three types. The first type is based on traditional methods such as association rules, Markov chains, and collaborative filtering. These methods often rely on historical statistical relationships between users and items or low-order transition probabilities, and can only characterize simple transition patterns between adjacent items. They are unable to model the many-to-many high-order relationships in a session where one item corresponds to multiple predecessor / successor items, nor can they effectively utilize the co-occurrence semantics within a local window.
[0004] The second category is based on attention mechanisms or sequence models. These methods use structures such as RNN / GRU, Self-Attention, and Transformer to characterize the evolution of user interests from a time-series perspective. However, standard self-attention mechanisms often treat all positions equally, resulting in limited sequential information encoding capabilities. Furthermore, in long sequence scenarios, they face O(n²) complexity and significant noise introduction issues, and tend to treat random clicks and accidental touches as valid signals, thus affecting recommendation accuracy.
[0005] The third category is session recommendation methods based on graph neural networks. By modeling sessions as directed or undirected graphs, GNNs or graph attention mechanisms are introduced to propagate information at the item level. This can uncover adjacency relationships and local structures to some extent, but they generally still use paired edges to model item relationships, which is insufficient for characterizing high-order collaborative relationships between multiple items in a session. Multi-layer graph convolutions are also prone to over-smoothing, leading to convergence of node representations. At the same time, when building global relationships at the session level, there is a lack of effective pruning and sparse aggregation strategies, making it difficult to filter out occasional co-occurring noisy edges and noisy sessions in a timely manner.
[0006] Therefore, existing conversation recommendation technologies generally suffer from the following technical problems: First, graph structures or one-dimensional sequence structures based on paired edges cannot uniformly express the complex many-to-many high-order item relationships and local co-occurrence relationships within a conversation, resulting in insufficient characterization of users' true interest patterns; second, in long conversation scenarios, traditional self-attention or graph neural networks have high computational overhead and low efficiency when modeling long-range dependencies, making it difficult to balance modeling ability and online inference performance; third, there is a lack of systematic denoising mechanisms for noisy behaviors and noisy connections, which easily includes accidental clicks and weakly related conversations in the aggregation scope, both within a conversation and at the global level across conversations, reducing the robustness and accuracy of the recommendation results. How to simultaneously achieve high-order structural relationship modeling within a conversation and global relationship modeling between conversations in conversation recommendation scenarios, and introduce effective denoising mechanisms to improve recommendation accuracy and robustness while controlling complexity, still needs further research. Summary of the Invention
[0007] To address the aforementioned issues, this invention provides a Mamba dual-channel denoising network session recommendation method and system based on a hypergraph. By constructing a session hypergraph based on session sequences, simultaneously including sequential transition hyperedges and local co-occurrence hyperedges, a unified model of many-to-many high-order item relationships within a session is achieved, improving the completeness and distinguishability of the session interest structure representation. By performing hypergraph attention message passing and aggregation on the session hypergraph and introducing selective state-space sequence modeling based on the Mamba mechanism, long-range dependency features within the session are extracted, enhancing the ability to characterize sequence transition patterns while maintaining low computational complexity. By constructing a session-level global graph and employing degree-sensitive pruning and entmax-based sparse attention aggregation in the global encoder, the associations between sessions are filtered and focused, reducing noise interference from accidental co-occurrences. By fusing session representations from local and global channels and outputting candidate item prediction probabilities accordingly, the synergistic utilization of local preferences and global associations is achieved, improving the accuracy and stability of the recommendation results.
[0008] To achieve the above objectives, this invention provides a hypergraph-based Mamba dual-channel denoising network session recommendation method, comprising: Acquire historical interaction data containing multiple user session sequences, and encode items in the sessions to form item embeddings; Based on the session sequence, items in the session are used as hypergraph nodes, and a first type of hyperedge is constructed to represent the sequential transfer relationship of items and a second type of hyperedge is constructed to represent the local co-occurrence relationship of items, thereby obtaining a session hypergraph to model the many-to-many higher-order item relationships existing in the session. On the session hypergraph, message passing and aggregation of higher-order interactions between nodes and hyperedges are performed based on the hypergraph attention layer to obtain a higher-order structural representation of items within the session. The higher-order structural representation is then input into a sequence feature extraction layer based on the Mamba mechanism to extract long-range dependency features within the session based on a selective state space model, thereby obtaining a session representation of local channels within the session. Based on the session sequence, each session is used as a global graph node. A session-level global graph is constructed according to the co-occurrence relationship between sessions, and the session node embedding is initialized. The session-level global graph is input into a global encoder. By pruning the global graph and aggregating sparse attention, the session relationship features between sessions are generated, and the session representation of the global channel between sessions is obtained. The session representation of the local channel is fused with the session representation of the global channel to obtain the final session representation of the target session; Based on the final session representation and candidate item embedding, the selection probability of each candidate item is calculated, and a recommendation result for the target session is generated according to the selection probability.
[0009] In the above technical solution, preferably, the specific construction process of the session hypergraph includes: For each target item in each session sequence, obtain the set of predecessor items of the target item in the session, and form a transition hyperedge by combining the target item and its predecessor items. When the target item is the first item in the session, its predecessor item set is empty. At this time, the corresponding transition hyperedge only contains the item itself. All the transition hyperedges constitute the first type of hyperedge set. For one or more preset window sizes, a sliding window approach is used on each session sequence to construct context hyperedges for items within each window position. The context hyperedges corresponding to all window positions constitute the context hyperedge set corresponding to the window size. The context hyperedge sets corresponding to each window size are merged to obtain the second type of hyperedge set. The first type of hyperedge set and the second type of hyperedge set are merged to obtain the hyperedge set in the session hypergraph.
[0010] In the above technical solution, preferably, the specific process of message passing and aggregation of higher-order interactions between nodes and hyperedges based on the hypergraph attention layer on the session hypergraph includes: During the node-to-hyperedge message passing phase, for each hyperedge, element-wise multiplication is performed based on the hyperedge context embedding and the node embeddings of each node contained in the hyperedge to obtain a combined feature. The combined feature is then multiplied by the first learnable parameter vector and activated by LeakyReLU to obtain an attention score. The attention scores of each node within the same hyperedge are then exponentialized and normalized to obtain node attention weights. The node embeddings are then weighted and aggregated based on the node attention weights to update the hyperedge representation. In the message passing phase from hyperedge to node, for each node, the node embedding is added to the jump connection term to obtain the node intermediate representation. Based on the node intermediate representation and the hyperedge representations containing the node, element-wise multiplication is performed to obtain the combined feature. The combined feature is then subjected to inner product operation with the second learnable parameter vector and activated by LeakyReLU to obtain the attention score. The attention scores of each hyperedge corresponding to the same node are exponentialized and normalized to obtain the hyperedge attention weight. Based on the hyperedge attention weight, the hyperedge representations are weighted and summed to update the node representation.
[0011] In the above technical solution, preferably, the sequence feature extraction layer integrating the Mamba mechanism includes a selective state-space model, and is formed by repeatedly stacking Mamba layers containing layer normalization, feedforward networks, and residual connections and normalization. The specific process includes: Perform a linear transformation on the in-session item representation output by the hypergraph attention layer to obtain the input features; The input features are input into the selective state space model, and state updates are performed based on the parameter matrix of the state space model to generate an output; During the state update process, the parameter matrix is dynamically adjusted based on the input features using selective gating, and the gating is applied to the state update or output generation through element-wise multiplication. The output is processed sequentially with layer normalization, feedforward network, and residual connection and normalization to obtain the session representation of the local channel within the session.
[0012] In the above technical solution, preferably, the specific process of constructing a session-level global graph and generating an inter-session global channel session representation includes: Each session is used as a node in the session-level global graph, and the session-level global graph is constructed based on the co-occurrence relationship between sessions. The session-level global graph does not contain item embedding information. Based on the average result of item embedding in each session, the initial session node embedding of each session node in the session-level global graph is generated; Based on the degree matrix and global inter-session relationship matrix of the session-level global graph, graph convolution operation is performed on the initial session node embedding to learn the inter-session relationship representation, and the inter-session relationship representation is input into the global encoder to obtain the session representation of the global inter-session channel.
[0013] In the above technical solution, preferably, the global encoder includes a degree-sensitive pruning mechanism, specifically including: Obtain the node degree of each session node in the session-level global graph; Based on the node degree, a pruning probability is determined for each session node, such that the pruning probability is inversely proportional to the node degree of the corresponding session node; Random pruning is performed on the edge relationships in the session-level global graph based on the pruning probability to obtain the pruned session-level global graph.
[0014] In the above technical solution, preferably, the global encoder uses a sparse attention mechanism to update the session node representation, specifically including: For each target session node in the pruned session-level global graph, the attention scope is defined by the neighboring session nodes of the target session node, and the attention score is calculated based on the representation of the target session node and the representations of each neighboring session node. The attention score is input into the entropy maximization function entmax to generate a sparse attention weight distribution; The neighbor session node representations are weighted and aggregated based on the sparse attention weights to update the session node representation of the target session node.
[0015] In the above technical solution, preferably, the global encoder further includes session similarity neighbor collaboration, specifically including: Based on the updated session node representation using the sparse attention mechanism, the cosine similarity between the target session node and the candidate session node is calculated, and the similarity score of the candidate session node is obtained based on the cosine similarity scaling factor γ. The top K session nodes with the highest similarity scores from the candidate session nodes are selected as the similar neighbor set. The representations of each session node in the similar neighbor set are then weighted and aggregated based on the similarity scores to obtain the neighbor cooperation representation. The neighbor collaboration representation is fused with the session node representation of the target session node to obtain the session representation of the global inter-session channel.
[0016] In the above technical solution, preferably, the training of the hypergraph-based Mamba dual-channel denoising network session recommendation model includes the following specific steps: The historical item sequence of each session in the training dataset is used as input, and the actual item selected in the next step of the session is used as the supervision label. Based on the final session representation and the candidate item embedding, the predicted selection probability distribution of each candidate item is calculated. Using the cross-entropy between the indicator label corresponding to the actual selected item and the predicted probability distribution as the loss function, backpropagation is performed on the parameters in the hypergraph attention layer, the sequence feature extraction layer based on the Mamba mechanism, the global encoder, and the prediction layer to complete the parameter update.
[0017] This invention also proposes a hypergraph-based Mamba dual-channel denoising network session recommendation system, which applies the hypergraph-based Mamba dual-channel denoising network session recommendation method disclosed in any of the above technical solutions, including: The data processing module is used to acquire historical interaction data containing multiple user session sequences and encode items in the session to form item embeddings; The hypergraph construction module is used to construct a first type of hyperedge representing the sequential transfer relationship of items and a second type of hyperedge representing the local co-occurrence relationship of items based on the session sequence, thereby obtaining a session hypergraph. The hypergraph encoding module is used to perform message passing and aggregation on the high-order interactions between nodes and hyperedges based on the hypergraph attention layer on the session hypergraph to obtain a high-order structural representation of items within the session. The high-order structural representation is then input into a sequence feature extraction layer based on the Mamba mechanism to extract long-range dependency features within the session based on a selective state space model, thereby obtaining a session representation of local channels within the session. The global encoding module is used to construct a session-level global graph based on the session sequence, taking each session as a global graph node, constructing a session-level global graph according to the co-occurrence relationship between sessions, initializing the session node embedding, inputting the session-level global graph into the global encoder, and generating inter-session relationship features by pruning the global graph and sparse attention aggregation to obtain the session representation of the global channel between sessions. The session fusion module is used to fuse the session representation of the local channel with the session representation of the global channel to obtain the final session representation of the target session, calculate the selection probability of each candidate item based on the final session representation and the candidate item embedding, and generate the recommendation result of the target session according to the selection probability.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) By constructing a session hypergraph containing sequential transition hyperedges and local co-occurrence hyperedges based on the session sequence, a unified modeling of many-to-many high-order item relationships within the session is achieved, thereby improving the completeness of the interest structure representation within the session.
[0019] (2) By using a hypergraph attention layer on the session hypergraph to perform message passing and aggregation between nodes and hyperedges, and inputting the resulting high-order structure representation into a sequence feature extraction layer based on the Mamba mechanism, the extraction of long-range dependency features within the session is realized, thereby improving the ability of the session representation to characterize the sequence transition rules.
[0020] (3) By constructing a session-level global graph and performing pruning and sparse attention aggregation in the global encoder to generate session relationship features, the filtering and aggregation of session association information is realized, reducing the interference of noisy connections on the global representation and improving focus.
[0021] (4) By integrating local channel session representation and global channel session representation and calculating the click probability of candidate items accordingly, recommendation results are generated, thereby realizing the synergistic use of local preferences and global associations and improving the accuracy and stability of recommendation results. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the flowchart of a hypergraph-based Mamba dual-channel denoising network session recommendation method disclosed in one embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] The present invention will now be described in further detail with reference to the accompanying drawings: like Figure 1 As shown, a hypergraph-based Mamba dual-channel denoising network session recommendation method according to the present invention includes: First, historical interaction data containing multiple user session sequences is obtained, and each item in the session is encoded to form an item embedding.
[0025] Subsequently, based on the session sequence, items are used as hypergraph nodes to construct a first type of hyperedge to represent the sequential transfer relationship of items and a second type of hyperedge to represent the local co-occurrence relationship of items, thus obtaining a session hypergraph to model the many-to-many higher-order item relationships within a session.
[0026] On the session hypergraph, message passing and aggregation are performed between nodes and hyperedges based on the Hypergraph Attention (HGA) layer to obtain a high-order structural representation of items within the session; the high-order structural representation is input into a sequence feature extraction layer based on the Mamba mechanism, and long-range dependency features within the session are extracted based on a selective state space model to obtain a session representation of local channels within the session.
[0027] Simultaneously, based on the session sequence, each session is used as a global graph node. A session-level global graph is constructed according to the co-occurrence relationship between sessions, and the session node embedding is initialized. The session-level global graph is input into a global encoder. By pruning the global graph and aggregating sparse attention, session relationship features are generated to obtain the session representation of the global channel between sessions.
[0028] The session representations of the local channels and the global channels are further fused to obtain the final session representation of the target session. Based on the final session representation and the candidate item embeddings, the predicted probability of each candidate item is calculated, and the recommendation result of the target session is generated according to the predicted probability.
[0029] In one possible implementation, the predicted probability can be calculated from the similarity score between the final session representation and the embedding of each candidate item, and the score of each candidate item is normalized to form a probability distribution.
[0030] In this implementation, a structured characterization of interest migration within a session is achieved through high-order relationship modeling of the session hypergraph and long-range dependency modeling of the Mamba mechanism; the filtering and focusing of inter-session related information is achieved through pruning of the session-level global graph and sparse attention aggregation; and the synergistic utilization of local interests and cross-session common preferences is achieved through dual-channel fusion and probabilistic prediction output, thereby improving the accuracy and stability of recommendation results.
[0031] In the above embodiments, preferably, the specific construction process of the session hypergraph includes: For each target item in each session sequence, obtain the set of predecessor items of the target item in the session, and form a transition hyperedge by combining the target item and its predecessor items; when the target item is the first item in the session, its predecessor item set is empty, and the corresponding transition hyperedge only contains the target item itself. All transition hyperedges constitute the first type of hyperedge set.
[0032] Specifically, regarding the conversation s Each item in Define its predecessor set Then construct the transition hyperedge:
[0033] in, Indicates the first j A transition hyperedge of an item, containing the item and all its predecessor items. All transition hyperedges form a set. :
[0034] Transition hyperedges are used to capture the sequential transition relationships between items and can model the temporal dependencies of items in a session. Compared to a regular session graph that only connects adjacent items as edges, transition hyperedges aggregate the entire prefix sequence at once, making them more suitable for describing long-range transition paths and multi-hop interest migrations.
[0035] For one or more preset window sizes, a sliding window approach is used on each session sequence to construct context hyperedges for items within each window position. The context hyperedges corresponding to all window positions constitute the context hyperedge set corresponding to the window size. The context hyperedge sets corresponding to each window size are merged to obtain the second type of hyperedge set.
[0036] Specifically, sliding windows of different sizes are used to capture local object relationships. Regarding window size... ω Context hyperedges are generated on the session sequence by using a sliding window.
[0037] For each window position w Define context hyperedge :
[0038] For window size ω Generate a set of context hyperedges :
[0039] For multiple window sizes W Merge context superedges of all window sizes :
[0040] Final set of hyperedges for:
[0041] Contextual hyperedges are used to capture local semantic information of item sequences, enabling the modeling of local relationships between items in a session. Compared to existing methods that rely entirely on self-attention to model local relationships, this module encodes local co-occurrence patterns into stable higher-order structures through contextual hyperedges formed by multi-scale windows, without introducing quadratic complexity.
[0042] The first type of hyperedge set and the second type of hyperedge set are merged to obtain the hyperedge set in the session hypergraph.
[0043] In this implementation, prefix order transition relations are aggregated and represented by transition hyperedges, and local co-occurrence relations are aggregated and represented by multi-window context hyperedges, thereby achieving unified encoding of intra-session order dependencies and local semantic co-occurrence, providing a more stable structural prior for subsequent high-order structural representation learning.
[0044] In the above embodiments, preferably, the specific process of message passing and aggregation of higher-order interactions between nodes and hyperedges based on the hypergraph attention layer on the session hypergraph includes: During the message passing phase from node to hyperedge, for each hyperedge... e j The process involves obtaining the hyperedge context embedding at layer k and the node embeddings of each node contained within the hyperedge at layer k; for each node, element-wise multiplication is performed between the hyperedge context embedding and the node embedding to obtain a combined feature vector; the inner product operation is performed between the combined feature vector and the first learnable parameter vector, and LeakyReLU activation is applied to the inner product result to obtain the attention score of the node relative to the hyperedge; the attention scores of each node within the same hyperedge are subjected to exponentialization and normalization to obtain the attention weights of the hyperedge for each node; and the node embeddings are weighted and aggregated based on the attention weights to update the hyperedge representation at layer k.
[0045] Specifically, hyper-edge e j In the k Layer representation It can be calculated using the following formula:
[0046] in, It is the aggregation function from the node to the hyperedge. Attention weights:
[0047] in, It is a super-edge In the k Layer context embedding, It is a node In the k Layer embedding, It is a learnable parameter vector, and ⊙ represents element-wise multiplication.
[0048] During the message passing phase from the hyperedge to the node, for each node... v i First, the node embedding at layer k is added to the skip connection term at layer k to obtain the intermediate node representation for attention calculation. For each hyperedge containing the node, the hyperedge representation at layer k is obtained. Element-wise multiplication is performed between the intermediate node representation and the hyperedge representation to obtain a combined feature vector. The combined feature vector is then multiplied by the second learnable parameter vector and subjected to LeakyReLU activation to obtain the attention score of the node relative to the hyperedge. The attention scores of each hyperedge corresponding to the same node are exponentialized and normalized to obtain the attention weights of the node for each hyperedge. Based on these attention weights, a weighted sum is performed on the hyperedge representations to obtain the attention score of the node at layer k. k The updated node representation of the layer.
[0049] Specifically, nodes v i In the k Layer update representation It can be calculated using the following formula:
[0050]
[0051]
[0052] in, It contains nodes v i The set of superedges s k It is a jump connector. It is a learnable parameter vector. For nodes v i In the k Layer query embedding, Indicates from the superedge e j To the node v i In the k Attention weights of layers.
[0053] Through bidirectional message passing from node to hyperedge and from hyperedge to node, this module can perform weighted aggregation of multi-item interactions at the hyperedge level. Compared with baseline models such as MSGAT that only perform sparse attention on paired edges, this is more conducive to explicitly characterizing high-order collaborative relationships.
[0054] In this implementation, weighted aggregation of high-order interaction information is achieved in a single-layer hypergraph structure through bidirectional attention message passing from node to hyperedge and from hyperedge to node. The risk of feature degradation is mitigated by skip connection terms, thereby improving the discriminability and stability of high-order structure representation within the session.
[0055] In the above embodiments, preferably, the sequence feature extraction layer integrating the Mamba mechanism includes a selective state space model and is formed by repeatedly stacking Mamba layers containing layer normalization, feedforward networks, and residual connections and normalization.
[0056] In this embodiment, a linear transformation is performed on the in-session item representation output by the hypergraph attention layer to obtain input features; the input features are input into the selective state space model, and state updates are performed based on the parameter matrix of the state space model to generate an output; during the state update process, the parameter matrix is dynamically adjusted according to the input features based on selective gating, and the gating is applied to the state update or output generation through element-wise multiplication; the output is sequentially processed by layer normalization, feedforward network, and residual connection and normalization to obtain the session representation of the local channel within the session.
[0057] During implementation, the Mamba layer repeats L times to capture hierarchical patterns in the session sequence. The specific calculation process is as follows: First, the output of the hypergraph attention layer is mapped to a higher dimension through a linear transformation to capture richer node features:
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064] in, It is the output of the hypergraph attention layer. It is a selective state-space model. and It is the parameter matrix of the state-space model. Represents element-wise multiplication. This represents the output representation after the input features are expanded in dimension through a linear transformation layer. Indicates auxiliary projection features, This is an intermediate feature representation after processing by one-dimensional convolution and a non-linear activation function. Represents the input state matrix. This represents the output state matrix. This is a dynamic time step parameter that enables input-dependent state discretization, transforming continuous state-space parameters into a discrete form to support dynamic state evolution processes. To output the state space using element-wise multiplication With the process Activated auxiliary features Perform feature representation after fusion. This represents the final output representation of the Mamba module. Unlike traditional models that obtain long-range dependencies by simply stacking multiple GNNs, this invention adopts a decoupled design combining a single-layer hypergraph with a multi-layer state space, avoiding the problems of over-smoothing of representations and information loss caused by multi-layer graph convolution.
[0065] In this implementation, a selective state-space model is used to model long-range dependencies of the session sequence, and selective gating is used to dynamically adjust the parameters of the state-space model. This enables the suppression of irrelevant noise information and the preservation of key transition patterns, thereby improving the ability of the in-session representation to characterize sequence patterns in long sequence scenarios.
[0066] In the above embodiments, preferably, the specific process of constructing a session-level global graph and generating an inter-session global channel session representation includes: Using each session as a node, inter-session relationships are constructed based on the co-occurrence relationships between sessions to obtain an adjacency matrix of the session-level global graph, wherein the session-level global graph does not contain item embedding information.
[0067] Initial session node embeddings are generated for each session node in the session-level global graph based on the average result of item embeddings in each session. Based on the degree matrix and global-level inter-session relationship matrix of the session-level global graph, graph convolution operations are performed on the initial session node embeddings to learn the inter-session relationship representation. The inter-session relationship representation is then input into the global encoder to extract the transition patterns and common preference features between sessions, so as to obtain the session representation of the global channel between sessions.
[0068] Specifically, initial session node embeddings are generated based on average item embeddings, and initial inter-session relationship representations are learned through graph convolution operations:
[0069] in, It is the degree matrix of the current global graph. A g This represents the global-level inter-session relationship matrix. p Representing a global graph G g The total number of session nodes in the middle. q This indicates the number of layers in the current graph convolution operation. The identity matrix is used. Compared to the baseline that only performs convolutions on a single session graph, this invention provides a more accurate session-level initial representation for subsequent sparse attention and neighbor collaboration through global graph convolutions.
[0070] In this implementation, co-occurrence relationships are explicitly modeled at the cross-session level through a session-level global graph, and inter-session relationship representations are formed through graph convolution, providing a more consistent session-level input representation for the subsequent global encoder to extract session transition patterns and common preference features.
[0071] In the above embodiments, preferably, the global encoder includes a degree-sensitive pruning mechanism, specifically including: Obtain the node degree of each session node in the session-level global graph; determine the pruning probability for each session node based on the node degree, such that the pruning probability is inversely proportional to the node degree of the corresponding session node; perform random pruning on the edge relationships in the session-level global graph based on the pruning probability to obtain the pruned session-level global graph.
[0072] Specifically, to address the interference caused by irrelevant clicks on items within a session and the resulting interest bias, degree-sensitive pruning is used to filter noise from the global session relation representation. Degree-sensitive pruning prioritizes removing low-degree nodes, with a pruning probability... p i The calculation is as follows:
[0073] in, N ( v i ) is a node v i The neighborhood, d ( u ) is a node u The mechanism adaptively weakens weak connections caused by accidental co-occurrence based on node degree, achieving more refined structural denoising at the global level compared to models that directly perform attention aggregation on the entire graph.
[0074] In this implementation, the edge relationships of the global graph are adaptively sparsified by pruning probability allocation based on node degree, which reduces the interference of weak connections formed by accidental co-occurrence on the representation of inter-session relationships and improves the purity of global structural information.
[0075] In the above embodiments, preferably, the global encoder uses a sparse attention mechanism to update the session node representation, specifically including: For each target session node in the pruned session-level global graph, the attention scope is defined by its pruned neighbor session nodes. An attention score is calculated based on the target session node representation and the representations of each neighbor session node. The attention score is input into the entropy maximization function entmax to generate a sparse attention weight distribution. The neighbor session node representations are weighted and aggregated based on the sparse attention weights to update the session node representation of the target session node.
[0076] Specifically, a sparse attention mechanism is used to update node information:
[0077]
[0078]
[0079] in, , , , It is a learnable weight matrix. , It is a bias term. entmax It is the entropy maximization function. Indicates passage The global attention weights calculated by the activation function are used to control the intensity of attention allocation. The attention entropy value is calculated using a multilayer perceptron. This is the updated representation of the session nodes after the sparse attention mechanism. Unlike conventional graph attention which uses a softmax distribution, entmax can generate naturally sparse attention weights, automatically ignoring most irrelevant session nodes, thereby further improving the noise resistance of the global channel.
[0080] In this implementation, a sparse attention weight distribution is generated by entmax, which enables the aggregation process to assign higher weights to a few key neighbors and reduce the weight ratio of irrelevant neighbors, thereby improving the global channel's ability to focus on key information and enhancing the distinguishability of inter-session relationship features.
[0081] In the above embodiments, preferably, the global encoder further includes session similarity neighbor collaboration, specifically including: Based on the updated session node representation using the sparse attention mechanism, the cosine similarity between the target session node and candidate session nodes is calculated, and the similarity score of the candidate session nodes is obtained based on the cosine similarity scaling factor γ. The top K session nodes with the highest similarity scores from the candidate session nodes are selected as a set of similar neighbors, and the session node representations in the set of similar neighbors are weighted and aggregated based on the similarity scores to obtain the neighbor collaboration representation. The neighbor collaboration representation is then fused with the session node representation of the target session node to obtain the session representation of the global inter-session channel.
[0082] Specifically, to further filter noise and enhance the current session representation, the representation is updated by calculating session similarity based on similar neighbor session information:
[0083]
[0084]
[0085] in, δ j γ is the similarity score of neighboring nodes, and γ is the cosine similarity scaling factor. The conversation similarity score. , Let represent the global representation of the current session and the global representation of the j-th neighbor session, respectively. Select the session with the highest similarity. K Each neighbor is used as an auxiliary representation of the current session to obtain the final output. Compared to baseline models that only utilize the behavior of the current session to model preferences, this module explicitly introduces cross-session auxiliary information through similar neighbor collaboration, which helps alleviate the information sparsity problem in long-tail items and short-session scenarios.
[0086] In a specific implementation process, K is taken as 5 and γ is taken as 1.7.
[0087] In this implementation, Top-K neighbor collaborative aggregation driven by similarity scores is used to introduce cross-session information that is closer to the target session's interests into the global representation construction process, which alleviates the information sparsity problem in short session and long-tail item scenarios and improves the stability of global channel representation between sessions.
[0088] In the above implementation, preferably, the training of the hypergraph-based Mamba dual-channel denoising network session recommendation model includes the following specific steps: The historical item sequence of each session in the training dataset is used as input, and the actual item selected in the next step of the session is used as the supervision label. The predicted selection probability distribution of each candidate item is calculated based on the final session representation and the candidate item embedding. Using the cross-entropy between the indicator label corresponding to the actual selected item and the predicted probability distribution as the loss function, backpropagation is performed on the parameters in the hypergraph attention layer, the sequence feature extraction layer based on the Mamba mechanism, the global encoder, and the prediction layer to complete the parameter update.
[0089] Specifically, the output of the Mamba-based sequence feature extraction layer is combined with the output of the global encoder to obtain the final session representation. Items are then calculated from the final session representation. i Corresponding click probability :
[0090]
[0091] in, Hf , This is the initial embedding of item nodes. By fusing the hypergraph channel (characterizing higher-order item relationships within a session) and the global channel (characterizing common interests between sessions), this invention comprehensively utilizes local and global information within a unified framework, achieving a more comprehensive and robust session representation compared to the single-channel baseline model.
[0092] Finally, the cross-entropy between the true and predicted values is used as the loss function for the HM-DDN model:
[0093] in, y i It is an item i The true label.
[0094] In the training and validation phase, the model was evaluated on the NowPlaying and Tmall datasets. The model was implemented using the PyTorch framework and deployed on an RTX 3090 GPU. The default batch size and embedding dimension were set to 256 and 100, respectively. An Adam optimizer with a learning rate of 0.005 was used, decaying by 0.1 every three epochs. HM-DDN-specific hyperparameters included: neighbor node weights. W ne =1.7, cosine similarity scaling factor γ=1.7, Mamba layer number L=2.
[0095] Precision@20 and MRR@20 were used as evaluation metrics. Precision@20 (P@20) was used to measure the proportion of relevant items among the top 20 recommended items, and Mean Reciprocal Rank@20 (MRR@20) was used to measure the average reciprocal rank of the first relevant item among the top 20 recommendations.
[0096] The experimental results for the NowPlaying and Tmall datasets are shown in the table below.
[0097] Table 1. Experimental data results for the NowPlaying and Tmall datasets.
[0098] On the NowPlaying dataset, HM-DDN achieves a Precision@20 of 43.87 and an MRR@20 of 19.14; on the Tmall dataset, it achieves a Precision@20 of 45.38 and an MRR@20 of 21.76. Compared to the current state-of-the-art baseline model, HM-DDN achieves a maximum improvement of 8.2% in Precision@20 and a maximum improvement of 12.1% in MRR@20. This result is attributed to HM-DDN's introduction of transitional and contextual hyperedges through its hypergraph structure, which significantly enhances its ability to capture higher-order dependencies. Furthermore, the introduction of the Mamba module enables efficient processing of long sequence dependencies, making it particularly outstanding in long-term intent modeling scenarios such as repeat purchase prediction.
[0099] In this implementation, cross-entropy supervised training is used to make the probability distribution of the prediction layer output converge to the actual clicked item, and end-to-end parameter updates are used to achieve collaborative optimization of the hypergraph channel and the global channel, thereby improving the repeatability and generalization performance of the recommendation results.
[0100] This invention also proposes a hypergraph-based Mamba dual-channel denoising network session recommendation system, which applies the hypergraph-based Mamba dual-channel denoising network session recommendation method disclosed in any of the above embodiments, including: The data processing module is used to acquire historical interaction data containing multiple user session sequences and encode items in the session to form item embeddings; The hypergraph construction module is used to construct a session hypergraph by taking items in the session as hypergraph nodes and constructing a first type of hyperedge to represent the sequential transfer relationship of items and a second type of hyperedge to represent the local co-occurrence relationship of items, thereby obtaining the session hypergraph. The hypergraph coding module is used to perform message passing and aggregation on the high-order interactions between nodes and hyperedges on the session hypergraph based on the hypergraph attention layer, to obtain the high-order structural representation of items in the session, and input the high-order structural representation into the sequence feature extraction layer based on the Mamba mechanism to extract long-range dependency features in the session based on the selective state space model, so as to obtain the session representation of local channels in the session. The global encoding module is used to construct a session-level global graph based on the session sequence, treating each session as a global graph node, and initializing the session node embedding. The session-level global graph is then input into the global encoder, and session relationship features are generated by pruning and sparse attention aggregation on the global graph to obtain the session representation of the global channel between sessions. The session fusion module is used to fuse the session representation of the local channel with the session representation of the global channel to obtain the final session representation of the target session. Based on the final session representation and the candidate item embedding, the selection probability of each candidate item is calculated, and the recommendation result of the target session is generated according to the selection probability.
[0101] In this implementation, by modularizing data processing, session hypergraph modeling, local channel sequence modeling, global channel relationship modeling, and fusion prediction, the session recommendation process is deployed and operated in a structured manner, reducing functional coupling and improving expansion and maintenance efficiency.
[0102] The Mamba dual-channel denoising network session recommendation system based on hypergraphs disclosed in the above embodiments has modules whose functions correspond to the steps of the Mamba dual-channel denoising network session recommendation method based on hypergraphs disclosed in the above embodiments. In the implementation process, the above embodiments are referred to for operation, and will not be repeated here.
[0103] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for recommending Mamba dual-channel denoised networks based on hypergraphs, characterized in that, include: Acquire historical interaction data containing multiple user session sequences, and encode items in the sessions to form item embeddings; Based on the session sequence, items in the session are used as hypergraph nodes, and a first type of hyperedge is constructed to represent the sequential transfer relationship of items and a second type of hyperedge is constructed to represent the local co-occurrence relationship of items, thereby obtaining a session hypergraph to model the many-to-many higher-order item relationships existing in the session. On the session hypergraph, message passing and aggregation of higher-order interactions between nodes and hyperedges are performed based on the hypergraph attention layer to obtain a higher-order structural representation of items within the session. The higher-order structural representation is then input into a sequence feature extraction layer based on the Mamba mechanism to extract long-range dependency features within the session based on a selective state space model, thereby obtaining a session representation of local channels within the session. Based on the session sequence, each session is used as a global graph node. A session-level global graph is constructed according to the co-occurrence relationship between sessions, and the session node embedding is initialized. The session-level global graph is input into a global encoder. By pruning the global graph and aggregating sparse attention, the session relationship features between sessions are generated, and the session representation of the global channel between sessions is obtained. The session representation of the local channel is fused with the session representation of the global channel to obtain the final session representation of the target session; Based on the final session representation and candidate item embedding, the selection probability of each candidate item is calculated, and a recommendation result for the target session is generated according to the selection probability.
2. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to claim 1, characterized in that, The specific construction process of the session hypergraph includes: For each target item in each session sequence, obtain the set of predecessor items of the target item in the session, and form a transition hyperedge by combining the target item and its predecessor items. When the target item is the first item in the session, its predecessor item set is empty. At this time, the corresponding transition hyperedge only contains the item itself. All the transition hyperedges constitute the first type of hyperedge set. For one or more preset window sizes, a sliding window approach is used on each session sequence to construct context hyperedges for items within each window position. The context hyperedges corresponding to all window positions constitute the context hyperedge set corresponding to the window size. The context hyperedge sets corresponding to each window size are merged to obtain the second type of hyperedge set. The first type of hyperedge set and the second type of hyperedge set are merged to obtain the hyperedge set in the session hypergraph.
3. The Mamba dual-channel denoising network session recommendation method based on a hypergraph according to claim 1 or 2, characterized in that, The specific process of message passing and aggregation of higher-order interactions between nodes and hyperedges based on the hypergraph attention layer on the session hypergraph includes: During the node-to-hyperedge message passing phase, for each hyperedge, element-wise multiplication is performed based on the hyperedge context embedding and the node embeddings of each node contained in the hyperedge to obtain a combined feature. The combined feature is then multiplied by the first learnable parameter vector and activated by LeakyReLU to obtain an attention score. The attention scores of each node within the same hyperedge are then exponentialized and normalized to obtain node attention weights. The node embeddings are then weighted and aggregated based on the node attention weights to update the hyperedge representation. In the message passing phase from hyperedge to node, for each node, the node embedding is added to the jump connection term to obtain the node intermediate representation. Based on the node intermediate representation and the hyperedge representations containing the node, element-wise multiplication is performed to obtain the combined feature. The combined feature is then subjected to inner product operation with the second learnable parameter vector and activated by LeakyReLU to obtain the attention score. The attention scores of each hyperedge corresponding to the same node are exponentialized and normalized to obtain the hyperedge attention weight. Based on the hyperedge attention weight, the hyperedge representations are weighted and summed to update the node representation.
4. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to any one of claims 1 to 3, characterized in that, The sequence feature extraction layer integrating the Mamba mechanism includes a selective state-space model, and is formed by repeatedly stacking Mamba layers containing layer normalization, feedforward networks, and residual connections and normalization. The specific process includes: Perform a linear transformation on the in-session item representation output by the hypergraph attention layer to obtain the input features; The input features are input into the selective state space model, and state updates are performed based on the parameter matrix of the state space model to generate an output; During the state update process, the parameter matrix is dynamically adjusted based on the input features using selective gating, and the gating is applied to the state update or output generation through element-wise multiplication. The output is processed sequentially with layer normalization, feedforward network, and residual connection and normalization to obtain the session representation of the local channel within the session.
5. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to claim 1, characterized in that, The specific process of constructing a session-level global graph and generating inter-session global channel session representations includes: Each session is used as a node in the session-level global graph, and the session-level global graph is constructed based on the co-occurrence relationship between sessions. The session-level global graph does not contain item embedding information. Based on the average result of item embedding in each session, the initial session node embedding of each session node in the session-level global graph is generated; Based on the degree matrix and global inter-session relationship matrix of the session-level global graph, graph convolution operation is performed on the initial session node embedding to learn the inter-session relationship representation, and the inter-session relationship representation is input into the global encoder to obtain the session representation of the global inter-session channel.
6. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to claim 5, characterized in that, The global encoder includes a degree-sensitive pruning mechanism, specifically comprising: Obtain the node degree of each session node in the session-level global graph; Based on the node degree, a pruning probability is determined for each session node, such that the pruning probability is inversely proportional to the node degree of the corresponding session node; Random pruning is performed on the edge relationships in the session-level global graph based on the pruning probability to obtain the pruned session-level global graph.
7. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to claim 5 or 6, characterized in that, The global encoder employs a sparse attention mechanism to update the session node representation, specifically including: For each target session node in the pruned session-level global graph, the attention scope is defined by the neighboring session nodes of the target session node, and the attention score is calculated based on the representation of the target session node and the representations of each neighboring session node. The attention score is input into the entropy maximization function entmax to generate a sparse attention weight distribution; The neighbor session node representations are weighted and aggregated based on the sparse attention weights to update the session node representation of the target session node.
8. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to any one of claims 5 to 7, characterized in that, The global encoder also includes session similarity neighbor collaboration, specifically including: Based on the updated session node representation using the sparse attention mechanism, the cosine similarity between the target session node and the candidate session node is calculated, and the similarity score of the candidate session node is obtained based on the cosine similarity scaling factor γ. The top K session nodes with the highest similarity scores from the candidate session nodes are selected as the similar neighbor set. The representations of each session node in the similar neighbor set are then weighted and aggregated based on the similarity scores to obtain the neighbor cooperation representation. The neighbor collaboration representation is fused with the session node representation of the target session node to obtain the session representation of the global inter-session channel.
9. The Mamba dual-channel denoising network session recommendation method based on hypergraphs according to claim 1, characterized in that, The training process for the hypergraph-based Mamba dual-channel denoising network session recommendation model includes: The historical item sequence of each session in the training dataset is used as input, and the actual item selected in the next step of the session is used as the supervision label. Based on the final session representation and the candidate item embedding, the predicted selection probability distribution of each candidate item is calculated. Using the cross-entropy between the indicator label corresponding to the actual selected item and the predicted probability distribution as the loss function, backpropagation is performed on the parameters in the hypergraph attention layer, the sequence feature extraction layer based on the Mamba mechanism, the global encoder, and the prediction layer to complete the parameter update.
10. A Mamba dual-channel denoising network session recommendation system based on a hypergraph, characterized in that, The method for recommending Mamba dual-channel denoised network sessions based on hypergraphs as described in any one of claims 1 to 9 includes: The data processing module is used to acquire historical interaction data containing multiple user session sequences and encode items in the session to form item embeddings; The hypergraph construction module is used to construct a first type of hyperedge representing the sequential transfer relationship of items and a second type of hyperedge representing the local co-occurrence relationship of items based on the session sequence, thereby obtaining a session hypergraph. The hypergraph encoding module is used to perform message passing and aggregation on the high-order interactions between nodes and hyperedges based on the hypergraph attention layer on the session hypergraph to obtain a high-order structural representation of items within the session. The high-order structural representation is then input into a sequence feature extraction layer based on the Mamba mechanism to extract long-range dependency features within the session based on a selective state space model, thereby obtaining a session representation of local channels within the session. The global encoding module is used to construct a session-level global graph based on the session sequence, taking each session as a global graph node, constructing a session-level global graph according to the co-occurrence relationship between sessions, initializing the session node embedding, inputting the session-level global graph into the global encoder, and generating inter-session relationship features by pruning the global graph and sparse attention aggregation to obtain the session representation of the global channel between sessions. The session fusion module is used to fuse the session representation of the local channel with the session representation of the global channel to obtain the final session representation of the target session, calculate the selection probability of each candidate item based on the final session representation and the candidate item embedding, and generate the recommendation result of the target session according to the selection probability.
Citation Information
Cited By
A state space recommendation model driven rag agent construction method and system
CN122367589A
A method and system for constructing RAG agents driven by a state-space recommendation model
CN122367589B