Skip to main content
QUICK REVIEW

[Paper Review] NeurASP: Embracing Neural Networks into Answer Set Programming

Zhun Yang, Adam Ishay|arXiv (Cornell University)|Jul 15, 2023
Multi-Agent Systems and NegotiationComputer Science3 citations
TL;DR

NeurASP introduces a novel integration of neural networks with Answer Set Programming (ASP) by treating neural network outputs as probabilistic distributions over atomic facts, enabling hybrid sub-symbolic and symbolic reasoning. It enhances perception robustness through symbolic constraints and improves neural network training via rule-based semantic regularization, achieving high accuracy with minimal data in tasks like Sudoku and shortest path prediction.

ABSTRACT

We present NeurASP, a simple extension of answer set programs by embracing neural networks. By treating the neural network output as the probability distribution over atomic facts in answer set programs, NeurASP provides a simple and effective way to integrate sub-symbolic and symbolic computation. We demonstrate how NeurASP can make use of a pre-trained neural network in symbolic computation and how it can improve the neural network's perception result by applying symbolic reasoning in answer set programming. Also, NeurASP can be used to train a neural network better by training with ASP rules so that a neural network not only learns from implicit correlations from the data but also from the explicit complex semantic constraints expressed by the rules.

Motivation & Objective

  • To address the challenge of integrating low-level perception with high-level reasoning in AI by combining neural networks and symbolic logic.
  • To enable neural networks to leverage symbolic constraints for improved robustness and generalization, especially in data-scarce scenarios.
  • To allow symbolic reasoning to correct neural perception errors by enforcing semantic and structural constraints.
  • To enhance neural network training by incorporating explicit semantic rules as regularization, reducing reliance on large labeled datasets.
  • To provide a flexible, extensible framework that supports complex reasoning constructs (e.g., defaults, aggregates, optimization) within a neuro-symbolic system.

Proposed method

  • Neural network outputs are modeled as probability distributions over atomic facts using neural atoms of the form |nn(m(e,t),[v1,…,vn])|, where m is a neural network identifier and t is an input pointer.
  • The system integrates neural outputs into ASP by treating them as probabilistic facts, enabling stable model computation via standard ASP solvers.
  • Symbolic reasoning is applied to detect and correct perception errors—e.g., invalid Sudoku configurations or inconsistent object relations—by enforcing domain constraints.
  • Neural network training is enhanced by backpropagating semantic loss from ASP reasoning through neural atoms, using rule-based constraints as implicit regularizers.
  • The framework supports complex ASP constructs such as default reasoning, aggregates, and optimization rules, enabling richer knowledge representation than prior neuro-symbolic models.
  • Training data can be arbitrary propositional formulas, not limited to single atoms, increasing flexibility compared to models like DeepProbLog.

Experimental results

Research questions

  • RQ1Can symbolic reasoning improve the robustness of neural network perception by detecting and correcting violations of semantic constraints?
  • RQ2How effectively can ASP rules serve as a semantic regularizer to improve neural network generalization, especially with limited training data?
  • RQ3To what extent does integrating neural outputs into ASP enhance performance on reasoning-intensive tasks like Sudoku or shortest path problems?
  • RQ4How does NeurASP compare to existing neuro-symbolic frameworks in terms of expressiveness, scalability, and training efficiency?
  • RQ5Can the framework be extended to handle dynamic or context-sensitive constraints, such as those involving randomly removed edges in graph problems?

Key findings

  • In the shortest path task, using ASP rules (p-r-o) increased prediction accuracy to 100% for the 'r' constraint, compared to only 96.6% with MLP alone.
  • When training with rules including 'nr' (randomly removed edges), the model achieved 70.5% accuracy on the 'nr' constraint, significantly outperforming the 32.9% baseline without rules.
  • For Sudoku digit recognition, NeurASP enabled correct puzzle solving even when the neural network misclassified digits, by enforcing Sudoku’s uniqueness constraints via ASP.
  • The framework reduced the need for large-scale training data, as demonstrated by high accuracy (e.g., 100%) in rule-augmented training with minimal data.
  • NeurASP outperformed baseline MLPs in all constraint categories, with the highest improvement seen in complex, multi-constraint scenarios (e.g., p-r-o-nr), where accuracy rose from 23.0% to 45.7% with rule integration.
  • The semantic loss from ASP reasoning was successfully backpropagated into neural networks, enabling rule-informed learning that improved generalization beyond data-driven patterns.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.