Sequence recommendation method for decoupling user long-term and short-term preferences based on frequency domain analysis

CN122196275BActive Publication Date: 2026-08-21CENT SOUTH UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610670333.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-15
Publication Date
2026-08-21
Estimated Expiration
2046-05-15

AI Technical Summary

Technical Problem

然而,由于序列推荐任务中普遍存在局部不变性偏置问题,仅依赖最近一次或少量交互行为,难以全面反映用户短期兴趣的真实变化,从而影响推荐结果的准确性

Benefits of technology

[0036] This invention discloses a sequence recommendation method based on frequency domain analysis for decoupling and modeling user long-term and short-term preferences. While ensuring computational efficiency, it can effectively decouple and model user long-term preferences and short-term interests, and achieve flexible and efficient sequence recommendation through feature fusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122196275B_ABST
    Figure CN122196275B_ABST
Patent Text Reader

Abstract

The application discloses a sequence recommendation method based on user long-term and short-term preference decoupling modeling of frequency domain analysis, comprising the following steps: S1. obtaining a historical interaction behavior sequence data set of a user; S2. based on a to-be-learned embedding matrix, frequency domain analysis, a gated recurrent unit, an N-Mamba module and a projection feature fusion module, an initial recommendation sequence prediction model is constructed; S3. an initial recommendation sequence prediction model is trained end to end by using a cross-entropy loss function, model parameters are updated, and a recommendation sequence prediction model is obtained; S4. a candidate item prediction probability distribution of a to-be-recommended user is obtained through the recommendation sequence prediction model, and sequence recommendation is realized by sorting from large to small. The method can effectively decouple and model the long-term preference and short-term interest of a user under the premise of ensuring the calculation efficiency, and realizes flexible and efficient feature fusion sequence recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data mining and recommendation technology, specifically relating to a sequence recommendation method based on frequency domain analysis for decoupling user long-term and short-term preferences. Background Technology

[0002] Sequence recommendation is a recommendation technology that predicts a user's future interests based on their historical behavior sequences. It has been widely used in e-commerce, content distribution, and information services. In practical applications, a user's historical interaction behavior usually contains two types of information: long-term stable preferences and short-term instantaneous interests. Long-term preferences reflect a user's persistent needs and interests, while short-term interests are usually driven by recent events or external trends and are characterized by rapid changes and high timeliness.

[0003] In existing technologies, some methods primarily characterize long-term user preferences by uniformly modeling complete historical sequences and approximating short-term user interests by extracting a few recent interactions. However, due to the prevalent local invariance bias problem in sequence recommendation tasks, relying solely on the most recent or a small number of interactions makes it difficult to fully reflect the true changes in users' short-term interests, thus affecting the accuracy of recommendation results.

[0004] To simultaneously model long-term preferences and short-term interests, existing methods have attempted to process user behavior sequences using multi-branch structures. However, different preference information often lacks effective decoupling during the modeling process, and information entanglement easily occurs between different branches, leading to severe feature coupling and affecting the model's stability and generalization ability. Furthermore, existing feature fusion methods mostly employ simple vector addition or concatenation, which is difficult to adaptively adjust according to different user behavior patterns, easily causing information loss and failing to reflect individual differences among users.

[0005] On the other hand, while attention-based sequence modeling methods perform well in terms of recommendation accuracy, their computational complexity increases quadratically with sequence length, making them difficult to meet efficiency requirements in long sequences or large-scale applications. In recent years, state-space model-based sequence modeling methods have shown a good balance between performance and efficiency in multiple fields, but effective solutions are still lacking for adapting these methods to the characteristics of highly diverse user behaviors and rapid preference evolution in sequence recommendation.

[0006] Therefore, there is an urgent need for a sequence recommendation method that can effectively decouple and model users' long-term preferences and short-term interests while ensuring computational efficiency, and achieve flexible and efficient feature fusion. Summary of the Invention

[0007] To address the shortcomings of existing technologies, the present invention aims to provide a sequence recommendation method based on frequency domain analysis for decoupling and modeling user long-term and short-term preferences. This method effectively decouples and models user long-term preferences and short-term interests while ensuring computational efficiency, and achieves flexible and efficient feature fusion sequence recommendation.

[0008] This invention provides a sequence recommendation method based on frequency domain analysis for decoupling user long-term and short-term preferences, comprising the following steps:

