Graph-Augmentation-Free Self-Supervised Learning for Social Recommendation

: Social recommendation systems can improve recommendation quality in cases of sparse user–item interaction data, which has attracted the industry’s attention. In reality, social recommendation systems mostly mine real user preferences from social networks. However, trust relationships in social networks are complex and it is difﬁcult to extract valuable user preference information, which worsens recommendation performance. To address this problem, this paper proposes a social recommendation algorithm based on multi-graph contrastive learning. To ensure the reliability of user preferences, the algorithm builds multiple enhanced user relationship views of the user’s social network and encodes multi-view high-order relationship learning node representations using graph and hypergraph convolutional networks. Considering the effect of the long-tail phenomenon, graph-augmentation-free self-supervised learning is used as an auxiliary task to contrastively enhance node representations by adding uniform noise to each layer of encoder embeddings. Three open datasets were used to evaluate the algorithm, and it was compared to well-known recommendation systems. The experimental studies demonstrated the superiority of the algorithm.


Introduction
With the advancement of the Internet, social platforms, such as WeChat, Weibo, and Twitter, have become an essential part of people's daily lives. More and more users like to express their opinions and present their hobbies on these platforms, and the interactions between users result in a wide range of consumption behaviors. Moreover, social homogeneity [1] and social influence theory [2] demonstrate that connected users in social networks have similar interest preferences and continue to influence one another as information spreads. Based on these findings, social relations are frequently integrated into recommender systems as a powerful supplement to user-item interaction information to address the problem of data sparsity [3], and numerous social recommendation methods have been developed. Social recommendation algorithms based on graph neural networks have demonstrated improved performance recently and helped advance recommendation technology; however, these models still have certain drawbacks.
1. Interaction data are sparse and noisy. Most recommendation models utilize supervised learning techniques [4,5], which substantially rely on user-item interaction data and are unable to develop high-quality user-item representations when data are sparse. As a result, cold-start problems usually occur. In addition, GNN-based recommendation algorithms must aggregate and propagate node embeddings and their neighbors during training, which amplifies the impact of interaction noise (i.e., user mis-click behavior), resulting in confusion with regard to user preferences.
2. The effect of the long-tail phenomenon. Due to the skewed distribution of interactive data [4], the recommendation algorithm only emphasizes a portion of some users' mainstream interests, resulting in underfitting of the sample tail distribution and trapping of the user's interest in the "filter bubble" [6], which is known as the long-tail phenomenon.

1.
We designed a high-order heterogeneous graph based on motifs, integrated social relations and item ratings, comprehensively modeled relational information in the network, and undertook modeling through graph convolution to capture high-order relations between users; 2.
We incorporated the cross-layer self-supervised contrastive learning task without graph augmentation into network training, enabling it to run more efficiently while ensuring the reliability of recommendations; 3.
We conducted extensive experiments with multiple real datasets, and the comparative results showed that the proposed model was superior and that the model was effective in ablation experiments.
The rest of this paper is organized as follows. Section 2 presents related work. Section 3 describes the framework for the multi-graph contrastive social recommendation model. Section 4 presents the experimental results and analysis. Finally, Section 5 brings the paper to a close.

Graph-Based Recommendation
To obtain high-order collaborative signals, graph-based recommendation algorithms employ multi-hop interaction topologies [11,12]. The success of graph convolutional neural network technology served as inspiration for Feng et al. [10] to develop a hypergraph representation learning framework that captures the relationship between high-order data by developing hyperedge convolution operations. Hypergraphs have a flexible topology and can be used to model complex and high-order dependencies. Additionally, some recently created recommender systems, such as HyperRec [13], MHCN [9], and HCCF [14], have begun to use hypergraph topologies to capture high-order interactions among nodes. HyperRec [13] applies numerous convolutional layers to hypergraphs to capture multilevel connections in order to describe short-term item correlation features. In order to mine high-order user relationship patterns, Yu et al. [9] presented a multi-channel hypergraph convolutional network (MHCN) and created numerous topic-induced hypergraphs. They also employed self-supervised learning to boost the learning of mutual information shared between channels. The application of hypergraphs to social recommendations is made possible by the retention of more high-level information. By simultaneously collecting local and global cooperation information through a hypergraph-enhanced cross-view contrastive learning architecture, HCCF [14] overcomes the over-smoothing problem. In comparison, our system makes use of hypergraph encoders to help create heterogeneous networks, maintain the collaborative relationship between users and items, and enhance the ability to identify user preferences.

