Next Article in Journal
On Properties of the Hyperbolic Distribution
Previous Article in Journal
Enhancing Autism Spectrum Disorder Classification with Lightweight Quantized CNNs and Federated Learning on ABIDE-1 Dataset
Previous Article in Special Issue
Blin: A Multi-Task Sequence Recommendation Based on Bidirectional KL-Divergence and Linear Attention
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

HyperCLR: A Personalized Sequential Recommendation Algorithm Based on Hypergraph and Contrastive Learning

Faculty of Information Engineering and Automation, Kunming University of Science and Technology, Kunming 650504, China
*
Author to whom correspondence should be addressed.
Mathematics 2024, 12(18), 2887; https://doi.org/10.3390/math12182887
Submission received: 29 July 2024 / Revised: 7 September 2024 / Accepted: 13 September 2024 / Published: 16 September 2024
(This article belongs to the Special Issue Applied Network Analysis and Data Science)

Abstract

:
Sequential recommendations aim to predict users’ next interactions by modeling their interaction sequences. Most existing work concentrates on user preferences within these sequences, overlooking the complex item relationships across sequences. Additionally, these studies often fail to address the diversity of user interests, thus not capturing their varied latent preferences effectively. To tackle these problems, this paper develops a novel recommendation algorithm based on hypergraphs and contrastive learning named HyperCLR. It dynamically incorporates the time and location embeddings of items to model high-order relationships in user preferences. Moreover, we developed a graph construction approach named IFDG, which utilizes global item visit frequencies and spatial distances to discern item relevancy. By sampling subgraphs from IFDG, HyperCLR can align the representations of identical interaction sequences closely while distinguishing them from the broader global context on IFDG. This approach enhances the accuracy of sequential recommendations. Furthermore, a gating mechanism is designed to tailor the global context information to individual user preferences. Extensive experiments on Taobao, Books and Games datasets have shown that HyperCLR consistently surpasses baselines, demonstrating the effectiveness of the method. In particular, in comparison to the best baseline methods, HyperCLR demonstrated a 29.1% improvement in performance on the Taobao dataset.

1. Introduction

Information overload is an important issue with the rapid development of the Internet, which means that network users are often faced with massive information and struggle to identify valuable content. To address this, recommendation systems have been developed [1]. These systems generate personalized item suggestions by analyzing users’ historical interaction data, browsing habits, and purchase records. A key aspect of these systems is sequential recommendation, which aims to capture the evolving preferences of users and predict their next item of interest [2]. The historical interaction data of users and items can be constructed as a graph. Recently, Graph Neural Networks (GNNs) have been widely used in sequential recommendation due to their superiority in graph-structured data processing. However, a major challenge is the diverse evolution of user interests, which complicates the interpretation of global item transition patterns. Moreover, while GNN-based methods [3] typically model data as directed graphs, they often fail to capture the complex, high-order item relationships in user sequences. Item transitions often result from interactions with multiple previous items in the real-world scenarios, creating intricate multi-to-multi high-order relationships that simple graphs cannot accurately represent [4]. Additionally, unpredictable and diverse user behaviors can introduce noise into the data.
Hypergraphs extend traditional graph structures by allowing each hyperedge to connect multiple nodes, which are suitable for capturing these potential relationships across multiple entities [4]. Recent research has explored the ability of hypergraphs in modeling interactions across users and items to provide more personalized recommendations. For example, Guo et al. [5] and Jiang et al. [6] attempt to recognize intricate relationships between users and items and capture the evolution of user preferences based on hypergraphs. In addition, contrastive learning has also been applied in sequential recommendation. It is a self-supervised learning method [7,8] that typically uses pairs of positive and negative samples to train models. This approach effectively reduces noise in the data, enabling the model to distinguish between similar and diverse user sequences. Zhou et al. [9] improve item representation learning through masked sequence modeling and contrastive learning, thus gaining deeper insights into user behavior patterns. Xia et al. [10] develop a contrastive learning strategy that focuses on user–item interactions, significantly raising the discriminative capability of the model.
For the first challenge, this paper leverages hypergraphs to model latent high-order relationships among user preferences in sequential recommendations [4]. We denote each user’s interaction data as a hyperedge and each item as a node in these hyperedges, thus forming a comprehensive hypergraph that contains item-level high-order relations. Through hypergraphs, this paper can analyze complex item transition patterns from users’ local interaction sequences to explore personalized preferences deeply. To address the second challenge, this paper proposes a HyperCLR algorithm that merges the global hypergraph with every user interaction sequence to build a Global Item Frequency Distance Graph (IFDG). This graph describes item transition patterns within user sequences, offering a global context for each user–item interaction by constructing edges based on interaction frequency and spatial distance as edge attributes. Inspired by GraphSAGE [11], this paper utilizes the technique of neighborhood sampling and obtains an enhanced representation of this network. Concerning the third challenge, this paper adopts contrastive learning [12] to refine the consistency between identical sequence representations within the enhanced graphs, mitigating the influence of noisy interactions in the data.
In this paper, we present HyperCLR, which is a personalized sequential recommendation algorithm based on both hypergraphs and contrastive learning. The whole framework of our method is shown in Figure 1. The contributions of this paper are concluded as follows:
(1)
Hypergraphs are utilized to extract and analyze high-order item transition patterns from local user interaction sequences, which enhances the understanding of personalized preferences. Given the impact of positional attributes of interaction sequences, this paper can dynamically integrate time and location data by fine tuning the hypergraph to current user preferences.
(2)
This paper constructs the Global Item Frequency Distance Graph (IFDG) to investigate the high-order interaction relationships among items, enabling the mining of item transformation relationships within sequences. In addition, this paper designs a gating mechanism to capture dynamic interest.
(3)
This paper adopts contrastive learning to alleviate data sparsity and the behavioral unpredictability of users, enhancing the coherence of sequence representations in these enhanced graph structures and reducing the impact of anomalous interactions.
(4)
Extensive experiments conducted on three real-world datasets demonstrate that HyperCLR consistently surpasses baselines, validating this approach’s effectiveness.

2. Related Work

2.1. Sequential Recommendation

Sequential recommendation systems aim to make predictions about users’ future interactions by analyzing their historical behaviors, which is structured in the time-order of item occurrences [2]. In recent years, deep neural networks have gained increasing attention in sequential recommendation systems. Notably, Convolutional Neural Networks (CNNs) and attention schemes have proven effective for this task. For example, Caser [13] utilizes convolutional filters to capture the sequential order of user interactions, while SASRec [14] employs an attention mechanism to understand the relationships between items, enhancing the detection of user intentions. Additionally, sequence modeling techniques are employed to encode user interaction sequences or to convert these sequences into graph structures, which facilitates a deeper exploration of item relevance [3,15,16]. The inherent complexity of user behavior, item characteristics, and interaction contexts in real-world scenarios poses a significant challenge in accurately modeling users’ dynamic preferences and consumption intentions in sequential recommendations.

