Implementing Tensor Logic: Unifying Datalog and Neural Reasoning via Tensor Contraction
Swapn Shah (1), Wlodek Zadrozny (2) ((1) School of Data Science, University of North Carolina at Charlotte, (2) Department of Computer Science, University of North Carolina at Charlotte)

TL;DR
This paper empirically validates Tensor Logic, unifying symbolic Datalog reasoning with neural networks through tensor contraction, enabling scalable, interpretable reasoning in large knowledge graphs.
Contribution
It demonstrates the equivalence between Datalog rules and tensor contractions, and shows how neural embeddings can perform zero-shot and multi-hop reasoning using tensor-based methods.
Findings
Transitive closure computed in 74 iterations on a biblical genealogy graph.
Neural network trained for zero-shot compositional inference successfully.
Achieved MRR of 0.3068 on link prediction and 0.3346 on compositional reasoning on FB15k-237.
Abstract
The unification of symbolic reasoning and neural networks remains a central challenge in artificial intelligence. Symbolic systems offer reliability and interpretability but lack scalability, while neural networks provide learning capabilities but sacrifice transparency. Tensor Logic, proposed by Domingos, suggests that logical rules and Einstein summation are mathematically equivalent, offering a principled path toward unification. This paper provides empirical validation of this framework through three experiments. First, we demonstrate the equivalence between recursive Datalog rules and iterative tensor contractions by computing the transitive closure of a biblical genealogy graph containing 1,972 individuals and 1,727 parent-child relationships, converging in 74 iterations to discover 33,945 ancestor relationships. Second, we implement reasoning in embedding space by training a…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Graph Neural Networks · Topic Modeling · Machine Learning in Healthcare