Self-Supervised Contrastive Learning
Self-supervised learning is divided into two categories: generative models and contrastive models. The goal of creating a model is to reconstruct the input so that the input and output are as similar as possible using techniques such as GAN [15] and VAE [16] autoencoders. Contrastive models have recently emerged as an effective self-supervised framework for capturing feature representation consistency across different viewpoints.
Model contrasts are classified into three types [17]: structure-level contrasts, featurelevel contrasts, and model-level contrasts. Local-local and global-global structural-level comparison targets exist. SGL [8] is a typical representative, changing the structure of graphs through local perturbations (node loss, edge loss, and random walk). These data enhancement and pre-training methods can extract more supervisory signals from the original graph data, allowing the graph neural network to learn node representation more effectively. Due to dataset constraints, feature-level comparisons have received less attention. Model-level comparison can be implemented end-to-end relatively easily, and SimGCL [10] directly adds noise to the embedding space for enhancement. Experiments show that, regardless of whether graph enhancement is used or not, optimization of the contrast loss can help learn representations. To model node embeddings, we used a cross-layer contrastive learning method without graph augmentation in this study.

Preliminaries
Let U = {u 1 , u 2 , · · · , u m } (|U| = m) represent the collection of users and I = {i 1 , i 2 , · · · , i n } (|I| = n) represent the collection of items. Since we are focused on item recommendation, we define R ∈ R m×n to represent the user-item interaction binary matrix. For each pair (u, i), r ui = 1 indicates that user u has interacted with item i and, conversely, r ui = 0 indicates that user u has not interacted with item i or that user u is not interested in item i. We represent social relations using directed social networks, where S ∈ R m×m represents an asymmetric relation matrix. Additionally, Z (1) u , Z (2) u , · · · , Z (l) u ∈ R m×d and Z (1) i , Z (2) i , · · · , Z (l) i ∈ R n×d denote the embeddings of the size d-dimensional users and Let G = (V, E) represent a hypergraph, V a vertex set containing N vertices in the hypergraph, and E an edge set containing M hyperedges. Each hyperedge ε ∈ E contains two or more vertices and is assigned a positive weight W εε . All weights form a diagonal matrix W ∈ R M×M . A hypergraph is represented by an incidence matrix H ∈ R N×M , which is defined as follows: If the hyperedge ε j ∈ E contains a vertex, then H i,j = 1; otherwise, H i,j = 0. The degrees of the vertices and edges of a hypergraph are represented as follows:

