Learning Explainable Linguistic Expressions with Neural Inductive Logic Programming for Sentence Classification (2020)

Abstract: Interpretability of predictive models is becoming increasingly important with growing adoption in the real-world. We present RuleNN, a neural network architecture for learning transparent models for sentence classification. The models are in the form of rules expressed in first-order logic, a dialect with well-defined, human-understandable semantics. More precisely, RuleNN learns linguistic expressions (LE) built on top of predicates extracted using shallow natural language understanding. Our experimental results show that RuleNN outperforms statistical relational learning and other neuro-symbolic methods, and performs comparably with black-box recurrent neural networks. Our user studies confirm that the learned LEs are explainable and capture domain semantics. Moreover, allowing domain experts to modify LEs and instill more domain knowledge leads to human-machine co-creation of models with better performance.

## introduction difficult-to-interpret, black-box predictive models have been shown to harbor undesirable biases (e.g., racial bias in computing risk of recidivism among criminals @xcite ). renewed interest in interpretability (blackboxnlp) has led to techniques for explaining not only the inner workings of the model but also to explain how it derives a prediction. while various techniques for explainability exist (see survey by @xcite ), one popular approach explains predictions from a black-box model by using a surrogate models @xcite . another extracts explanations from neural network layer activations, especially when said activations appeal to human intuition such as attention @xcite which may be interpreted as importance weights assigned to (latent) features derived by the model. while such approaches are useful, they raise questions such as whether the purported explanation provided by the surrogate correctly reflects the process employed by the black-box model to arrive at the prediction (sometimes called inexact explanation @xcite ). similarly, attention only provides noisy explanations @xcite . such approaches leave room for improvement because explainability is treated as an after-thought whereas our goal is to treat it as a first-class citizen. in other words, is it possible to devise a neural network that directly learns a model expressed in a clear, human-readable dialect? first-order logic (fol) is a human-interpretable fragment of logic that includes existential (∃) and universal (∀) quantification along with propositional logic's conjunction (∧), disjunction (∨) and negation (¬) operators. fol can model diverse applications such as data integration @xcite , image interpretation @xcite , and as the next example shows, natural language processing (nlp). consider identifying sentences denoting communication between two parties in a legal contract. figure 1 shows such a sentence along with linguistic abstractions in propbank notation @xcite extracted using shallow semantic parsing. it consists of two actions, transmit.01 and register.02, with arguments a0, a1 and argm. figure 1 also shows an fol rule that assigns label communication by evaluating linguistic clues. we refer to such rules as linguistic expressions (le). more precisely, the le in the figure assigns communication if: action belongs to the sentence, surface form of the action belongs to a dictionary containing "inform" and "transmit", and its a1 argument matches a dictionary containing "notice". not only does the le's conditions evaluate to true on the sentence example, but attribution, i.e., which parts of the sentence led to the prediction is also clear: transmit.01, rather than register.02, leads to the predicted label because the surface form corresponding to transmit.01's action and its a1 argument is "transmit" and "notice", respectively. this allows domain experts to verify the le's semantics and explain predictions without encountering aforementioned complications due to the use of surrogate models, for instance. fol rules may be learned using inductive logic programming (ilp) @xcite , statistical relational learning (starai) @xcite or neuro-symbolic ai @xcite . none of these however, target nlp. fol rules consist of predicates which are boolean functions that specify conditions for the rule to hold, e.g., contains and dictionary-match conditions in figure 1 . thus, we need to: 1) learn discriminative predicates, 2) combine them into les, and 3) learn multiple les in case one is insufficient. figure 2 summarizes our approach. we leverage natural language understanding (nlu) to generate well defined, human-interpretable predicates. our main contribution is rulenn, a neural dictionaries sentences nlu rulenn verify les facts predicates les figure 2: pictorial depiction of our approach. network (nn) comprising predicate generation (pgm) and clause generation (cgm) modules for learning and combining discriminative predicates to form les. by adding more modules, rulenn can learn multiple les jointly. we also show how to extract les expressed in crisp fol from ru-lenn post-hoc that may, in turn, be handed to domain experts for verification and even modification, to instill further domain expertise going beyond the available training data. by evaluating on two real-world sentence classification datasets and comparing against a host of baselines, we show that les learned by ru-lenn lead to large gains in terms of area under the precision-recall curve (auc-pr). averaging across labels, rulenn's auc-pr is 6.8×, 7.6×, 1.5× that of ilp, starai, other neuro-symbolic ai approaches, respectively. we also compare against black-box methods that are far less explainable. in particular, we show that rulenn's les are comparable to bi-directional lstms @xcite with glove embeddings @xcite . a user study with 4 domain experts confirms that rulenn's les are interpretable, capture domain semantics and are conducive to human-machine model co-creation. we make the following contributions: ## related work inductive logic programming (ilp) @xcite learns rules that perfectly entail the positive examples and reject all negatives. top-down ilp systems @xcite @xcite in particular, generate rules before testing them on data. since a 0-error rule may not exist, noise-tolerant ilp @xcite learns rules that minimize error which is more suited for noisy real-world scenarios. we compare rulenn against top-down and noisetolerant ilp in section 5. markov logic network (mln) @xcite , a member of statistical relational learning (starai) @xcite , comprises weighted rules to extend markov random fields @xcite to the first-order setting. a long line of work exploring various techniques culminated in the lsm heuristic @xcite that learns mln rules before estimating parameters. since such a stepwise approach can be computationally expensive, boostsrl @xcite jointly learns rules and parameters by approximating the gradient using functional gradient boosting @xcite . rulenn replaces logical operations with differentiable functions, thus learning les end-to-end without approximations. section 5 reports results of lsm and boostsrl. neuro-symbolic ai employs neural networks for rule induction @xcite @xcite . to the best of our knowledge however, none of these address nlp tasks such as sentence classification. neurallp @xcite for instance, learns restricted chain rules to predict links in knowledge graphs. ∂ilp @xcite learns recursion by materializing all possible logic programs thus incurring exponential complexity. neural logic machines @xcite translate fol to tensor operations and multi-layer perceptrons thus precluding extraction of fol rules. in contrast, we learn les for nlp by constructing predicates from nlu, rulenn's complexity is proportional to the number of rules, and we also extract fol rules once training has converged. other combinations of fol and neural networks include kazemi and poole ( 2018); sourek et al. (2018); donadello et al. (2017); gupta et al. (2020) and neural theorem provers @xcite , which convert user-specified rules into neural networks. in particular, neural module networks @xcite convert compositional questions into modules in a neural network with the goal being to learn all parameters jointly. in contrast to rulenn, none of these directly learn rules from labeled data. recall that in figure 1 , the sentence comprises actions and we evaluate the le on each action. this is in fact multiple instance learning (mil) @xcite where one instance (e.g., sentence) contains a set of instances (e.g., actions) and is strictly more general than independent and identically distributed (iid) classification. previous use of mil includes aspectbased sentiment analysis @xcite . in section 5, we compare rulenn against mil classifiers including miri @xcite , a mil rule-learner, and miti @xcite , a mil decision tree learner. ## constructing predicates based on natural language understanding in this section, we describe how to define human interpretable predicates by leveraging semantic role labeling (srl) @xcite and syntactic parsing. in section 4, we show how to learn discriminative les on top of such predicates. ## rulenn: learning linguistic expressions with neural networks we now present rulenn, a neural network for learning les from labeled data. since les are discrete objects, we first present a parameterized predicate that is defined in terms of learnable parameters. subsequently, we introduce predicate and clause generation modules. by adding more of these modules, the architecture scales to facilitate learning of multiple, longer les. ## conclusion and future work our experiments indicate that neuro-symbolic ru-lenn outperforms other rule induction techniques in terms of efficiency and quality of rules learned even in the presence of challenging conditions such as class skew. allowing domain experts to instill their expertise into les can also enable humanmachine co-creation of explainable models. ideas presented here are general enough to enable other applications. rulenn can be used for any mil task assuming predicates are given and pgms can be used to learn combinations of base predicates p even if the structure of the rule differs from les. as an extension, it may even be possible to determine the number of les k from the data using recurrent neural networks @xcite . rulenn can learn rules combining any previously built classifier's output probabilities (assuming such probabilities lie within [0, 1]). note that, rulenn's philosophy is distinct from other explainable ai approaches @xcite . we show that it is possible to learn human-interpretable models by designing neural networks keeping explainability in mind. as opposed to learning an explainable model (e.g., rulenn), one may also choose to explain a black-box model. such efforts are usually restricted to explaining outcomes and only provide a shallow understanding of the overall model, if at all @xcite . while recent embeddings @xcite may lead to improved accuracy, these remain poorly understood @xcite . one avenue of future work is to learn explainable rules that domain experts can interact with on top of such embeddings. another is to learn rules and dictionaries jointly, which may also aid sentiment analysis @xcite .