NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Knowledge Graph Completion via Complex Tensor Factorization

Théo Trouillon, Christopher R. Dance, Johannes Welbl, Sebastian Riedel, Éric Gaussier, Guillaume Bouchard

Abstract In statistical relational learning, knowledge graph completion deals with automatically understanding the structure of large knowledge graphs---labeled directed graphs---and predicting missing relationships---labeled edges. State-of-the-art embedding models propose different trade-offs between modeling expressiveness, and time and space complexity. We reconcile both expressiveness and complexity through the use of complex-valued embeddings and explore the link between such complex-valued embeddings and unitary diagonalization. We corroborate our approach theoretically and show that all real square matrices---thus all possible relation/adjacency matrices---are the real part of some unitarily diagonalizable matrix. This results opens the door to a lot of other applications of square matrices factorization. Our approach based on complex embeddings is arguably simple, as it only involves a Hermitian dot product, the complex counterpart of the standard dot product between real vectors, whereas other methods resort to more and more complicated composition functions to increase their expressiveness. The proposed complex embeddings are scalable to large data sets as it remains linear in both space and time, while consistently outperforming alternative approaches on standard link prediction benchmarks.

Introduction

Knowledge graphs (KGs) are fundamental to modern AI, serving as structured repositories for facts like (Paris, is_capital_of, France). However, these graphs are often incomplete. The task of knowledge graph completion involves predicting these missing links. A central challenge in this field is the diverse nature of relations: some are symmetric (e.g., is_married_to), while others are antisymmetric (e.g., is_father_of).

Historically, models have struggled with a trade-off between expressiveness and efficiency. Simple models like DistMult are computationally efficient but fail to capture asymmetry due to their symmetric dot product. Conversely, expressive models like RESCAL or NTN can handle complex relations but suffer from quadratic complexity, making them impractical for large-scale graphs.

The ComplEx Approach

To address these limitations, the authors introduce ComplEx, a model that transitions the embedding space from the real domain ($\mathbb{R}$) to the complex domain ($\mathbb{C}$). By representing entities and relations as complex-valued vectors, the model leverages the properties of the Hermitian dot product to capture directionality without increasing computational overhead.

The scoring function for a triple $(s, r, o)$ is defined as: $$\phi(r, s, o) = \text{Re}(\langle w_r, e_s, \bar{e}_o \rangle)$$

By taking the complex conjugate of the object entity's embedding ($\bar{e}_o$), the dot product becomes asymmetric ($\langle s, o \rangle \neq \langle o, s \rangle$). This allows the model to naturally distinguish between subjects and objects while maintaining linear time and space complexity.

Comparison of state-of-the-art embedding models in terms of scoring functions and complexity.

As shown in the table above, ComplEx achieves $O(K)$ time and space complexity, matching the efficiency of DistMult while providing the expressiveness needed to model asymmetric relations.

Theoretical and Empirical Validation

A key theoretical insight of this work is the proof that any real square matrix can be represented as the real part of a unitarily diagonalizable complex matrix. This provides a mathematical foundation for using complex numbers to represent relational adjacency.

The model was evaluated on several benchmarks, including synthetic data, Kinships, UMLS, WN18, and FB15K.

  • Synthetic Data: ComplEx was the only model tested that could perfectly recover both symmetric and antisymmetric relations simultaneously.
  • Large-Scale Benchmarks: On WN18 and FB15K, ComplEx significantly outperformed previous state-of-the-art models. For instance, on WN18, it achieved a Filtered Mean Reciprocal Rank (MRR) of 0.941, a substantial improvement over DistMult's 0.822.
  • Scalability: The model's linear complexity allows it to scale to massive datasets; training on nearly 500,000 triples from FB15K took only three hours on a single GPU.

Conclusion

ComplEx offers a simple yet powerful solution for knowledge graph completion. By utilizing complex-valued embeddings, it reconciles the need for expressive modeling of asymmetric relations with the requirement for linear scalability. While future work may explore n-ary relations and more sophisticated negative sampling, ComplEx establishes a new standard for efficiency and accuracy in relational learning.

Summary updated

BibTeX
@article{trouillon2017knowledge,
  author = {Théo Trouillon and Christopher R. Dance and Johannes Welbl and Sebastian Riedel and Éric Gaussier and Guillaume Bouchard},
  title = {{Knowledge Graph Completion via Complex Tensor Factorization}},
  journal = {J. Mach. Learn. Res.},
  year = {2017},
  url = {https://openreview.net/forum?id=vnig0boZJMM},
}
Figure