2.2. Graph Neural Networks

In recent years, Graph Neural Networks (GNNs) have become prominent in sequential recommendation tasks due to their distinct benefits on graph-structured data [3,17]. In general, users and items can be considered as nodes in a graph in order to depict the sequence of interactions of each user in the graph. Then, GNNs are used to learn user and item representations. Nevertheless, most works primarily focus on the quantity of interactions between nodes, often neglecting to thoroughly analyze the strength of correlations between items through their interactions or to effectively capture high-order item features for more precise embeddings. This limitation can hinder the model’s ability to detail the nuanced transitions between graph nodes [4]. At this point, hypergraphs provide a solution by naturally capturing complex high-order relationships [4]. Pioneering efforts such as HGNN [18] and HyperGCN [19], have applied graph convolution techniques to hypergraphs, using advanced GNNs to delve into the intricate item transition relationships within sequences and to model the contextual relationships between items and sequences comprehensively. These methods enhance interpretability and learn dynamic preference transitions by modeling complex user–item and item–item relationships within user interaction sequences.

2.3. Contrastive Learning for Recommendation

Contrastive learning focuses on obtaining robust data representations by exploiting the similarities and differences between data samples [7,8]. The basic idea of contrastive learning is that similar samples are clustered closer together and dissimilar samples are clustered farther apart. This method effectively improves the model’s capability to identify and interpret data patterns without the need for explicit labels. In the context of recommendation systems, CL4SRec [20] incorporates contrastive learning by augmenting sequences with techniques such as cropping, masking, or reordering. This approach not only refines the recommendation process but also introduces a new dimension to sequence manipulation for model training. Moreover, contrastive learning is adaptable to graph-based representations, enhancing the detection of global item-related signals. For instance, GCL4SR [16] applies graph contrastive learning to recommendation tasks by randomly sampling neighbors within item transition graphs to obtain different item representations from different subgraphs. APGL4SR [21] utilizes graph contrastive learning to ascertain personalized global information, thus refining the intricate interactions within user sequences.

3. Problem Definition

In this section, a detailed introduction to the target problem and the related notations involved in the approach of this paper are provided.
The objective of sequential recommendation is to effectively model the interaction sequence for the given user u at a given time t and to accurately predict the next item likely to be interacted with at time t + 1 . The set of users is denoted as U = { u 1 , u 2 , , u | U | } and the set of items is denoted as V = { v 1 , v 2 , , v | V | } . Each user u U has an associated interaction sequence S u = { v 1 u , v 2 u , , v n u } , which lists the items interacted with, ordered by interaction timestamps. Here, n is the total number of items in the interaction history of u. Additionally, p u R 1 × d represents the embedding vector for user u, and e i R 1 × d represents the embedding vecto for item i, where d is the dimension of embeddings. The initial embedding of the sequence S u is represented by E S 0 R n × d , where the t-th row corresponds to the embedding of the t-th item in S u . The matrix E R | V | × d contains the embeddings of all items. The objective of sequential recommendation is to effectively model the interaction sequence for the given user u at a given time t and to accurately predict the next item likely to be interacted with at time t + 1 .
In this paper, G H = ( V , E H ) represents a hypergraph, where each user is denoted as a hyperedge. Formally, each hyperedge associated with user u is represented as [ e u , 1 , e u , 2 , e u , 3 , , e u , m ] within the set E with each item e u , m belonging to the vertex set V. Here, V comprises item nodes accessed by user u, and E includes m hyperedges representing the user’s interactions. Each hyperedge ϵ connects two or more vertices and is assigned a positive weight W ϵ ϵ with all these weights forming a diagonal matrix W R m × m . The hypergraph structure is further described by an incidence matrix H R n × m [22]. In this matrix, if hyperedge ϵ includes vertex v i , then H i ϵ = 1 ; otherwise, H i ϵ = 0 . The degree of each vertex v i and each hyperedge ϵ are denoted by the diagonal matrices D and B, respectively. Specifically, D i i is calculated as D i i = ϵ = 1 m W ϵ ϵ H i ϵ and B ϵ ϵ is B ϵ ϵ = i = 1 n H i ϵ . In this setup, each hyperedge is assigned a uniform weight of 1 for simplicity.

4. Methodology

The framework of the proposed HyperCLR is shown in Figure 1. First, a global hypergraph is constructed based on the user interaction sequences. Next, from the constructed hypergraph and the global user interaction sequences, a Global Item Frequency Distance Graph (IFDG) will be built to learn higher-order interactions between items and explore their correlations. After that, this paper uses neighbor sampling to construct random subgraphs and use GATs (Graph Attention Networks) to learn item embeddings. Subsequently, to further improve the representation embeddings, this paper adopts contrastive learning on the basis of the learned embeddings from random subgraphs, mitigating data sparsity and user behavior uncertainty. Then, this paper extracts higher-order item transition patterns of users’ local interaction sequences to analyze users’ personalized preferences. Meanwhile, this paper dynamically fuses time and location information into users’ preferences and designs an interest-gating mechanism to accurately capture users’ dynamic preferences. Finally, this paper can use Transformer to understand the user’s preferences and predict the next item using a multi-layer perception (MLP). A detailed description of the HyperCLR follows.

4.1. Construction of Global Item Frequency Distance Transformation Graph (IFDG)

