Logic Tensor Networks: Deep Learning and Logical Reasoning from Data and Knowledge

Luciano Serafini, Artur S. d'Avila GarcezarXiv 2016

Introduction

Artificial Intelligence has historically been divided between connectionism—neural networks that learn patterns from raw data—and symbolism—logic systems that reason from structured rules. While neural networks excel at perception, they often lack the ability to incorporate high-level constraints or provide interpretable reasoning. Conversely, classical logic is powerful for structured knowledge but remains brittle in the face of noisy, real-world data.

Logic Tensor Networks (LTN) bridge this gap by providing a unified framework for "Neuro-Symbolic" AI. LTN enables systems to perform knowledge completion—filling in missing information in a database—by combining vector-based data representations with rich relational rules.

Methods: Real Logic and Semantic Grounding

The core of LTN is the introduction of Real Logic, a first-order logic (FOL) where truth values are real numbers in the interval $[0, 1]$ rather than binary. This transition to a continuous space allows logical reasoning to be integrated directly into deep learning architectures.

The framework relies on Semantic Grounding ($μ$), which maps logical components to tensor operations:

  • Constants are mapped to feature vectors.
  • Function symbols are mapped to linear transformations.
  • Predicates are mapped to Neural Tensor Networks (NTNs).
Neural architecture for grounding a logical implication $P(\mathbf{v}, \mathbf{u}) \to A(\mathbf{u})$ in LTN.

To maintain differentiability, logical connectives (AND, OR, NOT) are implemented using fuzzy logic operators known as t-norms and s-norms. This allows the entire logical formula to be treated as a differentiable function. Learning is then framed as an approximate satisfiability problem: the system uses gradient descent to find vector groundings that maximize the truth value of a set of logical formulas (the "Grounded Theory").

Experimental Setup: Friends and Smokers

The authors evaluate LTN on the "Friends and Smokers" dataset, a standard relational learning benchmark. This dataset includes 14 individuals with known or partial information regarding their smoking habits, cancer diagnoses, and friendship networks.

The 'Friends and Smokers' knowledge base, partitioned into specific facts ($κ_{a...h}, κ_{i...n}$) and general rules ($κ^{SFC}$).

The knowledge base consists of:

  1. Facts: Specific observations about individuals (e.g., $S(a)$ for "Alice smokes").
  2. Rules: Background knowledge such as "smoking causes cancer" ($\forall x(S(x) \to C(x))$) and "friendship is symmetric" ($\forall xy(F(x,y) \to F(y,x))$).

Key Insights and Results

LTN introduces several novel concepts to neuro-symbolic reasoning:

  • Symbols as Latent Vectors: By representing constants as points in a high-dimensional space, the system can discover latent similarities between entities.
  • Reasoning as Optimization: Logical inference is transformed into a continuous mathematical function, allowing the system to "stretch" the vector space to satisfy theorems.
  • Handling Existentials: Through Skolemization, LTN can generate features for hypothetical individuals that satisfy specific rules (e.g., "there exists a friend who smokes").

In practice, LTN successfully performed knowledge completion, correctly predicting missing facts like cancer diagnoses by combining raw data with logical rules. Notably, the system proved robust to inconsistency. In cases where the data contradicted a rule (e.g., a smoker without cancer), LTN assigned the rule a high but non-absolute truth value (e.g., 0.77), treating it as a strong trend rather than an infallible law.

Limitations and Future Work

While promising, LTN faces challenges in scalability, as the current benchmarks are relatively small. Future work will focus on testing the framework against large-scale relational databases and exploring the computational costs of deep function nesting. Additionally, the sensitivity of the system to the choice of fuzzy logic operators suggests a need for more automated hyperparameter tuning. Direct quantitative comparisons with established frameworks like Markov Logic Networks (MLNs) remain a priority for future benchmarking.

Summary updated

BibTeX
@misc{serafini2016logic,
  author = {Luciano Serafini and Artur S. d'Avila Garcez},
  title = {{Logic Tensor Networks: Deep Learning and Logical Reasoning from Data and Knowledge}},
  year = {2016},
  eprint = {1606.04422},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1606.04422},
}
Figure