Semantic Sensitivities and Inconsistent Predictions: Measuring the Fragility of NLI Models (2024)

Abstract: Recent studies of the emergent capabilities of transformer-based Natural Language Understanding (NLU) models have indicated that they have an understanding of lexical and compositional semantics. We provide evidence that suggests these claims should be taken with a grain of salt: we find that state-of-the-art Natural Language Inference (NLI) models are sensitive towards minor semantics preserving surface-form variations, which lead to sizable inconsistent model decisions during inference. Notably, this behaviour differs from valid and in-depth comprehension of compositional semantics, however does neither emerge when evaluating model accuracy on standard benchmarks nor when probing for syntactic, monotonic, and logically robust reasoning. We propose a novel framework to measure the extent of semantic sensitivity. To this end, we evaluate NLI models on adversarially generated examples containing minor semantics-preserving surface-form input noise. This is achieved using conditional text generation, with the explicit condition that the NLI model predicts the relationship between the original and adversarial inputs as a symmetric equivalence entailment. We systematically study the effects of the phenomenon across NLI models for \text{\emph{in-}} and \text{\emph{out-of-}} domain settings. Our experiments show that semantic sensitivity causes performance degradations of 12.92% and 23.71% average over \text{\emph{in-}} and \text{\emph{out-of-}} domain settings, respectively. We further perform ablation studies, analysing this phenomenon across models, datasets, and variations in inference and show that semantic sensitivity can lead to major inconsistency within model predictions.

## introduction transformer-based @xcite language models (lms) have shown solid performance across various nlu tasks (wang et al., 2018, † equal contribution, alphabetical order. * senior author. 2019). these advances have led to suggestions regarding the emergent capabilities of the models in terms of syntactic @xcite @xcite , logic @xcite and semantic @xcite understanding. however, we present novel evidence that indicates that these models are prone to inconsistent predictions induced by inherent susceptibility towards semantic sensitivities. to probe the models for these discrepancies, we formalise semantic comprehension as the ability to distinguish logical relations within sentences through identifying compositional semantics @xcite . this means that negligible semantic variations should not impact the inherent relations implied between the texts, e.g. "there were beads of perspiration on his brow." entails both "sweat built up upon his face." and the slight variation "the sweat had built up on his face." authentic comprehension of semantics does allow for such understanding through discovering semantic structures and the inherent relations induced by them @xcite @xcite . this means that analysing the emergent semantic understanding within a model should minimally involve testing for sensitivity towards semantics-preserving surface-form variations. we particularly focus on the task of textual entailment @xcite , otherwise referred to as natural language inference @xcite , which has been widely used to probe how well the models understand language @xcite @xcite . this is a pairwise input task, where given a premise p and a hypothesis h, the objective is to predict if the premise entails, contradicts or is neutral towards the hypothesis. we propose a framework for testing semantic sensitivity within transformer-based models trained for nli, by creating semantics-preserving surfaceform variations of the hypothesis (see figure 1 ). these variations are created using conditional generation with large language models (llms). we show that proposed candidates do not alter the core meaning or the truth value compared to the original statement. the original and generated sentences maintain denotative equivalence, where two sentences or phrases might be interpreted as having the same truth value or factual content but may carry minor variations of nuances or connotations. to ensure that the relations are preserved within the candidates during conditional generation, we assert that the nli model predicts the original and generated hypothesis to symmetrically entail each other. this indicates that the model perceives both the generated and original hypothesis as equivalent. after introducing these variations, we evaluate the nli model by replacing the original hypothesis with the generated candidates. as the candidates are indicated to be equivalent by the same nli model, this evaluation will indicate whether the model can recover the existent relation between the premise hypothesis pair in the presence of minor semantic-preserving noise. we use the samples where the model identifies the existing relation correctly from the original premise hypothesis pair. this ensures that assessing for semantic sensitivity would not be hindered by the discrepancies in model performance. we systematically study the semantic sensitivity across transformers that achieve state-of-the-art or similar results when trained on nli datasets, namely roberta @xcite , bart @xcite , deberta @xcite and dis-tilbart @xcite with different parametrizations. to measure the effect of the phenomenon on the inconsistency of the predictions, we use three popular english datasets -multinli @xcite , snli @xcite and anli @xcite . the models are fine-tuned using mnli, which we choose for in-domain testing, as it covers a wide range of topics and is frequently used for zeroshot and few-shot textual classification @xcite . we use the same models for out-of-domain evaluation across the other nli datasets. our contributions are as follows: (i) we propose a novel framework for assessing semantic sensitivity within transformer-based language models (ii) we systematically study the influence of this phenomenon on inconsistent predictions across various transformer variants (iii) we show that the effect is persistent and pronounced across both in-and out-of-domain evaluations (iv) we further complete ablations to assess the severity of the inconsistent predictions caused by semantic sensitivity. ## related work semantic comprehension is considered a fundamental building block for language understanding @xcite . although attempts have been made to probe language models in terms of compositional semantic capabilities, the conclusions regarding their emergence remain to be discussed. models appear to understand semantics recently a wide suite of tasks has been proposed for testing models for language understanding @xcite @xcite with the credence that a model with strong performance should be able to utilise semantic relations when completing the tasks. in light of these, it has been shown that transformer-based language models can be directly trained @xcite to utilise semantic structure to gain distributional information within the task. specifically, nli models have also been shown to be capable of pragmatic inferences @xcite with a perception of implicature @xcite and presupposition @xcite . models struggle with semantics directly probing for a specific aspect of semantic understanding has shown that transformer-based language models tend to struggle with semantics @xcite . it has been indicated that pretraining the language models does not exploit semantic information for entity labeling and coreference resolution @xcite . furthermore, transformer attention heads only minimally capture semantic relations @xcite from framenet @xcite . studies have also shown that nli models, in particular, tend to struggle with lexical variations, including word replacements @xcite @xcite , and sequence permutations @xcite . ## methodology we aim to create a framework for assessing semantic sensitivity within nli models and measure its impact on the inconsistence of model predictions. the first part of the pipeline we propose is an adversarial semantics-preserving generation for introducing variations within the original samples. the second part of the pipeline involves assessment using the acquired generations. ## results and analysis this section presents the results and analyses of our semantic sensitivity evaluation framework along with a suite of ablations analysing the phenomenon across various transformer sizes, domains, and label space. furthermore, we measure the impact of the phenomenon on the inconsistent predictive behaviour of nli models. ## conclusion we present a novel framework for assessing semantic sensitivity in nli models through generating semantics-preserving variations. our systematic study of the phenomenon across various datasets and transformer-based plms shows that the models consistently struggle with variations requiring knowledge of compositional semantics. this performance deterioration happens across the whole label space, almost regardless of model size. we measure the impact of semantic-sensitivity and show that it diminishes models' predictive confidence and can lead to predictive inconsistency.