A Relation in Knowledge Graph Is a Matching Matrix

· Source: Agus’s Substack · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Mathematics & Computational Sciences, Data Science & Analytics · Depth: Advanced, long

Summary

This post, part of the "Knowledge Graphs as Geometry" series, introduces the bilinear family of knowledge graph embedding models, which score facts by measuring agreement, contrasting with TransE's distance-based approach. It details RESCAL, using a full relation matrix Mᵣ, and DistMult, a constrained version with a diagonal Mᵣ, which reduces parameters but forces all relations to be symmetric. DistMult scores `(Ann, parentOf, Carol)` and its reverse identically (both 9.002). ComplEx resolves this by using complex numbers for coordinates and conjugating the tail, enabling it to differentiate directions, scoring `(Ann, parentOf, Carol)` at 11.63 and the reverse at 0.91. This "carrier" change resolves the symmetry limitation without increasing operator complexity. The article also compares matching (ComplEx) and distance scoring profiles on the UMLS dataset, showing ComplEx's high and flat Hits@1 (0.80) profile versus DistMult's lower scores (0.59). It positions DistMult, RESCAL, and TuckER as a lineage based on constraints on a shared core tensor.

Key takeaway

For Machine Learning Engineers building knowledge graph applications, if you encounter issues with models like DistMult failing on directed relations due to forced symmetry, consider ComplEx. By shifting to complex number coordinates, ComplEx effectively represents directional facts, yielding significantly better scores for true directions (e.g., 11.63 vs. 0.91). Evaluate your model's prediction profile (Hits@K) to ensure it provides a single, reliable answer for agents, rather than a cluster of candidates.

Key insights

Changing the number system (carrier) for knowledge graph embeddings can resolve model limitations more effectively than increasing operator complexity.

Principles

In practice

Topics

Code references

Best for: AI Scientist, Machine Learning Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Agus’s Substack.