Graph convolutional network and self-attentive for sequential recommendation

Sequential recommender systems (SRS) aim to provide personalized recommendations to users in the context of large-scale datasets and complex user behavior sequences. However, the effectiveness of most existing embedding techniques in capturing the intricate relationships between items remains suboptimal, with a significant concentration of item embedding vectors that hinder the improvement of final prediction performance. Nevertheless, our study reveals that the distribution of item embeddings can be effectively dispersed through graph interaction networks and contrastive learning. In this article, we propose a graph convolutional neural network to capture the complex relationships between users and items, leveraging the learned embedding vectors of nodes to represent items. Additionally, we employ a self-attentive sequential model to predict outcomes based on the item embedding sequences of individual users. Furthermore, we incorporate instance-wise contrastive learning (ICL) and prototype contrastive learning (PCL) during the training process to enhance the effectiveness of representation learning. Broad comparative experiments and ablation studies were conducted across four distinct datasets. The experimental outcomes clearly demonstrate the superior performance of our proposed GSASRec model.


INTRODUCTION
Personalized recommendation has become a dominant and widely adopted approach in various real-world applications, empowering users with tailored item suggestions that cater to their individual interests (Cheng et al., 2016;Fayyaz et al., 2020).The core task of a recommender system revolves around predictive modeling, which aims to predict the likelihood of user-item interactions, encompassing various forms of engagement like clicks, ratings, and purchases, among others.This predictive capability serves as the foundation of effective recommendation systems, enabling them to provide users with relevant and appealing item recommendations, thereby enhancing user satisfaction and engagement.Therefore, accurately capturing user preferences is a critical aspect (Peng, Sugiyama & Mine, 2022).
Collaborative filtering (CF) has emerged as a potent solution for recommendation systems.It relies on historical user-item interactions, such as purchases or clicks, with the assumption that users with similar behavior are likely to exhibit similar preferences for items (Cheng et al., 2018;He et al., 2017).One of its key advantages is that it does not rely on explicit feature engineering or content analysis, allowing it to discover hidden patterns and relationships between users and items solely based on user interactions.This approach makes collaborative filtering a powerful method to make personalized recommendations in various domains.Extensive research on CF-based recommenders has been conducted, leading to remarkable achievements in this field (Koren, 2008;He et al., 2018;Wang et al., 2019;He et al., 2020).However, collaborative filtering methods cannot directly consider the temporal relationships of user behaviors, which means they may not capture the evolving patterns of user behavior over time, thus performing suboptimally in handling recommendation problems involving temporal dependencies.On the other hand, Sequential recommendation (SR) is a branch of recommendation systems that focuses on providing personalized recommendations by considering the temporal order of user behavior sequences.User interests and preferences are known to evolve and change gradually.To handle the temporal dependency issues in SR, researchers have developed specialized models such as BERT4Rec (Sun et al., 2019) and SASRec (Kang & McAuley, 2018).These models organize users' actions, such as browsing, purchasing, adding to cart, and other interactions, in chronological order and employ attention mechanisms or positional encoding to gain a better understanding of how user interests evolve over time.Numerous sequential recommendation (Xie et al., 2020;Chen et al., 2022;Zhou et al., 2020;Liu et al., 2021a;Li et al., 2023) studies delve into exploring more effective ways of representing embedded representations of sequential items.One such approach is contrastive learning (Chen et al., 2020) where a positive sample sequence is obtained through sequence augmentation methods, while other sequences serve as negative samples.By encouraging the model to increase the similarity between the encodings of positive sample sequences and decrease the similarity with negative sample sequences, the model's representational capacity is enhanced.Consequently, the model becomes better equipped to differentiate between the long-term and short-term interests and intentions of distinct users.Through this approach, the model gains a more comprehensive understanding of the intricate patterns embedded in users' sequential behaviors, thus yielding more accurate and personalized recommendations.
However, sequential recommendation models often face challenges in directly learning the similarities between users and items, as well as item-item and user-user relationships.In contrast, collaborative filtering methods, such as multi-layer graph convolutions on user-item interaction graphs, can effectively unearth the underlying connections between items and users.For instance, users with similar behavior sequences are likely to have similar embedded representations, leading to higher similarity scores.Consequently, if two users have similar embedded representations for certain items, their overall item representations should also exhibit a higher degree of similarity.
Therefore, by combining collaborative filtering with sequential recommendation, we can address these issues.In this regard, we propose a method that utilizes user interaction graph convolutions to extract item embeddings and then employs a sequential recommendation model to predict the user's next actions.To further enhance the model's effectiveness, we incorporate instance contrastive learning and prototype contrastive learning to improve its representational capacity.
In summary, this article makes several contributions are: We propose that combining interactive graphs and attention-based sequence models can complement each other's limitations.We have empirically demonstrated that the fusion of these two techniques can indeed effectively enhance model performance.During the training phase, we employ a multi-task learning approach by integrating instance-wise contrastive learning and prototype contrastive learning.We have verified that the combination of these two contrasting learning methods can further improve model effectiveness.
Extensive experiments are carried out on four widely-used public datasets, showcasing the consistent superiority of our proposed approach over various competitive baselines.Additionally, we conducted multiple sets of ablation experiments to validate the effectiveness of each module.

