## 3 Our Model
### The Generator  
#### 3.2.1 Item Embedding Layer  
In the item embedding layer of the generator, we need to obtain representations of recent interactive items and target items. Figure 2 shows the knowledge graph information aggregation process. As shown in Figure 2, the KG is built with the item as the central node, and each item can build a KG. It can be represented by triples (h, r, t). Here, h \(\in\) E, r \(\in\) R, and t \(\in\) E represent the head entity, relation, and tail entity, respectively. E and R are the entity set and the relation set, respectively. The first graph in Figure 2 builds a knowledge graph with the item as the center, and the second graph is obtained by randomly sampling the number of nodes and calculating the weight score of the knowledge graph preference attention. Through Formula (5), the first-order entity representation \(\mathbf{e^{1}}\) in the third figure can be obtained, and the above operations can be repeated to obtain the h-order entity representation \(\mathbf{e^{H}}\). The following mainly introduces the one-layer structure and expands to the multilayer structure. For an item \(\mathbf{v^{0}}\), \(\mathbf{N(\mathbf{v^{0}})}\) denotes the set of one-hop neighbors directly connected to \(\mathbf{v^{0}}\), and \(\mathbf{r_{ij}}\) represents the relation between entities \(\mathbf{e_{i}}\) and \(\mathbf{e_{j}}\). The weight score is calculated by using the following knowledge graph preference attention formula:  
\[\mathbf{r_{i}}\mathbf{e_{j}}=\sigma\big{(}\mathbf{W_{1}}\mathbf{\cdot}\mathbf{concat}\big{(}\mathbf{r_{i }}\mathbf{,}\mathbf{e_{j}}\big{)}+\mathbf{b_{1}}\big{)} \tag{1}\]  
\[\mathbf{r_{r_{i}\mathbf{e_{j}}}}=\mathbf{\cdot}\mathbf{r_{i}}\mathbf{e_{j}} \tag{2}\]  
where \(\mathbf{u}\in\mathbf{R^{d}}\), \(\mathbf{r_{i,j}}\in\mathbf{R^{d}}\), and \(\mathbf{e_{j}}\in\mathbf{R^{d}}\) are the representations of the users and the relations between entities and tail entities, respectively, \(\sigma\) is a nonlinear function, \(\mathbf{d}\) is the dimension, and \(\mathbf{W_{1}}\in\mathbf{R^{d\times 2d}}\) and \(\mathbf{b_{1}}\in\mathbf{R^{d}}\) are weights and offsets. \(\mathbf{\pi_{i,i\
eq j}^{n}}\) indicates the user preference for the comprehensive consideration of relations and entities. The parameters \(\mathbf{W_{1}}\) and \(\mathbf{b_{1}}\) can be adjusted according to the feedback of the discriminator, thereby adaptively adjusting the aggregation weight of the neighbor information. Figure 2: The process of knowledge graph information aggregation. By calculating the linear combination of item \(v^{0}\)'s neighbors, the neighbor information vector of item \(v^{0}\) is obtained to represent \(e_{\mathbf{N}(v^{0})}^{u}\) :  
\[e_{\mathbf{N}(v^{0})}^{u}=\sum_{\mathbf{a}^{0}\in\mathbf{N}(v^{0})}\overline{\pi}_{\mathbf{r}_{ \mathbf{i}}\mathbf{j}\mathbf{e}^{0}}^{u} \tag{3}\]  
where \(\mathbf{e}^{0}\) denotes the representation of the item \(v^{0}\) neighbor entity. The following formula is the normalization of the weight score:  
\[\overline{\pi}_{\mathbf{r}_{\mathbf{i}}\mathbf{j}\mathbf{e}_{\mathbf{j}}}^{u}=\frac{exp\left(\pi _{\mathbf{r}_{\mathbf{i}}\mathbf{e}_{\mathbf{j}}}^{u}\right)}{\sum_{\mathbf{a}^{0}\in\mathbf{N}(v^{0} )}\pi_{\mathbf{r}_{\mathbf{i}}\mathbf{a}_{\mathbf{j}}}^{u}} \tag{4}\]  
We sum the representation \(\mathbf{v}_{\mathbf{h}}\) of the item \(v^{0}\) and its neighborhood representation \(v_{\mathbf{N}(v^{0})}^{u}\) to obtain the item representation \(e^{\mathbf{1}}\) fused with neighborhood information:  
\[\mathbf{e^{1}}=\sigma(\mathbf{W}_{2}\cdot\left(\mathbf{v}_{\mathbf{h}}+\mathbf{e}_{\mathbf{N}(v^{0})} ^{u}\right)+\mathbf{b}_{2}) \tag{5}\]  
where \(\mathbf{W}_{2}\in\mathbf{R}^{d\times 2d}\) and \(\mathbf{b}_{2}\in\mathbf{R}^{d}\) are weights and biases, respectively. \(\sigma\) is a nonlinear function. The KG is a multilayer structure that can obtain low-order entity information at the low level and mine high-order entity information at the high level.