Leanpub Header

Skip to main content

Knowledge Graph Embeddings as Geometric Operators

This book is 100% completeLast updated on 2026-07-24

What if TransE, ComplEx, RotatE and the rest of the knowledge graph “model zoo” were different views of one geometric operator? Learn the mathematics, code and practical design principles behind structured memory for trustworthy AI.

Minimum price

$29.95

$49.95

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
About

About

About the Book

Knowledge graph embeddings are often presented as a crowded model zoo: TransE, DistMult, ComplEx, RotatE, QuatE, RESCAL, TuckER and many more, each with its own notation and intuition. Knowledge Graph Embeddings as Geometric Operators replaces that list with a unifying map. It shows that these models can be understood as configurations of a single relation operator built from rotation, stretch and translation. Under this operator view, symmetry, inversion, composition and cardinality become geometric properties that can be imposed, learned and measured.

Beginning with linear algebra and requiring no prior knowledge of geometric algebra, the book develops the mathematics step by step before connecting it to training, expressivity, diagnostics, calibration and computation. A capstone case study demonstrates two-graph geometric binding for anti-money-laundering detection, while the companion PyTorch library and chapter notebooks make the results reproducible and practical. Written for graduate-level data scientists and practitioners who want more than a recipe, the book serves as the mathematical prequel to the KnowlytiX AI Engineering Series, the foundation beneath trustworthy retrieval, structured memory, geometric ground truth and governed agentic AI.

Author

About the Author

Agus Sudjianto and Wing Yan Lau

Dr. Agus Sudjianto

Dr. Agus Sudjianto works on the connections between geometry, machine learning and model risk. His central idea is that learning is the discovery of geometry, and he pursues it in two ways: in research on interpretable machine learning and in the practical work of making high-stakes models safe to deploy in regulated industries. He advises several AI companies and a university in his field, and consults independently for banks, fintechs and digital-media firms.

This idea shapes how he approaches machine learning. For tabular models, he treats a kernel as a geometry that is learned rather than chosen. That view unifies gradient-boosted trees, Gaussian processes and in-context learning, and it is the subject of his book in preparation, The Learned Kernel. His open-access toolkit MoDeVa brings interpretable model development and validation into one workflow, covering diagnostics, explainability and reliability testing. For generative AI, he applies the same idea to agentic systems through the KnowlytiX framework. Its Geometric Memory System places facts on a learned manifold, so plausibility becomes distance, contradiction becomes measurable tension, reasoning-path consistency becomes a geometric defect and exact numbers are stored without loss. This lets a governed agent sit between symbolic rules and a language model, working as memory, control plane and verifier that can be inspected and audited, and it grounds an agentic harness for testing large language models.

His work builds on more than two decades in quantitative risk. Agus was Executive Vice President and Head of Corporate Model Risk at Wells Fargo, where he chaired the Model Governance Committee and led enterprise model risk management. Earlier he was Director of Analytics and Modeling and Chief Model Risk Officer at Lloyds Banking Group in the UK and Head of Quantitative Risk at Bank of America. His career began in engineering at Ford Motor Company. He holds a PhD in Engineering from Wayne State University and a Master’s in System Design & Management from MIT, holds several U.S. patents and co-authored Design and Modeling for Computer Experiments.

Wing Yan Lau

Wing Yan Lau is the Chief Technology Officer at KnowlytiX and works at the intersection of data systems, knowledge infrastructure and dependable AI. Her focus is the engineering required to turn mathematical ideas into systems that can operate against real enterprise information. In the context of this book, that means connecting knowledge graph embeddings and geometric operators to the practical machinery through which facts are ingested, structured, queried, verified and ultimately made useful to an AI agent.

Her work on the Geometric Memory System spans document ingestion, knowledge-store construction, query infrastructure, verification pathways and the interfaces that connect governed AI systems to enterprise data. She is also a co-author of KnowlytiX research on graph-verified evaluation and structured financial-document retrieval, including work represented in FinStructBench and the company’s broader knowledge and testing platform. That perspective shapes the book’s emphasis on more than mathematical representation alone: an operator must not only express the geometry of a relationship but also be trainable, testable and usable within a complete computational system.