Collaborative filtering
Collaborative filtering (CF) is a popular approach in recommendation systems that involves learning latent features, or embeddings, to represent users and items.The prediction is then performed based on these embedding vectors.Matrix factorization is one of the early CF models, where users' interaction history is not explicitly considered, and only the user ID is projected to the embedding.However, subsequent research has shown that incorporating user interaction history can improve the quality of embeddings and prediction performance.
An example of this is the utilization of user interaction history in predicting numerical ratings, as demonstrated by SVD++ (Koren, 2008).Additionally, Neural Attentive Item Similarity (NAIS) assigns varying degrees of importance to items present in the interaction history, leading to more accurate item ranking predictions (He et al., 2018).The key to these enhancements lies in leveraging the subgraph structure of a user's interaction history, particularly considering their one-hop neighbors, which effectively enhances the process of embedding learning.
To further leverage the subgraph structure, Wang et al. (2019) propose NGCF, a stateof-the-art CF model inspired by graph convolution network (GCN) (Wu et al., 2019).NGCF adopts the propagation rule of GCN, which involves feature transformation, neighborhood aggregation, and nonlinear activation, to refine embeddings.While NGCF has shown promising results, it inherits many operations from GCN without justifying their relevance to the CF task.This design choice introduces unnecessary complexity, particularly when applied to user-item interaction graphs, where each node has only a onehot ID without rich attribute information.LightGCN (He et al., 2020) introduces a novel approach that propagates user and item embeddings linearly onto the user-item interaction graph, leveraging the weighted summation of embeddings learned across all layers as the ultimate embedding.This method exhibits significant performance improvements over NGCF, as evidenced by our experimental results.

Sequential recommendation
Sequential recommendation has garnered significant research attention in recent years, aiming to accurately capture users' dynamic interests by modeling their past behavior sequences.Early approaches in this field focused on utilizing Markov chains to model item-to-item transaction patterns.For instance, FPMC combined Markov chains with matrix factorization techniques to integrate sequential patterns and users' general interests (Rendle, Freudenthaler & Schmidt-Thieme, 2010).
In light of the rise of deep learning, a multitude of deep sequential recommendation models have emerged, harnessing neural networks to capture both long-term and shortterm preferences from behavioral sequences.Recurrent neural networks (RNNs) gained prominence due to their ability to encode sequential dependencies.For example, GRU4Rec employed gated recurrent units (GRUs) to model user interests (Hidasi et al., 2015).Another avenue of research delved into the use of convolutional neural networks (CNNs) for sequential recommendation (Yan et al., 2019).
The success of attention mechanisms in natural language processing tasks has motivated its adoption in sequential recommendation.Attention-based models have shown promise in capturing complex dependencies in behavior sequences.SASRec introduced the use of unidirectional attention mechanisms to assign adaptive weights to interacted items (Kang & McAuley, 2018).BERT4Rec improved upon this approach by employing bidirectional attention mechanisms with a Cloze task (Sun et al., 2019).LSAN proposed a light-weight approach with a temporal context-aware embedding and a twinattention network (Li et al., 2021).ASReP addressed data sparsity by leveraging a attention mechanism on revised user behavior sequences (Liu et al., 2021b).DuoRec (Qiu et al., 2022) introduces innovative techniques to improve semantic preservation and address the representation degeneration problem in recommendation systems.

