将模态逻辑融入神经网络,让模型能推理必然与可能。
Modal Logical Neural Networks
- 用特殊神经元模拟模态算子,基于可能世界进行逻辑推理。
- 可学习逻辑关系或固定规则,保持推理一致性且端到端可训练。
- 适合需要逻辑可解释性的场景,如自然语言推理与信任建模。
我们提出模态逻辑神经网络(MLNNs),一种将深度学习与模态逻辑形式语义结合的神经符号框架,支持对必然性与可能性的推理。基于Kripke语义,引入专门处理模态算子□和◇的神经元,在一组可能世界间运作,使系统成为可微分的“逻辑护栏”。该架构高度灵活:世界间的可达关系可由用户固定以强制已知规则,也可由神经网络参数化作为归纳特征。这使得模型既能从数据中学习逻辑关系,又能在此结构内执行演绎推理。整个框架端到端可微,通过最小化逻辑矛盾损失进行学习,不仅增强对不一致知识的鲁棒性,还能捕捉非线性关系以定义问题空间的逻辑。我们在四个案例中验证:语法约束、多智能体认知信任、自然语言谈判中的建设性欺骗检测、数独组合约束求解。实验表明,强制或学习可达关系均能提升逻辑一致性与可解释性,而无需改变任务架构。
原文摘要 · Abstract (English)
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, multi-agent epistemic trust, detecting constructive deception in natural language negotiation, and combinatorial constraint satisfaction in Sudoku. These experiments demonstrate how enforcing or learning accessibility can increase logical consistency and interpretability without changing the underlying task architecture.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。