# Entity-Alignment Interaction Model Based on Chinese RoBERTa
## 3 Methodology
### The Model Framework
#### 3.2.2 RoBERTa-Based Interaction Model
In contrast, multi-hop neighbor interaction is able to capture the relationship between entities more comprehensively. For one-hop neighbors \(N^{1}(e)\) and \(N^{1}(e^{\prime})\) and multi-hop neighbors \(N^{t}(e)\) and \(N^{t}(e^{\prime})\), we constructed the interaction matrices between \(N^{1}(e)\) and \(N^{1}(e^{\prime})\), \(N^{1}(e)\) and \(N^{t}(e^{\prime})\), \(N^{t}(e)\) and \(N^{1}(e^{\prime})\), \(N^{t}(e)\) and \(N^{t}(e^{\prime})\), respectively, extracted the  
Figure 3: Neighbor-interaction graph. We computed the similarity matrix between neighbors \(N(e)\) and \(N(e^{\prime})\), and extracted features from the matrix via a pairwise aggregation function. similarity vectors using the aggregation function of Formulas (4) and (5), respectively, and connected them as the final neighbor-similarity embedding. **Attention Interaction. ** In order to further enhance the expressiveness of the model, we incorporated attention interaction into the interaction model to capture finer-grained feature matching and improve the accuracy of entity alignment. We applied the multi-head attention mechanism to compute the similarity between entities and their neighbors. Specifically, we first linearly transformed the embeddings of entities and their neighbors to generate query vectors, key vectors, and value vectors. These vectors are divided into multiple heads, and each head independently performs the scaled dot-product attention computation with the following equation:  
\[Attention(Q,K,V)=\text{softmax}\bigg{(}\frac{QK^{T}}{\sqrt{d_{k}}}\bigg{)}V \tag{6}\]  
where \(Q\) is the query vector, from the neighbor embedding of entity \(e\); \(K\) and \(V\) are the key vector and value vector, respectively, both from the neighbor embedding of entity \(e^{\prime}\); \(d_{k}\) is the dimension of each head. All the outputs of the heads are concatenated together and transformed through linear layers to obtain the final interactive feature representation, as follows:  
\[b_{ij}=\frac{T(e_{i})\cdot T\Big{(}e^{\prime}_{j}\Big{)}}{\|T(e_{i})\|\cdot\|T \Big{(}e^{\prime}_{j}\Big{)}\|} \tag{3}\]0  
where \(n\) denotes the number of attention heads and \(Attention_{i}\) denotes the attention output of the i-th head. **Attribute Interaction. ** The attribute triples of entities \(e\) and \(e^{\prime}\) are \((e,a_{i},v_{i})\) and \(\left(e^{\prime},a^{\prime}_{j},v^{\prime}_{j}\right)\), respectively, which are similar to the entity neighbor triples, so attribute interaction can be analogous to neighbor interaction. We converted the similarity matrix between neighbor entities to the similarity matrix between \(T(v_{i})_{i=1}^{|A(e)|}\) and \(T(v^{\prime}_{i})_{i=1}^{|A(e^{\prime})|}\) and changed the mask matrix between neighbor relationships to the mask matrix between \(T(a_{i})_{i=1}^{|A(e)|}\) and \(T\big{(}a^{\prime}_{i})_{i=1}^{|A(e^{\prime})|}\). The aggregation function of Formulas (4) and (5) was next used to generate the attribute similarity vector \(v(A(e),A(e^{\prime}))\). To avoid nested interaction, we ignored the attributes of neighbors. **The Final Combination. ** Given the cosine similarity \(\cos(T(e),T(e^{\prime}))\) between the names of entities \(e\) and \(e^{\prime}\), the neighbor-similarity vector \(v(N(e),N(e^{\prime}))\), the attention-interaction feature \(Feature_{Multi-head}(e,e^{\prime})\) and the attribute-similarity vector \(v(A(e),A(e^{\prime}))\), we joined them together and applied the MLP layer to obtain the final similarity score between entities \(e\) and \(e^{\prime}\), as follows:  
\[b_{ij}=\frac{T(e_{i})\cdot T\Big{(}e^{\prime}_{j}\Big{)}}{\|T(e_{i})\|\cdot\|T \Big{(}e^{\prime}_{j}\Big{)}\|} \tag{3}\]1  
finally, \(d(e,e^{\prime})\) was brought into the Formula (2) marginal-loss equation, and the MLP parameters in Formula (8) were fine-tuned according to the loss.