Compositional Neural Logic Programming

Son N. TranIJCAI 2021 · DOI

TL;DR

This paper introduces Compositional Neural Logic Programming (CNLP), a novel framework that seamlessly integrates neural networks with logic programming. CNLP enables systems to reason with both symbolic and sub-symbolic (tensor) data simultaneously, offering a more flexible and powerful approach to AI reasoning.

What Problem Does This Paper Address?

For decades, researchers have sought to bridge the gap between the pattern recognition capabilities of neural networks and the structured reasoning abilities of logic programming. While existing neuro-symbolic approaches have made progress, they often struggle with handling mixed symbolic and sub-symbolic variables within a unified reasoning framework. This limitation hinders the development of AI systems that can perform general reasoning, akin to human cognition, where we effortlessly combine abstract concepts with sensory information. The paper aims to address this by proposing a framework that can infer values for any type of variable, whether symbolic or sub-symbolic, within a logical structure.

Methods

The core of CNLP lies in its "compositional neural predicates." These are essentially neural networks designed to represent first-order logic predicates. The paper introduces two types:

  • Symbolic Neural Predicates (SNPs): These handle predicates with only symbolic arguments. They are constructed using an auto-encoder approach trained on existing facts, allowing for efficient inference without explicit learning for each predicate.
  • Compositional Neural Predicates (CNPs): These are more general, capable of handling predicates with both symbolic and tensor (sub-symbolic) arguments. They are built by composing discriminative and generative neural networks.

Reasoning in CNLP is performed using a "voting backward-forward chaining" (VBFC) algorithm. This algorithm iteratively selects and infers neural predicates based on a voting mechanism that prioritizes predicates based on their type and the number of unassigned variables. This approach allows for both backward chaining (like in traditional logic programming) and forward chaining (generating new facts), enabling argument-retrieval queries. A key advantage highlighted is the ability to perform "batch reasoning," where multiple queries can be processed simultaneously, significantly improving efficiency.

Datasets

  • MNIST Dataset: Used for training and evaluating the addition task, providing digit images as facts for predicates.
  • PASCAL-PART Dataset: Used for the semantic image interpretation task, providing indoor object images with geometric and semantic features.

Key Insights and Ideas

  • Unified Reasoning for Mixed Data: The most significant insight is the successful integration of symbolic and sub-symbolic reasoning within a single framework. CNLP doesn't just process them separately; it allows them to interact and influence each other during inference.
  • Compositionality for Incremental Learning: The compositional nature of CNLP allows for incremental learning. New knowledge can be added by constructing new neural predicates and rules, without needing to retrain the entire system.
  • Flexibility in Argument Inference: CNLP's ability to infer any variable (symbolic or tensor) in a query is a major step towards more general AI reasoning. This goes beyond systems that primarily focus on inferring symbolic variables.
  • Efficient Batch Reasoning: The VBFC algorithm's support for batch reasoning offers a significant practical advantage, especially for large-scale applications where processing many queries efficiently is crucial.

Key Results

  • Discriminative Tasks: CNLP achieved 97.62% accuracy on a digit comparison task (icomp) using a recursive knowledge base.
  • Generative Tasks: In the addition task, CNLP demonstrated superior performance compared to DCGAN and ACGAN, achieving a higher inception score and lower cross-entropy for generating digit images that sum to a target number.
  • Efficiency: CNLP was found to be significantly more efficient than DeepProbLog in terms of convergence time and inference speed for addition tasks, particularly for triple-digit numbers, due to its batch reasoning capabilities.
  • Semantic Image Interpretation: CNLP outperformed existing methods like LTN in semantic image interpretation tasks, achieving higher AUC scores for both type prediction and part-of prediction.

Limitations and Future Work

  • Scalability: The paper acknowledges that applying CNLP to very large databases is a direction for future work to fully evaluate its compositional approach at scale.
  • Complexity of Recursive Rules: While VBFC handles recursive rules, the paper notes that merging results and defining termination conditions can be complex.
  • Future Work: The authors plan to explore CNLP's application to larger datasets and further investigate its potential for complex reasoning tasks.

Summary updated

BibTeX
@inproceedings{tran2021compositional,
  author = {Son N. Tran},
  title = {{Compositional Neural Logic Programming}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.24963/ijcai.2021/421},
}
Figure