## 4 Our Model
### CL-Based Graph Convolutional Neural Network Encoder
#### 4.1.1 Graph Convolution  
Initially, for a user \(u_{i}\) and an item \(v_{j}\), we obtain their embedding vectors \(e_{u_{i}}\) and \(e_{v_{j}}\). Unlike Matrix Factorization (MF) or Neural Collaborative Filtering (NCF) models, our process follows LightGCN's approach, performing embedding propagation among connected users and items. The key profile aggregation operations are as follows:  
Message Construction:For a user-item connection pair \((u,i)\), we define a message from user \(u\) to item \(i\) as:  
\[m_{u\gets i}=f(e_{i},e_{u},p_{(u,i)}) \tag{1}\]  
The decay factor \(p\) controls the propagation strength on edge \((u,i)\), indicating that the message's intensity should diminish with the path's length. The message encoding function, \(f(\cdot)\), is defined as:  
\[m_{u\gets i}=\frac{1}{\sqrt{|\mathcal{N}_{u}||\mathcal{N}_{i}|}}\cdot e_{i} \tag{2}\]  
where \(p\) is set to \(\frac{1}{\sqrt{|\mathcal{N}_{u}||\mathcal{N}_{i}|}}\) and \(\mathcal{N}_{u}\) and \(\mathcal{N}_{i}\) denote the first-hop neighbors of \(u\) and \(i\), respectively.  
Message Aggregation: This process collects messages propagated by \(u\)'s neighbors to enhance \(u\)'s representation. The aggregation function is defined as:  
\[e_{u}^{(1)}=\sum_{i\in\mathcal{N}_{u}}m_{u\gets i} \tag{3}\]  
Figure 1: GCLTE: integrating Graph Contrastive Learning and transformers for rating prediction and reason generation. In the figure, “bos” represents the marker indicating the beginning of the input sequence.  
where \(e_{u}^{(1)}\) denotes the representation of user \(u\) after the first embedding propagation layer and the summation symbols represent the aggregation of neighbors \(\mathcal{N}_{u}\). For \(e_{i}^{(1)}\), we apply the same aggregation method. Based on this, we can compute higher-level embeddings:  
\[e_{u}^{(k+1)}=\sum_{i\in\mathcal{N}_{u}}\frac{1}{\sqrt{|\mathcal{N}_{u}|| \mathcal{N}_{i}|}}e_{i}^{(k)},e_{i}^{(k+1)}=\sum_{i\in\mathcal{N}_{i}}\frac{1 }{\sqrt{|\mathcal{N}_{i}||\mathcal{N}_{u}|}}e_{u}^{(k)} \tag{4}\]  
The matrix equivalent of Equation (4) is:  
\[E^{(k+1)}=\Big{(}D^{-\frac{1}{2}}AD^{-\frac{1}{2}}\Big{)}e^{(k)}, \tag{5}\]  
where \(A\) represents the user-item interaction adjacency matrix and \(D\) is a diagonal matrix of size \((M+N)\times(M+N)\). The element \(D_{i}i\) indicates the number of non-zero elements in the ith row of \(A\).  
In traditional GCNs, no layer combination is employed, and the final output is simply the embedding from the last layer. However, this approach often leads to uniform feature representations across nodes after multiple convolutions, failing to meet the specific needs of recommender systems [38]. We consider the embeddings from all convolutional layers when forming the final user-item representation, as depicted in Figure 2. This method aims to achieve a graph convolution structure that incorporates self-connectivity:  
\[e_{u}=\sum_{k=0}^{K}a_{k}e_{u}^{(k)},e_{i}=\sum_{k=0}^{K}a_{k}e_{i}^{(k)} \tag{6}\]  
The weight \(a_{k}\), defined as \(\frac{1}{k+1}\) and always non-negative, represents the influence of the kth layer in synthesizing the final embedding. As illustrated in Figure 2, the matrix representation of Equation (6) can be depicted as follows:  
\[\begin{split} E&=a_{0}E^{(0)}+a_{1}E^{(1)}+a_{2}E^ {(2)}+\dots+a_{K}E^{(K)}\\ &=a_{0}E^{(0)}+a_{1}\bar{A}E^{(0)}+a_{2}\bar{A}^{2}E^{(0)}+ \dots+a_{K}\bar{A}^{K}E^{(0)}\end{split} \tag{7}\]  
where \(\bar{A}=D^{-\frac{1}{2}}AD^{-\frac{1}{2}}\).