Embedding Symbolic Knowledge into Deep Networks.

Yaqi Xie, Ziwei Xu, Kuldeep S. Meel, Mohan S. Kankanhalli, Harold Soh

Abstract

In this work, we aim to leverage prior symbolic knowledge to improve the performance of deep models. We propose a graph embedding network that projects propositional formulae (and assignments) onto a manifold via an augmented Graph Convolutional Network (GCN). To generate semantically-faithful embeddings, we develop techniques to recognize node heterogeneity, and semantic regularization that incorporate structural constraints into the embedding. Experiments show that our approach improves the performance of models trained to perform entailment checking and visual relation prediction. Interestingly, we observe a connection between the tractability of the propositional theory representation and the ease of embedding. Future exploration of this connection may elucidate the relationship between knowledge compilation and vector representation learning.

Introduction

Deep neural networks are famously "data-hungry," requiring thousands of labeled examples to learn concepts that humans can often describe with a single sentence of logic. While symbolic logic has long served as a robust framework for representing such knowledge, integrating it into the continuous, fluid architectures of neural networks remains a significant challenge. Previous attempts to bridge this gap often treated logic as simple text sequences or employed "logic losses" that fail to scale with complex rules. The core challenge lies in representing structured, symbolic knowledge in a way that a neural network can process without losing the underlying logical semantics.

Methodology: The LENSR Framework

The authors introduce LENSR (Logic Embedding Network with Semantic Regularization), a framework that treats logical formulae not as text, but as graphs. This approach allows the model to become invariant to variable relabeling, focusing instead on the inherent structure of the logical argument.

Overview of the LENSR framework showing graph-based formula embedding, semantic regularization for AND/OR nodes, and the resulting learned embedding space.

Graph Convolutional Networks and Node Heterogeneity

Since logical formulas can be represented as trees or directed acyclic graphs (DAGs), LENSR utilizes Graph Convolutional Networks (GCNs) to generate embeddings. Recognizing that not all components of a logic gate are equal, the model employs heterogeneous node embeddings, using distinct mathematical weights for different node types (e.g., AND gates, OR gates, variables) to capture their unique functional roles.

Semantic Regularization

To ensure the vector space respects logical properties, the authors introduce "semantic regularization" constraints:

  • AND Gates: The embeddings of child nodes are constrained to be orthogonal, reflecting the independence of the variables they represent.
  • OR Gates: The embeddings of children must sum to a unit vector, reflecting that in a deterministic formula, only one path is "true."

Tractable Representations

A critical component of LENSR is the choice of logical representation. Instead of the standard Conjunctive Normal Form (CNF), the authors utilize deterministic-Decomposable Negation Normal Form (d-DNNF). This is a "tractable" representation that simplifies complex computational tasks like satisfiability checking.

Comparison of logical representations: (a) General Form, (b) CNF, (c) d-DNNF, and (d) d-DNNF DAG. The study finds that more tractable forms like d-DNNF are easier for neural networks to learn.

Experimental Evaluation

The paper evaluates LENSR on two distinct tasks:

  1. Synthetic Entailment: A dataset of 3,000 formulas where the task is to predict if a truth assignment satisfies a given formula. LENSR using d-DNNF significantly outperformed CNF-based models, achieving 83.04% accuracy on moderate complexity formulas compared to 73.92% for CNF.
  2. Visual Relation Detection (VRD): A real-world dataset where logic is used to encode spatial constraints (e.g., "wear" implies object overlap). Adding LENSR logic embeddings boosted Top-5 Accuracy from a baseline of 84.30% to 92.77%.

Key Insights and Future Work

The most striking finding is that the "easier" a logic form is for a computer to solve (tractability), the "easier" it is for a neural network to learn its representation. This suggests a fundamental link between Knowledge Compilation and Representation Learning.

While powerful, the approach currently faces limitations regarding the computational overhead of compiling complex formulas into d-DNNF. Future work will focus on extending this framework to First-Order Logic and integrating it into end-to-end "pixels-to-logic" pipelines for more robust visual reasoning.

Summary updated

BibTeX
@inproceedings{xie2019embedding,
  author = {Yaqi Xie and Ziwei Xu and Kuldeep S. Meel and Mohan S. Kankanhalli and Harold Soh},
  title = {{Embedding Symbolic Knowledge into Deep Networks.}},
  booktitle = {NeurIPS},
  year = {2019},
  url = {https://openreview.net/forum?id=PsYRxujYTJw},
}
Figure