# Translation-Based Embeddings with Octonion for Knowledge Graph Completion
## 3 Methodology
### TransO: A Translation-Based KGC Model with Octonion
Based on the above design, for a triple \((head,rel,tail)\), we define the scoring function of the TransO model as Equation (9):  
\[f_{rel}(head,tail) =-\|\mathbf{m}(r_{1})\cdot\mathbf{s}(h)+\mathbf{s}(r_{2})-\mathbf{s}(t)\|_{2}^{2} +b_{head}+b_{tail} \tag{9}\] \[=-\|\mathbf{R}\cdot\mathbf{h}+\mathbf{r}-\mathbf{t}\|_{2}^{2}+b_ {head}+b_{tail}\]  
where we regard the entity \(h\), \(t\), and relation \(r_{1}\), \(r_{2}\) as octonions, i.e., \(h,r_{1},r_{2},t\in\mathbb{O};\mathbf{s}(h),\mathbf{s}(r_{2})\), \(\mathbf{s}(t)\) denote the coordinate vectors of the octonions \(h\), \(r_{2}\), \(t\), i.e., \(\mathbf{s}(h)=\mathbf{h},\mathbf{s}(r_{2})=\mathbf{r},\mathbf{s}(t)=\mathbf{t}\) and \(\mathbf{h},\mathbf{r},\mathbf{t}\in\mathbb{R}^{8}\); \(\mathbf{m}(r_{1})\) denotes the component matrix of the octonion \(r_{1}\), i.e., \(\mathbf{m}(r_{1})=\mathbf{R}\in\mathbb{R}^{8\times 8}\); \(b_{head},b_{tail}\in\mathbb{R}\) denote the radii of the decision boundary of the head and the tail entity, respectively. Finally, the score of triple \((head,rel,tail)\) is measured by the square of the \(l2\)-norm of the interactive result coordinate vector, and the bias parameters \(b_{head},b_{tail}\). For the scoring function in Equation (9), since each coordinate vector or component matrix corresponds to only one octonion with eight-dimensional elements, their dimension is strictly limited to 8 or \(8\times 8\). Due to the low dimension, the model has limited representation capability and cannot achieve satisfactory results in application. To solve this problem, we propose the generalized TransO model in higher-dimensional space, which represents each entity or relation as multiple groups of octonions and adopts grouping interaction rules to make the interaction occur between octonions in the same group. In this way, the dimension of the embedded space is no longer strictly limited to 8 and \(8\times 8\), but an integer multiple of 8, such as 32, 200, and 496. The scoring function of the generalized TransO model is shown in Equation (10):  
\[f_{rel}(head,tail)=-\|\mathbf{R}\cdot\mathbf{h}+\mathbf{r}- \mathbf{t}\|_{l2}^{2}+b_{head}+b_{tail}\] (10) \[=-\left\| \begin{bmatrix}\mathbf{m}(r_{11})\\ &\mathbf{m}(r_{12})\\ &&\ddots\\ &&&\mathbf{m}(r_{1k})\end{bmatrix}   
where \(\mathbf{h},\mathbf{r},\mathbf{t}\in\mathbb{R}^{8k}(k=1,2,\cdots,n)\), respectively, denote the embedding vectors of the head entity, relation in translation interaction, and tail entity composed of \(k\) octonion coordinate vectors \(\mathbf{s}(h_{1}),\mathbf{s}(h_{2}),\cdots,\mathbf{s}(h_{k})\), and \(\mathbf{s}(r_{21}),\mathbf{s}(r_{22}),\cdots,\mathbf{s}(r_{2k})\), and \(\mathbf{s}(t_{1}),\mathbf{s}(t_{2}),\cdots,\mathbf{s}(t_{k})\); \(\mathbf{R}\in\mathbb{R}^{8k\times 8k}(k=1,2,\cdots,n)\) denotes the diagonal matrix of the relation in the multiplication interaction composed of \(k\) octonion component matrices \(\mathbf{m}(r_{11}),\mathbf{m}(r_{12}),\cdots,\mathbf{m}(r_{1k})\); \(b_{head},b_{tail}\in\mathbb{R}\) still denote the bias parameters of the head and the tail entity, respectively. As can be seen from Equation (10), the component matrix of the relation used for multiplication interaction in the generalized TransO model is arranged as a diagonal matrix; each element on the principal diagonal is a standard octonion component matrix of \(8\times 8\), and several standard eight-dimensional octonion coordinate vectors of the entity and the relation used for translation interaction are also combined into a complete vector according to the multiple. In this way, entities and relations can interact in a higher embedded space and only between the octonions in the same group, ensuring that the time complexity of the model does not reach the square level, as with TransR [22] or RESCAL [10]. The growth of parameters resulting from the above group interaction process is still linear, and the model could achieve a balance between representation capability and complexity.