Hyperedges in the hypergragh focus on similarity and coherence among items while discarding the sequential order of interactions. Note that e S u , m 1 and e S u , m appear in the same hyperedge only if there is a previous interaction between them [23], which ensures that all items within the same sequence are interconnected. This paper can transform the hypergraph into an undirected graph to model the information transmission process because the influence between any pair of items is mutual and independent of their order in the interaction [24]. For instance, the impact of item v i on v j is considered equivalent to that of v j on v i [25]. The construction process of the hypergraph is illustrated in Figure 2. S 1 , S 2 , and S 3 represent the interaction sequences of users u 1 , u 2 , and u 3 , respectively.
Moreover, this paper can utilize the total interaction counts, Count ( i , j ) , between all users and global items to assign weights to the edges connecting items within a sequence. Count ( i , j ) represents the total number of visits to items i and j across all user sequences, reflecting their co-occurrence in the same hyperedge. Previous work often relies solely on the interaction count between two item nodes to set edge weights, focusing primarily on the local context or user preferences within each sequence. This focus generally overlooks the relevance among users who exhibit similar behavioral patterns, such as sharing identical item subsequences [26]. As a result, they fail to capture the fine-grained transition relationships between items, neglecting the high-order connectivity across different user sequences. Unlike methods that solely model sequential transition patterns within individual sequences, HyperCLR learns from both user–item interactions and the co-occurrence patterns between items [27].
Items that frequently appear together are considered more similar. To further enhance the global item transition patterns and discover latent high-order relationships between items, this paper can also incorporate the positional distance Δ D between items in all original user interaction sequences. Initially, each distance is set to zero as outlined in Equation (1).
D = Δ d 11 Δ d 12 Δ d 1 | V | Δ d 21 Δ d 22 Δ d 2 | V | Δ d i 1 Δ d i 2 Δ d i j Δ d i | V | Δ d | V | 1 Δ d | V | 2 Δ d | V | | V | ,
where Δ d i j quantifies the distance between two interacting items v i and v j within a user’s sequence. It accumulates based on the relative positions of these items whenever they appear together in the same sequence. The distance updating formula provided ensures that Δ D i j grows as v i and v j appear more frequently in closer proximity within sequences, as shown in Equation (2):
Δ D i j = | j i | + Δ D i j if H i ϵ = H j ϵ = 1 , ϵ { 1 , 2 , 3 , , M } , + if H i ϵ H j ϵ or H i ϵ = H j ϵ = 0 , ϵ { 1 , 2 , 3 , , M } ,
where i and j denote the actual positions of v i and v j in the user interaction sequence. Δ D i j represents the original value and Δ D i j represents the updated value. Here, H i ϵ = H j ϵ = 1 indicates that both v i and v j are part of the same hyperedge ϵ , reflecting direct interaction within the sequence. If v i and v j are not part of the same hyperedge, or if they do not appear in any hyperedge together, the distance is set to infinity, symbolizing no direct relationship within the given contexts.
After this process is applied across all user sequences, a tailored activation function S ( · ) is introduced to normalize the edge weights between nodes v i and v j in the global item graph based on the calculated interaction distances. The function S ( Δ D i j ) is defined as shown in Equation (3):
S ( Δ D i j ) = 1 Δ D i j if Δ D i j + , 0 if Δ D i j = + .
A larger distance between two interacting items indicates a weaker correlation, while a smaller distance indicates a stronger correlation and hence a higher edge weight. By integrating the global item distance with the interaction frequency data, Count(i,j), and normalizing this combination, the study develops a Global Item Frequency Distance Graph (IFDG). The construction process of IFDG is shown in Figure 3. In this graph, the edge weights between items are defined using the Formula (4):
w i j = w j i = softmax 2 × Count ( i , j ) × S ( Δ i j ) D i j + D i j ,
where D i i and D j j denote the degrees of nodes i and j within the hypergraph, indicating the number of interactions involving nodes i and j within a sequence. The IFDG is represented as G I ( V , E I ) .

4.2. Graph Convolution and Contrastive Learning

This paper constructs a stochastic subgraph construction from the IFDG according to the neighbor sampling in GraphSAGE [11], generating enhanced views of IFDG. Then, this paper can adopt the convolution operation in GAT [28] to enhance flexibility and adaptability in graph fusion. Specifically, for a random batch of nodes S from G I , each node v S is treated as a central node, and its neighbors are sampled for interaction. During the sampling process, nodes are uniformly sampled without consideration of edge weights, and the edges between sampled nodes are preserved along with their weights in G I . Hence, this paper can obtain two augmented views G S = ( V S , E S ) and G S = ( V S , E S ) , where V S and E S are the sets of nodes and edges, respectively. The node information fusion in this study is influenced by the information propagation and aggregation mechanism of GAT [28], where i is a central node and j is a neighboring node. Initially, h i 0 = e i and h j 0 = e j . The graph convolution process is shown in Formulas (5)–(7):
Aggregation:
n i ( l ) = j N i α i j ( l ) h j ( l ) ,
α i j ( l ) = exp σ ( W ( l ) h i ( l ) ) T σ ( W ( l ) h j ( l ) ) T k N i exp σ ( W ( l ) h i ( l ) ) T σ ( W ( l ) h k ( l ) ) T ,
Update:
h i ( l + 1 ) = δ W ( l ) n i ( l ) ,
where N i denotes the neighbors of node i, and W ( l ) is tasked with transforming node representations during the l-th propagation. W i , W k , and W j are the transformation matrices, while σ ( · ) represents a nonlinear activation function. A higher α i j l indicates a stronger similarity and more significant information transfer from v j to v i .
After multiple rounds of graph convolution, the sampled subgraphs enable the model to capture and learn crucial information about the interactions, distances, and inferred relevancies between each item and others within the same user space in the global item graph. More interactions between two items by different users, coupled with shorter distances in each interaction, indicate a higher degree of similarity and correlation. By effectively modeling the similarity information between item pairs, the model achieves more accurate embeddings of these items. Following multiple layers of information propagation and aggregation in the enhanced graphs, the final node embeddings in the GNN are represented as Z S R n × d based on the augmented view G S . A parallel enhanced representation, Z S R 1 × d , is derived from G S .
HyperCLR relies on user interactions with items that may contain noisy data, such as a user mistakenly clicking on an item that is not of interest to them [29]. To address this challenge, this paper can employ graph contrastive learning to ensure that representations derived from the same sequence’s enhanced graph views remain similar, while those from different sequences exhibit variability. A supplementary learning objective is developed to discern whether two views originate from the same user interaction sequence. Specifically, views from the same sequence are considered positive pairs as G S , G S S G I , and views from different sequences are treated as negative pairs as G S , G K S , K G I , S K .
As illustrated in Figure 4, the Item Frequency Distance Transformation Graph (IFDG) is constructed based on the hypergraph from Figure 2 and the original user sequences. Then, two augmented subgraphs from the IFDG can be constructed using the neighbor sampling in GraphSAGE [11]. Specifically, in Figure 4, the node v 6 is selected as the central node (other nodes are also selected as central nodes, although they are not shown in this figure), and randomly samples their neighbors without considering the original edge weights in the IFDG. After sampling, the edges between the nodes and the weights from G I are retained, ultimately generating two augmented views of the IFDG. The similar subsequences centered on v 6 in the two views serve as positive sample pairs G S , G S for contrastive learning, while subsequences centered on other nodes that significantly differ from the v 6 subsequences serve as negative sample pairs G S , G K during the contrastive learning process. Contrastive learning leverages the comparison between negative and positive samples to enhance the model’s ability to distinguish between different user behaviors. When handling diverse user behaviors, the model learns feature representations of different behavior patterns from a large set of samples, using contrastive learning to distinguish between genuine behavioral patterns and incidental anomalies. In essence, the model maximizes the mutual information between positive sample pairs and minimizes the mutual information between positive and negative samples, identifying and excluding noise that is unrelated to the target task during training. The contrastive objective used to differentiate between representations from the same interaction sequence and others is detailed as shown in Formula (8):
L G C L = S G I l o g e x p c o s z S , z S / τ K G I e x p c o s z S , z K / τ .
Here, the node embeddings from the final layer, Z S and Z S , are averaged to produce vectors z S and z S , respectively, each within R 1 × d . The cosine similarity function cos ( · ) measures the similarity between these vectors. The hyperparameter τ is empirically set to 0.5 in the experiments, which can facilitate the appropriate scaling of similarity scores during the learning process.