High-Order Social Information Exploitation
In this study, we used two graphs as data sources: a user-item interaction graph G r and a user social network graph.
We aligned the two networks into a heterogeneous network and divided it into three sets of views-an explicit friend social graph, an implicit friend social graph, and items shared by users with explicit friends' graphs-in order to establish high-order associations between users in the network. The project-sharing graph of users and explicit friends describes a user's interest in sharing items with friends, which can also serve as relationshipstrengthening. The social graph of explicit friends describes a user's interest in expanding their social circle. The social graph of implicit friends describes the similar interests a user shares with similar but unfamiliar users and can alleviate the negative impact of unreliable social relations.
Taking into account the fact that there are some significant social network structures that have impacts on the authority and reputation of nodes in the representation of higherorder relationships as network motifs, we used the motif-based PageRank [18] framework. PageRank is a general algorithm for ranking users in social networks [19]. It can be utilized as a measurement standard for opinion-leader mining, impact, and credibility analyses by assessing the authority of network nodes. However, only edge-based relations are exploited, with higher-order structures in complex networks being neglected. This aspect is improved by the motif-based PageRank algorithm. As shown by Figure 1, which covers the fundamental and significant user social types, the user-item interaction graph splits the explicit friend social graph into seven motifs. M8, also defined as the user's implicit friend social network, represents strangers who share the user's interests. The relationship M9-M10, generally described as users' and explicit friends' item-sharing graph, is, at the same time, extended in accordance with friends' shared buying behaviors.
Appl. Sci. 2023, 13, x FOR PEER REVIEW 5 of 1 Figure 1, which covers the fundamental and significant user social types, the user-item interaction graph splits the explicit friend social graph into seven motifs. M8, also defined as the user's implicit friend social network, represents strangers who share the user's in terests. The relationship M9-M10, generally described as users' and explicit friends item-sharing graph, is, at the same time, extended in accordance with friends' shared buying behaviors. When given any motif set k M , we can calculate the adjacency matrix of the moti using Table 1. When given any motif set M k , we can calculate the adjacency matrix of the motif using Table 1.
In Table 1, B = S S T and U = S − B are the adjacency matrices of two-way and oneway social networks respectively. Without considering self-connections, A e = ∑ 7 k=1 A M K , A i = A M 8 , and A j = A M 9 + A M 10 , where, in A j = A M 9 + A M 10 , we only keep values greater than 5 for the reliability of the implicit friend pair experiment. Furthermore, the adjacency matrix for the user-items graph is A r = R. Table 1. Computation of motif-based adjacency matrices.

Graph Collaborative Filtering BackBone
In this section, we present our model GAFSRec. In Figure 2, the schematic overview of our model is illustrated.
Due to its strong ability to capture node dependencies, we adopted LightGCN [20] to aggregate neighborhood information. Formally, a general GCN is constructed using the following hierarchical propagation: where Z (l) is the l-th layer embedding of the node, and G q ∈ G r , G e , G i , G j are the four views, with A being the adjacency matrix and D the degree diagonal matrix of A. We encoded the original node vectors into the embedding vectors required by each view through gating functions.
where σ, W q g ∈ R d×d , and b q g ∈ R d are the activation function, weight matrix, and bias vector. q ∈ {r, e, i, j} represents four views. Z (0) denotes the initial embedding vector and represents the dot product. We used the generalization ability of hypergraph modeling to capture more effective high-level user information. Therefore, in the encoder, a hypergraph convolutional neural network [21] was used.
where A = HWD −1 e H T is the Laplacian matrix of the hypergraph convolutional network; H is the incidence matrix of each hypergraph; D v and D e are the degree matrix of the nodes and the degree matrix of the hyperedges; and σ, Θ, and W are activation functions, learnable filter matrices, and the parameters of the diagonal matrix.
tive high-level user information. Therefore, in the encoder, a hypergraph convolutional neural network [21] was used.
where 1 T e − A = HWD H is the Laplacian matrix of the hypergraph convolutional network; H is the incidence matrix of each hypergraph; v D and e D are the degree matrix of the nodes and the degree matrix of the hyperedges; and  ,  , and W are activation functions, learnable filter matrices, and the parameters of the diagonal matrix. Considering node influence and credibility, we adopted motifs [18] to construct a hypergraph. Given the complexity of the actual construction of the Laplacian matrix for hypergraph convolution (which includes a large number of graph-induced hyperedges), matrix multiplication can be considered for simplification.
Finally, the hypergraph convolutional neural network can be expressed as: is the degree matrix of q A . It can be seen from Considering node influence and credibility, we adopted motifs [18] to construct a hypergraph. Given the complexity of the actual construction of the Laplacian matrix for hypergraph convolution (which includes a large number of graph-induced hyperedges), matrix multiplication can be considered for simplification.
Finally, the hypergraph convolutional neural network can be expressed as: , where D q ∈ R m×m is the degree matrix of A q . It can be seen from this that the graph convolutional neural network is a special case of the hypergraph neural network.
After l-layer propagation, we used the weighting functions and the readout function to output the representations of all layers, obtaining the following representations: We applied an attention approach [22] to learn the weights α and aggregate the user embedding vectors for augmented views.
where a and W are trainable parameters. The final user embedding Z u and item embedding Z i look like this: The ranking score generated by this model recommendation is defined as the inner product with user and item embeddings: To optimize the parameters in the model, we adopted the Bayesian loss function [23]. The main reason was that the Bayesian loss function considers the comparison of pairwise preferences between observed interactions and unobserved interactions. The loss function of this model is: where Φ is a trainable parameter and β is a regularization coefficient that controls the strength of L2 regularization, prevents overfitting, and is a sigmoid function. Each input datum is a triplet sample < u, i, j >; this triplet includes the current user u, the positive item i purchased by u, and the randomly drawn negative item j. The negative item j is the user u's unliked or unknown items.