[0009] S1. Obtain a dataset of users' historical interaction behavior sequences;

[0010] S2. Based on the learning embedding matrix, frequency domain analysis, gated recurrent unit, N-Mamba module, and projection feature fusion module, an initial recommendation sequence prediction model is constructed.

[0011] S3. The initial recommendation sequence prediction model is trained end-to-end using the cross-entropy loss function, and the model parameters are updated to obtain the recommendation sequence prediction model.

[0012] S4. Using the recommendation sequence prediction model, obtain the predicted probability distribution of candidate items for the user to be recommended, sort them from largest to smallest, and realize sequence recommendation.

[0013] In the historical interaction behavior sequence dataset of step S1, for any user u, the discrete interaction behavior sequence is a sequence of length n. It can be expressed using the following formula: ;in, Let u be the item that user u interacts with at time step i.

[0014] In step S2, the initial recommendation sequence prediction model includes an embedding layer module, a frequency domain decomposition module, a long-term interest GRU module, a short-term interest N-Mamba module, a projection feature fusion module, and a prediction layer module.

[0015] The embedding layer module maps the item IDs in the input user history interaction sequence to the corresponding low-dimensional dense vector representation, and the resulting embedding sequence is input to the frequency domain decomposition module.

[0016] The frequency domain decomposition module performs frequency domain analysis on the input embedded sequence to obtain long-term interest preference components and short-term interest behavior components.

[0017] The Long-Term Interest GRU module takes long-term interest preference components as input, uses gated recurrent units for modeling, and processes them through update gate and reset gate mechanisms to obtain the long-term interest representation sequence.

[0018] The short-term interest N-Mamba module takes short-term interest behavior components as input and improves upon the Mamba module to obtain an N-Mamba module suitable for sequence recommendation data. Through the improved N-Mamba with a bidirectional structure, it models the original time data and the transposed input, captures the temporal dependencies within the sequence and cross-item dimension association information, and obtains the short-term interest representation sequence.

[0019] The projection feature fusion module takes the long-term interest representation sequence and the short-term interest representation sequence as input, and performs projection feature fusion on the long-term interest representation sequence and the short-term interest representation sequence to obtain the fused feature sequence.

[0020] The prediction layer module takes the fused feature sequence as input, performs an inner product operation between the fused feature sequence and the item embedding matrix, and then normalizes it using the Softmax function to obtain the predicted probability distribution of all candidate items as the output of the model.

[0021] The embedded layer module will input the user u's historical interaction sequence. Each item ID is mapped to a corresponding vector representation to obtain an embedding sequence, which is represented by the following formula: ;in, For items The vector corresponding to the item embedding matrix E.

[0022] The frequency domain decomposition module first applies a discrete Fourier transform to the input embedded sequence, mapping the sequence from the time domain to the frequency domain, as expressed by the following formula: ;in, Let be the complex weight representing the k-th frequency component in the frequency domain coefficients; t is the time index, and ; Let be a complex exponential basis function, where is the natural constant and k is the frequency index. Since the latter half of the spectrum of a real-valued signal is only the conjugate mirror of the former half and does not contain new information, it is usually taken as . ;

[0023] Next, set the hyperparameter c as the number of low-frequency components to be retained, and obtain the set low-frequency frequency domain, which can be expressed by the following formula: ;

[0024] Perform an inverse real-valued Fourier transform on the obtained low-frequency frequency domain to obtain the low-frequency components. , of which The vector for each time step is calculated using the following formula: ;in, For the first in the time domain The low-frequency components are represented at each time step;

[0025] Then based on the obtained low-frequency vector The high-frequency vector is obtained using the following formula. : ;in, For the first in the time domain High-frequency components at each time step;

[0026] With low frequency components As a representation of long-term interests and preferences, i.e. ;

[0027] With high frequency components As a representation of short-term interest behavior, i.e. .

[0028] The short-term interest N-Mamba module is a bidirectional N-Mamba structure. The input data is processed by two N-Mamba modules respectively, and the results are added together as the output of the short-term interest N-Mamba module. The improvement of the N-Mamba module is as follows: the causal convolution structure contained in the left branch of the traditional Mamba structure is removed; a memory gate mechanism is introduced on the basis of the original gating mechanism of the right branch of the traditional Mamba structure; and the SSM module in the traditional Mamba structure is improved into an M-SSM module.

