Analyzing Differentiable Fuzzy Implications

Emile van Krieken, Erman Acar, Frank van Harmelen

Abstract: Bridging the gap between symbolic logic and deep learning requires differentiable operators that can translate logical rules into training signals. This paper examines fuzzy implications used as loss functions in Differentiable Fuzzy Logic (DFL). We demonstrate that many classical implications suffer from vanishing gradients or learning imbalances. To address these issues, we introduce sigmoidal implications, which smooth the transition between truth values and balance learning between antecedents and consequents. Our results on semi-supervised MNIST show that properly tuned implications significantly enhance model performance by effectively incorporating background knowledge.

Introduction

Deep learning excels at processing raw sensory data but often struggles with "symbol grounding"—the task of mapping abstract concepts to specific visual or auditory inputs. Conversely, symbolic AI handles complex, rule-based knowledge well but is brittle in the face of noise. Differentiable Fuzzy Logic (DFL) attempts to merge these paradigms by interpreting logical predicates as neural network outputs and using logical formulas as differentiable loss functions.

Figure 1: An illustration of the symbol grounding problem, where abstract object labels (O1, O2) must be mapped to specific regions in a visual scene.

The Failure of Classical Implications

The core of DFL is the "If-Then" operator, or implication ($p \to q$). While simple in binary logic, fuzzy logic offers numerous definitions, primarily categorized into S-implications (based on $\neg p \lor q$) and R-implications (residua of t-norms).

A critical finding of this research is that many standard implications are unsuitable for gradient-based optimization. For instance, the popular Gödel implication is shown to be highly unsuitable because its derivative for the antecedent is always zero; it can never learn to correct the "If" part of a rule. Other implications, like Łukasiewicz, treat the antecedent and consequent symmetrically. If a rule is violated, the model "distrusts" both parts equally, which often leads to suboptimal learning trajectories.

Sigmoidal Implications and Gradient Balance

To overcome these limitations, we propose Sigmoidal Implications. By wrapping existing fuzzy implications in a parameterized sigmoid function, we "smooth" the gradients. This prevents the model from getting stuck in "corners" where it is highly confident but incorrect, effectively mitigating the vanishing gradient problem.

Furthermore, we analyze implications based on two key metrics: $d_{Ic}$ (the gradient for the consequent) and $d_{I\neg a}$ (the gradient for the negated antecedent). These correspond to Modus Ponens (MP) and Modus Tollens (MT) reasoning, respectively. In many logical datasets, negative examples are far more frequent than positive ones (the "Raven Paradox"), making MT reasoning—learning by falsifying the antecedent—the dominant mode of learning.

Figure 5: Log-scale visualization of the gradients for Modus Ponens (dMP) and Modus Tollens (dMT), illustrating the balance of learning signals across the antecedent and consequent.

Experimental Results

We evaluated these implications on the MNIST dataset in a semi-supervised setting with only 1% labeled data. Background knowledge was provided via rules relating digits to a "same-digit" predicate (e.g., "If $x$ is a zero and $y$ is a zero, then $x$ and $y$ are the same").

The experiments confirmed our theoretical analysis:

  • Performance Failures: The Gödel and Goguen implications performed worse than a baseline model using no logic at all (90.6% and 94.0% vs. 95.0% accuracy).
  • Top Performers: Reichenbach and Łukasiewicz implications performed well, reaching ~97% accuracy.
  • The Winner: The newly introduced Reichenbach-sigmoidal implication achieved the best results at 97.3% accuracy, demonstrating that balancing gradients is key to stable learning.

Conclusion

The choice of fuzzy implication is a decisive factor in the success of Differentiable Fuzzy Logic. By smoothing implications with sigmoidal functions and balancing the gradients between antecedents and consequents, we can create more stable and effective training signals. While DFL is not yet competitive with specialized semi-supervised architectures like Ladder Networks, it provides a robust framework for injecting domain knowledge into neural models.

Summary updated

BibTeX
@inproceedings{krieken2020analyzing,
  author = {Emile van Krieken and Erman Acar and Frank van Harmelen},
  title = {{Analyzing Differentiable Fuzzy Implications}},
  booktitle = {KR},
  year = {2020},
  doi = {10.24963/kr.2020/92},
}
Figure