Skip to main content
QUICK REVIEW

[Paper Review] Neural Logic Rule Layers

Jan Reimann, Andreas Schwung|arXiv (Cornell University)|Jan 1, 2019
Bayesian Modeling and Causal InferenceComputer Science14 references5 citations
TL;DR

This paper introduces Neural Logic Rule Layers (NLRL), a differentiable neural network module that embeds logical rules—specifically conjunctive and disjunctive normal forms—into deep learning architectures. By combining learnable negation gates, shared-weight AND/OR connectors, and a gating mechanism for rule selection, NLRL enables end-to-end training of interpretable logic rules, achieving high accuracy on synthetic logic and arithmetic tasks while preserving human interpretability and supporting knowledge injection.

ABSTRACT

Despite their great success in recent years, deep neural networks (DNN) are mainly black boxes where the results obtained by running through the network are difficult to understand and interpret. Compared to e.g. decision trees or bayesian classifiers, DNN suffer from bad interpretability where we understand by interpretability, that a human can easily derive the relations modeled by the network. A reasonable way to provide interpretability for humans are logical rules. In this paper we propose neural logic rule layers (NLRL) which are able to represent arbitrary logic rules in terms of their conjunctive and disjunctive normal forms. Using various NLRL within one layer and correspondingly stacking various layers, we are able to represent arbitrary complex rules by the resulting neural network architecture. The NLRL are end-to-end trainable allowing to learn logic rules directly from available data sets. Experiments show that NLRL-enhanced neural networks can learn to model arbitrary complex logic and perform arithmetic operation over the input values.

Motivation & Objective

  • To address the poor interpretability of deep neural networks (DNNs) by embedding logical rules directly into network architecture.
  • To enable end-to-end training of logical rules using backpropagation while preserving human-understandable reasoning structures.
  • To allow direct incorporation of expert knowledge in the form of predefined logical rules into neural networks.
  • To improve model robustness by reducing false positives on unknown inputs through rule-based decision-making.
  • To explore the representational capacity of neural layers for both logical and nonlinear functions.

Proposed method

  • The NLRL architecture consists of three blocks: a learnable negation gate using a sigmoid gating mechanism to compute ¬x = (1−σ(gu))◦x + σ(gu)◦(1−x).
  • The AND and OR connectors share weights and are defined using algebraic forms: AND = exp(A(log(|ˆx|+ϵ))), OR = ((1−anˆxn)⊙…⊙(1−a2ˆx2)⊙(−1a1ˆx1))1+1.
  • An output gating unit σ(gr) selects between AND and OR outputs via y = (1−σ(gr))◦AND + σ(gr)◦OR.
  • The entire structure is end-to-end trainable using backpropagation, enabling joint optimization of rule parameters and network weights.
  • The method supports representation of arbitrary logic functions via conjunctive and disjunctive normal forms, and can model nonlinear functions when combined with appropriate activation functions.
  • The architecture allows for knowledge injection by initializing rule parameters with expert-defined logical expressions, which are then fine-tuned via backpropagation.

Experimental results

Research questions

  • RQ1Can neural networks be structured to represent arbitrary logical rules—specifically in conjunctive and disjunctive normal forms—while remaining differentiable and trainable?
  • RQ2How does the inclusion of learnable logic layers affect training convergence and performance on synthetic logic and arithmetic tasks?
  • RQ3To what extent can NLRL incorporate prior expert knowledge in the form of predefined logical rules and fine-tune them using data?
  • RQ4Does the NLRL architecture improve robustness to unknown inputs compared to standard softmax output layers?
  • RQ5Can NLRL effectively model nonlinear functions beyond pure logic, such as arithmetic operations?

Key findings

  • Networks with both AND and OR capabilities (AND-OR) converged faster and achieved better performance than those restricted to only AND operations, despite higher computational cost.
  • AND-NEG networks, which include redundant negation gates, showed significantly slower convergence than AND-NONEG networks, especially with deeper architectures, due to cyclic training behavior and parameter redundancy.
  • Performance saturated at a connection size (CS) of 8, indicating that further increases in network width did not improve results, suggesting optimal capacity for the tested tasks.
  • The loss function exhibited a stepwise decline pattern, indicating that individual logical rules converged in discrete phases, likely due to the combinatorial nature of the optimization and sigmoid derivative behavior.
  • Qualitative visualization of learned surfaces confirmed that high-performing networks accurately captured the underlying logic and arithmetic manifolds of the training data.
  • Computation time was substantially higher for AND-OR networks due to the increased complexity of evaluating both AND and OR paths in parallel.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.