Abstract
We introduce Deep Adaptive Semantic Logic (DASL), a novel framework for automating the generation of deep neural networks that incorporates user-provided formal knowledge to improve learning from data. We provide formal semantics that demonstrate that our knowledge representation captures all of first order logic and that finite sampling from infinite domains converges to correct truth values. DASL's representation improves on prior neural-symbolic work by avoiding vanishing gradients, allowing deeper logical structure, and enabling richer interactions between the knowledge and learning components. We illustrate DASL through a toy problem in which we add structure to an image classification problem and demonstrate that knowledge of that structure reduces data requirements by a factor of 1000. We then evaluate DASL on a visual relationship detection task and demonstrate that the addition of commonsense knowledge improves performance by 10.7% in a data scarce setting.
Introduction
Artificial Intelligence has long been split into two camps: Knowledge Representation and Reasoning (KRR), which uses formal logic to perform robust reasoning but is often brittle, and Deep Learning (DL), which excels at pattern recognition but is notoriously data-hungry and lacks "common sense."
The challenge lies in the "Neuro-Symbolic" middle ground. Previous attempts to inject logic into neural networks often used "fuzzy logic" (mapping truth to the [0, 1] interval). However, these methods frequently suffer from vanishing gradients—when a model is very certain, the mathematical signal for learning disappears. This limits the complexity of the logical rules. DASL aims to bridge this gap by creating a differentiable framework that supports full First-Order Logic (FOL) without killing the gradient.
Methods: Compiling Logic into Networks
The core innovation of DASL is its compilation process. Instead of just adding a logic-based penalty to a loss function, DASL uses the "parse tree" of a logical statement to assemble a neural network on the fly.
Key technical highlights include:
- Logit Representation: Unlike prior work, DASL represents truth values as logits (real numbers from $-\infty$ to $+\infty$). In this space, logical conjunctions ($\wedge$) behave like additions, ensuring that gradients remain healthy even through deep logical structures.
- Differentiable Connectives: The authors define specific differentiable operators for negation, conjunction, and implication. For example, the "and" operator is implemented using a numerically stable approximation of the product of probabilities.
- Sampling for Quantifiers: To handle universal quantifiers ("for all" $x$), DASL uses a sampling approach similar to mini-batching in standard SGD. They provide a formal proof that this finite sampling converges to correct truth values in the limit.
- Soundness and Completeness: The authors ground DASL in Tarski-style model theory, proving that their framework can represent any statement possible in full First-Order Logic.
Experiments and Results
The researchers evaluated DASL on two distinct computer vision tasks: MNIST handwritten digit classification and Visual Relationship Detection (VRD).
MNIST with Arithmetic Rules
In this "toy" problem, the model was given a few labeled digits and a large set of unlabeled triplets $(X_1, X_2, X_3)$ known to satisfy the rule: $digit(X_1) + digit(X_2) = digit(X_3) \pmod{10}$.
As shown in Figure 2, DASL achieved 97.7% accuracy using only 2 labeled samples per class by leveraging the modular arithmetic rules. A standard neural network without these rules performed significantly worse (53.3%) with the same amount of data. This represents a 1000x reduction in labeled data requirements.
Visual Relationship Detection (VRD)
On the VRD benchmark, DASL was used to test how "common sense" rules (e.g., "only humans can wear clothes") help in data-scarce settings. When only 1% of the training data was available, adding common-sense rules improved the model's performance by 10.7% in zero-shot settings (predicting relationships the model hadn't seen during training).
Conclusion
DASL demonstrates that logic is a powerful substitute for massive datasets. By treating declarative knowledge as an architectural blueprint and operating in logit space, it overcomes the gradient bottlenecks of previous neuro-symbolic methods. This unified view allows for seamless semi-supervised and distantly supervised learning where data labels and logical assertions are treated identically.
Summary updated