Graph-Augmentation-Free Self-Supervised Learning
Data augmentation is the premise of self-supervised contrastive learning models, and they can obtain a more uniform representation by perturbing the structure and optimizing the contrastive loss. With regard to the learning of graph representations, a study on SimGCL [10] showed that it is the uniformity of distribution rather than dropout-based graph augmentation that has the greatest impact on the performance of self-supervised graph learning. Therefore, we considered adding random noise to the embedding to create a self-supervised signal that could enhance the performance of the contrastive learning.
where ε is the added random uniform noise vector, and the noise direction is in the same direction as the embedding vector, ε = x sign(z), x ∈ R d ∼ U(0, 1). The embedding representation added with perturbation retains most of the information of the original representation, as well as some invariance. By applying different scales of embedding vectors to the current node embedding, the perturbed embedding vectors can then be fed into the encoder. The embedding vector of the final perturbed node is expressed as: We regarded augmented views from the same node as positive examples and augmented views from different nodes as negative examples. Positive auxiliary supervision promotes the consistency of predictions among different views of the same node, while negative supervision strengthens the divergence between different nodes. Formally, we adopted the contrastive loss InfoNCE [24] 2 represents the k-th layer L2-regularized embedding vector compared with the final layer embedding, sim(a, b) represents the dot-product cosine similarity between normalized embeddings, and b. τ is the temperature parameter. The total loss Appl. Sci. 2023, 13, 3034 8 of 18 function for self-supervised learning includes the contrastive loss for each view user and the item contrastive loss, as shown in the following equation: To improve recommendation through contrastive learning, we utilized a multi-task training strategy to jointly optimize the recommendation task and the self-supervised learning task, as shown in the following equation: where λ is the hyperparameter used to control the auxiliary task.

Complexity Analysis
In this section, we analyze the theoretical complexity of GAFSRec.

Experiments and Results
In this section, we describe the extensive experiments we conducted to validate GAFS-Rec. The experiments were conducted in order to answer the following three questions: We conducted experiments using three real-world datasets: Douban-Book [25], Yelp [26], and Ciao [5]. The statistical data for the datasets are shown in Table 2. In accordance with the summary provided by Tao et al. [27], we conducted statistical analyses of the three datasets, which were helpful for the analysis of the results of the subsequent experiments. It was found that the higher the level of social diffusion was (greater than 1), the greater the possibility of similar preferences among users was, and the higher the effective social density was, the lower the scoring density was, indicating that explicit social relationships are very important for recommendation. We performed fivefold cross-validation with the three datasets and report the averaged results.

Metrics
To evaluate all the models, we chose two evaluation metrics: Recall@K and NDCG@K. Recall@K employs the proportions of each user's favorite items appearing in the recommended items. Normalized discounted cumulative gain (NDCG) means that the scores for the relevance of each recommendation result are accumulated and used as the score for the entire recommendation list. The greater the relevance of the recommendation result is, the greater the DCG is. The recall rate is defined as:

