S co N e: Benchmarking Negation Reasoning in Language Models With Fine-Tuning and In-Context Learning (2023)

Abstract: A number of recent benchmarks seek to assess how well models handle natural language negation. However, these benchmarks lack the controlled example paradigms that would allow us to infer whether a model had truly learned how negation morphemes semantically scope. To fill these analytical gaps, we present the Scoped Negation NLI (ScoNe-NLI) benchmark, which contains contrast sets of six examples with up to two negations where either zero, one, or both negative morphemes affect the NLI label. We use ScoNe-NLI to assess fine-tuning and in-context learning strategies. We find that RoBERTa and DeBERTa models solve ScoNe-NLI after many shot fine-tuning. For in-context learning, we test the latest InstructGPT models and find that most prompt strategies are not successful, including those using step-by-step reasoning. To better understand this result, we extend ScoNe with ScoNe-NLG, a sentence completion test set that embeds negation reasoning in short narratives. Here, InstructGPT is successful, which reveals the model can correctly reason about negation, but struggles to do so on NLI examples outside of its core pretraining regime.

## introduction negation is a ubiquitous but complex linguistic phenomenon that poses a significant challenge for nlp systems. a diverse array of benchmarks focused on negation have appeared in recent years, many of which contain families of contrasting examples that provide a local view of the model decision boundary @xcite . for instance, @xcite , @xcite , @xcite , @xcite , @xcite , and @xcite all conduct evaluations with minimal pairs of examples that are identical except for a negative morpheme. these examples reveal whether the presence of negation has a causal impact on model predictions. however, negation is not simply present or absent in a sentence. rather, negation morphemes are semantic operators that take scope in complex ways, as we see in clear contrasts like the person who was at the talk wasn't happy and the person who wasn't at the talk was happy. the recent con-daqa benchmark of @xcite includes minimal pairs aimed at determining whether models are sensitive to these differences in scope. with the current paper, we seek to provide an even fuller picture of the complexities of negation and semantic scope. we introduce the englishlanguage scoped negation natural language inference benchmark (scone-nli). scone-nli extends the negated portion of the monotonicity nli dataset @xcite ) such that each of the 1,202 examples is now a contrast set with six examples in which zero, one, or two negations are present and each negation may or may not have a semantic scope such that the nli label is impacted by its presence. these six conditions offer a rich picture of how negation affects nli reasoning, and they allow us to determine whether models are truly able to handle nested negation and scope or whether they have found simplistic solutions. we evaluate models on scone-nli using manyshot fine-tuning as well as a wide range of incontext learning strategies. for fine-tuning approaches, we find that roberta and deberta models both solve scone-nli. for in-context learning, we evaluate the latest instructgpt model with a variety of prompt strategies. we find that these models perform well on sections of scone-nli where the negation morphemes can simply be ignored, but they systematically fail in conditions where exactly one negative morpheme has semantic scope such that its presence changes the nli label. in other words, these models fail to learn in context how negation actually takes scope. split premise rel. hypothesis examples no negation the cowboy fell off a horse at the competition ⊐ the cowboy fell off a racehorse at the competition 1,202 one not scoped the cowboy did not fear anything, until he fell off a horse at the competition ⊐ the cowboy did not fear anything, until he fell off a racehorse at the competition 1,202 two not scoped the cowboy, who was not very old, was not proud that he fell off a horse at the competition ⊐ the cowboy, who was not very old, was not proud that he fell off a racehorse at the competition 1,202 two scoped there is no way that the cowboy did not fall off a horse at the competition ⊐ there is no way that the cowboy did not fall off a racehorse at the competition 1,202 one scoped the cowboy did not fall off a horse at the competition ⊏ the cowboy did not fall off a racehorse at the competition 1,202 one scoped, one not scoped the cowboy did not fall off a horse, but the competition was not too important ⊏ the cowboy did not fall off a racehorse, but the competition was not too important 1,202 (a) a six-example contrast set from scone-nli. no negation glen is a fan of learning math. when he sees that his new high school requires that he take a calculus course, he negation glen is not a fan of learning math. when he sees that his new high school requires that he take a calculus course, he non-scoping negation glen isn't just a fan of learning math, he's obsessive. when he sees that his new high school requires that he take a calculus course, he (b) a three-example contrast set from scone-nlg. ## a brief review of negation in nli benchmarks a diverse array of benchmarks and diagnostic experiments have included negation reasoning in recent years @xcite @xcite @xcite @xcite . hossain et al. ( 2022 ) analyze a variety of natural language understanding benchmarks and find that negation is underrepresented, and that when negation is present it often has no impact on the example label. hossain et al. (2020) address this issue by manually adding negation to the premisehypothesis pairs in mnli @xcite , @xcite , and rte @xcite . @xcite introduce the crowdsourced med dataset, which has many nli examples where negation generates inferences. monotonicity nli (monli; geiger et al. 2020) consists of modified snli sentences that have gold labels impacted by lexical entailments in affirmative contexts (pmonli) and lexical entailments reversed by a negation (nmonli). bert fine-tuned on snli and mnli fails to generalize to both of these datasets, but succeeds with further fine-tuning on med/monli. some automatically generated nli datasets also include negation reasoning @xcite @xcite . ## scone-nli the authors generated scone-nli by using each example of nmonli to create a contrast set of six examples where gold labels are impacted by the scope of zero, one, or two negations, as in to succeed across all sections of scone, models need to attend to the presence of negation as well as the way it scopes semantically. fine-tuning on scone-nli we used publicly available weights on huggingface for the deberta-v3-base models already fine-tuned on mnli, fever-nli, and adversarial-nli @xcite . appendix b contains comparable results for the roberta model @xcite . fine-tuning results are in fine-tuning on existing nli datasets is insufficient for good performance on scone-nli: deberta-v3-base fine-tuned on existing nli datasets, even those that focus on negation, systematically fails. thus, it seems that scone-nli captures novel aspects of negation reasoning. in contrast, fine-tuning on monli and scone-nli training data results in near perfect performance on scone-nli test data. this shows that deberta can learn negation reasoning and generalize to new lexical items. in-context learning on scone-nli we evaluated instructgpt using openai's api with textdavinci-002 and text-davinci-003 engines and a temperature of 0.0 @xcite . we ask instructgpt to infer nli labels given the premise and hypothesis using prompts. all prompts are constructed such that if the response contain "yes" (case-insensitive), then the label entailment is predicted, else the label neutral is predicted. we use six prompts ( instructgpt makes systematic errors similar to a baseline that ignores negation entirely. the best results are for the few-shot reasoning prompt with davinci-003. while its overall accuracy of 82% may initially appear to be a success, further analysis reveals otherwise. instructgpt succeeds only on the sections of scone-nli where zero or two negations take scope, namely, no negation (99%), one not scoped (97%), two not scoped ## scone-nlg instructgpt fails to reason about negation when given nli examples that must be adapted to natural language generation (nlg) with prompts. we hypothesized that instructgpt may correctly reason about negation when evaluated on examples hand tailored to its pretraining objective, because there is no need for prompt engineering @xcite @xcite . dataset scone-nlg is a natural language generation dataset that contains 74 contrasting triplets of examples of half-completed naturalistic narratives that have different coherent completions de-pending on the presence and scope of a negation. instructgpt fails on the sections of scone-nli examples containing only one negation, so we opt for contrast sets with three examples that require knowledge of a lexical entailment in an affirmative context without negation, an affirmative context with non-scoping negation, and an negative context with scoping negation, respectively. see in-context learning on scone-nlg we used in-structgpt to complete the partial sentence inputs with the text-davinci-003 engine (temperature of 0.0). in the zero-shot setting, the prompt consists of the scone-nlg example. in the few-shot setting, four demonstrations from scone-nlg are given one with no negation, two with scoping negation, and one with non-scoping negation. see appendix e.13 for the complete prompts. to evaluate, the authors went through the responses by hand and determined whether the generated text is coherent and compatible with the initial narrative. the authors agreed on these annotations for 216/222 of the zero-shot responses with a fleiss kappa of 0.84 and 220/222 of the few-shot responses with a fleiss kappa of 0.91. these agreement rates are so high that we evaluate instructgpt only for the cases where the annotators agree. here, instructgpt is successful but not perfect, achieving 95% and 92% accuracy in the few and zero-shot settings, respectively. we do not observe the systematic failures seen on scone-nli. figure 1 : four human-interpretable algorithms for scone-nli. the first two solve the task perfectly, and the other two implement flawed heuristics that a model might learn to implement. the function get-lexrel retrieves the relation between the aligned words in the premise and hypothesis, count-scoped counts scoped negations, count-neg counts negations regardless of scope, and get-first returns true if the first negation scopes, while get-second returns true if there is a second negation and it scopes. ## future work on interpretability scone is based in naturalistic examples, but it also has a controlled structure that offers valuable opportunities to move beyond simple behavioral testing and more deeply understand how models solve tasks related to lexical entailment and negation. the theory of causal abstraction provides a framework for interpretability @xcite , where a neural model can be understood to implement the intermediate variables and internal structure of a program or algorithm @xcite @xcite @xcite . in fact, the monli dataset and the technique of interchange interventions (which is the primary technique in causal abstraction analysis) were jointly introduced in geiger et al. 2020, where interchange interventions were used to investigate whether a bert model implements a simple, human-interpretable algorithm that can perfectly label monli using a variable representing lexical entailment and a variable representing the presence of negation. with scone, we can ask even deeper interpretability questions of this form. to encourage future work in this direction, we present a range of algorithmic solutions in figure 1 . two of these solutions solve scone and could perhaps explain neural models that learn the task perfectly, and two others implement flawed heuristics that could explain neural models with poor task performance. figure 1a and figure 1b present two intuitive and correct algorithms that solve scone, but have distinct intermediate variables and internal struc-ture. the first computes two booleans representing whether each negation scopes, and the second computes a count of how many negations scope. figure 1d is the flawed heuristic that ignores negation that we discussed in section 3 as a hypothesis about how models fail at our task. figure 1d is a second flawed heuristic that counts the number of negations present but ignores scope. using the toolkit of causal abstraction, we can assess models not only behaviorally, but also evaluate whether they implement an interpretable algorithm. the results of @xcite begin to show how such analyses could be extended to in-context learning with llms, as in section 4. ## conclusion we introduced scone, a benchmark for fine-tuning and in-context learning experiments on negation. scone is challenging for nli models fine-tuned on other datasets, even those designed for negation reasoning, but modest amount of fine-tuning on scone leads to success. for in-context learning, we find that that instructgpt models fail dramatically on scone. however, we also introduce scone-nlg, which uses more narrative-like examples to probe models' capacity to handle negation, and show that instructgpt is successful with zeroshot and few-shot prompts for this task. these results show that scone supports fine-grained assessments of whether models can reason accurately about natural language negation, and our discussion in section 5 suggests that scone can be a powerful tool for discovering how models reason semantically.