On the Hardness of Probabilistic Neurosymbolic Learning

Jaron Maene, Vincent Derkinderen, Luc De Raedt

Abstract

Probabilistic neurosymbolic (NeSy) learning integrates the learning power of neural networks with the formal reasoning of symbolic logic. A major bottleneck in training these models is differentiating through logical constraints, a task equivalent to #P-hard weighted model counting. This paper provides a complexity analysis of gradient approximation in NeSy models, proving that while generally intractable, the problem becomes easier as the model gains confidence during training. We introduce WeightME, an unbiased gradient estimator based on weighted model sampling that provides theoretical guarantees with a logarithmic number of calls to a SAT solver.

Introduction

Neurosymbolic AI seeks to combine the raw learning capabilities of deep neural networks with the rigorous reasoning of symbolic logic. Training such systems typically involves gradient descent, which requires calculating how changes in a network's output probabilities affect logical outcomes. This process, known as differentiating probabilistic reasoning, is computationally intensive and often intractable in the general case, falling into the #P complexity class.

Complexity and Tractability

The authors demonstrate that approximating gradients with probabilistic guarantees (PAC learning) is NP-hard. However, they identify a significant "silver lining": as a neural network learns and its outputs move toward binary values (0 or 1), the gradient approximation problem becomes tractable. This "confidence shortcut" implies that the computational difficulty of training NeSy models decreases as the model becomes more certain of its predictions.

Gradient quality (cosine similarity) improves alongside training likelihood, illustrating the 'confidence shortcut'.

Methods: WeightME and Gradient Estimation

To overcome the limitations of biased approximation methods, the authors propose WeightME (Weighted Model Estimator). WeightME is an unbiased gradient estimator that leverages weighted model sampling. Unlike standard sampling techniques that may fail to find valid logical models in high-dimensional spaces (the "needle in a haystack" problem), WeightME samples directly from the set of valid interpretations. The method is theoretically efficient for many problems, requiring only $O(\log n)$ calls to a SAT oracle.

A comparison of gradient estimation methods, highlighting trade-offs between bias, determinism, and complexity.

Key Results and Insights

The researchers evaluated their approach using the MNIST-addition task, Model Counting Competition (MCC) benchmarks, and the ROAD-R autonomous driving dataset. Key findings include:

  • Gradient Accuracy: At initialization, when the problem is hardest, WeightME significantly outperformed existing methods, achieving a cosine similarity to the true gradient between 0.78 and 0.95.
  • Failure of Biased Heuristics: Popular biased methods, such as fuzzy t-norms, Gumbel-Softmax, and Straight-Through Estimators, often failed to reach global optima even on benchmarks where exact solutions were possible.
  • The Role of Variance: The authors argue that low variance is not a sufficient metric for estimator quality; instead, researchers should focus on relative error and $(\epsilon, \delta)$-approximations to ensure reliable learning.

Conclusion and Future Work

This research bridges the gap between the theoretical complexity of logic and the practical requirements of deep learning. By proving that training itself can simplify the reasoning task, the authors provide a more rigorous foundation for neurosymbolic systems. Future research directions include extending these results to first-order logic and addressing the "cold start" problem, where initial random weights make finding valid models difficult for any estimator.

Summary updated

BibTeX
@inproceedings{maene2024hardness,
  author = {Jaron Maene and Vincent Derkinderen and Luc De Raedt},
  title = {{On the Hardness of Probabilistic Neurosymbolic Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=vxPmrxKe0J},
}
Figure