[0029] The N-Mamba module specifically refers to:

[0030] The input data will pass through two parallel branch structures. The left branch consists of a linear transformation and a ReLU activation function to obtain the feature representation. The right branch also consists of a linear transformation and a ReLU activation function, yielding the feature representation. In a standard Mamba architecture, the left branch outputs... This will be further input into the Selective State-Space Model (SSM) module for modeling. Since the SSM essentially acts as a sequence filter, its output is denoted as... Then With the right branch Element-wise multiplication is performed to achieve gated information modulation. Finally, the multiplication result is passed through a linear mapping layer to restore the original feature dimension, obtaining the final output of the Mamba module. Based on this, we improve the structure. Considering that the filtering characteristics of the SSM module may lead to the weakening or loss of some original information, we introduce an additional memory gate mechanism. Specifically, we set a memory gate... , with the original features of the left branch Element-wise multiplication is performed to selectively retain the original information not processed by SSM, and this information is then added to the final output of the module to obtain the final N-Mamba output. The M-SSM module specifically comprises:

[0031] In the Mamba network, a Selective State-Space Model (SSM) is used. Its discrete form can be expressed as: ;in For the current input, In hidden state, For output, This is the state transition matrix; The input mapping matrix; To output the mapping matrix; These are the parameters for the directly connected terms. Unlike traditional SSMs, the input and output mapping matrices in selective SSMs are dynamically generated based on the current input, i.e.: ;in This is the first parameter matrix to be learned; The second parameter matrix to be learned; additional direct connection terms. This provides a jump connection from input to output, which preserves the original input information and enhances expressiveness.

[0032] By making and The model adapts to changes in input, dynamically adjusting the intensity of information writing and reading to achieve selective modeling of sequence information; while direct connection terms... This further mitigates the potential information loss during state recursion. This structure constitutes an efficient and more expressive selective state-space modeling mechanism in Mamba.

