Injecting Logical Constraints into Neural Networks via Straight-Through Estimators

Zhun Yang, Joohyung Lee, Chiyoun Park
7/10/2023
cs.AIcs.LGcs.NE

Official code: azreasoners/cl-ste (10 stars, MIT, last commit 2022-06-01).

Abstract

Injecting discrete logical constraints into neural network learning is one of the main challenges in neuro-symbolic AI. We find that a straight-through-estimator, a method introduced to train binary neural networks, could effectively be applied to incorporate logical constraints into neural network learning. More specifically, we design a systematic way to represent discrete logical constraints as a loss function; minimizing this loss using gradient descent via a straight-through-estimator updates the neural network's weights in the direction that the binarized outputs satisfy the logical constraints. The experimental results show that by leveraging GPUs and batch training, this method scales significantly better than existing neuro-symbolic methods that require heavy symbolic computation for computing gradients. Also, we demonstrate that our method applies to different types of neural networks, such as MLP, CNN, and GNN, making them learn with no or fewer labeled data by learning directly from known constraints.

View on arXivView PDF

Code Implementations(1)

azreasoners/cl-steOfficial100%
MIT
100Shell, PythonNov 23, 20214 years agoMIT

Similar Papers

Cite this paper

@article{yang2023injecting,
  title  = {Injecting Logical Constraints into Neural Networks via Straight-Through Estimators},
  author = {Zhun Yang and Joohyung Lee and Chiyoun Park},
  year   = {2023},
  eprint = {2307.04347},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.04347v1},
  journal = {ICML 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.04347.svg)](https://codeofpaper.com/paper/2307.04347)

Discussion