Contrastive learning for recommendation
Contrastive learning (CL) has garnered significant attention in various research domains such as computer vision, natural language processing, and recommender systems.In the context of recommender systems, the focus of contrastive learning lies in optimizing mutual information between positively transformed data samples while simultaneously enhancing the discriminability of negative samples.Traditional recommender systems often rely on large amounts of labeled user behavioral data, which are often difficult to obtain and may result in subpar recommendations for new users and rare items.In contrast, contrastive learning, with its label-free self-supervised learning approach, exhibits remarkable advantages in recommender systems.
Early works in contrastive learning for recommendation focused on utilizing deep neural networks (DNNs) to enhance collaborative filtering-based recommendation leveraging item attributes (Yao et al., 2020).These models utilized a two-tower architecture to compare positive and negative samples and learn effective item representations.Another line of research employed contrastive learning within graph neural networks (GCNs) to improve collaborative filtering methods using only item IDs as features (Wu et al., 2020).
In the domain of sequential recommendation, contrastive self-supervised learning (SSL) has been utilized to capture associations among items, subsequences, and characteristics found in user behavior sequences (Zhou et al., 2020).These models adopt an end-to-end training approach, incorporating contrastive SSL throughout the entire training phase.Nonetheless, this unified training methodology facilitates information sharing between the SSL and next-item prediction tasks, eliminating the need for separate fine-tuning and pretraining stages, potentially constraining overall performance enhancement.To overcome this limitation, recent studies have proposed multi-task training frameworks incorporating a contrastive objective to improve user representations (Xie et al., 2020;Liu et al., 2021a).Furthermore, a novel approach named ICLRec, presented by Chen et al. (2022), introduces clustering techniques to extract users' intent distributions from their behavior sequences.By leveraging clustering, ICLRec identifies distinct patterns of user intent embedded within the data.

PRELIMINARIES Problem settings
Let V and U represent the sets of items and users, respectively.We denote a user u 2 U interaction sequence as S u ¼ fv 1 ; v 2 ; …:; v T g, where T is the total number of items in the sequence, and the items are ordered chronologically.Each item v i 2 S u is associated with an order index i ¼ 1; 2; …; T, indicating its position in the sequence.Our objective is to create a prioritized list of the top K items that user u is highly likely to visit in the subsequent time step T + 1.

PROPOSED MODEL
In this section, we will introduce our proposed graph convolution and self-attention model, named GSASRec.GSASRec is primarily composed of interaction graph convolution (IGC) layers and self-attention layers.We will proceed to describe each layer of the model in the order of forward propagation, along with the contrastive learning methods utilized in the model.

Embedding layer
We expound on the representation of a user, denoted as u, and an item, denoted as i, through their respective embedding vectors, e u 2 R d (for user u) and e i 2 R d (for item i), where d signifies the embedding dimension.The described process can be the creation of a parameter matrix, which operates akin to an embedding look-up table: where t represents the total number of users, while m corresponds to the total number of items.For the input sequence S u ¼ fv 1 ; v 2 ; …; v n g, data augmentation techniques such as masking, cropping, noising, and reordering are applied to obtain two augmented sequence S u 0 ¼ fv 1 0 ; v 2 0 ; …; v n 0 g and S u 00 ¼ fv 1 00 ; v 2 00 ; …; v n 00 g.Then, based on the E i table, we can acquire their embedding E S u ¼ fe v 1 ; e v 2 ; …; e v n g 2 R nÂd , E S u 0 ¼ fe v 1 0 ; e v 2 0 ; …; e v n 0 g 2 R nÂd and E S u 00 ¼ fe v 1 00 ; e v 2 00 ; …; e v n 00 g 2 R nÂd .

Interaction graph convolution layer
LightGCN (He et al., 2020) incorporates graph convolution neural networks into collaborative filtering, taking into account the latent relationships between users and items, as well as between items themselves.However, during prediction, it does not consider the temporal order of item sequences.Therefore, in this work, we leverage graph convolution neural networks to extract latent embedding information, with a focus on capturing the sequential characteristics of items, as illustrated in Fig. 1.
Based on the training data, we construct the user-item interaction matrix R 2 R tÂm and the item-user interaction matrix R T 2 R mÂt .With these matrices in place, we define the graph convolution network as follows: As items undergo multiple graph convolutions, and the sequence model focuses solely on item sequences for recommendations, we extract only the item embedding representations for the subsequent layers.We aggregate the outputs of various convolution layers to obtain the graph embedding representation for item i.
where K represents the number of graph convolution layers utilized in the model.

Self-attention layer
To represent the temporal order within a sequence, we employ positional embedding.Assuming the positional embedding is represented as P 2 R nÂd , we add it to the embedding of the behavioral sequence: we incorporate self-attention mechanism and feed-forward network layers: where the matrices

Recommendation learning
For the output sequence F ¼ ff 1 ; f 2 ; …; f n g of the feed-forward network (FFN), we can compute the binary cross-entropy loss at each step of the recommendation model:

Instance-wise contrastive learning
For a training batch B ¼ fF 1 ; F 2 ; …; , where b is the number of original sequences, and 3 Á b is the total number of sequences in one batch, comprising the original sequences and their two augmented sequences, we aim to maximize the similarity between F i and its corresponding augmented sequences F i 0 and F i 00 , as well as the similarity between the two augmented sequences themselves.
Additionally, we seek to minimize the similarity between F i , F i 0 , F i 00 , and the other sequences in the batch, thereby achieving contrastive learning.Hence, we can compute the InfoNCE loss for the batch B: where simðÁÞ represents the tensor similarity function, which is used to calculate the similarity between tensors.

Prototype contrastive learning
Prototype contrastive learning aims to learn feature representations by comparing the similarity between samples and prototypes.This process makes the feature representations of similar samples closer while pushing those of dissimilar samples further apart, resulting in the formation of distinct clusters.Typically, this learning is conducted after multiple rounds of training, specifically when the instance contrastive learning loss approaches relative stability.We interpret the embedding encoding of a user's entire sequence as the representation of their long-term interest.Generally, users with similar behavioral sequences exhibit close long-term interest embeddings.Hence, adopting prototype contrastive learning can bring the embedding encodings of similar behavioral sequences closer, placing them within the same category.This approach is advantageous for recommendation systems as it facilitates recommending similar items to users with shared interests.
We apply k-means clustering M times to the embedding representations of all user sequences in the data.For each iteration m ð1 m MÞ, we randomly select several points as the initial cluster centroids, denoted as C ¼ fc m 1 ; c m 2 ; …; c m jCj g.After several iterations of clustering in the m-th run, we fix the cluster centroids.Subsequently, we define the function: , and the function gðÁÞ assists in identifying the nearest cluster centroid c j for each averaged embedding f i calculated as the mean of all embeddings f i within the set F i .We leverage pre-iterated cluster centers for contrastive learning and compute the loss function as follows:

