Logical Reasoning with Span-Level Predictions for Interpretable and Robust NLI Models (2022)

Abstract: Current Natural Language Inference (NLI) models achieve impressive results, sometimes outperforming humans when evaluating on in-distribution test sets. However, as these models are known to learn from annotation artefacts and dataset biases, it is unclear to what extent the models are learning the task of NLI instead of learning from shallow heuristics in their training data.We address this issue by introducing a logical reasoning framework for NLI, creating highly transparent model decisions that are based on logical rules. Unlike prior work, we show that improved interpretability can be achieved without decreasing the predictive accuracy. We almost fully retain performance on SNLI, while also identifying the exact hypothesis spans that are responsible for each model prediction.Using the e-SNLI human explanations, we verify that our model makes sensible decisions at a span level, despite not using any span labels during training. We can further improve model performance and the span-level decisions by using the e-SNLI explanations during training. Finally, our model is more robust in a reduced data setting. When training with only 1,000 examples, out-of-distribution performance improves on the MNLI matched and mismatched validation sets by 13% and 16% relative to the baseline. Training with fewer observations yields further improvements, both in-distribution and out-of-distribution.

## introduction the task of natural language inference (nli) involves reasoning across a premise and hypothesis, determining the relationship between the two sentences. either the hypothesis is implied by the premise (entailment), the hypothesis contradicts the premise (contradiction), or the hypothesis is neutral to the premise (neutral). nli can be a highly challenging task, requiring lexical, syntactic and logical reasoning, in addition to sometimes requiring premise: the man in the black wetsuit is walking out of the water. hypothesis: a man in a wetsuit walks out of the water carrying a surfboard. real-world knowledge @xcite . while neural nli models perform well on in-distribution test sets, this does not necessarily mean they have a strong understanding of the underlying task. instead, nli models are known to learn from annotation artefacts (or biases) in their training data @xcite . models can therefore be right for the wrong reasons @xcite , with no guarantees about the reasons for each prediction, or whether the predictions are based on a genuine understanding of the task. we address this issue with our logical reasoning framework, creating more interpretable nli models that definitively show the specific logical atoms responsible for each model prediction. one challenge when applying a logical approach to nli is determining the choice of logical atoms. when constructing examples from knowledge bases, the relationships between entities in the knowledge base can be used as logical atoms @xcite ; in synthetic fact-based datasets, each fact can become a logical atom @xcite . neither approach would be suitable for snli @xcite , which requires reasoning over gaps in explicitly stated knowledge @xcite , with observations covering a range of topics and using different forms of reasoning. instead, our novel logical reasoning framework considers spans of the hypothesis as logical atoms. we determine the class of each premise-hypothesis pair based entirely on span-level decisions, identifying exactly which parts of a hypothesis are responsible for each model decision. by providing a level of assurance about the cause of each prediction, we can better understand the reasons for the correct predictions and highlight any mistakes or misconceptions being made. using the e-snli dataset @xcite , we assess the performance of our span-level predictions, ensuring that the decisions about each hypothesis span align with human explanations. to summarise our findings: 1) our span logical reasoning framework (slr-nli) produces highly interpretable models, identifying exactly which parts of the hypothesis are responsible for each model prediction. 2) slr-nli almost fully retains performance on snli, while also performing well on the sick dataset @xcite . this contrasts with previous work, where the inclusion of logical frameworks result in substantially worse performance. 3) evaluating the slr-nli predictions at a span level shows that the span-level decisions are consistent with human explanations, with further improvements if e-snli explanations are used during training. 4) slr-nli improves model robustness when training in a reduced data setting, improving performance on unseen, out-ofdistribution nli datasets. 1 ## span logical reasoning inspired by previous work on error detection @xcite @xcite , we construct models for detecting spans of the hypothesis that either contradict the premise (contradiction spans) or are not implied by the premise (neutral spans). we train the model with sentence-level labels while also using auxiliary losses that guide the model behaviour at the span level. as no span labels are provided in the snli training data, we supervise our slr-nli model at a span level using logical rules, for example requiring a contradiction example to include at least one contradiction span. the model is evaluated based on the span-level decisions for each logical atom. ## experiments we train the slr-nli model either using snli @xcite or sick @xcite . snli is a large corpus of 570k observations, with a diverse range of reasoning strategies required to understand the relationship between the premise and hypothesis. image captions are used for premises, with annotators asked to create a hypothesis for each class for each given premise. in contrast, sick has 10k observations and initially uses sentence pairs from image captions and video descriptions, with additional sentence pairs generated by applying a series of rules, including replacing nouns with pronouns and simplifying verb phrases. as a result, entailment and contradiction examples in sick are often the same except with one or two small changes. previous work exploits this similarity, using logical reasoning to identify the contradiction and entailment examples @xcite . compared to this setting, snli provides a more challenging dataset for applying logical reasoning. we further experiment with training our model in a reduced data setting, motivated by the hypothesis that forcing our model to learn at a span-level will make better use of a smaller number of examples. we expect slr-nli to be more robust in a reduced data setting, with existing models known to rely on dataset biases when overfitting to small datasets @xcite . for the reduced data experiments, we train slr-nli with 100 and 1,000 examples from sick or snli, evaluating outof-distribution performance on other unseen nli datasets including snli-hard @xcite , mnli @xcite and hans @xcite . as no explanations are provided for sick, we only use explanations when training on snli (reported as slr-nli-esnli). for sick, when we consider out-of-distribution performance we evaluate on the corrected sick dataset @xcite , with labels manually corrected by @xcite and @xcite . however, for a fair comparison to previous work, we use the original sick dataset when evaluating in-distribution performance from sick. to validate that the model is making sensible decisions at a span level, we compare the span-level predictions to the e-snli human explanations. for each single-span hypothesis rationale in e-snli, we consider each model span containing this entire rationale. each span that does contain the rationale is evaluated, with its span predictions compared to the sentence-level label. in summary, we consider the following research questions: 1) does our interpretable slr-nli model retain performance on snli? 2) is slr-nli a flexible approach that can also work on sick? 3) does slr-nli improve performance in a reduced data setting? 4) in the reduced data setting, does slr-nli also improve robustness? 5) does slr-nli make sensible decisions at a span level? work on logical reasoning for snli, as the inclusion of logical frameworks has previously resulted in large drops in performance @xcite @xcite . we achieve this level of performance without training or evaluating on the full premise and hypothesis pairs. when training with the e-snli explanations, we see an additional improvement in accuracy (90.49%). slr-nli compares favourably to prior logical reasoning work on sick, despite these baselines being specifically designed for this dataset ( ## analysis 6.1 span-level evaluation even without additional supervision from e-snli, slr-nli performs well at a span level, with 84.75% accuracy in a zero-shot setting ( ## conclusion we introduce slr-nli as a logical framework that predicts the class of an nli sentence pair based on span-level predictions. slr-nli almost fully retains performance on snli, outperforming previous logical methods, whilst also performing well on the sick dataset. the model also outperforms the baseline in a reduced data setting, with substantially improved model robustness. finally, we create a highly interpretable model whose decisions can easily be understood, highlighting why these predictions are made and the reasons for any misclassifications. while slr-nli provides a guarantee about which hypothesis spans are responsible for each model prediction, this does not mean that the spanlevel decisions cannot still be influenced by shallow heuristics. our approach may help to mitigate some dataset biases, for example the length of the hypothesis @xcite or the proportion of words that overlap between the two sentences @xcite . however, other biases, including how specific words correlate with individual labels @xcite , may still be influencing the model. finally, our framework is designed for hypotheses that are mostly a single sentence. without further modifications, this approach is unlikely to generalise well to more challenging nli datasets with longer hypotheses, for example with the anli dataset @xcite .