Quant Memo
Advanced

Knowledge Graph Embeddings and TransE

Representing entities and relationships as vectors so that a relationship becomes literal vector addition — the head entity plus the relationship vector should land near the tail entity.

Prerequisites: Word Embeddings and Word2Vec

A knowledge graph stores facts as triples: (head entity, relationship, tail entity) — for example, (Apple, supplier-of, Foxconn). TransE is a simple, elegant way to turn such a graph into vectors: it learns an embedding for every entity and every relationship type such that adding the head entity's vector to the relationship's vector lands close to the tail entity's vector. In symbols, it wants head+relationtail\text{head} + \text{relation} \approx \text{tail} for every true fact in the graph, and wants that sum to land far from the tail for facts that are false.

The intuition mirrors the famous word2vec analogy result "king minus man plus woman equals queen": if relationships behave like consistent directions in vector space, then the same "supplier-of" vector should carry any company to its supplier, regardless of which company you start from. Training pushes true triples' head-plus-relation sum close to the true tail, and randomly generated false triples (swap the tail for a random entity) far from it, using a margin-based loss so the model doesn't just collapse everything to the same point.

For financial graphs — companies, executives, suppliers, subsidiaries, regulators — this lets a model answer questions like "which company is likely the supplier of Company X" purely by vector arithmetic, and lets analysts surface non-obvious but plausible relationships (like an undisclosed supply-chain link) by seeing which entity's vector best completes the equation.

TransE embeds a knowledge graph's entities and relationships as vectors so that a true fact corresponds to head-vector plus relation-vector landing near tail-vector, turning relational reasoning into vector addition. It's simple and fast but struggles with relationships that aren't one-to-one, which later models like TransH and TransR were built specifically to fix.

Related concepts

Practice in interviews

Further reading

  • Bordes et al., Translating Embeddings for Modeling Multi-relational Data (2013)
ShareTwitterLinkedIn