What are knowledge graph embeddings?

What are knowledge graph embeddings? How are they useful? Are there any extensive reviews on the subject to know all the details? Note that I am asking this question just to give a quick overview of the topic and why it might be interesting or useful, I am not asking for all the details, which can be given in the reference/survey.

1 Answer

Knowledge graph embeddings (KGE) are embeddings created in the context of a knowledge graph (KG), which can be viewed as a visual/graphical representation of a knowledge base, where nodes are entities (e.g. "a car" or "Lewis Hamilton") and edges are relations between those entities (e.g. "drives"), so a (directed) connection from "Lewis Hamilton" to "a car" through the edge "drives" would represent the fact "Lewis Hamilton drives a car".

A KGE is a vector representation of an entity or relation in the KG that, hopefully, preserves the semantics of the entities and relations. For example, we expect the embedding of the entity "man" to be closer to the embedding of the entity "woman" than to the embedding of a "turtle". The idea of learning a lower-dimensional vector representation of objects that preserves some notion of semantics or meaning between those objects also appears in other AI subfields, like natural language processing (see e.g. word embeddings), or ML applied to software engineering (see code embeddings).

A KGE can be useful because a KG is most likely incomplete, so one of the tasks that you need to solve when using a KG is determining whether a fact is true or false. So, if we denote the fact as a triple $$f = \langle s, r, o \rangle$$, where $$s$$ stands for the subject, $$r$$ for the relation, and $$o$$ the object, then we want to determine whether this fact $$f$$ is true or false. In the context of KGEs, this is known as triple classification. Of course, in our KG, we don't have the fact $$f$$, but maybe we have the entities $$s$$ and $$o$$ but there's no edge between them that is labeled with $$r$$. So, given the embeddings of $$s$$, $$r$$, and $$o$$ (which was previously learned), we can then use a so-called score function to determine the likelihood of this fact. So, KGEs can be used to discover new "likely" knowledge, but it's a different approach than using deduction to derive new knowledge from a set of axioms or facts. It's an inductive/probabilistic approach, which has advantages (e.g. you don't need a deductive system) but also disadvantages (e.g. the fact may not actually be true even if our approach tells us that's the case).

There are many similar/related ways to learn KGEs. Just to give you an idea of how these are learned, a simple approach (TransE) is as follows. You learn the vectors $$s$$, $$r$$ and $$o$$ such that the constraint $$s + r = o$$ is satisfied. Of course, this constraint only makes sense if $$o$$ can only go with $$s$$ and $$r$$, so this approach is not realistic, as it doesn't model e.g. many-to-many relations. For this reason, people have introduced other approaches (like RotatE or ConvE), which have advantages but also disadvantages. There are also other issues that arise when learning these embeddings, like generating synthetic negative/false facts (i.e. if you have a KG, you only have known true facts, so how do you know if a fact is false? You need examples of false facts!).

The Wikipedia page on KGEs is already quite comprehensive, but there are many other resources on the topic. For example, the survey Knowledge Graph Embedding: A Survey of Approaches and Applications (2017) or the (long but very useful) tutorial Knowledge Graph Embeddings Tutorial: From Theory to Practice by some of the people that are currently doing research on this topic.