Abstract
Humans have the ability to seamlessly combine low-level visual input with high-level symbolic reasoning, often in the form of recognizing objects, learning relations between them, and applying rules. Neuro-symbolic systems aim to bring a unifying approach to connectionist and logic-based principles for visual processing and abstract reasoning, respectively. This paper presents a complete neuro-symbolic method for processing images into objects, learning relations, and logical rules in an end-to-end fashion. The main contribution is a differentiable layer in a deep learning architecture from which symbolic relations and rules can be extracted by pruning and thresholding. We evaluate our model using two datasets: a subgraph isomorphism task for symbolic rule learning and an image classification domain with compound relations for learning objects, relations, and rules. We demonstrate that our model scales beyond state-of-the-art symbolic learners and outperforms deep relational neural network architectures.
Introduction
In the quest for Artificial General Intelligence, researchers have long struggled to marry the "System 1" perception of neural networks with the "System 2" reasoning of symbolic logic. Neural networks excel at processing raw sensory data like images but struggle with transparent, rule-based reasoning. Conversely, symbolic systems are masters of logic but fail when faced with the messy, continuous nature of the real world.
A new paper from Imperial College London, "pix2rule: End-to-end Neuro-symbolic Rule Learning," introduces a novel architecture that bridges this gap, allowing a model to learn everything from raw pixels to high-level logical rules in a single, differentiable pipeline. The framework transforms images into objects, identifies their relations, and learns logical rules using a novel "Semi-symbolic Layer."
Problem Statement
Traditional neuro-symbolic systems often rely on a "hand-off": a neural network handles perception (e.g., "this is a cat"), and a separate symbolic engine handles the logic. This creates a bottleneck: the symbolic part usually isn't differentiable, meaning you can't easily train the whole system at once.
Furthermore, implementing logic gates (AND/OR) directly in neural networks using "fuzzy logic" (t-norms) often leads to vanishing gradients. If a conjunction has many inputs and just one is "false," the gradient effectively dies, making it nearly impossible for upstream layers (like a CNN) to learn what features matter. The authors tackle the challenge of creating a logic layer that is both differentiable and capable of converging into crisp, symbolic rules.
Methodology
The core innovation is the Semi-symbolic Layer (SL). Inspired by the classic perceptron, the authors define a specific inductive bias by constraining the layer's bias term ($\beta$). By adjusting $\beta$ based on the maximum and sum of weights, the layer can be forced to behave like an AND gate or an OR gate.
Crucially, they use a "semantic gate selector" ($\delta$) that gradually shifts the layer from a standard linear layer to a strict logic gate during training. This prevents gradient starvation early on. To learn complex rules, they stack these layers into a Disjunctive Normal Form (DNF) structure—essentially a layer of ANDs followed by a layer of ORs. For visual tasks, the model uses a CNN to extract patches, a Gumbel-Softmax attention mechanism to select "objects," and an MLP to define relations between those objects. After training, the authors apply a post-training regime where they prune weak weights and threshold the rest to extract pure symbolic formulas that can be run in standard logic solvers.
Experimental Evaluation
The authors evaluated pix2rule on two distinct challenges:
- Subgraph Set Isomorphism: A symbolic dataset where the model must decide if a graph contains specific subgraphs. This is an NP-complete problem used to test the scalability of the rule-learning component.
- Relations Game: A visual reasoning dataset involving shapes and colors. The model must learn compound relations like "Between" (is object A between B and C?) or "Same" (are these two objects identical?). They tested this on "Pentominoes" (5-pixel shapes) and evaluated generalization on "Hexominoes" (6-pixel shapes) and striped patterns.
Key Results
- Superior Scaling: On the Subgraph Isomorphism task, pix2rule achieved 100% accuracy on "Hard" settings where state-of-the-art symbolic learners (like ILASP or FastLAS) timed out after 16 hours. It scales linearly with iterations, making it practical for large-scale combinatorial problems.
- Visual Reasoning: In the Relations Game, pix2rule outperformed PrediNet, a popular deep relational architecture. It showed remarkable data efficiency, matching or beating baselines even when trained on only 100 examples.
- Robustness: The model maintained high accuracy (above 90%) even when 15% of the input truth values were randomly flipped (noise), demonstrating that the fuzzy-to-crisp transition helps the model ignore outliers.
Discussion and Conclusion
The SL layer's primary advantage is that it doesn't need complex t-norms to do logic. By cleverly constraining the bias of a standard linear layer, it maintains a healthy gradient flow while still reaching a state where the weights represent clear logical connections. The model successfully learned to identify objects and their relations simultaneously with the rules governing them. It didn't need pre-defined labels for what "between" or "same" meant; it discovered these concepts to satisfy the final classification goal.
While powerful, pix2rule has its hurdles. With very small datasets, the neural-based formulation is still prone to overfitting compared to pure symbolic methods. Additionally, the process of turning continuous weights into discrete symbolic logic (thresholding) can sometimes break a functioning model if weights haven't saturated enough. Future work could focus on "disentangling" learned features to make the entire pipeline truly transparent, potentially applying this differentiable logic to reinforcement learning domains.
Summary updated