[0033] In M-SSM, to further enhance the adaptability of the SSM module to input data and enable the model to dynamically adjust the information retention strength according to different inputs, we will adjust the parameters in the direct connection terms. It is also designed to depend on the current input for generation. Specifically, that is... Therefore, the output equation can be rewritten as: ;in This is the third parameter matrix to be learned; through this design, the direct connection from input to output is no longer a fixed mapping, but can adaptively adjust the degree of information retention and enhancement according to the current input content. Thus, M-SSM maintains the selective SSM dynamic read / write mechanism ( , While ensuring input relevance, the residual path also possesses input-awareness capabilities, thereby achieving more personalized and fine-grained sequence modeling capabilities. The projection feature fusion module adds the input long-term interest representation sequence and short-term interest representation sequence, then processes them through the pooling module to obtain the global feature sequence. The long-term and short-term interest representation sequences are projected onto the global feature sequence direction, and the results are mapped using the Sigmoid function. Finally, they are multiplied element-wise with the meta-features to obtain the fused user behavior representation.

[0034] In the projection feature fusion module, the input long-term interest representation sequence and short-term interest representation sequence After addition, the global feature sequence is obtained through the pooling module. Projecting the long-term interest representation sequence and the short-term interest representation sequence onto the direction of the global feature sequence, respectively, is represented by the following formula: ; ;in, This represents the global projection feature of long-term interest. The short-term interest global projection features are obtained; finally, the long-term interest global projection features and the short-term interest global projection features are mapped using the Sigmoid function to obtain the long-term interest global mapping features and the short-term interest global mapping features respectively; the long-term interest global mapping features are then mapped to the input long-term interest representation sequence. Perform element-wise weighted multiplication to obtain the long-term feature sequence before fusion; combine the short-term interest global mapping features with the short-term interest representation sequence. Element-wise weighted multiplication is performed to obtain the short-term feature sequence before fusion; finally, the long-term feature sequence before fusion is added to the short-term feature sequence before fusion to obtain the user behavior representation feature sequence after fusion.

[0035] In step S3, the cross-entropy loss function is used as the optimization objective to maximize the predicted probability of the next real interactive item, and the model parameters are updated end-to-end. The cross-entropy loss function is expressed by the following formula: Where u is the user serial number; U is the user set; This represents the model's predicted probability of the next real interactive item.

[0036] This invention discloses a sequence recommendation method based on frequency domain analysis for decoupling and modeling user long-term and short-term preferences. While ensuring computational efficiency, it can effectively decouple and model user long-term preferences and short-term interests, and achieve flexible and efficient sequence recommendation through feature fusion. Attached Figure Description

[0037] Figure 1 This is a schematic flowchart of the method of the present invention;

[0038] Figure 2 This is a schematic diagram of the overall structure of the model in an embodiment of the present invention;

[0039] Figure 3 This is a schematic diagram of a bidirectional N-Mamba structure in an embodiment of the present invention;

[0040] Figure 4 This is a comparison diagram of the N-Mamba structure in this embodiment of the invention and the existing ordinary Mamba structure;

[0041] Figure 5 This is a schematic diagram of the projection feature fusion module structure in an embodiment of the present invention;

[0042] Figure 6 The figure shows the experimental results of the effect of hyperparameter c on the game dataset in this embodiment of the invention. Detailed Implementation

[0043] This invention provides a sequence recommendation method based on frequency domain analysis for decoupling user long-term and short-term preferences, as illustrated in the flowchart below. Figure 1 As shown, it includes the following steps:

[0044] S1. Obtain a dataset of users' historical interaction behavior sequences;

[0045] In the historical interaction behavior sequence dataset of step S1, for any user u, the discrete interaction behavior sequence is a sequence of length n. The following formula can be used to express this: ;in, Let U be the item that user u interacts with at time step i.

[0046] S2. Based on the learning embedding matrix, frequency domain analysis, gated recurrent unit, N-Mamba module, and projection feature fusion module, an initial recommendation sequence prediction model is constructed.

[0047] In step S2, the initial recommendation sequence prediction model is as follows: Figure 2 As shown, it includes an embedding layer module, a frequency domain decomposition module, a long-term interest GRU module, a short-term interest N-Mamba module, a projection feature fusion module, and a prediction layer module;

[0048] The embedding layer module maps the item IDs in the input user history interaction sequence to the corresponding low-dimensional dense vector representation, and the resulting embedding sequence is input to the frequency domain decomposition module.

[0049] The frequency domain decomposition module performs frequency domain analysis on the input embedded sequence to obtain long-term interest preference components and short-term interest behavior components.

[0050] The Long-Term Interest GRU module takes long-term interest preference components as input, uses gated recurrent units for modeling, and processes them through update gate and reset gate mechanisms to obtain the long-term interest representation sequence.

[0051] The short-term interest N-Mamba module takes short-term interest behavior components as input and is an improved N-Mamba module based on the Mamba module, suitable for sequence recommendation data. Through a bidirectional structure, the improved N-Mamba model models the original temporal data and the transposed input, capturing the temporal dependencies within the sequence and cross-item dimension association information to obtain the short-term interest representation sequence; the bidirectional N-Mamba structure is as follows: Figure 3 As shown; the N-Mamba module structure is compared with the ordinary Mamba structure, for example... Figure 4 As shown.

[0052] The projection feature fusion module takes the long-term interest representation sequence and the short-term interest representation sequence as input, and performs projection feature fusion on the long-term interest representation sequence and the short-term interest representation sequence to obtain the fused feature sequence; the structure of the projection feature fusion module is as follows. Figure 5 As shown.

[0053] The prediction layer module takes the fused feature sequence as input, performs an inner product operation between the fused feature sequence and the item embedding matrix, and then normalizes it using the Softmax function to obtain the predicted probability distribution of all candidate items as the output of the model.

[0054] The embedded layer module will input the user u's historical interaction sequence. Each item ID is mapped to a corresponding vector representation to obtain an embedding sequence, which is represented by the following formula: ;in, For items The vector corresponding to the item embedding matrix E.

[0055] The frequency domain decomposition module first applies a discrete Fourier transform to the input embedded sequence, mapping the sequence from the time domain to the frequency domain, as expressed by the following formula: ;in, The frequency domain coefficients represent the complex weights of the nth frequency component; t is the time index. ; For complex exponential basis functions, i.e. discrete sine / cosine basis, where... It is a natural constant; For frequency indexing, since the latter half of the spectrum of a real-valued signal is merely a conjugate mirror of the first half and does not contain new information, it is usually taken as... ;

[0056] Next, set the hyperparameter c as the number of low-frequency components to be retained, and obtain the set low-frequency frequency domain, which can be expressed by the following formula: ;

[0057] Perform an inverse real-valued Fourier transform on the obtained low-frequency frequency domain to obtain the low-frequency components. , of which The vector for each time step is calculated using the following formula: ;in, For the first in the time domain The low-frequency components are represented at each time step;

[0058] Then based on the obtained low-frequency vector The high-frequency vector is obtained using the following formula. : ;in, For the first in the time domain High-frequency components at each time step;

[0059] With low frequency components As a representation of long-term interests and preferences, i.e. ;

[0060] With high frequency components As a representation of short-term interest behavior, i.e. .

[0061] The short-term interest N-Mamba module is a bidirectional N-Mamba structure. The input data is processed by two N-Mamba modules respectively, and the results are added together as the output of the short-term interest N-Mamba module. The improvement of the N-Mamba module is as follows: the causal convolution structure contained in the left branch of the traditional Mamba structure is removed; a memory gate mechanism is introduced on the basis of the original gating mechanism of the right branch of the traditional Mamba structure; and the SSM module in the traditional Mamba structure is improved into an M-SSM module.

[0062] The N-Mamba module specifically refers to:

[0063] The input data will pass through two parallel branch structures. The left branch consists of a linear transformation and a ReLU activation function to obtain the feature representation. The right branch also consists of a linear transformation and a ReLU activation function, yielding the feature representation. In a standard Mamba architecture, the left branch outputs... This will be further input into the Selective State-Space Model (SSM) module for modeling. Since the SSM essentially acts as a sequence filter, its output is denoted as... Then With the right branch Element-wise multiplication is performed to achieve gated information modulation. Finally, the multiplication result is passed through a linear mapping layer to restore the original feature dimension, obtaining the final output of the Mamba module. Based on this, we improve the structure. Considering that the filtering characteristics of the SSM module may lead to the weakening or loss of some original information, we introduce an additional memory gate mechanism. Specifically, we set a memory gate... , with the original features of the left branch Element-wise multiplication is performed to selectively retain the original information that has not been processed by SSM, and then added to the final output of the module to obtain the final output of N-Mamba.

[0064] The M-SSM module is specifically:

[0065] In the Mamba network, a Selective State-Space Model (SSM) is used. Its discrete form can be expressed as: ;in For the current input, In hidden state, For output, State transition matrix The input mapping matrix; To output the mapping matrix; These are the parameters for the directly connected terms. Unlike traditional SSMs, the input and output mapping matrices in selective SSMs are dynamically generated based on the current input, i.e.: ;in This is the first parameter matrix to be learned; The second parameter matrix to be learned; additional direct connection terms. This provides a jump connection from input to output, which preserves the original input information and enhances expressiveness.

[0066] By making and The model adapts to changes in input, dynamically adjusting the intensity of information writing and reading to achieve selective modeling of sequence information; while direct connection terms... This further mitigates the potential information loss during state recursion. This structure constitutes an efficient and more expressive selective state-space modeling mechanism in Mamba.

[0067] In M-SSM, to further enhance the adaptability of the SSM module to input data and enable the model to dynamically adjust the information retention strength according to different inputs, we will adjust the parameters in the direct connection terms. It is also designed to depend on the current input for generation. Specifically, that is... Therefore, the output equation can be rewritten as: ;in This is the third parameter matrix to be learned; through this design, the direct connection from input to output is no longer a fixed mapping, but can adaptively adjust the degree of information retention and enhancement according to the current input content. Thus, M-SSM maintains the selective SSM dynamic read / write mechanism ( , While ensuring input relevance, the residual path also possesses input-awareness capabilities, thereby achieving more personalized and fine-grained sequence modeling capabilities. The projection feature fusion module adds the input long-term interest representation sequence and short-term interest representation sequence, then processes them through the pooling module to obtain the global feature sequence. The long-term and short-term interest representation sequences are projected onto the global feature sequence direction, and the results are mapped using the Sigmoid function. Finally, they are multiplied element-wise with the meta-features to obtain the fused user behavior representation.

[0068] In the projection feature fusion module, the input long-term interest representation sequence and short-term interest representation sequence After addition, the global feature sequence is obtained through the pooling module. Projecting the long-term interest representation sequence and the short-term interest representation sequence onto the direction of the global feature sequence, respectively, is represented by the following formula: ; ;in, This represents the global projection feature of long-term interest. The short-term interest global projection features are obtained; finally, the long-term interest global projection features and the short-term interest global projection features are mapped using the Sigmoid function to obtain the long-term interest global mapping features and the short-term interest global mapping features respectively; the long-term interest global mapping features are then mapped to the input long-term interest representation sequence. Perform element-wise weighted multiplication to obtain the long-term feature sequence before fusion; combine the short-term interest global mapping features with the short-term interest representation sequence. Element-wise weighted multiplication is performed to obtain the short-term feature sequence before fusion; finally, the long-term feature sequence before fusion is added to the short-term feature sequence before fusion to obtain the user behavior representation feature sequence after fusion.

[0069] S3. The initial recommendation sequence prediction model is trained end-to-end using the cross-entropy loss function, and the model parameters are updated to obtain the recommendation sequence prediction model.

[0070] In step S3, the cross-entropy loss function is used as the optimization objective to maximize the predicted probability of the next real interactive item, and the model parameters are updated end-to-end. The cross-entropy loss function is expressed by the following formula: Where u is the user serial number; U is the user set; This represents the model's predicted probability of the next real interactive item.

[0071] S4. Using the recommendation sequence prediction model, obtain the predicted probability distribution of candidate items for the user to be recommended, sort them from largest to smallest, and realize sequence recommendation.

[0072] The method of the present invention will be further described below with reference to the embodiments:

[0073] The proposed method was compared with seven existing models on publicly available datasets (Games, Products, and Steam), and the results are shown in Table 1. The seven models include: Caser, GRU4Rec, BERT4Rec, SASRec, Mamba4Rec, AdaMCT, and SIGMA.

[0074] Table 1 Results of existing models and the method of this invention

[0075] Table 1 summarizes the performance comparison between our proposed model and the baseline methods on three datasets. The following conclusions can be drawn from the table:

[0076] 1) Our model demonstrated stable and superior performance across 18 evaluation metrics on three public datasets. It achieved optimal results on 90% of the metrics and near-optimal results on the remaining 10%, indicating good robustness and stability across different data distributions and application scenarios.

[0077] 2) Compared with current representative state-of-the-art methods, our model also demonstrates significant advantages: compared to the SIGMA method, its average performance is improved by 8.62%; compared to the AdaMCT method, its average performance is improved by 16.79%. These results indicate that the model proposed in this invention has stronger modeling capabilities in characterizing user-item interaction relationships.

