Neuro-symbolic learning over OWL 2 DL via consequence-based compilation to differentiable circuits
Authors: Olga Mashkova, Asaad Mohammedsaleh, Fernando Zhapa-Camacho, Robert Hoehndorf
Organizations: Computer Science Program, Computer, Electrical, and Mathematical Sciences & Engineering Division, King Abdullah University of Science and Technology, Thuwal 23955, Saudi Arabia
OWL 2 DL ontologies, grounded in the description logic SROIQ, express large knowledge bases in biomedicine and the Semantic Web. Neuro-symbolic (NeSy) learners over description logics either embed the ontology in a continuous space, abandoning classical entailment, or restrict to the Horn fragment EL++, which has a single canonical model. We present Baobab, which compiles a SROIQ ontology with a finite ABox into a Sentential Decision Diagram (SDD): it saturates a propositional core under a consequence-based calculus and instantiates the remaining SROIQ features (nominals, number restrictions, and the role axioms) over the active domain. The SDD's evidence-conditioned weighted model count then trains a perception network to recognize real images under partial ABox supervision: on an ontology that exercises every distinctive SROIQ feature, a CNN learns to read MNIST digits coupled by a successor relation and recovers latent ontology concepts that an independent perception leaves at chance. When the supervision admits several ontology-consistent completions, an independent perception collapses onto one, a reasoning shortcut: we show that a mixture indexed by the query's justifications can represent the calibrated posterior no independent perception can, and that seeding it from the circuit's enumerated completions attains the Bayes-optimal posterior on a real-image MNIST task where single-WMC and learned mixtures (the BEARS-ensemble hypothesis class) do not: to our knowledge the first to characterize and mitigate reasoning shortcuts in a non-Horn description logic. Soundness of the compiler and the representation result are machine-checked in Lean 4. Code is available at https://github.com/bio-ontology-research-group/baobab.
Figures & tables
regime
method
digit
latent
viol ↓
ECE ↓
grounded ( #RS=1 )
Independent
0.25±.09
0.49±.14
0.80±.12
0.33±.14
WMC
0.99±.00
1.00±.00
0.02±.01
0.00±.00
under-det. ( #RS=5 )
Independent
0.20±.03
0.46±.10
0.93±.10
0.08±.08
WMC
0.18±.07
0.67±.03
0.78±.05
0.15±.02
Table 1: MNIST- SROIQ , mean ± std over ten seeds (metrics in § 4 ; digit identities never supervised). Grounding the concept evidence collapses #RS from 5 to 1 .
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
feature
emitted ground clauses
count
nominal Noma
Noma(a) ; ¬Noma(b) , b=a
d
≥nR.C at x
Q(a)↔⋁∣S∣=n⋀y∈SR(a,y)∧C(y)
d((nd)+1)
≤nR.C at x
Q(a)↔⋀∣T∣=n+1(⋀y∈TR(a,y)∧C(y)→⋁i<jyi≈yj)
O(dn+1)
inverse R≡S−
R(a,b)↔S(b,a)
2d2
Trans(R)
R(a,b)∧R(b,c)→R(a,c)
d3−d
chain R1∘…∘Rk⊑S
R1(a0,a1)∧⋯∧Rk(ak−1,ak)→S(a0,ak)
dk+1
Appendix
Table 2: Grounding schemata over the active domain Δ , d=∣Δ∣ . a,b,c range over Δ ; (nd) is the n -subset count.
refinement
method
topping
property
viol ↓
closed
Independent
0.95±.01
0.45±.15
0.89±.18
closed
WMC
0.93±.01
0.92±.02
0.06±.02
open
Independent
0.95±.01
0.45±.16
0.86±.28
open
WMC
0.95±.01
0.78±.01
0.00±.00
Appendix
Table 3: Closed-world ablation on the Pizzaiolo fragment (mean ± std over ten seeds, five epochs; same fragment and metrics as Table 7 ). Closed materializes the exact biconditional X(a)⇔⨆thasTopping(a,t)⊓C(t) ; open keeps the forward direction X(a)→∃hasTopping.C only, dropping the closure clause ∃hasTopping.C→X(a) . Removing the closure clause leaves supervised toppings untouched but lowers latent property recovery from 0.92 to 0.78 ; the reported violation falls to 0.00 because the removed clause is the constraint whose violation was counted (§ 4.1 ).
clauses
fixed vtree
minimized
ontology
unsat → sat
unsat = sat
unsat
sat
horn-chain
3→6
10
8
8
disjunction
7→12
23
17
12
two-disjunctions
11→29
38
22
18
exists+disjunction
8→73
73
41
36
bird-penguin
11→44
1011
139
143
Appendix
Table 4: Effect of saturation on SDD node count, measured with the accompanying library. Saturation adds entailed clauses (column clauses ) without changing the atom set. Over a fixed vtree the size is identical with and without saturation (Theorem 0.F.1 ); under dynamic vtree minimization it usually shrinks but is not guaranteed to ( bird-penguin ).
toppings ( ∣Δ∣ )
atoms
clauses
ground (s)
SDD nodes
peak mem
1 ( ∣Δ∣=2 )
201
638
0.04
3,182
0.7 GB
2 ( ∣Δ∣=3 )
302
957
0.19
12,064
5.7 GB
3 ( ∣Δ∣=4 )
403
1,276
0.01
—
>22 GB †
Appendix
Table 5: Compiling the full Pizzaïolo SROIQ ontology ( 66 named classes, 90 existential and 44 universal restrictions, right-hand-side disjunctions on Pizza and SpicyPizza ) over a growing active domain, with a fixed vtree throughout. Grounding stays sub-second at every size; the compiled SDD grows super-linearly and exceeds a 22 GB / 600 s budget at three toppings. The 59 -atom two-topping fragment of § 4.1 is a separately extracted role-based sub-signature, not a row here.
experiment
feat. dim
hidden
epochs
λ
κ
K
MNIST (CNN)
282
CNN
12
0.5
–
–
Pizzaiolo frag. (ResNet-18)
2242
linear head
5
0.5
–
–
Pizza (synthetic)
12
64
10
0.3
–
–
MNIST-Disj. (CNN)
282
CNN
20
0.5
2.0
4
Appendix
Table 6: Hyperparameters (Adam; learning rates and batch sizes in the text). λ : semantic-loss weight; κ : diversity weight; K : mixture / ensemble size.
method
topping
property
viol ↓
Independent
0.95±.01
0.45±.15
0.89±.18
WMC
0.93±.01
0.92±.02
0.06±.02
Appendix
Table 7: Pizzaiolo two-topping role-based fragment (mean ± std over ten seeds; metrics in § 4 ). topping is supervised; property are the latent Vegetarian/NonVegetarian/Spicy classes recovered through hasTopping .
Method
digit
NLL ↓
ECE ↓
mode-cov. TV ↓
Independent (UCI)
0.99±.00
6.93±.00
0.00±.00
1.00±.00
Single-WMC (SL / DPL)
0.99±.00
6.13±.00
0.00±.00
0.99±.00
JustWMC (learned mix)
0.99±.00
6.69±.43
0.11±.03
0.99±.01
BEARS
−
6.36±2.36
0.41±.12
0.44±.11
JustWMC (anchored)
0.99±.00
4.17±.00
0.00±.00
0.02±.00
Appendix
Table 8: MNIST-Disjunction ( #RS=4 ; mean ± std over ten seeds; metrics in § 4 ). NLL is over the gender atoms (Bayes-optimal 4.16 ); ECE and mode-coverage TV are the reasoning-shortcut diagnostics. BEARS is a K=4 deep-ensemble mitigation [ 24 ] trained on the same circuit; its per-digit accuracy is not separately evaluated ( − ).
method
topping
pizza
latent
violation
(observed)
(4 latent)
(11 latent)
rate
Independent
0.99±.00
0.44±.12
0.43±.08
1.00
WMC
0.76±.01
0.75±.00
0.58±.05
0.00
Appendix
Table 9: Pizza- SROIQ , 64 held-out examples, mean ± std over ten seeds (higher is better except for violation). The pizza (4 latent) and latent (11 atoms) columns are the headline: WMC infers them from topping evidence though those atoms receive no direct supervision.
OWL kind
axioms
ours
DPL (Horn)
DPL (manual)
DPL (inexpr.)
DPL clauses
SubClassOf
23
46
15
8
0
30
DisjointClasses
14
28
14
0
0
14
EquivalentClasses
3
12
0
3
0
11
RoleInclusion
2
4
2
0
0
2
AsymmetricRole
2
4
2
0
0
2
IrreflexiveRole
2
4
2
0
0
2
Appendix
Table 10: Per-OWL-axiom-kind encoding cost for the MNIST- SROIQ ontology. ours : normalized DL-clauses produced by the structural transformation. DPL Horn / DPL manual : DPL admits / requires user-written disjunctive / cardinality / negation encoding.
The OWL 2 EL profile is used in some of the largest production ontologies, including the Gene Ontology and SNOMED CT. Existing neuro-symbolic (NeSy) learning methods accept propositional theories or Datalog, and reasoning-shortcut (RS) awareness has not been investigated in ontology settings. We present Moose, a method that compiles an EL++ TBox and finite ABox to a Sentential Decision Diagram (SDD). The SDD acts as a differentiable weighted-model-counting layer, and we add closure clauses outside the EL++ profile on declared exhaustive families to overcome the limited expressivity of EL++ under partial supervision. We show termination, soundness, completeness, and polynomial intermediate sizes, and validate the proofs in Lean. We then define the first formal partial-supervision latent-concept-learning task over an OWL EL ontology, i.e., learning per-individual classifiers for latent concepts from observed ABox literals, and evaluate Moose on MNIST-with-ontology and Pizzaïolo. Moose improves over propositional-NeSy, fuzzy-logic, and ontology embedding baselines, and presents the first reasoning-shortcut analysis in an OWL EL setting.
Olga Mashkova, Asaad Mohammedsaleh, Fernando Zhapa-Camacho +1
Computer Science Program, Computer, Electrical, and Mathematical Sciences & Engineering Division, King Abdullah University of Science and Technology, Thuwal 23955, Saudi Arabia
OWL ontologies provide a formal knowledge representation framework that enables semantic reasoning, and have been widely adopted across domains such as healthcare and bioinformatics. In practice, however, real-world ontologies are often incomplete, which pose challenges for reasoning. In this work, we focus on a fundamental subsumption reasoning problem: given an incomplete ontology and a candidate (non-entailed) subsumption, determine whether the subsumption is semantically plausible and, if so, providing a logically sound explanation containing potential missing axioms. This task unifies subsumption verification with ontology abduction, and generalizes the latter by removing the need for a predefined candidate set of missing axioms. To address this subsumption reasoning problem, we propose NeurOWL, an end-to-end neuro-symbolic framework that jointly performs verification and abduction, leveraging both formally defined semantics and textual semantics through Large Language Models and ontology embeddings. We evaluate NeurOWL on real-world ontologies across multiple domains, demonstrating strong and robust performance across different domains.
Hui Yang, Jiaoyan Chen, Yiping Song +2
The University of Manchester · Zhejiang University
Probabilistic Neurosymbolic Learning (PNL) combines neural predictions with symbolic reasoning, enabling end-to-end learning from final-output supervision without labels for intermediate concepts. A central challenge is probabilistic inference: state-of-the-art approaches often rely on materializing the logical provenance of a query, which can itself become a major computational bottleneck. We introduce Dynamic Probabilistic Neurosymbolic Learning (DPNL), an oracle-guided framework that avoids requiring complete provenance materialization before inference. DPNL lazily explores the space of intermediate assignments, while oracles resolve entire regions that can already be certified to produce or exclude the target output. We establish conditions ensuring soundness and termination. ApproxDPNL extends the same search with early termination while maintaining certified bounds on the exact output probability, providing controlled approximation guarantees. The oracle interface decouples inference from the representation of the symbolic component, enabling problem-specific reasoning within the same framework. Experiments on several neurosymbolic tasks show that DPNL and ApproxDPNL substantially extend the range of problem instances tractable by probabilistic neurosymbolic inference.
Thomas Jean-Michel Valentin, Pierre Genev{è}s, Luisa Sophie Werner +3