Multi-task learning
To enhance model performance, data efficiency, and generalization capability, and to address challenges such as data scarcity and overfitting, we adopt a multitask learning approach, as shown in Fig. 2, to integrate recommendation, instance contrastive learning, and prototype contrastive learning tasks.Specifically, we jointly optimize the loss functions of these tasks: where k and b are adjustable parameters used to balance the importance of the losses.

EXPERIMENTS
In this section, an extensive assessment is conducted to evaluate the recommendation efficacy of our GSASRec model, designed for sequential recommendation tasks.Our evaluation entails a comprehensive analysis that includes a comparative study between GSASRec and previous sequential recommenders.Subsequently, we delve into a thorough investigation to explore the influence of crucial components and hyperparameters integrated within GSASRec's architecture.This systematic examination aims to shed light on the model's strengths and potential areas for further enhancement, contributing to the advancement of sequential recommendation techniques powered by deep learning methodologies.

Datasets
In our investigation, we embark on a series of experiments encompassing four widely adopted benchmark datasets.These datasets have their statistical attributes meticulously summarized and displayed in Table 1.Incorporated within McAuley et al. (2015), the Amazon review dataset has been thoughtfully partitioned into three distinct subcategories, namely Sports, Beauty and Toys.Concurrently, Yelp emerges as a prominent dataset tailored for the specific task of business recommendation.Following the methodology presented in reference (Xie et al., 2020), we adopt a similar approach to preprocess the dataset, eliminating users with fewer than five interactions.

Evaluation metrics
To evaluate the performance of our approach, we utilize two widely recognized Top-K metrics (NDCG@K and HR@K) as proposed by a previous work (Krichene & Rendle, 2020).The formula for NDCG@K is as follows: NDCG@K ¼ DCG@K IDCG@K where DCG@K ¼ P K i¼1 rel i log 2 ðiþ1Þ and rel i is the relevance score of the item at position i in the ranked list.IDCG@K is the maximum possible DCG@K achievable for a perfect ranking.It is calculated by sorting the items by their true relevance scores in descending order and then calculating DCG@K for this ideal ranking.HR@K is a binary evaluation metric, commonly used for the performance evaluation of recommendation systems.The formula for HR@K is as follows: where the number of relevant items in recommendations is the number of items related to user interests in the first K recommended results.Overall, HR@K measures the percentage of recommended items that contain at least one ground truth item within the top K positions.On the other hand, NDCG@K assesses the ranking quality by giving higher scores to hits at higher-ranked positions.These metrics provide a quantitative measure of how effective each model is at recommending relevant items within the top K positions.By comparing NDCG@K or HR@K scores, we can determine which model is better at surfacing relevant content to users.Higher scores indicate more effective recommendations.To ensure consistency, we set the value of K to 5 and 10 for both metrics.

Baseline methods
We compare GSASRec with the following baseline methods: BPR-MF (Rendle et al., 2012) proposed a generic learning algorithm based on stochastic gradient descent with bootstrap sampling.Caser (Tang & Wang, 2018) proposed a convolutional sequence embedding recommendation model, which effectively captures both general preferences and sequential patterns in recommendation tasks.GRU4Rec (Hidasi et al., 2015) proposed a novel session-based recommendation model based on GRUs, which effectively captures temporal dependencies in user behavior sequences.SASRec (Kang & McAuley, 2018) utilized self-attention mechanism for sequential recommendation.BERT4Rec (Sun et al., 2019) adopted BERT as the sequential recommendation model.S 3 Rec (Zhou et al., 2020) adopted a self-supervised learning approach, where items in the user behavior sequence are masked, and the masked sequence is used to predict the masked items.CL4SRec (Xie et al., 2020) proposes the use of data augmentation in contrastive learning to enhance the effectiveness of recommendation systems.ICLRec (Chen et al., 2022) leveraged clustering to learn user intent and validated the rationality of this approach.