Wing brings more than two decades of database and data-platform engineering experience to this work. She has contributed to core technologies at IBM, SAP and Workday, with responsibilities spanning query optimization, storage systems and execution infrastructure. This background informs how she approaches knowledge graphs: not as abstract collections of triples but as operational systems in which data representation, numerical exactness, retrieval behavior and execution performance must work together.

Her contribution is the implementation discipline that connects theory to practice. She focuses on how documents become structured knowledge, how facts and numeric values retain their fidelity, how graph-backed queries are executed reliably and how verification becomes part of the system rather than an instruction left to a language model. That systems perspective complements the geometric framework developed in this book and helps turn its central ideas into software that researchers and engineers can build, reproduce and run.

Contents

Table of Contents

  • Preface
  • Part I. Foundations
    • 1. Knowledge Graphs and Link Prediction
      • 1.1 Why embed a graph of facts?
      • 1.2 The companion code and notebooks
      • 1.3 A graph of facts
      • 1.4 The completion task
      • 1.5 We only have positives
      • 1.6 Measuring success: filtered ranking
      • 1.6.1 Why ranking must be filtered
      • 1.6.2 Why ties must be handled carefully
      • 1.7 From scores to answers
      • 1.8 What relations look like
      • 1.9 Summary
      • 1.10 Exercises
    • 2. TransE: Translation as a Decoder
      • 2.1 A relation is a displacement
      • 2.2 Training with manufactured negatives
      • 2.3 The geometry, and its rigidity
      • 2.4 TransE in practice
      • 2.5 Summary
      • 2.6 Exercises
  • Part II. The Model Zoo
    • 3. Bilinear and Tensor Models
      • 3.1 A relation is a matching matrix
      • 3.2 DistMult: the diagonal, and forced symmetry
      • 3.3 ComplEx: a complex carrier breaks the symmetry
      • 3.4 TuckER: the core tensor, and what contains what
      • 3.5 Matching versus distance
      • 3.6 Summary
      • 3.7 Exercises
    • 4. Rotation and Hypercomplex Models
      • 4.1 RotatE: a relation is a rotation
      • 4.2 Why composition commutes
      • 4.3 QuatE: the first noncommutative relation
      • 4.4 The L2-versus-L1 subtlety
      • 4.5 Pattern coverage, side by side
      • 4.6 Summary
      • 4.7 Exercises
    • 5. Three Choices: Carrier, Operator, Comparator
      • 5.1 The three choices
      • 5.2 One class, four models
      • 5.3 The identities that make it efficient
      • 5.4 What the lens is missing
      • 5.5 Summary
      • 5.6 Exercises
  • Part III. Geometric Algebra for Embeddings
    • 6. Geometric Algebra from Linear Algebra
      • 6.1 A product of vectors
      • 6.2 The dot product is only half of a product
      • 6.3 The outer product and bivectors
      • 6.4 Generators and the fundamental relation
      • 6.5 Multivectors, blades and grades
      • 6.5.1 Labeling blades by bits
      • 6.6 The geometric product is structured linear algebra
      • 6.7 Complex numbers and quaternions live inside the algebra
      • 6.8 Three involutions
      • 6.9 Reflections and rotations
      • 6.9.1 Rotations need not commute
      • 6.10 What the geometric product cannot do by itself: translation
      • 6.11 Two notions of size
      • 6.12 Summary
      • 6.13 Exercises
    • 7. Rotors, Reflections and Rigid Motions
      • 7.1 Rotations are built from reflections
      • 7.2 The obstacle, stated precisely
      • 7.3 Two null directions: the conformal model
      • 7.4 Motors: rotation and translation in one operator
      • 7.5 Why rigid motions are the right middle ground for relations
      • 7.6 Summary
      • 7.7 Exercises
    • 8. Clifford Models and Universality
      • 8.1 The relation operator is multiplication
      • 8.2 Universality: every linear map is a geometric product
      • 8.3 The signature is the modeling choice
      • 8.4 GeomE: the scalar part is weighted matching
      • 8.5 Degenerate signatures carry translation
      • 8.6 Summary
      • 8.7 Exercises
    • 9. The Unified Geometric Operator
      • 9.1 Three choices
      • 9.2 One operator
      • 9.3 The rotation, done once
      • 9.4 The stretch and the translation
      • 9.5 Every model is a configuration
      • 9.6 Why the comparator must match the geometry
      • 9.7 The expressivity ladder
      • 9.8 Regions: points are radius-zero spheres
      • 9.9 Where the unification ends
      • 9.10 Summary
      • 9.11 Exercises
    • 10. Heterogeneous Relations and Operator Assignment
      • 10.1 Why one operator is not enough
      • 10.2 Heterogeneity by assignment
      • 10.3 Choosing the operator from structure
      • 10.4 Gating by geometric constraint
      • 10.5 Why a learned gate does not
      • 10.6 The soft constraint: a regularized gate
      • 10.7 Parameter sharing at scale
      • 10.8 Summary
      • 10.9 Exercises
  • Part IV. Theory and Practice
    • 11. Structural Results: Patterns and Impossibilities
      • 11.1 Patterns as constraints on the operator
      • 11.2 Symmetry forces an involution
      • 11.3 Composition and the price of commutativity
      • 11.4 The injectivity barrier
      • 11.5 Gauge non-identifiability
      • 11.6 Full expressivity by containment
      • 11.7 Summary
      • 11.8 Exercises
    • 12. Expressivity, Complexity and Computation
      • 12.1 Three kinds of expressivity
      • 12.2 Algebra size is not embedding size
      • 12.3 Block versus low-rank: where to put the rotation
      • 12.4 Projecting first, then rotating fully
      • 12.5 A negative result: when the synthetic washes out the distinction
      • 12.6 Parameter and compute scaling
      • 12.7 Summary
      • 12.8 Exercises
    • 13. Diagnostics, Training and Calibration
      • 13.1 The objective: a fourth design choice
      • 13.2 Two training signals
      • 13.3 Regularizing the geometry
      • 13.4 Measuring structure on the learned operators
      • 13.5 From scores to decisions
      • 13.6 The training algorithm
      • 13.7 Summary
      • 13.8 Exercises
  • Part V. Capstone Case Study
    • 14. Capstone: Two-Graph Geometric Binding for AML Detection
      • 14.1 The two graphs
      • 14.2 A typology as a query graph
      • 14.3 Candidate binding
      • 14.4 Role membership as regions
      • 14.5 The binding score
      • 14.6 Training the geometry: objective-specialized detectors
      • 14.7 Calibration and the near-miss
      • 14.8 Benchmark across the typology set
      • 14.9 Separate specialists or one shared model
      • 14.10 Carrying amount and frequency in the operator
  • Part VI. Frontiers
    • 15. Synthesis and Frontiers
      • 15.1 The unification in one picture
      • 15.2 Choosing the operator: from taxonomy to design
      • 15.3 The unification, tested
      • 15.4 A query algebra from the same parts
      • 15.5 What the unification does not unify, and where it points
      • 15.6 Two early probes: consistency and the meet
      • 15.7 Summary
      • 15.8 Exercises
  • A. Training and the PyTorch Implementation
    • A.1 From a graph of facts to a gradient
    • A.2 Manufacturing negatives
    • A.3 The objective functions
    • A.4 The model interface
    • A.5 The training loop
    • A.6 The filtered evaluator
    • A.7 Running it
  • B. API Reference
    • B.1 The public namespace
    • B.2 Data
    • B.3 Evaluation
    • B.4 Training
    • B.5 Models
    • B.6 The unified operator
    • B.7 Heterogeneous KGE
    • B.8 The Clifford core and carriers
    • B.9 Structure identification
    • B.10 Diagnostics
    • B.11 Calibration and decisions
  • About the Author

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub