Approximate Inference for Neural Probabilistic Logic Programming

Robin Manhaeve, Giuseppe Marra, Luc De Raedt

Abstract

Neural-Symbolic (NeSy) AI integrates deep learning's perception with formal logic's reasoning. However, frameworks like DeepProbLog suffer from scalability issues due to the computational cost of exact inference. We present DPLA, an approximate inference method utilizing A search to identify the most probable proofs. By incorporating geometric mean heuristics and UCB-based exploration, DPLA* achieves significant speedups—up to three orders of magnitude—while maintaining high accuracy across various benchmarks, including MNIST addition and complex handwritten formulas.

Introduction

The field of Neural-Symbolic (NeSy) AI aims to combine the perceptual capabilities of deep learning with the structured reasoning of formal logic. DeepProbLog is a prominent framework where neural networks function as "neural predicates"—for instance, a convolutional neural network (CNN) outputting probabilities for digit classification. However, DeepProbLog’s reliance on exact inference creates a significant bottleneck. Calculating the probability of a logical statement (e.g., "the sum of these two images is 10") requires finding every possible proof, a process that scales exponentially as logical complexity increases.

Methodology

DPLA (DeepProbLog A) addresses this bottleneck by treating logical reasoning (SLD resolution) as a search problem. Instead of exhaustive proof-finding, DPLA employs A search to prioritize the most probable proofs.

Neural-symbolic integration for addition

The framework incorporates several key innovations:

  1. A* Search on SLD-Trees: Logical reasoning is navigated as a tree of possible steps, prioritized by likelihood.
  2. Geometric Mean Heuristic: This heuristic guides the A* search by prioritizing branches based on the geometric mean of probabilities, which is particularly effective when neural networks exhibit high confidence.
  3. UCB Exploration: To prevent a "vicious cycle" where an untrained network leads the search toward incorrect proofs (and thus learns incorrect patterns), the Upper Confidence Bound (UCB) algorithm is used to ensure diverse exploration during training.
  4. Parametric Heuristics: The system can utilize a secondary neural network to predict the likelihood of a logical goal, acting as a "shortcut" for the search process.

Results and Discussion

The authors evaluated DPLA* on tasks such as MNIST Addition, Handwritten Formulas (HWF), and CLUTRR. A primary finding is that optimizing for the "explanation probability" (the single best proof) often yields results nearly identical to exact inference at a fraction of the cost.

Scalability of DPLA* compared to exact inference methods

As shown in Figure 3, DPLA demonstrates massive speedups, often 2 to 3 orders of magnitude faster than exact inference. While standard DeepProbLog and NeurASP fail to scale beyond 3-digit addition, DPLA scales efficiently to 5 digits and beyond. Furthermore, the Geometric Mean (GM) heuristic significantly outperforms standard Uniform Cost Search (UCS), especially as problem complexity grows. On the HWF dataset, DPLA* outperformed specialized systems like NGS on long expressions, maintaining high accuracy where others failed to converge.

Conclusion

DPLA* effectively bridges the gap between neural perception and symbolic reasoning by replacing exhaustive inference with efficient, heuristic-driven search. While currently limited by a lack of support for logical negation and a dependency on heuristic quality, it represents a significant step toward scalable NeSy AI. Future work includes extending support to more complex logic features and exploring fully learned heuristics.

Summary updated

BibTeX
@inproceedings{manhaeve2021approximate,
  author = {Robin Manhaeve and Giuseppe Marra and Luc De Raedt},
  title = {{Approximate Inference for Neural Probabilistic Logic Programming}},
  booktitle = {KR},
  year = {2021},
  doi = {10.24963/kr.2021/45},
}
Figure