Implementation
We employ various critical hyperparameters.Specifically, we configure the embedding size to 64, establish the maximum sequence length at 50, define a batch size of 256, and specify 300 epochs for training.When it comes to the contrastive learning loss during prototype computation, our learning process kicks off from epoch 160, with a learning rate set at 0.001.Our model architecture comprises three graph convolutional layers, each of which incorporates two self-attention blocks with two attention heads.We set k to 0.9 and b to 0.1.Additionally, we iterate through the clustering procedure M times, with M being defined as 3. Furthermore, we harness the PyTorch framework, and our GPU is equipped with an NVIDIA GeForce RTX 3070, supported by a substantial 64 GB of computer RAM.

Overall performance
Through the analysis of Table 2, we can observe the results obtained by various methods on different datasets.we observe that incorporating sequential patterns in user behavior sequences enhances the performance of sequential models like SASRec and Caser, surpassing the non-sequential approach BPR-MF.This highlights the significance of mining sequential patterns, with GRU4Rec also exhibiting improved results over BPR-MF in the deep learning era.Furthermore, Caser, leveraging a convolutional module to stack sequential tokens as a matrix, performs on par with GRU4Rec.Moreover, SASRec stands out as the pioneer in utilizing uni-directional attention for sequence encoding, demonstrating its superiority over previous deep learning-based models by significantly improving performance.With the rise of contrastive learning techniques in recommendation systems, BERT4Rec, S3-Rec, and CL4SRec have all leveraged contrastive learning to enhance model performance, surpassing pure sequential recommendation models.However, the two-stage training strategy employed in S3-Rec obstructs information sharing between tasks, resulting in suboptimal outcomes.On the contrary, CL4SRec consistently outperforms other baselines, showcasing the efficacy of contrastive self-supervised learning in enriching sequence representations at an individual user level.The additional objective employed by CL4SRec, entailing two distinct views of the same sequence, significantly contributes to its superior performance.Subsequently, the emergence of ICLRec method combines the advantages of previous approaches and introduces user intent extraction techniques, which also rely on contrastive learning methods, resulting in significant improvements.Finally, our proposed GSASRec model achieves even greater improvements compared to ICLRec.In contrast, we enhance the model's representational capacity by leveraging graph convolutional techniques on the user-item interaction graph.Moreover, we perform multiple prototype clustering to mitigate noise interference and introduce a data augmentation method for instance-based contrastive learning.
Figure 3 presents the model's performance at each epoch.It is important to highlight that we introduced the prototype contrastive learning loss at epoch 160, as depicted in Fig. 3E.This led to a noticeable increase in the computed loss values, resulting in distinctive fluctuations and an overall upward trend in the curves, particularly evident in the Toys (Fig. 3C) and Beauty (Fig. 3B) datasets.

Impact of parameters k and b
As shown in Fig. 4, to evaluate the impact of loss function weights on the model's performance, we conducted experiments with multiple sets of k and b values and assessed the model's NDCG@10 performance on four different datasets.The results indicate that the model performs best when k is set to 0.9 and b to 0.1.However, when b is set to 0 or greater than 0.1, the model's performance deteriorates.We attribute this to the introduction of the prototype contrast loss, which results in the prototype contrast loss value becoming much larger than the instance contrast loss value after a certain number of epochs.Consequently, the model overly emphasizes the prototype contrast task and does not continue to optimize the sequence recommendation task and the instance contrast task.Therefore, it is necessary to reasonably reduce the weight of the prototype contrast task.