4.3. Hypergraph Convolution and User-Personalized Interest Gating

This paper uses the hypergraph convolutional network to analyze complex inter-item relationships. This paper addresses the primary challenge of defining convolution operations on hypergraphs by effectively propagating item embeddings. Building upon the methodology presented in [19], the definition of hypergraph convolution is expressed mathematically as shown in Formula (9):
x i ( l + 1 ) = j = 1 N ϵ = 1 M H i ϵ H j ϵ W ϵ ϵ x j ( l ) .
As suggested in [18], this paper does not use nonlinear activation functions and convolutional filter parameter matrices. Here, the weight W ϵ ϵ assigned to each hyperedge is 1. The normalization of the embedding operates as shown in Formula (10):
X h ( l + 1 ) = D 1 HWB B 1 H T X h ( l ) .
Hypergraph convolution is described as a two-stage information aggregation process to learn feature transformation in a “node–hyperedge–node” manner. Initially, the operation H X h ( l ) aggregates information from nodes to hyperedges, followed by H , which redistributes the accumulated information back to the nodes. After L layers of hypergraph convolution, the item embeddings from each layer are averaged to produce the final item embedding X h = 1 L + 1 l = 0 L X h ( l ) .
To capture the distinctions of user local interaction sequences that encompass temporal intervals, an item temporal interval encoder [30] is introduced. Considering that the time interval length between consecutive interactions might influence the impact of the current interaction on the subsequent one, the representation of each item is combined with its internal time interval. Given a sequence E S 0 and its associated timestamp sequence T u , the timestamps { t 1 , , t | S u | } are transformed into a sequence of time intervals as shown in Formula (11):
λ 1 , λ 2 , , λ S u = 0 , t 2 t 1 , , t S u t S u 1 .
As depicted in Figure 5, the relevance of each item to a user decreases over time. An item interacted with earlier is less connected to the last recommended item [17]. Consequently, a decay activation function F λ i is designed as shown in Formula (12):
F λ i = tanh 1 ( λ i + 0.0001 ) .
The intuition is that the effect of each item on the final recommended item varies with the time interval between these two interactions. This function effectively reduces the weight of older interactions to emphasize more recent ones, which can adapt to the dynamic preferences of users over time. To prevent division by zero, a small constant 0.0001 is added to Δ t . The function tanh ( · ) maps the value of F ( λ i ) to the ( 0 , 1 ) range, preventing outcomes that are excessively large or small.
After capturing the time information for each item in the user sequence, this paper computes the position embedding for the time interval λ i by Equation (13) [31]:
p o s i = α l o g ( λ i c + 1 ) ,
where α and c are scaling factors, and δ i is the position embedding for the i-th item in E S 0 , δ i R 1 × n . The embedding for the t-th item in sequence E S 0 is Equation (14):
x t = tanh W t x t , p o s i , F δ i + b ,
where W t R d × 2 d and b R d are learnable parameters. Sequence embeddings are represented by aggregating the representations of items in the sequence. Following the strategy used in SR-GNN, the embedding of sequence E S 0 is refined as shown in Formulas (15) and (16):
α t = f σ W a s x s + W a t x t + c ,
p u = t = 1 m α t x t ,
where x s is the high-order item embedding from E S 0 after hypergraph convolution, which was obtained by averaging the embeddings of items it contains, x s = 1 m t = 1 m x m . The user’s general interest embedding p u in the whole sequence is represented by a soft attention mechanism that aggregates item embeddings, and different items have different priorities. f R d , W α s R d × d , and W α t R d × d are attention parameters used to learn the weights α t .
The authors of [32] design a user-specific gating mechanism to capture global context information tailored to a user’s personalized preferences as shown in Formula (17):
Q S = Z S σ Z S W g 1 + W g 2 p u T ,
where W g 1 R d × 1 and W g 2 R L × d , σ ( · ) represent the sigmoid function, and ⊗ denotes element-wise multiplication. The user embedding p u T describes the user’s general preferences. Similarly, this paper can obtain Q S for the enhanced view G S .

4.4. Attention Layer

In this work, in addition to the advanced graph-enhanced sequence representations, we use traditional sequence modeling techniques to encode users’ interaction sequences. Specifically, a set of stacked Transformer encoders [31] is designed to effectively model these sequences. The transformation process for each layer, denoted as , begins with the node representations from the previous layer H 1 . The output for the -th layer of the Transformer encoder is computed as shown in Formulas (18) and (19):
H = FFN ( Concate ( h e a d 1 , , h e a d n ) W h ) ,
h e a d i = Attention ( H 1 W i Q , H 1 W i K , H 1 W i V ) .
Here, F F N ( · ) denotes a feedforward network; h represents the number of heads; W i Q , W i K , and W i V are projection matrices in R d × d / h and W h R d × d . The attention mechanism is defined as shown in Formula (20):
A t t e n t i o n ( Q , K , V ) = s o f t m a x QK d V ,
where Q , K , and V correspond to the query, key, and value matrices, respectively, with d serving as a normalization factor. Moreover, the representations derived from the graph views, Q S and Q S , will be integrated with the initial embeddings of the user interaction sequence items E S ( 0 ) as shown in Formula (21):
M = A t t N e t C o n c a t Q S , Q S , E S ( 0 ) ,
where AttNet ( · ) denotes the final vector representation produced by the attention network after layer stacking and M R 1 × d .

4.5. Prediction Layer

The probability of interaction between a user and items at step n + 1 , following a user interaction sequence S u of length n, can be calculated as shown in Formula (22), where y ^ R 1 × | V | :
y ^ = softmax ( M E ) ,
where M represents the final embedding matrix derived from the attention network and E stands for the item embedding matrix. The softmax function transforms the scores into probabilities to predict of the user’s likelihood of interacting with each item at the next time. The model is optimized during the training phase using a binary cross-entropy loss function as shown in Equation (23):
L main = i = 1 m y i log ( y ^ i ) + ( 1 y i ) log ( 1 y ^ i ) .
To further enhance the learning process, we adopt contrastive learning in HyperCLR, which leverages sequence comparison to obtain more robust representations. The whole loss function combining both learning tasks is expressed as shown in Equation (24):
L t o t a l = L main + λ 1 L G C L .
Here, L main and L G C L deal with the sequential recommendation task and the graph contrastive learning task, respectively, and λ 1 is a hyperparameter that balances the two tasks.

5. Experiment

5.1. Experimental Settings

5.1.1. Datasets

The performance of HyperCLR can be assessed on three real-world datasets:
  • Taobao [33]: It is a set of data collected from user browsing and purchasing activities across Tmall, Taobao, and Alipay from 1 July 2015, to 30 November 2015. For analysis, a random one-eighth sample of all purchase records was selected.
  • Books and Games [34]: These are two datasets from the Amazon website that contain a large amount of interaction data between users and different categories of items, primarily focusing on user purchasing behavior.
For each dataset, redundant interactions per user were eliminated, and items were organized chronologically. To ensure data quality, user sequences with fewer than five interactions and items appearing fewer than five times were excluded [35]. In these experiments, the last item interacted with by each user was designated for testing, the penultimate item for validation, and all preceding items for training [36]. The statistical results are summarized in Table 1.

5.1.2. Evaluation Metrics

To evaluate the effectiveness of the HyperCLR method, we chose two widely used metrics in sequential recommendations: Hit Rate (HR) and Normalized Discounted Cumulative Gain (NDCG).
(1)
HR@N: It measures whether the items in users’ Top-N predicted recommendations occur in users’ interactions, which reflects the accuracy of the model.
(2)
NDCG@N: NDCG measures whether the items of actual interest to the user are ranked higher, emphasizing the “order” of the predictions and the importance of ranking accuracy.
This paper focuses on HR@1,10 and NDCG@10. NDCG@1 is not considered because it has the same value as Hit@1. To manage the large item set efficiently, we constructed a testing pool of 100 items by pairing one genuine item with 99 randomly selected negative items for evaluation, enhancing computational efficiency while maintaining assessment precision.

5.1.3. Compared Baselines

This paper compared HyperCLR with the following sequential recommendation methods:
  • GRU4Rec [37]: GRU4Rec employs Gated Recurrent Units (GRUs), a variant of Recurrent Neural Networks (RNNs), to efficiently process sessions in small batches and execute output sampling.
  • Caser [13]: Caser utilizes Convolutional Neural Networks (CNNs) to analyze users’ historical behavior sequences. It achieves a comprehensive understanding of user behavior patterns through the implementation of horizontal and vertical convolutional layers.
  • SASRec [14]: SASRec adopts a self-attention mechanism to assign weights unidirectionally to all preceding user interactions, dynamically capturing the relevance among items within the sequence.
  • HGN [38]: The Hierarchical Gated Network (HGN) utilizes a multi-layer graph structure equipped with gated networks to enhance sequential recommendations, effectively managing item information across various scales.
  • LightGCN [39]: LightGCN simplifies Graph Convolutional Networks (GCNs) by removing nonlinear activations and feature transformations, reducing model complexity and improving recommendation performance.
  • CL4SRec [20]: CL4SRec integrates contrastive learning into sequential recommendations by creating positive and negative sample pairs, which helps with accurately learning and distinguishing user behavior patterns.
  • HyperRec [40]: HyperRec constructs hypergraphs using timestamps and extracts short-term item correlations. It fuses dynamic item embeddings with short-term user intentions to model user preferences more accurately.
  • APGL4SR [21]: APGL4SR incorporates personalized global information into the recommendation model, significantly improving its capability to customize recommendations according to individual user preferences.

5.1.4. Setup and Implementation Details

These experiments are implemented with an Intel CORE i7 10875H processor and an Nvidia RTX 2060 graphics card. The code of HyperCLR is based on Pycharm 2022 and PyTorch 1.7. For fair comparison, we used the original code of the benchmarks and adopt the optimal parameter settings suggested in the literature. Unless otherwise stated, the default settings are an embedding dimension of 128, a sampling depth of 4, five graph convolution layers, a dropout rate of 0.2 , and a learning rate of 0.1 .

5.2. Overall Performance Comparison

Table 2 illustrates the performance of all methods. The best results are marked in bold, and the second best results are underlined. Models based on Recurrent Neural Networks (RNNs) and Convolutional Neural Networks (CNNs), such as GRU4Rec and Caser, outperform models employing self-attention mechanisms (e.g., SASRec). The latter’s superior performance is mainly due to the self-attention mechanism’s ability to effectively capture dependencies between items, including those that are temporally far apart. GNN-based models (e.g., HGN and LightGCN) outperform SASRec’s results, demonstrating the benefits of Graph Neural Networks in sequential recommendation tasks. CL4SRec improves these models by augmenting sequence representations by exploiting the local context in individual sequences, suggesting that a self-supervised learning objective can help to improve the performance of sequential recommendations. However, CL4SRec does not perform as well as APGL4SR. This discrepancy arises because CL4SRec focuses primarily on local sequence contexts without integrating broader item transition patterns.
In contrast, HyperCLR outperforms all of the baseline methods on various datasets. It employs a novel approach by using subgraphs from the transition graph constructed from all users’ sequences, which helps with learning item relevancy and enhancing sequence representations. This approach not only provides a rich mix of global and local context information for model learning but also dynamically incorporates the time and location embeddings of items. Furthermore, HyperCLR utilizes hypergraph modeling to capture high-order personalized preference relationships between users. This comprehensive model framework allows HyperCLR to effectively harness specific global context information based on user personalized preferences, achieving superior performance across the board.

5.3. Ablation Experiments