[0078] 3) Regarding key evaluation metrics, our model achieved an average improvement of 8.28% in HR (Hit Rate) and 7.05% in NDCG (Normalized Discounted Cumulative Gain). These results demonstrate that the model exhibits significant advantages in both recommendation coverage and ranking quality, enabling it to more effectively uncover potentially relevant items. In summary, the method presented in this invention improves both the breadth (coverage) and depth (ranking quality) of recommendation results, thus possessing greater practical value in real-world recommendation system applications.

[0079] To fully evaluate the impact of the proposed improvements on the model, we conducted systematic ablation experiments on the Steam dataset.

[0080] First, an ablation experiment was conducted on the N-Mamba module, and the results are shown in Table 2.

[0081] Table 2. Results of N-Mamba ablation experiments

[0082] The experimental results in Table 2 show that the use of convolution leads to feature over-expression, thus weakening the model's learning ability. Introducing a memory gate enhances the model's information retention capacity, making recommendation predictions more accurate. Furthermore, M-SSM improves the model's flexibility by making the skip connection matrix D dependent on the input data. Overall, N-Mamba achieves the best performance in the experiments, demonstrating the effectiveness of the proposed design.

[0083] Then, an ablation experiment was conducted on the feature fusion module, and the results are shown in Table 3.

[0084] Table 3 Ablation Experiment Results of Feature Fusion Module

