Modal Logical Neural Networks
Antonin Sulc
TL;DR
MLNNs introduce a differentiable Kripke-semantics layer that integrates modal logic into neural reasoning by using Box and Diamond neurons over a set of possible worlds. A learnable accessibility relation $A_ heta$ lets the system inductively discover the relational structure governing knowledge, time, and trust, while a logical contradiction loss enforces coherence with user-defined axioms. The approach yields interpretable guardrails for neural models, capable of enforcing symbolic rules, abstaining on indeterminate inputs, and uncovering latent epistemic structures in multi-agent settings. The framework is analyzed theoretically for soundness and convergence and demonstrated across tasks including grammatical guardrails, dialect indeterminacy, epistemic learning, and real-world diplomacy interactions, highlighting its potential to improve reliability and interpretability in AI systems.
Abstract
We propose Modal Logical Neural Networks (MLNNs), a neurosymbolic framework that integrates deep learning with the formal semantics of modal logic, enabling reasoning about necessity and possibility. Drawing on Kripke semantics, we introduce specialized neurons for the modal operators $\Box$ and $\Diamond$ that operate over a set of possible worlds, enabling the framework to act as a differentiable ``logical guardrail.'' The architecture is highly flexible: the accessibility relation between worlds can either be fixed by the user to enforce known rules or, as an inductive feature, be parameterized by a neural network. This allows the model to optionally learn the relational structure of a logical system from data while simultaneously performing deductive reasoning within that structure. This versatile construction is designed for flexibility. The entire framework is differentiable from end to end, with learning driven by minimizing a logical contradiction loss. This not only makes the system resilient to inconsistent knowledge but also enables it to learn nonlinear relationships that can help define the logic of a problem space. We illustrate MLNNs on four case studies: grammatical guardrailing, axiomatic detection of the unknown, multi-agent epistemic trust, and detecting constructive deception in natural language negotiation. These experiments demonstrate how enforcing or learning accessibility can increase logical consistency and interpretability without changing the underlying task architecture.
