Skip to main content
QUICK REVIEW

[Paper Review] TensorLog: A Differentiable Deductive Database

William W. Cohen|arXiv (Cornell University)|May 20, 2016
Bayesian Modeling and Causal InferenceComputer Science9 references75 citations
TL;DR

TensorLog introduces a differentiable probabilistic deductive database that compiles logical theories into factor graphs and unrolls belief propagation into differentiable functions, enabling efficient, gradient-based parameter learning. It achieves linear-time compilation and inference, scales well on recursive tasks, and matches or exceeds performance of established systems like ProbLog2 and ProPPR in learning accuracy and inference speed.

ABSTRACT

Large knowledge bases (KBs) are useful in many tasks, but it is unclear how to integrate this sort of knowledge into "deep" gradient-based learning systems. To address this problem, we describe a probabilistic deductive database, called TensorLog, in which reasoning uses a differentiable process. In TensorLog, each clause in a logical theory is first converted into certain type of factor graph. Then, for each type of query to the factor graph, the message-passing steps required to perform belief propagation (BP) are "unrolled" into a function, which is differentiable. We show that these functions can be composed recursively to perform inference in non-trivial logical theories containing multiple interrelated clauses and predicates. Both compilation and inference in TensorLog are efficient: compilation is linear in theory size and proof depth, and inference is linear in database size and the number of message-passing steps used in BP. We also present experimental results with TensorLog and discuss its relationship to other first-order probabilistic logics.

Motivation & Objective

  • To address the challenge of integrating large knowledge bases into deep learning systems by enabling differentiable reasoning.
  • To design a probabilistic deductive database (PrDDB) where inference is differentiable, supporting end-to-end gradient-based learning of parameters.
  • To achieve efficient compilation and inference that scale linearly with theory size, database size, and message-passing steps.
  • To demonstrate that differentiable logical reasoning can effectively approximate complex probabilistic logic models like ProbLog2 and ProPPR.
  • To enable tight integration of logical reasoning with deep learning frameworks through differentiable, composable inference functions.

Proposed method

  • Each logical clause in a theory is compiled into a factor graph, where logical variables map to random variables and literals to factors.
  • Belief propagation (BP) message-passing steps are unrolled into differentiable functions for each query type, enabling gradient computation.
  • Differentiable inference functions are composed recursively to handle non-trivial, interrelated logical theories with multiple predicates.
  • Parameters (e.g., fact confidences) are optimized via gradient descent using unregularized cross-entropy loss and ReLU-like clipping to ensure non-negativity.
  • The system uses softmax to convert output scores into probability distributions for probabilistic inference.
  • Inference and compilation run in linear time relative to theory size, proof depth, database size, and number of BP steps.

Experimental results

Research questions

  • RQ1Can logical reasoning in a probabilistic deductive database be made fully differentiable to support gradient-based learning?
  • RQ2How efficiently can differentiable inference scale on recursive and deeply nested logical queries?
  • RQ3Can a differentiable logic system like TensorLog match or outperform established systems like ProbLog2 and ProPPR in learning accuracy and inference speed?
  • RQ4To what extent can differentiable logical inference approximate the semantics of full first-order probabilistic logics?
  • RQ5Can differentiable logical reasoning be effectively integrated into deep learning pipelines for joint training?

Key findings

  • TensorLog achieves linear-time compilation and inference, scaling efficiently with theory size, database size, and number of message-passing steps.
  • On a 16-by-16 grid path-finding task, TensorLog trained for 20 epochs reached 96.5% test accuracy in approximately 3 seconds per epoch.
  • TensorLog outperformed ProbLog2 in inference speed by a factor of several times, even when querying six times more entities.
  • On a 64-by-64 grid, TensorLog demonstrated superior scalability and faster runtimes compared to ProbLog2, especially on deeply recursive queries.
  • In citation matching and relation prediction tasks, TensorLog achieved comparable accuracy to ProPPR despite using a simpler learning scheme and single-threaded implementation.
  • The learned weights in a 6x6 grid visualization showed meaningful patterns, with edge directionality and magnitude differences reflecting learned confidence in paths.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.