In this subsection, we investigate the impact of three pivotal components in the HyperCLR model: the IFDG graph construction, graph convolution combined with contrastive learning, and the personalized interest gating mechanism. With HR@10 and NDCG@10 as metrics, the detailed results on the Taobao dataset are presented in Table 3.
The three variants of HyperCLR designed are as follows:
(1)
HyperCLR-1: This variant deletes the edge weights in the IFDG graph, facilitating the evaluation of their role in capturing the subtleties of item interactions within the graph.
(2)
HyperCLR-2: In this configuration, the graph contrastive learning loss is removed by setting λ 1 to zero, and the GAT (Graph Attention Network) convolution module is removed. This approach examines the significance of both contrastive loss and attention-based graph convolutions in boosting recommendation performance.
(3)
HyperCLR-3: This version excludes both the hypergraph convolution and the personalized interest gating mechanism, allowing for an assessment of their contributions to the model’s overall effectiveness.
From Table 3, the best results are marked in bold. It can be discovered that HyperCLR-1, which lacks edge weighting in the IFDG graph, shows a slight decrease in both Hit Rate (HR) and Normalized Discounted Cumulative Gain (NDCG). This suggests that item transition frequencies across sequences can help differentiate the importance of neighboring items, thereby improving the performance of recommendations. It also can be found that HyperCLR outperforms HyperCLR-2, indicating the substantial roles of graph convolution and contrastive learning loss in refining item and sequence representations for recommendations. Moreover, HyperCLR exceeds HyperCLR-3 across all metrics, affirming that leveraging contextual information about users’ personalized preferences markedly boosts sequential recommendation performance. This highlights the essential role of personalized interest gating mechanisms in understanding user preferences and customizing recommendations, which enhances both accuracy and relevance for users.

5.4. Hyperparameter Analysis

When evaluating the effect of a specific parameter, this paper sets all other parameters to the optimal hyperparameter. In this section, we evaluate the effect of the item embedding dimension d, sampling depth M, and the number of GAT convolution layers on the performance of the HyperCLR model.

5.4.1. Analysis of Embedding Dimension d

This paper explores the influence of the embedding dimension d on the Taobao dataset. The results, illustrated in Figure 6, demonstrate that the model’s performance increases with the embedding dimension up to d = 128 beyond which it either stabilizes or slightly declines. This suggests that a larger embedding dimension does not invariably enhance performance. It means that there exists an optimal dimension of d = 128 , beyond which the risk of overfitting might diminish returns.

5.4.2. Analysis of Sampling Depth

This paper analyzes the effects of various sampling depths on the performance of the HyperCLR model. Sampling depths of M = { 1 , 2 , 3 , 4 , 5 } are tested across different datasets to assess their NDCG@10 performance, as shown in Figure 7.
The results in Figure 7 indicate that a minimal sampling depth is insufficient for capturing complex high-order item interactions. Optimal performance is noted at a sampling depth of M = 4 , which effectively encapsulates comprehensive user–item relationship dynamics, thus improving the model’s scalability. Nonetheless, an excessive increase in sampling depth can introduce noise from loosely related nodes, potentially degrading performance.

5.4.3. GAT Convolution Layer Analysis

This paper delves into the effects of varying the number of GAT convolution layers on the HyperCLR model. The performance across three datasets is evaluated with layer counts from 1 to 6, using NDCG@10 as the metric. The outcomes, depicted in Figure 8, reveal that increasing the number of layers initially boosts the model’s performance, which peaks with 5 layers. This setting appears to optimally balance multi-order neighbor information for effective graph node embedding learning, whereas excessive layers may induce training instability and overfitting risks.

5.5. Discussion

Although the personalized sequential recommendation algorithm based on hypergraph and contrastive learning proposed in this paper outperforms baseline models in terms of performance, it still has several limitations. First, the construction and optimization of the hypergraph structure are relatively complex. This complexity, particularly when dealing with large-scale datasets, results in high computational costs, potentially limiting the algorithm’s efficiency and scalability in real-world applications. Second, while contrastive learning is effective at capturing useful features in the data, its performance is highly dependent on the selection and sampling strategy of negative samples. An improper selection of negative samples could lead to overfitting or a decline in model performance. Moreover, HyperCLR is primarily optimized for sequential recommendation tasks. Its effectiveness for other types of recommendation tasks, such as session-based or social recommendation, may require further investigation and adjustments. Therefore, future research could focus on simplifying the hypergraph construction process, optimizing negative sample sampling strategies, and exploring the adaptability of this algorithm across different recommendation scenarios.

6. Conclusions

This paper presents HyperCLR, which dynamically incorporates the time and location embeddings of items and utilizes hypergraph modeling to capture high-order relationships of personalized user preferences. HyperCLR designs the IFDG framework to create the Global Item Frequency Distance Graph (IFDG), making the model comprehensively assess item relevancy. Building on this, HyperCLR utilizes contrastive learning to ensure maximal consistency within identical interaction sequences while minimizing discrepancies between global context representations on IFDG and local sequence representations. The effectiveness of sequential recommendation is significantly increased this way. A specialized gating mechanism is used to collect unique global contextual information from each user based on the user’s preferences. Rigorous testing across diverse datasets has consistently revealed that HyperCLR outperforms baselines on multiple performance indicators, affirming the efficacy of this approach. In the future, it is possible to integrate broader user behavior data into HyperCLR to advance sequential recommendations, providing more precise and tailored services to users.

Author Contributions

Conceptualization, H.W.; supervision, H.W.; methodology, R.Z.; Investigation, H.W. and J.H.; software, R.Z.; validation, H.W.; formal analysis, H.W. and R.Z.; writing—original draft preparation, R.Z.; writing—review and editing, H.W.; visualization, R.Z.; project administration, H.W.; funding acquisition, J.H. All authors have read and agreed to the published version of the manuscript.

Funding

The work is supported by the National Natural Science Foundation of China under Grant No. 82160347.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available upon request from the corresponding author.

Acknowledgments

