LEARNING WHERE AND WHEN TO REASON IN NEURO-SYMBOLIC INFERENCE

Abstract

The integration of hard constraints on neural network outputs is a very desirable capability. This allows to instill trust in AI by guaranteeing the sanity of that neural network predictions with respect to domain knowledge. Recently, this topic has received a lot of attention. However, all the existing methods usually either impose the constraints in a "weak" form at training time, with no guarantees at inference, or fail to provide a general framework that supports different tasks and constraint types. We tackle this open problem from a neuro-symbolic perspective. Our pipeline enhances a conventional neural predictor with (1) a symbolic reasoning module capable of correcting structured prediction errors and (2) a neural attention module that learns to direct the reasoning effort to focus on potential prediction errors, while keeping other outputs unchanged. This framework provides an appealing trade-off between the efficiency of constraint-free neural inference and the prohibitive cost of exhaustive reasoning at inference time. We show that our method outperforms the state of the art on visual-Sudoku, and can also benefit visual scene graph prediction. Furthermore, it can improve the performance of existing neuro-symbolic systems that lack our explicit reasoning during inference.

1. INTRODUCTION

Despite the rapid advance of machine learning (ML), it is still difficult for deep learning architectures to solve a certain classes of problems, especially those that require non-trivial symbolic reasoning (e.g. automated theorem proving or scientific discovery). A very practical example of this limitation -even in applications that are typical deep learning territory such as image processing -is the difficulty of imposing hard symbolic constraints on model outputs. This is relevant when learning systems produce outputs for which domain knowledge constraints apply (e.g., Figure 2 ). The common situation today, that ML systems violate such constraints regularly, is both a missed opportunity to improve performance and more importantly a source of reduced public trust in AI. This issue has motivated a growing body of work in neuro-symbolic methods that aim to exploit domain knowledge constraints and reasoning to improve performance. Most of these methods address neuro-symbolic learning, where constraints are applied in the loss function (e.g., Xu et al. ( 2018 2020)) and predictions that violate those constraints are penalised. In this way, during learning, the model is "encouraged" to move close to a solution that satisfies the constraints/rules. However, high-capacity deep networks in any case usually fit their training sets, and thus violate no constraints on the output labels during supervised learning. The central issue of whether constraints are also met upon inference during deployment is unaddressed by these methods and is under-studied more generally Giunchiglia et al. (2022b); Dash et al. (2022); von Rueden et al. (2021) . A minority of studies have worked towards exploiting constraints during inference. Since in general reasoning to guarantee that constraints are met is expensive, some methods try to apply soft relaxations (Daniele & Serafini, 2019; Li & Srikumar, 2019; Wang et al., 2019) , which is unhelpful for trust and guarantees. The few methods that manage to impose exact constraints are either restricted to very simple or restrictive rules (Yu et al., 2017; Giunchiglia et al 



); Xie et al. (2019); Li et al. (2019); Wang & Pan (

., * Work done while at Samsung AI, Cambridge 1

