## 2 TransRFT Model Principle and Training
### The TransRFT Model  
As shown in Figure 1, suppose there are two triples in the knowledge graph: ([PERSON], position, US President) and ([PERSON], position, US President). For TransE, both the relation \(r\) and the tail entity are the same, so their corresponding head entity vector \(h\) is the same. This is clearly factually incorrect, and TransE cannot effectively distinguish between [PERSON] and [PERSON]. Therefore, inspired by the TransH model, the entity is first introduced into the relationship-specific hyperplane on the basis of TransE to improve the ability of TransE to deal with complex relationships. Assuming that the normal vector of the hyperplane \(w_{r}\) is \(W_{r}\), and the projected head and tail entities are \(\mathbf{h}_{\perp},\mathbf{t}_{\perp}\), then:  
\[\left\{ \begin{aligned} &\mathbf{h}_{\perp}=\mathbf{h}-W_{r}^{T} \mathbf{h}W_{r}\\ &\mathbf{t}_{\perp}=\mathbf{t}-W_{r}^{T}\mathbf{t}W_{r}\end{aligned} \right. \tag{1}\]Then, apply the relational hyperplane and the projected triplet representation is shown in Figure 2.  
Through Figure 2, it can be observed that after introducing the head entities ([PERSON], [PERSON]) onto the relation-specific hyperplane (Position), even though [PERSON] and [PERSON] are not the same person, they end up with the same projection \(\mathbf{h}_{\perp}\). By representing each entity and relation with separate entity and relation vectors, and assigning a relation-specific hyperplane to each relation, it is possible to distinguish between different head entities with the same relation to a given tail entity. Additionally, the differences and interactions between different relations can also be captured by the hyperplanes corresponding to different relations. Compared to TransE, this approach enables better handling of one-to-many, one-to-one, and many-to-many relationships. Normally, it is hoped that in vector space, the projection of the head entity vector on the relational hyperplane \(h_{\perp}\) plus the relation \(r\) should equal the projection of the tail  
Figure 1: Example of triples. Orange and blue arrows represent the head entity and the tail entity respectively, and the green arrow represents the relationship. Figure 2: Example of projected triples. Orange and blue arrows represent the head entity and the tail entity respectively, and the green arrow represents the relationship. entity vector on the relational hyperplane \(t_{\perp}\). Therefore, the vector score function after projection is  
\[ \begin{array}{rcl}f_{r}(h,t)&=&\left\|\mathbf{h}_{\perp}+\mathbf{r}-\mathbf{t}_ {\perp}\right\|_{2}^{2}\\ &=&\left\|\left(\mathbf{h}-W_{r}^{T}\mathbf{h}W_{r}\right)+\mathbf{r}-\left( \mathbf{t}-W_{r}^{T}\mathbf{t}W_{r}\right)\right\|_{I_{1}/I_{2}}\end{array}  \tag{2}\]  
The score function represents the degree of correctness of the head and tail entities of the triplet species after the \"translation\" of the relationship. The lower the score, the more favorable it is to the positive sample triplet; the higher the score, the more favorable it is to the negative sample. However, the aforementioned approach also has its own limitations. For instance, compared to TransE, it significantly increases the model complexity and training time. Furthermore, it still performs poorly when dealing with reflexive relationships. Therefore, the idea of flexible translation is introduced after projecting into the hyperplane of relation. Specifically, for each triplet \((h,r,t)\), assuming that the embeddings of \(h\) and \(r\) are given, then \(t\) is allowed to be a range of planes, rather than a fixed vector or a set of vectors in the same direction in the cross-section model.