Impact of model components on recommendation performance
To validate the effectiveness of various model architectures and methods thoroughly, we conducted comprehensive ablation experiments on four diverse datasets, leveraging the widely accepted NDCG@10 metric for evaluation.The conducted ablation experiments involved systematically removing specific functionalities from our proposed model, GSASRec, in order to gauge their individual contributions to the overall performance.In Fig. 5, we present the insightful results obtained from these ablation experiments.Each abbreviation in the figure represents a specific functionality removed from the GSASRec model.'w/o' stands for 'without,' indicating the absence of the corresponding functionality.Specifically, 'ICL' represents Instance-wise contrastive learning, 'PCL' refers to prototype contrastive learning, 'IGCL' signifies the interaction graph convolution layer Moreover, the results highlight the importance of prototype contrastive learning, particularly for the Toys dataset, where it exhibits a noteworthy influence on enhancing recommendation performance.This observation emphasizes the versatility of our proposed model across different datasets and the potential of prototype contrastive learning in addressing specific domain challenges.Furthermore, the interaction graph convolution layer stands out as a significant component in our model, consistently leading to substantial performance improvements across all the evaluated datasets.This finding underlines the efficacy of incorporating graph-based interactions to capture complex relationships between users and items, reinforcing the importance of leveraging graphbased learning methods in recommendation systems.

Impact of layer combination
In our model, we aggregate the outputs of k convolutional layers to obtain the embedding representation.The choice of different k values significantly influences the effectiveness of the model's embedding representation.Figure 6 illustrates the effects of varying convolutional layer depths on four distinct datasets.The term 'Number of Layer'   improve the model's representation capabilities, we employ instance contrastive learning and prototype contrastive learning techniques.The introduction of these contrastive learning techniques enables our model better capture the underlying structures and patterns in the data, leading to improved recommendation performance.We have conducted extensive comparative experiments and ablation studies to demonstrate the superiority of our proposed method.
representation of node i in the k þ 1st iteration.The sum is taken over all the neighboring nodes u of node i denoted by N i .The term 1 factor that accounts for the degree of nodes i and u, and e ðkÞ u is the representation of node u in the k-th iteration.When k ¼ 0, we initialize e ð0Þ i ¼ e i 2 E i and e ð0Þ u ¼ e u 2 E u .This update rule is used in graph convolution networks to aggregate neighboring node features and update the representation of each node in the graph.
Guo and Zeng (2023), PeerJ Comput.Sci., DOI 10.7717/peerj-cs.17016/20 and W ð2Þ 2 R dÂd serve as parameter matrices, while b ð1Þ and b ð2Þ 2 R d represent bias vectors.The attention mechanism is expressed as follows:AttentionðQ; K; VÞ ¼ softmax QK T ffiffiffi d p VSimilarly, from b E p 0 and b E p 00 , we can obtain F 0 and F 00 .

Figure 2
Figure 2 The overview of GSASRec in the training stage.We assume that the input sequence of examples goes through data augmentation techniques, such as introducing noise, to generate two positive sample sequences (only one is shown in the figure).In this process, we randomly replace i 9 and i 6 with i 7 and i 2 , respectively.Subsequently, the encoded sequences undergo multitask learning, involving instance contrastive learning and prototype contrastive learning.Full-size  DOI: 10.7717/peerj-cs.1701/fig-2

Figure 3
Figure 3 The training curves of GSASRec, which are evaluated through training loss, and testing HR@k and NDCG@k per epoch on the Sports, Beauty, Toys, and Yelp datasets.Full-size  DOI: 10.7717/peerj-cs.1701/fig-3

Figure 4
Figure 4 The performance of ablation experiments on the parameters and b.Full-size  DOI: 10.7717/peerj-cs.1701/fig-4

Figure 6
Figure 6 The results of different graph convolution layer settings in the four datasets.Full-size  DOI: 10.7717/peerj-cs.1701/fig-6 logð1 À rðf t Á e v j ÞÞ where f i represents the output of the i-th FFN of the model.ŷ represents the index of the target item at position n+1 in the sequence within E i .r denotes the sigmoid function.e v ŷ signifies the embedding representation of the training label.

Table 1
Statistics of experimental datasets.

Table 2
Overall performance.
Notes:Bold indicates the best result among all methods, while underlining represents the highest result among previous methods.Improveð%Þ ¼ Our model scoreÀhighest result among previous methods highest result among previous methods .Guo and Zeng (2023), PeerJ Comput.Sci., DOI 10.7717/peerj-cs.170113/20