← Latest papers
🤖 AI

Neuro-symbolic learning over OWL 2 DL via consequence-based compilation to differentiable circuits

This paper introduces Baobab, a neuro-symbolic learning framework that compiles full OWL 2 DL ontologies into differentiable Sentential Decision Diagrams to train perception networks under partial supervision, effectively overcoming reasoning shortcuts and achieving Bayes-optimal performance in non-Horn description logic tasks.

Original authors: Olga Mashkova, Asaad Mohammedsaleh, Fernando Zhapa-Camacho, Robert Hoehndorf

Published 2026-08-19
📖 8 min read🧠 Deep dive

Original authors: Olga Mashkova, Asaad Mohammedsaleh, Fernando Zhapa-Camacho, Robert Hoehndorf

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the vast landscape of artificial intelligence, two distinct traditions have long competed to make machines understand the world. One tradition, known as deep learning, excels at recognizing patterns in raw data, such as identifying a cat in a photograph or reading a handwritten number. It learns by adjusting millions of internal knobs until it gets the right answer, but it does so without a clear understanding of the rules governing the world. The other tradition, rooted in logic and knowledge representation, builds systems that reason with strict rules, like a digital encyclopedia that knows a "poodle" is a type of "dog" and that "dogs" are "mammals." This system is precise and reliable but often struggles to connect with the messy, unstructured reality of images and sounds. For years, researchers have tried to merge these two approaches, creating "neuro-symbolic" systems that can both see and reason. The challenge has been that the most powerful logical languages used to describe complex knowledge are incredibly difficult to translate into the mathematical language that neural networks use to learn.

A team of researchers at King Abdullah University of Science and Technology has developed a new method called Baobab that successfully bridges this gap for a specific, highly complex type of logical system. They created a compiler that takes a detailed logical description of a world—complete with rules about how things relate, how many things can exist, and how categories overlap—and translates it into a structure that a neural network can use to learn. Unlike previous attempts that either simplified the logical rules too much or abandoned them entirely, this method preserves the full complexity of the original rules. The researchers tested their system by asking a neural network to look at images of handwritten digits and figure out not just the numbers, but also hidden logical properties like whether a number is prime or even, based solely on a set of logical rules provided to the machine. The system learned to identify these hidden concepts with high accuracy, even when the images themselves provided no direct clues about them.

The core of this achievement lies in how the researchers handled the translation process. They took a logical knowledge base, which is essentially a collection of statements about how concepts relate to one another, and compiled it into a specific type of circuit diagram. This diagram acts as a filter, checking whether the predictions made by the neural network make sense according to the logical rules. If the network predicts that a number is both even and prime (which is only true for the number two), the circuit allows it. If it predicts a number is both even and odd, the circuit rejects that possibility. By running this check millions of times, the system can guide the neural network to learn the correct logical relationships, even when the images it sees do not explicitly label those relationships. The researchers proved that this translation is mathematically sound, meaning the circuit accurately reflects the original logical rules without losing any information or introducing errors.

One of the most significant findings of the study concerns a common problem in these hybrid systems known as a "reasoning shortcut." When a machine is given a task with multiple possible correct answers, it often finds a way to solve the problem by picking just one answer and ignoring the others, effectively bypassing the logical system. For example, if a rule allows for several different configurations of a scene, a standard neural network might lock onto a single configuration and fail to recognize that other valid configurations exist. The researchers discovered that their new method, when combined with a specific technique of seeding the network with all possible valid configurations, could overcome this shortcut. Instead of collapsing onto a single, potentially wrong answer, the system learned to maintain a probability distribution over all the correct possibilities, achieving a level of accuracy that no previous method had reached for this type of complex logic.

The team demonstrated the power of their approach using two distinct datasets. In one experiment, they used images of handwritten digits from the MNIST dataset. They set up a logical system where digits were linked in a chain, such that if one number was followed by another, a specific relationship had to hold. The neural network was shown pairs of images but was never told the actual numbers. Instead, it was given a few logical clues, such as knowing that one number was even and the other was prime. Through the logical circuit, the network learned to infer the exact identity of the digits with nearly perfect accuracy, rising from a random guess rate of 25 percent to 99 percent. In a second experiment, they applied the same method to a dataset of synthetic pizza images. The system learned to identify hidden categories of pizzas, such as "vegetarian" or "spicy," based on the toppings visible in the image and the logical rules defining those categories, again outperforming systems that did not use the logical circuit.

The researchers also showed that their method works with the full, complex version of the logical language used in biomedical databases and the Semantic Web, which includes features like rules about how many items can be connected and rules about the direction of relationships. Previous attempts to use neural networks with this level of complexity had to simplify the rules so much that they lost their meaning. Baobab, however, handled the full complexity without simplification. The team verified the correctness of their compiler using a formal proof system, a rigorous mathematical check that ensures the translation from logic to circuit is flawless. They also compared their system to existing methods and found that a significant portion of the logical rules used in their experiments could not be handled by those older methods, which were limited to simpler, less expressive forms of logic.

A critical part of the study involved addressing the issue of multiple valid answers. In many real-world scenarios, the information provided is not enough to determine a single unique solution. For instance, if a rule states that a person is either male or female, and we know they are married to someone of the opposite sex, there are still two valid possibilities for the genders of the couple. Standard neural networks often fail here, arbitrarily picking one possibility and treating it as the only truth. The researchers found that by using a mixture of different logical paths, each corresponding to a valid possibility, their system could represent all the correct answers simultaneously. This allowed the system to provide a calibrated probability for each outcome, reflecting the true uncertainty in the data rather than forcing a false certainty. This capability is essential for applications in fields like medicine, where understanding the range of possible diagnoses is just as important as identifying a single one.

The work also highlighted the practical limits of such systems. While the method is powerful, the size of the logical circuit grows rapidly as the complexity of the problem increases. In one test involving a full ontology of pizza types, the researchers found that compiling the complete set of rules into a circuit required more memory than was available on a standard computer, forcing them to use a simplified subset of the rules for the final training. This suggests that while the method is theoretically sound and effective for many problems, scaling it to the largest, most complex knowledge bases will require further engineering advances. Nevertheless, the successful application to the simplified pizza dataset and the digit recognition task proves that the approach is viable and effective for real-world data.

The implications of this research extend beyond just better image recognition. It offers a pathway for artificial intelligence to integrate the rich, structured knowledge found in scientific databases directly into the learning process of neural networks. This means that future AI systems could learn from images while simultaneously adhering to the strict, verified rules of biology, chemistry, or physics. By ensuring that the machine's predictions are always consistent with established scientific knowledge, this approach could lead to more reliable and trustworthy AI, particularly in high-stakes fields where errors can have serious consequences. The researchers have made their code and tools available to the public, inviting others to build upon this foundation and explore how far this integration of logic and learning can go.

Ultimately, the study demonstrates that the gap between pattern recognition and logical reasoning can be closed without sacrificing the strengths of either approach. By translating complex logical rules into a format that neural networks can process, the researchers have created a system that learns not just from data, but from the structure of knowledge itself. The ability to recover hidden concepts, avoid reasoning shortcuts, and handle the full complexity of modern logical languages marks a significant step forward in the quest to build machines that truly understand the world they observe. The results suggest that with the right tools, artificial intelligence can move beyond simply recognizing patterns to genuinely reasoning about the relationships and rules that govern them.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →