Answer Set Networks: Casting Answer Set Programming into Deep Learning

Arseny Skryagin, Daniel Ochs, Phillip Deibert, Simon Kohaut, Devendra Singh Dhami, Kristian KerstingarXiv 2024 · DOI

Introduction

Neuro-Symbolic (NeSy) AI represents a frontier in artificial intelligence, aiming to combine the perceptual strengths of deep learning with the rigorous, explainable reasoning of symbolic logic. However, a significant "hardware gap" has historically hindered this integration. While neural networks are designed for the massive parallelism of Graphics Processing Units (GPUs), state-of-the-art logic solvers, such as clingo, are primarily CPU-bound and rely on sequential search tree algorithms.

This computational mismatch creates a bottleneck: when a deep learning model must consult a logic program—for instance, to verify a drone's flight path against aviation regulations—the system must pause its GPU operations to perform a symbolic search on the CPU. Answer Set Networks (ASN) address this by compiling Answer Set Programming (ASP) directly into Graph Neural Networks (GNNs), effectively moving logical reasoning from the CPU to the GPU.

The ASN Framework

ASN translates logical programs into a neural architecture through a four-step process that re-imagines logic as a flow problem on a graph.

The ASN pipeline: from ASP program to solutions via neural compilation, choice definitization, message passing, and model reduction.

1. Neural Compilation

In the first stage, a grounded ASP program is converted into a Reasoning Graph (RG). In this representation, logical atoms, rules, and aggregates (such as #sum or #count) are mapped to nodes, while the logical dependencies between them become edges. This transformation allows the structure of the logic program to dictate the topology of the neural network.

An example of a reasoning graph mapping a logical rule (a :- -b1, b2) into a node-and-edge structure.

2. Choice Definitization

ASP programs often contain "choices" (e.g., "A or B could be true"). To handle this non-determinism, ASN creates parallel instances of the Reasoning Graph. Each instance represents a different potential logical path, allowing the system to explore multiple solutions simultaneously in a single GPU batch.

3. Message Passing

Rather than performing a traditional tree search, ASN utilizes GNN-style message passing. Truth values propagate through the graph from "source" nodes (representing facts) to "sink" nodes (representing constraints). This allows the entire reasoning process to benefit from the high-throughput parallel processing of modern AI hardware.

4. Model Reduction

Finally, the system employs efficient bit-wise operations to filter the results. This ensures that the generated solutions adhere to "stable model" semantics, which is the formal standard for correctness in Answer Set Programming.

Experimental Evaluation

The authors evaluated ASN across three diverse domains to demonstrate its versatility and performance:

  • ProMis Paris (City-Scale Navigation): Using geographic data from OpenStreetMap covering 169 km² of Paris, the system was tasked with generating safety maps based on complex aviation laws.
  • The Reversal Curse: Testing the ability of Large Language Models (LLMs) to infer symmetric relationships (e.g., if "A is the mother of B," then "B is the child of A").
  • MNIST-Addition: A standard benchmark requiring a model to learn arithmetic from handwritten digits without explicit labels for the digits themselves.

Key Results and Impact

ASN demonstrates transformative performance improvements over traditional CPU-based symbolic solvers:

  • Massive Speedups: In the Paris navigation task, ASN rendered a full safety map in just 56 minutes. Traditional solvers were estimated to take between 5 and 7 days for the same task—a speedup of approximately 200x.
  • Solving the "Reversal Curse": By using ASN for abductive fine-tuning, the logic layer provides an "inverse signal" during training. When fine-tuning Llama2-7B, ASN-guided training reached convergence in only 9 epochs, compared to the 96 epochs required by the baseline.
  • Scalability: On the MNIST-Addition benchmark, ASN outperformed the previous state-of-the-art NeSy solver (SAME) by a factor of 2.7x and was orders of magnitude faster than DeepProbLog.

Conclusion

By casting logic as a graph-based flow problem, Answer Set Networks bridge the hardware gap between symbolic and neural AI. This framework enables the execution of complex logical reasoning at the scale required for real-world applications, from autonomous urban navigation to improving the fundamental reasoning capabilities of Large Language Models. Future work aims to reduce the memory footprint of choice definitization and explore fully differentiable weighted model semantics for even tighter integration with gradient-based optimization.

Summary updated

BibTeX
@misc{skryagin2024answer,
  author = {Arseny Skryagin and Daniel Ochs and Phillip Deibert and Simon Kohaut and Devendra Singh Dhami and Kristian Kersting},
  title = {{Answer Set Networks: Casting Answer Set Programming into Deep Learning}},
  year = {2024},
  eprint = {2412.14814},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.14814},
}
Figure