Abstract
Neural-symbolic AI (NeSy) allows neural networks to exploit symbolic background knowledge in the form of logic. It has been shown to aid learning in the limited data regime and to facilitate inference on out-of-distribution data. Probabilistic NeSy focuses on integrating neural networks with both logic and probability theory, which additionally allows learning under uncertainty. A major limitation of current probabilistic NeSy systems, such as DeepProbLog, is their restriction to finite probability distributions, i.e., discrete random variables. In contrast, deep probabilistic programming (DPP) excels in modelling and optimising continuous probability distributions. Hence, we introduce DeepSeaProbLog, a neural probabilistic logic programming language that incorporates DPP techniques into NeSy. Doing so results in the support of inference and learning of both discrete and continuous probability distributions under logical constraints. Our main contributions are 1) the semantics of DeepSeaProbLog and its corresponding inference algorithm, 2) a proven asymptotically unbiased learning algorithm, and 3) a series of experiments that illustrate the versatility of our approach.
Introduction
The field of Neural-Symbolic AI (NeSy) aims to bridge the gap between the "low-level" perception of neural networks and the "high-level" reasoning of symbolic logic. While existing systems like DeepProbLog have successfully integrated neural networks with discrete logic, they remain limited by their inability to handle continuous variables. In real-world scenarios, reasoning often involves continuous values, such as temperature readings, spatial coordinates, or physical measurements.
Conversely, Deep Probabilistic Programming (DPP) is highly effective at modeling continuous distributions but lacks the structured relational reasoning capabilities found in logic. DeepSeaProbLog addresses this "DPP-NeSy gap" by introducing a framework that handles both discrete and continuous random variables while maintaining the expressive power of logical constraints.
Methods
DeepSeaProbLog (where "Sea" represents 'C' for continuous) introduces several key components to enable hybrid reasoning:
- Neural Distributional Facts (NDFs): These allow neural networks to parameterize probability distributions. For example, a CNN can predict the mean and variance of a Gaussian distribution representing an object's position.
- Probabilistic Comparison Formulas (PCFs): These enable logic to reason about continuous variables using operators like
>or<. This allows for rules such as "the weather is pleasant if the temperature is between 15 and 25 degrees." - Inference via Weighted Model Integration (WMI): To compute probabilities in this hybrid space, the system utilizes WMI, which combines symbolic knowledge compilation for logical reasoning with sampling techniques to handle continuous integrals.
To facilitate end-to-end training, the authors employ the reparameterization trick and continuous relaxations. Hard logical comparisons (step functions) are "softened" into differentiable sigmoids, allowing gradients to flow from logical constraints back into the neural networks. The authors provide a theoretical proof that this gradient estimate is asymptotically unbiased as the relaxation parameter is annealed.
Experimental Evaluation
The system was evaluated across three distinct tasks designed to test its hybrid reasoning capabilities:
- Handwritten Years: A dataset where four MNIST-like digits are placed randomly in an image. The model is supervised only by the 4-digit year label, not the digit locations. This tests the model's ability to perform localization through logical constraints.
- Neural Hybrid Bayesian Networks: This task uses a meteorological dataset for temperatures combined with CIFAR-10 images acting as proxies for weather conditions (e.g., cloudy or humid). The goal is to perform density estimation under distant supervision.
- Neural-Symbolic VAE: Using the MNIST dataset, the model performs generative tasks based on the subtraction of two digit images, testing its ability to maintain consistency across logical operations.
Key Results and Insights
DeepSeaProbLog demonstrates significant improvements over purely neural or traditional NeSy baselines. In the Handwritten Years task, the system achieved 93.77% accuracy, compared to 54.71% for a standard neural baseline and 76.50% for Logic Tensor Networks. Notably, the model achieved high Intersection-over-Union (IoU) for digit localization despite never seeing a bounding box during training, effectively using logic as a form of attention.
Furthermore, the system showed strong Zero-Shot Generative Reasoning. Because the logic is decoupled from the neural architecture, a model trained to subtract digits can be queried in reverse (e.g., solving $X - Y = 5$ for $X$) without additional training. This highlights the flexibility of the symbolic-probabilistic bridge.
Conclusion and Future Work
DeepSeaProbLog represents a strict generalization of DeepProbLog, extending NeSy to continuous domains. By treating logical constraints as a differentiable bridge, it enables complex reasoning in hybrid environments.
However, challenges remain. The use of continuous relaxations introduces bias that requires careful annealing schedules. Additionally, while the inference algorithm is effective, Weighted Model Integration is computationally intensive. Future research will focus on scaling these methods to larger logical theories and integrating more advanced variational inference techniques directly into the logical solver.
Summary updated