Learning differentiable logic programs for abstract visual reasoning

Hikaru Shindo, Viktor Pfanschilling, Devendra Singh Dhami, Kristian Kersting · DOI

Introduction

While deep learning models have achieved remarkable success in perceptual tasks, they often struggle with abstract, logical reasoning. Conversely, traditional symbolic AI excels at logic but falters when dealing with raw, high-dimensional visual data. Neuro-symbolic AI aims to combine these strengths. A prominent approach is Differentiable Inductive Logic Programming ($\partial$ILP), which embeds logical reasoning within neural networks. However, standard $\partial$ILP systems suffer from a severe memory bottleneck: they represent logic programs as dense tensors, leading to quadratic memory scaling that causes systems to crash on complex visual scenes.

This paper introduces NEUMANN (NEUro-symbolic Message pAssiNg reasoNer), a memory-efficient framework designed to learn interpretable logic programs directly from images. By transitioning from dense tensors to graph-based representations, NEUMANN enables neuro-symbolic reasoning to scale to sophisticated abstract tasks that were previously computationally infeasible.

Methodology: NEUMANN

NEUMANN addresses the limitations of existing differentiable logic systems through two primary innovations:

1. Graph-Based Forward Reasoning

Instead of encoding logical facts and rules in massive dense tensors, NEUMANN compiles logic programs into a bipartite Forward Reasoning Graph. In this graph, one set of nodes represents logical atoms (facts), and another represents conjunctions (rules). Reasoning is performed via message passing across the graph, simulating logical deduction. This shift reduces memory consumption from quadratic $\mathcal{O}(|G| \times |C^*|)$ to linear $\mathcal{O}(|G| + |C^*|)$, where $G$ is the number of ground atoms and $C^*$ is the number of clauses.

2. Gradient-Based Structure Learning

Traditional symbolic learning often relies on exhaustive or beam searches to find valid rules. NEUMANN streamlines this by using gradients as a search heuristic. It evaluates multiple candidate rules simultaneously; rules that contribute significantly to reducing the classification loss receive strong gradients. Using the Gumbel-max trick, NEUMANN differentiably selects and refines these promising rules, allowing it to navigate the vast search space of logic programs efficiently.

NEUMANN framework overview: Task 1 illustrates program induction from positive/negative examples, while Task 2 shows visual reasoning and "imagination" using the learned programs.

Experimental Evaluation

The authors evaluated NEUMANN on several benchmarks, including:

  • Kandinsky Patterns: Classifying images based on abstract geometric relations.
  • CLEVR-Hans: Testing for true logical reasoning versus reliance on spurious correlations.
  • CLEVR-List & Visual Reasoning Behind the Scenes: Two new benchmarks. CLEVR-List requires learning list operations (e.g., sort, delete) from visual data. "Behind the Scenes" tests "imagination"—answering queries about states that are not directly observed but must be inferred through learned logical operations.

Key Results

NEUMANN demonstrates significant improvements in efficiency and scalability:

  • Memory Efficiency: On Kandinsky tasks, NEUMANN used only 3.12% of the memory required by $\alpha$ILP, a state-of-the-art tensor-based reasoner.
  • Scalability: While previous systems crashed due to Out-Of-Memory (OOM) errors on scenes with many objects or complex list operations, NEUMANN maintained high performance, achieving 98-99% accuracy on the challenging "Behind the Scenes" benchmark.
  • Explainability: As an end-to-end differentiable system, NEUMANN provides "free" explainability. By tracing gradients back to the input pixels, the model can generate heatmaps that highlight the specific objects responsible for a logical conclusion.

Conclusion and Future Work

NEUMANN represents a step forward in scalable neuro-symbolic AI, proving that graph-based message passing can overcome the memory barriers of differentiable logic. Current limitations include a restriction to definite clauses and the use of pre-trained perception modules. Future research will focus on end-to-end training of perception and logic, as well as extending the framework to handle more complex logical structures and probabilistic reasoning.

Summary updated

BibTeX
@article{shindo2024learning,
  author = {Hikaru Shindo and Viktor Pfanschilling and Devendra Singh Dhami and Kristian Kersting},
  title = {{Learning differentiable logic programs for abstract visual reasoning}},
  journal = {Machine Learning},
  year = {2024},
  doi = {10.1007/s10994-024-06610-2},
}
Figure