[0085] In this context, vector concatenation represents feature concatenation followed by linear projection back to the original dimension. Experimental results show that projective feature fusion outperforms simple linear fusion methods. Its advantage lies in its ability to dynamically generate weights based on the correlation between input features and global semantics. Furthermore, with... By mapping to weighted representations, important information components can be fully expressed, while irrelevant information is effectively suppressed. Therefore, projection feature fusion enables more flexible feature fusion.

[0086] Finally, experiments were conducted on a game dataset to investigate the impact of hyperparameter c on model performance. Parameter c determines the number of low-frequency components retained after Discrete Fourier Transform (DFT) decomposition, with the remaining components considered as high-frequency components. Five parameter values ​​were set for the experiment (c=3,5,7,9,11). The experimental results are shown in Figure 6, where the green dashed line represents the baseline model without DFT decomposition, i.e., the input sequence data is directly fed into the GRU and bidirectional N-Mamba modules for processing.

[0087] Experimental results show that frequency domain decomposition of sequence data using DFT can extract low-frequency and high-frequency information separately, thus simultaneously representing users' long-term and short-term interests. Furthermore, when c=7, the model performs better on the experimental data; at this point, the low-frequency components effectively represent long-term stable preference information, while the retained high-frequency components reflect users' short-term dynamic interests. Therefore, the DFT-based sequence decomposition method can effectively model different frequency information in sequence recommendation tasks, thereby improving the model's ability to represent changes in user interests.

