Semantically-Regularized Logic Graph Embeddings

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

Abstract

Bridging the gap between discrete symbolic logic and continuous neural representations is a fundamental challenge in artificial intelligence. This paper presents LENSR (Logic Embedding Network with Semantic Regularization), a framework designed to embed logical formulae into a continuous vector space while preserving their structural and semantic properties. By utilizing tractable logical forms (d-DNNF) and enforcing geometric constraints through semantic regularization, LENSR enables deep networks to effectively reason with symbolic knowledge.

Introduction

Deep neural networks typically require vast amounts of labeled data to learn concepts that can often be succinctly described by logical rules. Integrating symbolic logic into deep learning—"knowledge injection"—aims to reduce data dependency and improve model interpretability. However, standard approaches often fail to capture the complex graph structure of logic or struggle with scalability. LENSR addresses these issues by projecting logical rules into a manifold where geometric distance reflects logical entailment.

Methodology

Graph Representation and Tractability

A key contribution of this work is the choice of logical representation. While Conjunctive Normal Form (CNF) is standard, it is often computationally intractable for classical algorithms and difficult for neural networks to learn. LENSR utilizes d-DNNF (decision-Deterministic Decomposable Negation Normal Form), a tractable representation that facilitates more efficient processing.

Comparison of logical representations, highlighting the transition from general forms to the tractable d-DNNF DAG used in LENSR.

The logical formulae are represented as Directed Acyclic Graphs (DAGs). LENSR employs an augmented Graph Convolutional Network (GCN) with Heterogeneous Node Embeddings, learning distinct propagation parameters for AND gates, OR gates, and variables.

Semantic Regularization

To ensure the embedding space is semantically faithful to the underlying logic, the authors introduce geometric constraints based on logical properties:

  • AND nodes (Decomposability): Embeddings of children are regularized to be orthogonal.
  • OR nodes (Determinism): Embeddings of children are regularized to sum to a unit vector.
The LENSR framework architecture, showing the multi-layer graph embedding process, semantic regularization formulas, and the resulting learned embedding space.

The model is trained using a triplet loss, ensuring that a formula's embedding is proximal to satisfying assignments and distal from unsatisfying ones in the learned space. This approach allows the "meaning" of logic to be captured by the specific shape and distance metrics of the vector space.

Experimental Evaluation

The framework was evaluated on synthetic logic datasets and a real-world Visual Relationship Detection (VRD) task.

  • Synthetic Logic: LENSR with d-DNNF and semantic regularization achieved 71.52% accuracy on high-complexity entailment tasks, outperforming standard GCNs on general logic forms (68.51%).
  • Visual Relationship Prediction: On the VRD dataset, LENSR significantly improved performance. A baseline model without logic achieved 84.30% Top-5 accuracy, which increased to 92.77% with LENSR-based logic injection. The model successfully used logic to enforce spatial constraints, such as the requirement that a person and the glasses they are wearing must overlap in location.

Discussion and Conclusion

The results demonstrate that the tractability of logical forms (like d-DNNF) directly benefits representation learning. By mapping abstract logical properties onto geometric manifolds, LENSR creates a structure-aware embedding space invariant to variable relabeling. While currently limited to propositional logic, future work aims to extend this framework to First-Order Logic and explore more robust end-to-end integration strategies to mitigate the computational overhead of initial rule compilation.

Summary updated

BibTeX
@inproceedings{xie2019semantically,
  author = {Yaqi Xie and Ziwei Xu and Kuldeep S. Meel and Mohan S. Kankanhalli and Harold Soh},
  title = {{Semantically-Regularized Logic Graph Embeddings}},
  booktitle = {NeurIPS},
  year = {2019},
  url = {https://openreview.net/forum?id=PsYRxujYTJw},
}
Figure