Knowledge-graph embeddings score typed triples, but the scoring operator determines which relation distinctions are even possible.
Summary
Ada is Ben’s parent; the reverse relation is false in this example. Can swapping the entity embeddings change the proposed score? If not, increasing width cannot teach this score the missing direction.
The task: knowledge-graph completion
Represent a fact as head, relation and tail, , with corresponding learned vectors. Score candidate heads or tails under a stated higher-is-better convention. An unobserved triple is not necessarily false; corrupted-entity negatives need a declared validity policy. Architecture, training loss and ranking evaluation are separate choices.
The four models to know
TransE: translation
Use . Under exact zero residual, two true tails require . Likewise, two reversed zero-residual facts require and collapse their entity embeddings. These are exact-constraint limits; approximate ranking need not satisfy those equalities.
DistMult: bilinear diagonal
For real scalars , both scores are six. Commutativity holds in every coordinate, so adding dimensions preserves the equality.
ComplEx: complex bilinear
Use complex embeddings and . Choose , with . Forward score is . Reverse score is .
Conjugation changes which factors contribute imaginary signs. It permits this directed distinction; it does not guarantee learning the correct facts.
Learning objective
Complex conjugation lets the reversed relation receive a different score
Derivation
DistMult: swapping is invisible
Real multiplication commutes in every dimension.
ComplEx: conjugation preserves direction
Swapping entities moves the conjugate to the other vector.
Why does conjugating the swapped head reverse the rotation?
RotatE: rotation in complex space
Use , with unit-modulus relation coordinates. Multiplying by gives with zero residual; inverse rotation maps it back to one. The inverse is coordinatewise conjugation; composing exact rotations multiplies their coordinates.
Which patterns each model expresses
| Operator | Discriminating test | Scope |
|---|---|---|
| TransE | distinct tails force conflicting translations | exact zero residual |
| DistMult | head/tail swap leaves score unchanged | every shared-entity real score |
| ComplEx | conjugated swap can change real score | capacity, not learned accuracy |
| RotatE | conjugate inverse and componentwise composition | unit-modulus, exact rotations |
Pattern claims depend on their formal definitions and residual assumptions, not a universal expressivity ordering.
Change the required information
Require direction
New task: replace undirected similarity with parent_of.
Picture and change: reject the forced-symmetric score or use a directional operator with explicitly distinct entity roles.
Check: duplicating the DistMult coordinate gives twelve in both directions, still tied. The one-coordinate ComplEx example gives one and minus one.
Use when: reversal must change the ranking; test held-out directed facts.
Add an unseen entity
New task: score a new title with metadata but no trained ID vector.
Picture and change: supply an explicit feature/neighbor encoder or fallback, then evaluate unseen-entity generalization.
Check: a toy feature map maps to one. It can enter the example’s forward score, which becomes one. That arithmetic supplies an embedding, not evidence that the asserted fact is true.
Use when: deployment must cover entities absent from the transductive training IDs.
Reconstruct the limitation
Does algebraic capacity prove that a missing link is correct?
Reasoned answer
No. Observation coverage, negative validity, split leakage, training evidence and optimization remain separate requirements. Changing width cannot remove DistMult’s forced equality; changing its operator can.
Where this fits in recsys / RAG
Catalog graphs can supply typed side-information alongside collaborative features. Relational GNNs add neighborhood computation; random-walk embeddings learn another neighborhood objective. Neither is a universal replacement or winner. Structured RAG inputs can also contain stale or false triples; graph grounding does not establish truth.
What an interviewer expects you to say
Define the fact population, candidate set, negative construction and temporal/train/test split. Evaluate filtered MRR or Hits@K under a declared known-positive filtering protocol and tie policy. State whether encoder inputs can expose future or test information.
Common confusions
Classification or ranking losses can train a triple score; the evaluation task determines the appropriate metrics. Unobserved does not mean negative. ID-only embeddings do not provide an unseen entity’s representation. Relation-pattern theorems use specific definitions; approximate learned scores need separate empirical evaluation.
Related: Graph neural networks, Word embeddings, Negative sampling strategies, Matrix factorization for recsys, Content-based filtering.