The authors would like to acknowledge the anonymous reviewers and editors whose thoughtful comments helped improve this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Wang, S.; Zhang, Q.; Hu, L.; Zhang, X.; Wang, Y.; Aggarwal, C. Sequential/session-based recommendations: Challenges, approaches, applications and opportunities. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, Madrid, Spain, 11–15 July 2022; pp. 3425–3428. [Google Scholar]
  2. Fang, H.; Zhang, D.; Shu, Y.; Guo, G. Deep learning for sequential recommendation: Algorithms, influential factors, and evaluations. ACM Trans. Inf. Syst. (TOIS) 2020, 39, 1–42. [Google Scholar] [CrossRef]
  3. Chang, J.; Gao, C.; Zheng, Y.; Hui, Y.; Niu, Y.; Song, Y.; Jin, D.; Li, Y. Sequential recommendation with graph neural networks. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual, 11–15 July 2021; pp. 378–387. [Google Scholar]
  4. Wang, Z.; Chen, J.; Rosas, F.E.; Zhu, T. A hypergraph-based framework for personalized recommendations via user preference and dynamics clustering. Expert Syst. Appl. 2022, 204, 117552. [Google Scholar] [CrossRef]
  5. Guo, Y.; Imani, M.; Kang, J.; Salamat, S.; Morris, J.; Aksanli, B.; Kim, Y.; Rosing, T. Hyperrec: Efficient recommender systems with hyperdimensional computing. In Proceedings of the 26th Asia and South Pacific Design Automation Conference, Tokyo, Japan, 18–21 January 2021; pp. 384–389. [Google Scholar]
  6. Jiang, J.; Wei, Y.; Feng, Y.; Cao, J.; Gao, Y. Dynamic hypergraph neural networks. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, Macao, China, 10–16 August 2019; pp. 2635–2641. [Google Scholar]
  7. Jaiswal, A.; Babu, A.R.; Zadeh, M.Z.; Banerjee, D.; Makedon, F. A survey on contrastive self-supervised learning. Technologies 2020, 9, 2. [Google Scholar] [CrossRef]
  8. Zhai, X.; Oliver, A.; Kolesnikov, A.; Beyer, L. S4l: Self-supervised semi-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1476–1485. [Google Scholar]
  9. Zhou, K.; Wang, H.; Zhao, W.X.; Zhu, Y.; Wang, S.; Zhang, F.; Wang, Z.; Wen, J.R. S3-rec: Self-supervised learning for sequential recommendation with mutual information maximization. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, Online, 19–23 October 2020; pp. 1893–1902. [Google Scholar]
  10. Xia, L.; Huang, C.; Shi, J.; Xu, Y. Graph-less collaborative filtering. In Proceedings of the ACM Web Conference 2023, Austin, TX, USA, 30 April–4 May 2023; pp. 17–27. [Google Scholar]
  11. da Silva, A.B.; Spinosa, E.J. A Sequential Recommender System with Embeddings Based on GraphSage Aggregators. In Proceedings of the Brazilian Conference on Intelligent Systems, Campinas, Brazil, 28 November–1 December 2022; Springer International Publishing: Cham, Switzerland, 2022; pp. 1–15. [Google Scholar]
  12. Xie, X.; Sun, F.; Liu, Z.; Wu, S.; Gao, J.; Zhang, J.; Ding, B.; Cui, B. Contrastive learning for sequential recommendation. In Proceedings of the 2022 IEEE 38th International Conference on Data Engineering (ICDE), Kuala Lumpur, Malaysia, 9–12 May 2022; pp. 1259–1273. [Google Scholar]
  13. Tang, J.; Wang, K. Personalized top-n sequential recommendation via convolutional sequence embedding. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, Los Angeles, CA, USA, 5–9 February 2018; pp. 565–573. [Google Scholar]
  14. Kang, W.C.; McAuley, J. Self-attentive sequential recommendation. In Proceedings of the 2018 IEEE International Conference on Data Mining (ICDM), Singapore, 17–20 November 2018; pp. 197–206. [Google Scholar]
  15. Hao, Y.; Ma, J.; Zhao, P.; Liu, G.; Xian, X.; Zhao, L.; Sheng, V.S. Multi-dimensional graph neural network for sequential recommendation. Pattern Recognit. 2023, 139, 109504. [Google Scholar] [CrossRef]
  16. Zhang, Y.; Liu, Y.; Xu, Y.; Xiong, H.; Lei, C.; He, W.; Cui, L.; Miao, C. Enhancing sequential recommendation with graph contrastive learning. arXiv 2022, arXiv:2205.14837. [Google Scholar]
  17. Zhang, S.; Chen, L.; Wang, C.; Li, S.; Xiong, H. Temporal Graph Contrastive Learning for Sequential Recommendation. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; Volume 38, pp. 9359–9367. [Google Scholar]
  18. Feng, Y.; You, H.; Zhang, Z.; Ji, R.; Gao, Y. Hypergraph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; Volume 33, pp. 3558–3565. [Google Scholar]
  19. Yadati, N.; Nimishakavi, M.; Yadav, P.; Nitin, V.; Louis, A.; Talukdar, P. Hypergcn: A new method for training graph convolutional networks on hypergraphs. In Proceedings of the Advances in Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019; Volume 32. [Google Scholar]
  20. Wang, C.; Ma, W.; Chen, C.; Zhang, M.; Liu, Y.; Ma, S. Sequential recommendation with multiple contrast signals. ACM Trans. Inf. Syst. 2023, 41, 1–27. [Google Scholar] [CrossRef]
  21. Yin, M.; Wang, H.; Xu, X.; Wu, L.; Zhao, S.; Guo, W.; Liu, Y.; Tang, R.; Lian, D.; Chen, E. APGL4SR: A Generic Framework with Adaptive and Personalized Global Collaborative Information in Sequential Recommendation. In Proceedings of the 32nd ACM International Conference on Information and Knowledge Management, Birmingham, UK, 21–25 October 2023; pp. 3009–3019. [Google Scholar]
  22. Bai, S.; Zhang, F.; Torr, P.H.S. Hypergraph convolution and hypergraph attention. Pattern Recognit. 2021, 110, 107637. [Google Scholar] [CrossRef]
  23. Gao, Y.; Zhang, Z.; Lin, H.; Zhao, X.; Du, S.; Zou, C. Hypergraph learning: Methods and practices. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 44, 2548–2566. [Google Scholar] [CrossRef] [PubMed]
  24. Fan, W.; Ma, Y.; Li, Q.; He, Y.; Zhao, E.; Tang, J.; Yin, D. Graph neural networks for social recommendation. In Proceedings of the World Wide Web Conference, San Francisco, CA, USA, 13–17 May 2019; pp. 417–426. [Google Scholar]
  25. Fan, W.; Ma, Y.; Li, Q.; Wang, J.; Cai, G.; Tang, J.; Yin, D. A graph neural network framework for social recommendations. IEEE Trans. Knowl. Data Eng. 2020, 34, 2033–2047. [Google Scholar] [CrossRef]
  26. Chen, M.; Li, Y.; Zhou, X. CoNet: Co-occurrence neural networks for recommendation. Future Gener. Comput. Syst. 2021, 124, 308–314. [Google Scholar] [CrossRef]
  27. Gwadabe, T.R.; Liu, Y. IC-GAR: Item co-occurrence graph augmented session-based recommendation. Neural Comput. Appl. 2022, 34, 7581–7596. [Google Scholar] [CrossRef]
  28. Veličković, P.; Cucurull, G.; Casanova, A.; Romero, A.; Lio, P.; Bengio, Y. Graph attention networks. arXiv 2017, arXiv:1710.10903. [Google Scholar]
  29. Chen, Y.; Liu, Z.; Li, J.; McAuley, J.; Xiong, C. Intent contrastive learning for sequential recommendation. In Proceedings of the ACM Web Conference 2022, Virtual, 25–29 April 2022; pp. 2172–2182. [Google Scholar]
  30. Zhang, Y.; Yang, B.; Liu, H.; Li, D. A time-aware self-attention based neural network model for sequential recommendation. Appl. Soft Comput. 2023, 133, 109894. [Google Scholar] [CrossRef]
  31. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems; Neural Information Processing Systems Foundation: Long Beach, CA, USA, 2017; Volume 30. [Google Scholar]
  32. Ma, C.; Kang, P.; Liu, X. Hierarchical gating networks for sequential recommendation. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Anchorage, AK, USA, 4–8 August 2019; pp. 825–833. [Google Scholar]
  33. Xu, C.; Li, Q.; Ge, J.; Gao, J.; Yang, X.; Pei, C.; Sun, F.; Wu, J.; Sun, H.; Ou, W. Privileged features distillation at taobao recommendations. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Virtual, 6–10 July 2020; pp. 2590–2598. [Google Scholar]
  34. Satinsky, B.M.; Zielinski, B.L.; Doherty, M.; Smith, C.B.; Sharma, S.; Paul, J.H.; Crump, B.C.; Moran, M.A. The Amazon continuum dataset: Quantitative metagenomic and metatranscriptomic inventories of the Amazon River plume, June 2010. Microbiome 2014, 2, 17. [Google Scholar] [CrossRef] [PubMed]
  35. Zhou, K.; Yu, H.; Zhao, W.X.; Wen, J.R. Filter-enhanced MLP is all you need for sequential recommendation. In Proceedings of the ACM Web Conference 2022, Virtual, 25–29 April 2022; pp. 2388–2399. [Google Scholar]
  36. He, X.; Liao, L.; Zhang, H.; Nie, L.; Hu, X.; Chua, T.S. Neural collaborative filtering. In Proceedings of the 26th International Conference on World Wide Web, Perth, Australia, 3–7 April 2017; pp. 173–182. [Google Scholar]
  37. Hidasi, B.; Karatzoglou, A.; Baltrunas, L.; Tikk, D. Session-based recommendations with recurrent neural networks. arXiv 2015, arXiv:1511.06939. [Google Scholar]
  38. Fang, Y.; Sun, S.; Gan, Z.; Pillai, R.; Wang, S.; Liu, J. Hierarchical graph network for multi-hop question answering. arXiv 2019, arXiv:1911.03631. [Google Scholar]
  39. He, X.; Deng, K.; Wang, X.; Li, Y.; Zhang, Y.; Wang, M. Lightgcn: Simplifying and powering graph convolution network for recommendation. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual, 25–30 July 2020; pp. 639–648. [Google Scholar]
  40. Wang, J.; Ding, K.; Hong, L.; Liu, H.; Caverlee, J. Next-item recommendation with sequential hypergraphs. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual, 25–30 July 2020; pp. 1101–1110. [Google Scholar]
