DistMult

On this page 7

DistMult is a knowledge graph embedding model that represents every entity and every relation as a real-valued vector and scores a fact (head, relation, tail) by the sum of the element-wise product of the three vectors. In graph learning, a branch of artificial intelligence, it serves as a simple and strong baseline for link prediction: estimating which missing facts in a knowledge graph are likely to be true.

Introduced in 2015 by Yang and colleagues, DistMult is a bilinear model with a diagonal relation matrix. That restriction makes it fast and compact, but it also makes every relation symmetric by construction, which is its best-known limitation and the reason later models such as ComplEx were developed.

How DistMult scores a triple

DistMult scores a triple by multiplying the head embedding, the relation embedding and the tail embedding dimension by dimension and adding the results. Written compactly, the score is f(h, r, t) = sum_i h_i * r_i * t_i, often called a trilinear dot product. A high score means the model considers the fact plausible, and a low score means it considers the fact unlikely.

The model is a special case of RESCAL, which scores a triple as h^T M_r t with a full d x d relation matrix. DistMult forces M_r to be diagonal, so each relation needs only d parameters instead of d squared. Each relation therefore acts as a per-dimension weighting that says which latent features of the head and tail must agree for the relation to hold.

The table below lists the components of the model and their typical settings in modern implementations.

ComponentFormTypical setting
Entity embeddingReal vector per entityDimension 100 to 1,000
Relation embeddingReal vector (diagonal matrix)Same dimension as entities
Score functionTrilinear productUnbounded real number
LossCross-entropy or logistic1-N scoring or negative sampling
RegularizationL2 or N3 norm, dropoutTuned per dataset
DistMult components and typical settings

Training and evaluation

DistMult is trained by teaching it to rank true triples above corrupted ones. Early implementations sampled a few negative triples per positive by replacing the head or tail with a random entity and used a margin or logistic loss. Current practice often uses 1-N scoring, which scores a query against all entities at once with a softmax cross-entropy loss and is faster on a GPU.

Evaluation follows the standard link prediction protocol. For each test triple, the model ranks the correct tail (and head) among all candidate entities, removes other known true triples in the filtered setting, and reports mean reciprocal rank (MRR) and Hits@k. Benchmarks such as FB15k-237 and WN18RR were built specifically to remove trivial inverse-relation leakage found in their predecessors.

Reported numbers depend heavily on training choices. The original paper reported modest results, but careful re-tuning studies showed that DistMult reaches an MRR of roughly 0.34 on FB15k-237 and about 0.45 on WN18RR, close to far more complex models. The lesson is that hyperparameters and training regime often matter as much as the score function.

Which relation patterns DistMult can represent

DistMult can represent only part of the relation patterns that occur in knowledge graphs, because its score is unchanged when head and tail are swapped. The product h_i * r_i * t_i is commutative, so f(h, r, t) = f(t, r, h) for every relation. The model is therefore well suited to symmetric relations such as “is married to” and poorly suited to directed ones such as “is the parent of”.

Relation patternExampleDistMult support
Symmetricis sibling ofYes, inherently
Antisymmetricis parent ofNo
Inverseparent of and child ofOnly for symmetric relations
Compositionmother of a father is grandmotherNo
One-to-manycountry has cityPartly, through shared features
Relation patterns and DistMult support

In practice the symmetry problem is less severe on some benchmarks than theory suggests, because test queries often ask for the tail of a directed relation where the reversed fact simply does not appear among candidates. On graphs with many hierarchical or directional relations, however, the weakness becomes visible.

DistMult compared with other embedding models

DistMult belongs to the semantic matching family of knowledge graph embeddings, which score triples by multiplicative interactions, as opposed to translational models such as TransE and RotatE that score triples by distances. The comparison below places it among its closest neighbors.

ModelScore ideaMain strengthMain weakness
RESCALFull bilinear matrixVery expressived squared parameters per relation
DistMultDiagonal bilinear productSimple, fast, compactSymmetric only
ComplExComplex-valued productHandles antisymmetryTwice the memory per dimension
TransEHead plus relation near tailIntuitive, handles inversionWeak on one-to-many
RotatERotation in complex spaceSymmetry, inversion, compositionMore tuning needed
DistMult and related knowledge graph embedding models

ComplEx is the direct successor of DistMult. By moving embeddings into complex space and conjugating the tail vector, it breaks the symmetry while keeping the same linear cost. DistMult is also widely used as the decoder in relational graph convolutional networks, where an encoder computes entity representations from the graph and DistMult scores candidate links.

When to use DistMult and common mistakes

DistMult is a sensible choice when a team needs a fast, low-memory baseline for link prediction, when most relations are symmetric or weakly directional, or when it needs a simple decoder on top of a graph neural network. Its memory cost grows linearly with the number of entities times the embedding dimension, which matters on graphs with millions of nodes.

  • Using it for strongly directional relations without checking reversed-triple errors in the results.
  • Comparing against poorly tuned baselines, which overstates the gain of newer models.
  • Reporting raw instead of filtered metrics, which penalizes correct predictions of other true facts.
  • Skipping regularization, which lets embedding norms grow and degrades ranking quality.

The short version

A knowledge graph stores facts such as “Paris is the capital of France”. Many true facts are missing. DistMult guesses which missing facts are probably true.

It gives every thing and every relationship a list of numbers. To judge a fact, it multiplies the three lists position by position and adds up the results. A big total means a likely fact. The method is quick and simple. Its main blind spot is direction: it treats “Anna is Ben’s parent” and “Ben is Anna’s parent” as equally likely.

Where it makes a difference

A pharmaceutical research group maintains a biomedical knowledge graph with about 100,000 entities, including drugs, proteins, diseases and side effects, linked by roughly 40 relation types. The team wants to suggest candidate drug-target interactions for laboratory screening.

As a first model, the data scientists train DistMult with 200-dimensional embeddings, 1-N scoring and N3 regularization. Training finishes in under an hour on one GPU and produces a useful baseline MRR on held-out interactions. Error analysis shows that the model confuses direction for relations such as “inhibits”, so the team also trains ComplEx, which improves results on directional relations.

The group keeps DistMult as a fast sanity check for every new data release and uses the combined rankings to pick the top 50 candidate pairs for wet-lab validation each quarter.