NeSyCat Torch: A Differentiable Tensor Implementation of Categorical Semantics for Neurosymbolic Learning

📅 2026-06-17
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the semantic fragmentation and lack of a unified differentiable framework in existing neuro-symbolic systems by proposing the first differentiable neuro-symbolic learning framework that integrates NeSyCat semantics with neural networks. Built upon strong monads and truth-aggregation structures, the framework establishes a unified inductive definition of truth and interprets predicates and functions via neural networks. It innovatively introduces a lazy logarithmic tensor monad to ensure numerical stability and support differentiable training while remaining compatible with diverse neuro-symbolic approaches. By combining distribution and batching monads, it leverages monadic do-notation to automatically perform marginalization and branch pruning. Evaluated on the MNIST addition task, implementations in HaskTorch, JAX, and PyTorch consistently outperform LTN and DeepProbLog in both accuracy and speed, approaching the performance of DeepStochLog while preserving architectural unity.
📝 Abstract
Neurosymbolic semantics is fragmented: classical, fuzzy, probabilistic and neural systems each define truth by their own inductive rules. NeSyCat, extending ULLER, subsumes them under a single inductive definition of truth, parametric in a strong monad and an aggregation structure on truth-values. NeSyCat has so far lacked an account of predicates and functions learned by neural networks. We provide NeSyCat Torch as the missing link and interpret computational symbols via neural networks, implementing the framework in probabilistic programming and tensor-based backends. We use the distribution monad for reference semantics and metric evaluation, and complement it by a monad for numerically stable, differentiable training: the lazy log-tensor monad over the log-semiring. For efficient training in batches, we furthermore employ a batch monad. The axioms are the source code: written once in monad-based do-notation, monadic bind performs marginalisation, lazily pruning unneeded branches. On MNIST addition, our HaskTorch, JAX, and PyTorch implementations outperform LTN and DeepProbLog in speed and accuracy, while achieving nearly the accuracy of DeepStochLog. However, unlike DeepStochLog, we stay in a uniform framework that applies to many first-order NeSy approaches. Namely, the construction is parametric in the monad; instantiating it with, e.g., the Giry monad extends the approach to continuous probability (working out a neural representation here is left for future work).
Problem

Research questions and friction points this paper is trying to address.

Neurosymbolic semantics
truth-value aggregation
neural predicates
monadic semantics
differentiable learning
Innovation

Methods, ideas, or system contributions that make the work stand out.

Neurosymbolic learning
Differentiable semantics
Monad-based programming
Lazy log-tensor monad
Tensor implementation
D
Daniel Romero Schellhorn
University of Osnabrück, Osnabrück, Germany
Till Mossakowski
Till Mossakowski
Professor of Computer Science, University of Osnabrück
Logicformal ontologyknowledge representationneuro-symbolic AI
B
Björn Gehrke
University of Osnabrück, Osnabrück, Germany