Claims

1. A sequence recommendation method based on frequency domain analysis for decoupling user long-term and short-term preferences, characterized in that, Includes the following steps: S1. Obtain a dataset of users' historical interaction behavior sequences; S2. Based on the learning embedding matrix, frequency domain analysis, gated recurrent unit, N-Mamba module, and projection feature fusion module, an initial recommendation sequence prediction model is constructed. S3. The initial recommendation sequence prediction model is trained end-to-end using the cross-entropy loss function, and the model parameters are updated to obtain the recommendation sequence prediction model. S4. Using the recommendation sequence prediction model, obtain the predicted probability distribution of candidate items for the user to be recommended, sort them from largest to smallest, and realize sequence recommendation; In step S2, the initial recommendation sequence prediction model includes an embedding layer module, a frequency domain decomposition module, a long-term interest GRU module, a short-term interest N-Mamba module, a projection feature fusion module, and a prediction layer module. The embedding layer module maps the item IDs in the input user history interaction sequence to the corresponding low-dimensional dense vector representation, and the resulting embedding sequence is input to the frequency domain decomposition module. The frequency domain decomposition module performs frequency domain analysis on the input embedded sequence to obtain long-term interest preference components and short-term interest behavior components. The Long-Term Interest GRU module takes long-term interest preference components as input, uses gated recurrent units for modeling, and processes them through update gate and reset gate mechanisms to obtain the long-term interest representation sequence. The short-term interest N-Mamba module takes short-term interest behavior components as input and improves upon the Mamba module to obtain an N-Mamba module suitable for sequence recommendation data. The bidirectional N-Mamba module models the original time data and the transposed input, captures the temporal dependencies within the sequence and cross-item dimension association information, and obtains the short-term interest representation sequence. The projection feature fusion module takes the long-term interest representation sequence and the short-term interest representation sequence as input, and performs projection feature fusion on the long-term interest representation sequence and the short-term interest representation sequence to obtain the fused feature sequence. The prediction layer module takes the fused feature sequence as input, performs an inner product operation between the fused feature sequence and the item embedding matrix, and then normalizes it through the Softmax function to obtain the predicted probability distribution of all candidate items as the output of the model. The short-term interest N-Mamba module is a bidirectional N-Mamba structure. The input data is processed by two N-Mamba modules respectively, and the results are added together as the output of the short-term interest N-Mamba module. The improvement of the N-Mamba module is as follows: the causal convolution structure contained in the left branch of the traditional Mamba structure is removed; a memory gate mechanism is introduced on the basis of the original gating mechanism of the right branch of the traditional Mamba structure; and the SSM module in the traditional Mamba structure is improved into an M-SSM module. The N-Mamba module specifically refers to: The input data will pass through two parallel branch structures. The left branch consists of a linear transformation and a ReLU activation function to obtain the feature representation. The right branch also consists of a linear transformation and a ReLU activation function, yielding the feature representation. In the standard Mamba architecture, the left branch outputs... It will be further input into the selective state-space model module for modeling, and its output is denoted as Then With the right branch Element-wise multiplication is performed to achieve gated information modulation. Finally, the multiplication result is passed through a linear mapping layer to restore the original feature dimension, obtaining the final output of the Mamba module. Based on this, considering that the filtering characteristics of the SSM module may lead to the weakening or loss of some original information, an additional memory gate mechanism is introduced. Specifically, a memory gate is set. , with the original features of the left branch Element-wise multiplication is performed to selectively retain the original information not processed by SSM, and then multiplied. With the right branch The results of element-wise multiplication are added together, and finally, the final output of N-Mamba is obtained through a linear mapping layer. The M-SSM module is specifically: In the Mamba network, a selective state-space model is used, and its discrete form is expressed as follows: ;in For the current input, In hidden state, For output, This is the state transition matrix; The input mapping matrix; To output the mapping matrix; For parameters of the direct connection term.

2. The sequence recommendation method based on frequency domain analysis and decoupling modeling of user long-term and short-term preferences according to claim 1, characterized in that, In the historical interaction behavior sequence dataset of step S1, for any user u, the discrete interaction behavior sequence is a sequence of length n. The following formula can be used to express this: ;in, Let U be the item that user u interacts with at time step i.

3. The sequence recommendation method based on frequency domain analysis and decoupling modeling of user long-term and short-term preferences according to claim 1, characterized in that, The embedded layer module will input the user u's historical interaction sequence. Each item ID is mapped to a corresponding vector representation to obtain an embedding sequence, which is represented by the following formula: ;in, For items The vector corresponding to the item embedding matrix E.

4. The sequence recommendation method based on frequency domain analysis and decoupling modeling of user long-term and short-term preferences according to claim 1, characterized in that, The frequency domain decomposition module first applies a discrete Fourier transform to the input embedded sequence, mapping the sequence from the time domain to the frequency domain, as expressed by the following formula: ;in, The frequency domain coefficients represent the complex weights of the nth frequency component; For time index ; For complex exponential basis functions, i.e. discrete sine / cosine basis, where... It is a natural constant; Frequency index; Next, set the hyperparameter c as the number of low-frequency components to be retained, and obtain the set low-frequency frequency domain, which can be expressed by the following formula: ; Perform an inverse real-valued Fourier transform on the obtained low-frequency frequency domain to obtain the low-frequency components. , of which The vector for each time step is calculated using the following formula: ;in, For the first in the time domain The low-frequency components are represented at each time step; Then based on the obtained low-frequency vector The high-frequency vector is obtained using the following formula. : ;in, For the first in the time domain High-frequency components at each time step; With low frequency components As a representation of long-term interests and preferences, i.e. ; With high frequency components As a representation of short-term interest behavior, i.e. .

5. The sequence recommendation method based on frequency domain analysis and decoupling modeling of user long-term and short-term preferences according to claim 1, characterized in that, The projection feature fusion module adds the input long-term interest representation sequence and short-term interest representation sequence, and then processes them through the pool module to obtain the global feature sequence. The long-term interest representation sequence and short-term interest representation sequence are projected onto the direction of the global feature sequence, and the results are mapped using the Sigmoid function. Finally, the results are multiplied element-wise with the meta-features to obtain the fused user behavior representation.

6. The sequence recommendation method based on frequency domain analysis and decoupling modeling of user long-term and short-term preferences according to claim 5, characterized in that, In the projection feature fusion module, the input long-term interest representation sequence and short-term interest representation sequence After addition, the global feature sequence is obtained through the pooling module. Projecting the long-term interest representation sequence and the short-term interest representation sequence onto the direction of the global feature sequence, respectively, is represented by the following formula: ; ;in, This represents the global projection feature of long-term interest. The short-term interest global projection features are obtained; finally, the long-term interest global projection features and the short-term interest global projection features are mapped using the Sigmoid function to obtain the long-term interest global mapping features and the short-term interest global mapping features respectively; the long-term interest global mapping features are then mapped to the input long-term interest representation sequence. Perform element-wise weighted multiplication to obtain the long-term feature sequence before fusion; combine the short-term interest global mapping features with the short-term interest representation sequence. Element-wise weighted multiplication is performed to obtain the short-term feature sequence before fusion; finally, the long-term feature sequence before fusion is added to the short-term feature sequence before fusion to obtain the user behavior representation feature sequence after fusion.

7. The sequence recommendation method based on frequency domain analysis and decoupling modeling of user long-term and short-term preferences according to claim 1, characterized in that, In step S3, the cross-entropy loss function is used as the optimization objective to maximize the predicted probability of the next real interactive item, and the model parameters are updated end-to-end. The cross-entropy loss function is expressed by the following formula: Where u is the user serial number; U is the user set; This represents the model's predicted probability of the next real interactive item.

Citation Information

Patent Citations

  • Course resource recommendation method and device based on improved state space model, equipment and storage medium

    CN120744242A