Baobab: compiling SROIQ ontologies into differentiable schemas for training neural networks with logic preservation

30 August 202616 views

Baobab's novel approach translates OWL 2 DL ontologies into differentiable SDD schemas via a consequence calculus, enabling perceptual models to be trained on real data under logical constraints. The authors demonstrate how this mitigates reasoning shortcuts and brings posterior estimates closer to Bayes-optimal ones.

Baobab: compiling SROIQ ontologies into differentiable schemas for training neural networks with logic preservation

What's wrong with neuro-symbolic learning on description logics

OWL 2 DL ontologies, based on the SROIQ description logic, have long been a working tool in biomedicine and on the Semantic Web — they make it possible to compactly describe large knowledge bases. But when it comes to training neural networks using such ontologies, problems begin. Classical approaches either "blur" the logic by embedding the ontology into continuous vector spaces, which loses strict logical entailment, or they are limited to the Horn fragment EL++, which has only one canonical model. As a result, expressive ontologies often remain inaccessible to hybrid systems.

Compiling an ontology into a differentiable scheme

The Baobab system offers not to compromise: it compiles a full SROIQ ontology with a finite ABox into a Sentential Decision Diagram (SDD). The process proceeds in two stages: first, the propositional core is saturated using a consequence-based calculus, then SROIQ-specific constructs — nominals, role cardinality restrictions, and role axioms — are instantiated on the active domain. The output is a scheme over which weighted model counting (WMC) can be performed. It is WMC that becomes the link between the neural network and the logical constraints.

Training a neural network while preserving logic

Weighted model counting over the SDD, taking evidence into account, allows training a perception network — for example, a convolutional neural network — to recognize images even when only part of the data is labeled in the ABox. In the experiment, the authors built an ontology that engages all the distinctive features of SROIQ and trained a CNN to recognize MNIST digits linked by a succession relation. The network did not just classify images — it recovered latent ontological concepts. With independently trained perception, such concepts remain at chance level, but here they were learned thanks to the logical constraints.

Reasoning shortcuts and calibrated posterior

When the supervisory signal admits several possible completions equally consistent with the ontology, an independently trained network often "collapses" to one of them. The authors call this phenomenon a reasoning shortcut. The paper shows that a mixture indexed by query justifications can represent a calibrated posterior — something unattainable for a single model. Moreover, initializing such a mixture from the enumerated completions of the scheme yields a Bayes-optimal posterior on the MNIST task with real images. For comparison, a single WMC and trained ensemble mixtures do not achieve this result.

Correctness verification and availability

The authors note that this is the first work in which reasoning shortcuts are characterized and mitigated for a non-Horn description logic. The correctness of the compiler and the representability result are machine-checked in Lean 4 — a strong argument for the reliability of the approach. The system's code is open, so the results can be reproduced and extended.

Conclusion

Baobab shows that one does not have to sacrifice the expressiveness of description logic for trainability. Compiling SROIQ into a differentiable scheme preserves logical entailments and at the same time makes it possible to train neural networks on real data. And solving the reasoning shortcut problem via justification-indexed mixtures is an important step toward more reliable and calibrated hybrid models.

Frequently asked questions

Related materials

All materials
Validating Candidates Costs More Than Generating Them: Honeypots Against LLM Vulnerability Hunting
News

Validating Candidates Costs More Than Generating Them: Honeypots Against LLM Vulnerability Hunting

The study examines the cost asymmetry in agentic vulnerability discovery: generating candidate versions is cheap, while confirming them through reachability analysis, execution, and PoC development consumes most of the budget, making verification a potential standalone target for defense. The proposed RedHerring—repository-adapted decoys with a hidden certificate—reduced the number of real vulnerabilities found by 38.7–60.4% at equal cost across 33 OSS-Fuzz projects; even after the agent was warned, the reduction remained at 37.2%.

9 November 2026
Checking LLM Hallucinations via SQL-Based Source Representation Without Fine-Tuning
News

Checking LLM Hallucinations via SQL-Based Source Representation Without Fine-Tuning

The study examines whether an LLM can apply a basic symbolic skill—building a SQL database from source documents—to ground its outputs in sources without supervision when detecting hallucinations. On RAGTruth and DiaHalu, this neuro-symbolic pipeline proves more accurate than direct prediction and comparable to state-of-the-art methods, without requiring domain-specific fine-tuning.

9 November 2026
MathAdv: What the Final Accuracy of Machine-Generated Proofs Conceals
News

MathAdv: What the Final Accuracy of Machine-Generated Proofs Conceals

A diagnostic suite of tasks spanning 13 undergraduate and graduate mathematics topics evaluates machine-proving systems in Lean 4 not only by their final results, but also by their subject-matter mastery, the quality of their informal reasoning, and their robustness to rephrased conditions. A component-by-component analysis shows that translating a problem into formal form remains the main obstacle, and that success depends heavily on the area of mathematics and how the problem is framed.

9 November 2026
Baobab: compiling SROIQ ontologies into differentiable schemas for training neural networks with logic preservation