Settings
To ensure a fair comparison, we checked the best hyperparameter settings reported in the original papers for the baselines and then used grid search to fine-tune all the hyperparameters for the baselines. For the general setup of all baselines, all embeddings were initialized with Xavier. The embedding size was 64, the L2 regularization parameter was β = 0.01, and the batch size was 2048. We optimized all models using Adam with a learning rate of 0.001 and let the temperature τ = 0.2.

Recommendation Performance
Next, we verified whether GAFSRec could outperform the baselines and achieve the expected performance. The purpose of social recommendation is to alleviate data sparsity. We also conducted a cold-start experiment with the entire training set. The cold-start experiment dataset only included the data for cold-start users with fewer than ten historical purchase records. The results are shown in Tables 3 and 4. It can be observed that GAFSRec outperformed the baselines in general and cold-start cases with all datasets.

Comparison of Training Efficiency
In this section, we report the actual training time to verify the theoretical plausibility of the method. The reported data were collected using a workstation equipped with an Intel(R)Core™ i9-9900K CPU and a GeForce RTX 2080Ti GPU. The model depths of all methods were set to two layers.
As shown in Figure 3, compared with the MHCN and SGL models, GAFSRec demonstrated longer computation time due to the parallel processing of hierarchical self-supervised learning tasks in the MHCN model, and the running time also increased with the number of datasets. For SGL-ED, only the user-item interaction dataset was computed, and most of the runtime was spent on building the perturbation graph. In the large Douban-Book dataset especially, the speed of GAFSRec was three times faster than that of MHCN, thus demonstrating the strong advantage of graph-augmentation-free cross-layer contrastive learning in terms of operational efficiency.

Comparison of Ability to Promote Long-Tail Items
As mentioned in the introduction, GNN-based recommendation models are easily affected by the long-tail problem. To verify that GAFSRec could entirely alleviate the long-tail problem, we divided the test set into ten groups according to popularity. Each group contained the same numbers of interactions, and the larger the ID of a group was, the more popular the items were. Then, we set the number of layers to two for the experiments and verified the long-tail recommendation ability of the model by observing Recall@20. self-supervised learning tasks in the MHCN model, and the running time also increased with the number of datasets. For SGL-ED, only the user-item interaction dataset was computed, and most of the runtime was spent on building the perturbation graph. In the large Douban-Book dataset especially, the speed of GAFSRec was three times faster than that of MHCN, thus demonstrating the strong advantage of graph-augmentation-free cross-layer contrastive learning in terms of operational efficiency.

Comparison of Ability to Promote Long-Tail Items
As mentioned in the introduction, GNN-based recommendation models are easily affected by the long-tail problem. To verify that GAFSRec could entirely alleviate the long-tail problem, we divided the test set into ten groups according to popularity. Each group contained the same numbers of interactions, and the larger the ID of a group was, the more popular the items were. Then, we set the number of layers to two for the experiments and verified the long-tail recommendation ability of the model by observing Recall@20.
As shown in Figure 4, LightGCN tended to recommend popular items and had the lowest recommendation ability for long-tail items (as illustrated in the small figure). Due to sparse interaction signals, it was difficult for LightGCN to obtain high-quality representations of long-tail items. However, with SimGCL, by optimizing the consistency of InfoNCE-loss learning representations, long-tail problems could be avoided as much as was possible, and excellent recommendation performance could be achieved. MHCN also optimized the InfoNCE loss through global and local comparisons but did not learn a more consistent representation, resulting in inferior performance to SimGCL when recommending long-tail items. In contrast, GAFSRec showed outstanding advantages when recommending long-tail products (such as GroupIDs 1, 2, and 3) and the highest recall value, but it was not as good as other models for GroupID 10. It can be seen that learning a more uniform representation by optimizing the InfoNCE loss can enable models to debias and alleviate the long-tail phenomenon, as well as increasing freshness and helping to meet user needs. As shown in Figure 4, LightGCN tended to recommend popular items and had the lowest recommendation ability for long-tail items (as illustrated in the small figure). Due to sparse interaction signals, it was difficult for LightGCN to obtain high-quality representations of long-tail items. However, with SimGCL, by optimizing the consistency of InfoNCE-loss learning representations, long-tail problems could be avoided as much as was possible, and excellent recommendation performance could be achieved. MHCN also optimized the InfoNCE loss through global and local comparisons but did not learn a more consistent representation, resulting in inferior performance to SimGCL when recommending long-tail items. In contrast, GAFSRec showed outstanding advantages when recommending long-tail products (such as GroupIDs 1, 2, and 3) and the highest recall value, but it was not as good as other models for GroupID 10. It can be seen that learning a more uniform representation by optimizing the InfoNCE loss can enable models to debias and alleviate the long-tail phenomenon, as well as increasing freshness and helping to meet user needs.

Investigation of Multi-Graph Setting
To investigate the influence of high-order relationships in user social networks on recommendation, we first investigated the impact of individual views on recommendations by removing any one of the three social relationships' views and leaving two remaining. As can be seen from Figure 5, removing any view resulted in performance degradation. The bars in the figure (except the complete bar) represent the cases with the corresponding views removed, while the complete bar represents the complete model.

Investigation of Multi-Graph Setting
To investigate the influence of high-order relationships in user social networks on recommendation, we first investigated the impact of individual views on recommendations by removing any one of the three social relationships' views and leaving two remaining. As can be seen from Figure 5, removing any view resulted in performance degradation.
The bars in the figure (except the complete bar) represent the cases with the corresponding views removed, while the complete bar represents the complete model.

Investigation of Multi-Graph Setting
To investigate the influence of high-order relationships in user social networks on recommendation, we first investigated the impact of individual views on recommendations by removing any one of the three social relationships' views and leaving two remaining. As can be seen from Figure 5, removing any view resulted in performance degradation. The bars in the figure (except the complete bar) represent the cases with the corresponding views removed, while the complete bar represents the complete model. Obviously, for the Douban-Book dataset, due to the low effective social density of the dataset, the explicit user view had little influence on the recommendation, while the recommendation performance of the view lacking the implicit user dropped sharply, indicating that the implicit user was the user. Items that met user needs were recommended, proving the key role of implicit users for recommendation. For the Yelp and Ciao datasets, due to the higher effective social density of the datasets, explicit user views had a greater impact on the recommendation. Figure 6 visualizes each graph's attention score (median attention score for training set users), revealing that the implicit user had the highest attention score, while the explicit user and the joint graph had low attention scores. According to the findings shown in Figures 5 and 6, implicit users contributed significantly to the analysis of user preferences while explicit users played a greater role when the social density was high, and the joint graph did not necessarily bring greater benefits due to social noise.  Obviously, for the Douban-Book dataset, due to the low effective social density of the dataset, the explicit user view had little influence on the recommendation, while the recommendation performance of the view lacking the implicit user dropped sharply, indicating that the implicit user was the user. Items that met user needs were recommended, proving the key role of implicit users for recommendation. For the Yelp and Ciao datasets, due to the higher effective social density of the datasets, explicit user views had a greater impact on the recommendation. Figure 6 visualizes each graph's attention score (median attention score for training set users), revealing that the implicit user had the highest attention score, while the explicit user and the joint graph had low attention scores. According to the findings shown in Figures 5 and 6, implicit users contributed significantly to the analysis of user preferences while explicit users played a greater role when the social density was high, and the joint graph did not necessarily bring greater benefits due to social noise. Attention Weights e j i

Investigation of Contrastive Learning Setting
In this study, we investigated the impact of contrastive learning on recommendation through two GCLSRec variants:
Disabling cross-layer comparison and using the final embedding of each layer embedding to add uniform noise and construct two sets of views for comparison of the learning task recommendations (CL-c).
The evaluation results are reported in Table 5. It can be observed that not adding self-supervised contrastive learning (without CL) reduced the accuracy of recommendation, and when recommending top 40 items, the recommendation performance only improved slightly, as the aggregation mechanism of GCN can obscure high-order connection information. While model recommendation by constructing contrasting views individually (CL-ours) worked well, constructing contrasting views individually (CL-c) led to high model complexity and was time-consuming. However, GAFSRec with cross-layer comparative learning could not only guarantee recommendation accuracy but also had remarkably high recommendation efficiency. We observed the effect on the recommendation performance when the combination of λ and ε was changed. When λ was [0, 0.01, 0.05, 0.1, 0.2, 0.5, 1], ε was [0, 0.01, 0.05, 0.1, 0.2, 0.5, 1], and the number of model layers was set to two.
We fixed λ at the best values for the three datasets, as reported in Figure 8, and then adjusted ε to observe the performance change. When ε = 0.01, the best recommendation performance (Douban-Book dataset and Yelp dataset) was achieved. However, when ε was too large or too small, the recommendation was especially vulnerable to changes in ε, so the performance declined faster. What can be seen from this is that GAFSRec was more sensitive to changes in λ, and with ε = 0.01, the model could maintain stable performance.
As shown in Figure 7, when fixing ε at 0.1, all parameters showed similar trend changes, and the best performance was achieved at specific λ values (Douban-Book dataset λ = 0.1, Yelp dataset λ = 0.05, Ciao dataset λ = 0.01). However, when λ was too large (λ = 0.5, 1), a significant performance drop could be seen. We fixed λ at the best values for the three datasets, as reported in Figure 8, and then adjusted ε to observe the performance change. When ε = 0.01, the best recommendation performance (Douban-Book dataset and Yelp dataset) was achieved. However, when ε was too large or too small, the recommendation was especially vulnerable to changes in ε, so the performance declined faster. What can be seen from this is that GAFSRec was more sensitive to changes in λ, and with ε = 0.01, the model could maintain stable performance.   We fixed λ at the best values for the three datasets, as reported in Figure 8, and then adjusted ε to observe the performance change. When ε = 0.01, the best recommendation performance (Douban-Book dataset and Yelp dataset) was achieved. However, when ε was too large or too small, the recommendation was especially vulnerable to changes in ε, so the performance declined faster. What can be seen from this is that GAFSRec was more sensitive to changes in λ, and with ε = 0.01, the model could maintain stable performance.

Layer Selection for Contrasting
For the recommendations using cross-layer contrastive learning, it is necessary to choose one of the embeddings of one layer and the final embedding for the comparative learning. To explore the optimal model depth and compare the choice of layers, we stacked graph convolution depths from one to five layers. As shown in Table 6, the performance was the best when the model had a depth of two layers. The performance of GAFSRec dropped for all datasets as the number of layers increased. The reason may have been that, as the depth increased, it became more likely to encounter the problem of over-smoothing. In particular, the performance was best only when the first layer of embeddings was learned in contrast to the final embedding. Therefore, the model under consideration could directly select the first layer to compare with the final embedding, making it possible to achieve better results.

Conclusions
In this paper, we proposed a graph-contrastive social recommendation model (GAFS-Rec) for ranking predictions. To fully mine high-order user relationships, the social graph was divided into multiple views, which were modeled using a hypergraph encoder to improve social recommendations. In particular, we presented a method of cross-layer comparative learning to help maintain the consistency of user preferences. Our experiments showed that implicit users outperformed datasets with sparse explicit social relations, and GAFSRec outperformed state-of-the-art baselines using three real datasets. Here, we only considered incorporating the trust relationships between friends in a social network into the recommendations. In the real world, however, a social graph with attributes could better reflect the relationships between users and products. Therefore, exploring social recommendations with attributes will be our next research direction.  Informed Consent Statement: Informed consent was obtained from all subjects involved in the study.

Data Availability Statement:
The datasets used and analyzed during the present study are available from the corresponding author upon reasonable request.