[论文解读] Learning Modulo Theories
本文提出 SMTLayer,一种可微分的 PyTorch 模块,将可满足性模理论(SMT)求解器集成到深度神经网络中,以直接嵌入符号知识。通过在反向传播过程中使用不可满足核心和加权最大 SMT 提供梯度反馈,SMTLayer 使模型能够以显著更少的训练数据学习到可解释且鲁棒的表示,其性能优于先前的方法如 SATNet 和 Scallop,在数据稀缺和协变量偏移设置下表现更优。
Recent techniques that integrate \emph{solver layers} into Deep Neural Networks (DNNs) have shown promise in bridging a long-standing gap between inductive learning and symbolic reasoning techniques. In this paper we present a set of techniques for integrating \emph{Satisfiability Modulo Theories} (SMT) solvers into the forward and backward passes of a deep network layer, called SMTLayer. Using this approach, one can encode rich domain knowledge into the network in the form of mathematical formulas. In the forward pass, the solver uses symbols produced by prior layers, along with these formulas, to construct inferences; in the backward pass, the solver informs updates to the network, driving it towards representations that are compatible with the solver's theory. Notably, the solver need not be differentiable. We implement \layername as a Pytorch module, and our empirical results show that it leads to models that \emph{1)} require fewer training samples than conventional models, \emph{2)} that are robust to certain types of covariate shift, and \emph{3)} that ultimately learn representations that are consistent with symbolic knowledge, and thus naturally interpretable.
研究动机与目标
- 为解决在无需昂贵且依赖监督的标注情况下,将符号知识整合到深度学习中的挑战。
- 使深度神经网络能够通过非可微分的 SMT 求解器学习与符号理论兼容的表示。
- 在视觉和自然语言处理任务中,提升数据效率、对协变量偏移的鲁棒性以及可解释性。
- 证明符号知识可在训练过程中被利用,而无需对求解器行为进行可微分松弛。
- 提供一个通用框架,支持多种 SMT 理论,并随求解器技术的进步而扩展。
提出的方法
- SMTLayer 将 SMT 求解器作为可微分层嵌入到 PyTorch 模型中,使用命题变量与神经网络输出进行接口交互。
- 在前向传播过程中,SMT 求解器检查神经网络输出与编码为逻辑公式的符号约束之间的一致性。
- 在反向传播过程中,利用求解器生成的不可满足核心来生成梯度信号,以更新神经网络。
- 另一种方法使用加权最大 SMT,通过为违反的约束分配惩罚来指导学习。
- 该方法避免对求解器进行可微分松弛,从而可使用任何高效的 SMT 求解器,无论理论复杂度或可判定性如何。
- 该框架作为 PyTorch 模块实现,使用 Z3 作为底层 SMT 求解器,支持端到端训练。
实验结果
研究问题
- RQ1能否在无需可微分松弛的情况下,有效将编码为 SMT 约束的符号知识整合到深度学习中?
- RQ2将 SMT 求解器集成到神经网络中是否能提升在感知-符号任务学习中的数据效率?
- RQ3SMTLayer 是否能增强在测试时分布中出现的协变量偏移(训练期间未见)下的鲁棒性?
- RQ4SMTLayer 在多大程度上产生与符号理论一致的可解释表示?
- RQ5与先前的可微分求解器层(如 SATNet 和 Scallop)相比,SMTLayer 在性能和样本效率方面表现如何?
主要发现
- 在仅使用 10% 训练数据的 MNIST 加法任务中,SMTLayer 达到了接近完美的准确率,而 SATNet 和 Scallop 要么未能收敛,要么学习到了错误的表示。
- 在视觉代数和视觉数独任务中,SMTLayer 在低数据场景下优于 SATNet 和 Scallop,且随着数据量增加,性能稳步提升。
- SMTLayer 在 MNIST 加法任务中学习到的数字表示正确率高达 99%,与标准 MNIST 模型准确率相当,而 Scallop 由于表示解耦不良,准确率仅为约 50%。
- 使用 SMTLayer 训练的模型对协变量偏移具有鲁棒性,在测试数据的数字对组合与训练数据不同时,仍能保持高性能。
- SMTLayer 产生的表示本质上是可解释的,因为网络学会了以符号约束中使用的相同位向量格式编码输入。
- 使用不可满足核心和加权最大 SMT 进行梯度反馈的方法被证明有效,且在所测试的数据集中,更简单的不可满足核心方法实际表现优于最大 SMT。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。