Language models are not naysayers: an analysis of language models on negation benchmarks (2023)

Abstract: Negation has been shown to be a major bottleneck for masked language models, such as BERT. However, whether this finding still holds for larger-sized auto-regressive language models (“LLMs”) has not been studied comprehensively. With the ever-increasing volume of research and applications of LLMs, we take a step back to evaluate the ability of current-generation LLMs to handle negation, a fundamental linguistic phenomenon that is central to language understanding. We evaluate different LLMs - including the open-source GPT-neo, GPT-3, and InstructGPT - against a wide range of negation benchmarks. Through systematic experimentation with varying model sizes and prompts, we show that LLMs have several limitations including insensitivity to the presence of negation, an inability to capture the lexical semantics of negation, and a failure to reason under negation.

## introduction despite being a core linguistic phenomenon, negation remains a major stumbling block for modern nlp architectures @xcite . a reason for this could be that texts containing negation are underrepresented in training data of language models, as humans tend to express themselves using affirmative rather than negative expressions @xcite . regardless, negation has been shown to be challenging even for humans to correctly interpret due to the diversity of forms across domains @xcite . for instance, in clinical documents, many acronyms are used to denote negation such as nad (no abnormality detected), and implicit negation abounds, such as normal chest x-ray scan, which implies the absence of an abnormality. even more complex is the use of negation in combination with other linguistic phenomena such as quantifiers, gradable adjectives (not unattractive does not imply attractive) * now at google deepmind. @xcite ; licensing context (negative polarity items, e.g. any, either, yet, normally appear in certain negative grammatical contexts @xcite ); downward entailment (a man owns a dog entails a man owns an animal but a man does not own a dog does not entail a man does not own an animal) @xcite . traditionally, negation has been treated as a standalone problem, e.g. as negation detection @xcite . the investigation of the impact of negation in various downstream tasks @xcite , or through probing @xcite has revealed several limitations of modern large language models ("llms") in handling negation. given that llms are being adopted in an ever-growing range of tasks and have been shown to display emergent abilities for high-level tasks that require complex reasoning @xcite , we are interested in exploring how the handling of negation has progressed. in this work, we investigate the performance of auto-regressive language models on different negation-focused benchmarks. instead of just looking at samples containing negation in common nlp datasets, we consider datasets in which negation plays an important role in making the correct judgement. in particular, we classify the benchmarks into three categories corresponding to the requisite negation reasoning abilities: (1) sensitivity to negation through cloze completion (fill-inthe-blank) queries of factual statements; (2) lexical semantics of negation through classification of antonym/synonym relationships; and (3) ability to reason with negation through language inference tasks. we conduct extensive experiments using promptbased learning to facilitate zero-and few-shot evaluation of llms, and find the following: ## experimental settings in this section, we outline the settings that , including benchmark datasets, models to evaluate, and the prompts that were used. our code is available at https://github.com/ joey234/llm-neg-bench . ## main findings we summarize the main findings in this section. in general, the performance of gpt-neo and opt follows a similar trend across all benchmarks (we present gpt-neo results; results of opt models are in appendix b). finding 1: larger lms are more insensitive to negation mkr-nq @xcite masked knowledge retrieval -negated query (mkr-nq) is a negated version of the lama dataset @xcite , which contains lexicalized statements of triples in conceptnet @xcite . this dataset contains factual statements with verbal negations (i.e. negators not, don't are associated with the main verb of the sentence), e.g. iburofen is a type of medicine. → iburofen isn't a type of medicine. each sample contains the query along with a set of wrong word completions, supporting the evaluation of the sensitivity of the model to negation by measuring how likely a model will generate incorrect completions. note that mkr-nq only considers sample sentences that contain a single verb, making it trivial to negate the original sentences. findings from figure 1 , which is based on llms with a negated factual statement (default prompt), we observe relatively low hit rates (< 0.15) across all model sizes, and a clear inverse scaling trend between model sizes and their performance. the smallest variant (gpt-neo-125m) has the best performance, which is comparable to that of masked language model of a similar size (bert-base, 110m parameters) @xcite . this phenomenon reflects the finding that larger models tend to memorize the training data more @xcite . moreover, higher hit rates for top-1 predictions suggest that models predict wrongly with high confidence. for contrasting prompts, in which we prepend the negated statement with its non-negated version, we notice a drastic increase in whr, showing that models are prone to repeating what is presented in the prior context, confirming the finding of @xcite . when a discourse term is added to connect the two sentences (discourse prompt), we do not observe any improvement, and the performance of the largest model is even worse. to investigate whether this phenomenon is attributable to models not being able to detect the presence/absence of negation, we experiment with masking out the main noun/verb of the queries (mask prompt). we observed even higher whr, especially for the top-1 prediction in this setting. the results suggest that repetitions are caused more by llms being easily primed by repeating what is present in the previous context, than by generating words that are closely associated with the main subject of interest. this again shows that the models cannot differentiate between identical contexts, differing only on whether negation is present or absent (i.e., outputs tend to be similar with or without negation). finding 2: lms fail to capture synonym/antonym lexical relations mwr @xcite to test the ability of lms to capture negative lexical semantics, we use mwr dataset, where models are asked to predict the antonym/synonym of a target word. the dataset was constructed by using the most frequent nouns, adjectives, and adverbs that appear in snli @xcite , then choosing their corresponding synonyms and antonyms from concept-net @xcite . the dataset also contains different wordings for antonym-asking and synonym-asking queries (e.g. is the opposite of, is different from and is similar to, is a rephrasing of ) to test model sensitivity to prompt variations. findings from figure 2 , we can observe the same inverse scaling trend as for mkr-nq using query wrong completions top-5 predictions greed is an antonym of greed, avarice, desire, greeds, gluttony altruism, self-sacrifice, self-denial, self-abnegation, gods finale is an antonym of conclusion, finish, finales, finale last, epiphany, finality, anticlimax, anticlimactic the default prompt, where the hit rate of the smallest model is around 0.02, better than previouslyreported sota results @xcite . with a more natural query with more focus on the target words via quotation marks (quote prompt), surprisingly, we noticed a drastic jump in hit rates. however, mwr may not be a good indicator of model performance due to how the task is framed. one problem is that models can generate words that are not in the given wrong prediction set, but are also irrelevant, and are also neither antonyms nor synonyms of the given target words, as demonstrated in findings in contrast to the high results for mwr, we find that for this task, model performance is equivalent to random, with accuracy fluctuating around 0.5 (figure 3 ). for prompt variants, we do not observe any meaningful improvement, in that simple follows a similar trend to default and negation performs better for larger models (2.7b and 6b). this is a huge degradation from previous fully fine-tuned results over encoder models. for instance, @xcite reported that bert large achieves 92.5% accuracy on sar. we argue that this is a specific task that is not captured in the next token prediction training objective of llms and thus, requires explicit supervision. finding 3: llms are unable to reason under negation negnli (hossain et al., 2020) negnli contains 4500 premise-hypothesis pairs with important negation, where negation is essential in making the correct judgement about the relationship between the premise-hypothesis pairs. samples are extracted from the commonly-used nli datasets (rte dagan et al. (2005), snli bowman et al. (2015), mnli williams et al. ( 2018 )), then the negator not is added to the main verb either in the premise, hypothesis, or both. here, we consider each subset separately, as the number of classes are not the same, and denote them snli-neg, mnlineg, rte-neg. monli @xcite monli is an nli dataset focused on lexical entailment and negation. specifically, the dataset investigates the downward monotonicity property where negation reverses entailment relations (e.g. dance entails move, but not move entails not dance). monli was created by extending samples from snli by substituting the nouns by their hypernyms/hyponyms from word-net @xcite . nan-nli @xcite nan-nli is a test suite which focuses on sub-clausal negation, in which only part of the sentence's meaning is negated, thus making it harder to correctly determine the correct negation scope (e.g. in not the first time that they pulled that off the negation scope is only not the first time and the main clause of the sentence they pulled that off is not negated). each premise-hypothesis pair is constructed so that the corresponding hypotheses are constructed to reflect different interpretations that the negated instance in the premise are likely to be misunderstood for. findings similar to the antonym/synonym classification task, the performance for most negationfocused nli benchmarks is low. in particular, for all nli datasets, the performance is generally lower than baseline. as shown in figure 4 , scaling up model size has almost no effect, and the largest model performs worse in many cases, even when the prompt explicitly states that the task requires reasoning about negation (negation prompt). for datasets which include a training set (sar, monli), we also experimented with fewshot learning but did not observe any noticable improvement (figure 5 ). one exception is that the 2.7b model seems to pick up some signal from the provided monli training samples, but falls back again when we increase the model size to 6b. even with general nli datasets, zero-shot applications of llms were previously shown to be roughly equivalent to a random baseline @xcite . when negation is involved, the task becomes even more complex. as pointed out in @xcite , one possible reason that llms benchmark gpt-j-6b gpt-3 instructgpt instructgpt w/ neg. prompt flan-t5-xxl w/ neg. prompt mkr-nq whr5 ↓ 0.083 0.172 0.195 na na mwr 0.125 0.488 0.504 na na sar accuracy ↑ 0.490 0.501 0.687 0.780 0.507 snli-neg 0.316 0.267 0.640 0.673 0.477 mnli-neg 0.275 0.359 0.548 0.625 0.354 rte-neg 0.211 0.525 0.767 0.807 0.770 nan-nli 0.298 0.469 0.647 0.682 0.376 monli 0.500 0.540 0.470 0.400 0.500 ## conclusion we have shown that llms still struggle with different negation benchmarks through zero-and fewshot evaluations, implying that negation is not properly captured through the current pre-training objectives. with the promising results from instructiontuning, we can see that rather than just scaling up model size, new training paradigms are essential to achieve better linguistic competency. through this investigation, we also encourage the research community to focus more on investigating other fundamental language phenomena, such as quantification, hedging, lexical relations, and downward entailment.