TransE is a knowledge graph embedding model that represents entities as points in a vector space and each relation as a translation vector, so that for a true fact the head entity plus the relation lands close to the tail entity. Introduced by Bordes and colleagues in 2013, it became the reference point for an entire family of translational models in graph learning.
The model is built for link prediction on multi-relational data such as Freebase or Wikidata, where facts are stored as triples of the form head, relation, tail. Its appeal lies in extreme simplicity: one embedding per entity, one per relation and a distance function, which makes TransE fast to train on graphs with millions of entities.
How TransE scores a triple
TransE scores a triple by measuring how far the translated head lies from the tail. For a triple with head h, relation r and tail t, the model computes the distance between h + r and t using the L1 or L2 norm; a small distance means the fact is plausible, a large distance means it is unlikely.
Training uses a margin-based ranking loss. For each observed triple the model creates a corrupted triple by replacing the head or the tail with a random entity, then pushes the score of the true triple below the score of the corrupted one by at least a fixed margin, often set between 1 and 5. Entity vectors are usually normalized to unit length after each update so that the model cannot reduce the loss simply by enlarging embeddings.
The table below lists the main components of the model and the role each one plays.
| Component | Form | Role in training |
|---|---|---|
| Entity embedding | One vector per entity | Position of the entity in space |
| Relation embedding | One vector per relation | Translation applied to the head |
| Scoring function | Norm of h + r minus t | Plausibility of a triple |
| Negative sampling | Random head or tail replacement | Supplies false facts for contrast |
| Margin loss | Hinge loss with a fixed margin | Separates true and false triples |
Key hyperparameters and typical values
TransE has few hyperparameters, but their values strongly affect results. Published benchmarks on FB15k and WN18 used modest dimensions, while later re-evaluations showed that careful tuning of negatives and learning rates closes much of the gap to newer models.
| Hyperparameter | Typical range | Effect |
|---|---|---|
| Embedding dimension | 50 to 400 | Capacity versus memory and overfitting |
| Margin | 1 to 5 | Strength of separation from negatives |
| Distance norm | L1 or L2 | L1 is often slightly better on sparse graphs |
| Negatives per positive | 1 to 256 | More negatives give a stronger training signal |
| Learning rate | 0.0001 to 0.01 | Stability and speed of convergence |
The choice of negatives deserves particular care. Uniform corruption often produces trivially false triples, so later work introduced Bernoulli sampling, which corrupts the head or tail with a probability that depends on the relation type, and self-adversarial sampling, which weights harder negatives more heavily.
Relation patterns TransE can and cannot model
The translation assumption gives TransE a clear geometric bias: it handles some relation patterns naturally and fails on others by construction. Understanding this is essential for deciding whether the model fits a given graph.
Composition works well, because adding two translations yields a third, so a chain such as born in a city and city located in a country can be approximated. Inversion also works, since the inverse relation can be the negative vector. Symmetric relations fail, because h + r = t and t + r = h together force r toward zero, which collapses the two entities.
The most important weakness concerns one-to-many, many-to-one and many-to-many relations. If one director made several films, all those films must sit near the same point, so TransE pushes distinct entities together and loses the ability to tell them apart.
| Relation pattern | TransE | DistMult | RotatE |
|---|---|---|---|
| Composition | Supported | Not supported | Supported |
| Inversion | Supported | Not supported | Supported |
| Symmetry | Not supported | Supported | Supported |
| Antisymmetry | Supported | Not supported | Supported |
| One-to-many | Weak | Partial | Partial |
Variants and successors of TransE
Several successors keep the translation idea while relaxing its constraints. TransH projects entities onto a relation-specific hyperplane before translating, which lets one entity have different representations for different relations. TransR and TransD project entities into separate relation spaces using learned matrices, adding capacity at a higher computational cost.
Other models replace translation with different operations. DistMult uses a bilinear product, ComplEx extends it to complex numbers to capture asymmetry, and RotatE models each relation as a rotation in complex space, which covers symmetry, inversion and composition at once. Graph neural approaches such as the relational graph convolutional network can use TransE-style scoring as a decoder on top of learned node representations.
Practical use, evaluation and limitations
TransE remains a strong and cheap baseline for knowledge graph completion, entity recommendation and the initialization of more complex models. It is implemented in common libraries such as PyKEEN, DGL-KE and PyTorch-BigGraph, which can train it on graphs with hundreds of millions of triples.
Evaluation follows the filtered ranking protocol: for each test triple the model ranks all candidate tails or heads, removes other known true triples from the ranking, and reports mean reciprocal rank (MRR) and Hits@k. Early benchmarks such as FB15k and WN18 contained inverse-relation leakage, so results on FB15k-237 and WN18RR are considered more reliable.
- Do not use TransE alone for graphs dominated by symmetric or many-to-many relations.
- Report filtered metrics and the exact negative sampling strategy, because both change scores substantially.
- Expect transductive behavior: entities absent during training receive no embedding without retraining.
The simple explanation
TransE turns facts into arrows on a map. Each person, place or thing becomes a dot. Each kind of relationship becomes an arrow of fixed length and direction. If Paris is the capital of France, the capital-of arrow leads from the Paris dot to the France dot.
Once the map is learned, the computer can guess missing facts. It starts at a dot, follows an arrow and checks which dot lies nearby. The method is simple and fast. It struggles when one thing points to many others, because they all must crowd into one spot.
How it is used in practice
A pharmaceutical research team maintains a biomedical knowledge graph linking about 90,000 drugs, genes, proteins and diseases through relations such as targets, treats and interacts with. Many plausible links are missing because the literature has not yet tested them.
The team trains TransE with 200-dimensional embeddings, an L1 distance and 64 negatives per positive on roughly 4 million triples. On a held-out test set the model reaches a filtered MRR in a useful range for screening, and training finishes within hours on a single GPU.
Researchers rank candidate drug and disease pairs by TransE score and pass the top few hundred to domain experts. Because TransE handles the many-to-many treats relation poorly, the team later compares it with RotatE, but TransE remains the fast first-pass filter that narrows thousands of hypotheses to a list experts can review.