Figure 1. HyperCLR model structure diagram.
Figure 1. HyperCLR model structure diagram.
Mathematics 12 02887 g001
Figure 2. A toy example of the construction of the hypergraph.
Figure 2. A toy example of the construction of the hypergraph.
Mathematics 12 02887 g002
Figure 3. A toy example of the construction of IFDG.
Figure 3. A toy example of the construction of IFDG.
Mathematics 12 02887 g003
Figure 4. A toy example of contrastive learning.
Figure 4. A toy example of contrastive learning.
Mathematics 12 02887 g004
Figure 5. The time interval of each item in the user interaction sequence.
Figure 5. The time interval of each item in the user interaction sequence.
Mathematics 12 02887 g005
Figure 6. Embedded dimensional analysis.
Figure 6. Embedded dimensional analysis.
Mathematics 12 02887 g006
Figure 7. Different sampling depths in NDCG@10 results.
Figure 7. Different sampling depths in NDCG@10 results.
Mathematics 12 02887 g007
Figure 8. Different GAT convolution layers in NDCG@10 results.
Figure 8. Different GAT convolution layers in NDCG@10 results.
Mathematics 12 02887 g008
Table 1. Dataset statistics.
Table 1. Dataset statistics.
DatasetUsersProjectsActionsSparsity
Taobao75,282189,6711,168,59499.99%
Books52,40641,2641,856,74799.91%
Games31,01323,715287,10799.96%
Table 2. Experimental results on datasets for different models.
Table 2. Experimental results on datasets for different models.
DatasetMetricGRU4RecCaserSASRecHGNLightGCNCL4SRecHyperRecAPGL4SRHyperCLR
TaobaoHR@10.02460.02810.03520.04360.04370.05210.05910.05680.0763
HR@100.05820.06730.09270.12780.15060.18300.20570.22340.2364
NDCG@100.04370.04810.05860.08630.11640.15400.18390.20640.2321
BooksHR@10.01480.02650.03890.03190.04680.03970.06210.08690.0921
HR@100.06340.07480.07830.10820.14900.16230.18430.19070.2078
NDCG@100.07850.10920.14530.18570.23090.25300.27430.29870.3154
GamesHR@10.02490.03290.03840.04720.05180.05490.05970.06980.0759
HR@100.07970.09190.13950.17920.20690.23980.26730.29300.3101
NDCG@100.06190.08950.09510.14320.18730.21090.23190.26380.2759
Table 3. Performance of HyperCLR compared with its variations.
Table 3. Performance of HyperCLR compared with its variations.
ModelHR@10NDCG@10
HyperCLR-10.20170.2168
HyperCLR-20.22140.2197
HyperCLR-30.21590.2239
HyperCLR0.23640.2321
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, R.; Wang, H.; He, J. HyperCLR: A Personalized Sequential Recommendation Algorithm Based on Hypergraph and Contrastive Learning. Mathematics 2024, 12, 2887. https://doi.org/10.3390/math12182887

AMA Style

Zhang R, Wang H, He J. HyperCLR: A Personalized Sequential Recommendation Algorithm Based on Hypergraph and Contrastive Learning. Mathematics. 2024; 12(18):2887. https://doi.org/10.3390/math12182887

Chicago/Turabian Style

Zhang, Ruiqi, Haitao Wang, and Jianfeng He. 2024. "HyperCLR: A Personalized Sequential Recommendation Algorithm Based on Hypergraph and Contrastive Learning" Mathematics 12, no. 18: 2887. https://doi.org/10.3390/math12182887

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop