Testing Large Language Models on Compositionality and Inference with Phrase-Level Adjective-Noun Entailment (2022)

Abstract: Previous work has demonstrated that pre-trained large language models (LLM) acquire knowledge during pre-training which enables reasoning over relationships between words (e.g, hyponymy) and more complex inferences over larger units of meaning such as sentences. Here, we investigate whether lexical entailment (LE, i.e. hyponymy or the is a relation between words) can be generalised in a compositional manner. Accordingly, we introduce PLANE (Phrase-Level Adjective-Noun Entailment), a new benchmark to test models on fine-grained compositional entailment using adjective-noun phrases. Our experiments show that knowledge extracted via In–Context and transfer learning is not enough to solve PLANE. However, a LLM trained on PLANE can generalise well to out–of–distribution sets, since the required knowledge can be stored in the representations of subwords (SW) tokens.

## introduction composition and entailment are crucial features of human language and reasoning. the first refers to the ability to combine units of meaning, like words or phrases, into larger constructs, such as sentences or paragraphs. entailment, on the other hand, refers to the notion of inference. a linguistic element a (e.g. a word or phrase) is said to entail an element b if, assuming a is true, so is b. word-level entailment is often referred to as lexical entailment (le), hypernym detection, or the is a relation @xcite @xcite , and refers to examples such as dog entails (|=) animal and gun |= weapon. yet entailment does not occur just between two words, and has been a long standing problem in nlp @xcite @xcite . when occurring between two sentences, it is usually referred to as natural language inference (nli). although arguments have been made in favour of a more probabilistic interpretation of the task (see @xcite ; @xcite , inter alia), nli benchmarks generally abandoned the rigid binary classification for a three way classification, usually involving a neutral or unk label 1 . with a few exceptions, e.g., @xcite ; @xcite ; @xcite , nli is still the main method adopted by the nlp community to jointly study the compositional and inferential abilities of a model. however, commonly used benchmarks frequently contain spurious statistical associations that a model can use to solve the task @xcite @xcite . these cues might be as simple as the presence of negation or lexical overlap @xcite , but can be more complex, and exploit similar syntactic substructures between premise and hypothesis @xcite . popular alternatives to training and testing models on datasets containing significant biases are prompting @xcite @xcite and in-context learning @xcite . the success of these paradigms has grown in parallel with the popularity of large language models (llms) based on transformers @xcite . llms architectures are usually pre-trained with mask or next-sentence prediction tasks, and later fine-tuned on other downstream tasks. pre-trained llms have been successfully used with a prompt-based framework to extract factual information @xcite (e.g. dante, born_in, italy), le relations @xcite (e.g. car, is a, vehicle) and study the more complex entailment in winograd-style schemata @xcite . here, we study the impact that pre-training, nli tuning and supervised learning have on the 1 usually matched with entailment and non-entailment/contradiction. our main contributions are as follow. first, in section 3, we introduce plane (phrase-level adjective-noun entailment), a large and automatically annotated resource to evaluate models on phrase-level compositional entailment for the english language. we then provide consistent evidence that knowledge acquired by llms during the pre-training phase (section 4), and during finetuning on nli tasks (section 5) is weak, yielding poor and unstable performances on plane. in contrast, we show in section 6 how, in a supervised setting, a model like bert can effectively generalise to out-of-distribution test sets, and how crucial the role of subword (sw) tokens is to this ability. finally, our work underlines how the different logical functions associated with the three macro classes of adjectives, frequently ignored or oversimplified, can pose notably different challenges to these models. ## related work prompting among the vast literature on prompting llms, the work from @xcite is closely related to ours, and provides evidence that bert retains information on the hyponym-hypernym relation occurring between two words. the work also shows how crucial the structure of the prompt can be. garí soler and apidianaki (2020) provide evidence on the rich representations that bert has about scalar adjectives and their intensity. @xcite propose a set of detailed entailment-based experiments, using both prompting and finetuning paradigm. here, winograd-like scenarios are used to carefully construct sentences that challenge llm's internal association between two entities. results strongly suggest that, once a model is not able to rely on those learned associations, the task becomes challenging even after finetuning. phrase entailment compared to nli, phraselevel entailment (ple) has received significantly less attention. @xcite present a set of experiments on compositional entailment considering adjective (e.g., big dog |= dog) and quantifier modifications (e.g., all dogs |= some dogs). however, instances were strictly limited to an |= n, and the class of the modifying adjectives was not discussed or differentiated in the results. kartsaklis and sadrzadeh (2016) introduced a manually annotated dataset for ple, using subject-verb, verbobject, and subject-verb-object phrases. negative samples were built by reversing each entailment item. in contrast, in our dataset, the label of an item can not be inferred by directional clues (i.e. hyponym-hypernym vs hypernym-hyponym) or by the absence of the hypernym relation between constituent words (e.g. big cat ̸ |= dog because cat ̸ |= dog). @xcite showed how automatically constructed compound-noun and an compositional items can be used as a data augmentation method to enhance le. however, this work filtered out intensional adjectives and assumed that for all other adjectives, n |= h(n ) =⇒ an |= h(n ). an phrases were also studied within the context of fully formed sentences. the main example is the work from @xcite , that introduced the addone dataset. overall, addone resemble the standard nli benchmark, with sentence as premise and hypothesis, used to formulate a three way (entailment, non-entailment, unk) classification task. however, in this case premise and hypothesis differ only by the presence or absence of a single adjective. @xcite probed bert with addone to study how it encodes the property of a noun. in contrast, we study the different entailment relations which are valid for different classes of adjectives. ## plane in this section, we describe the plane benchmark. we first outline how each of the three classes of adjectives, intersective (i), subsective (s) and intensional (o), affects the relation between a noun and its hypernym, as well as the noun itself. we then describe the sources used to gather adjectives, nouns, an phrases, and hypernyms, and the procedure used to generate entailment items. ## in-context learning in this section we investigate the ability of multiple llms to solve compositional entailment with-out any target training. to do so, we adopt an in-context learning paradigm. with a similarly aim, @xcite evaluated a model's performance on le by testing if it was able to unmask a prompt p such as "a x is a [mask]" with a correct hypernym of x. given the phrasal nature of our investigation, we structure our prompts to ask the model whether a particular instance is a positive (✓) or negative (✗) example of an entailment pair. results from @xcite and preliminary zero-shot experiments (see appendix b.1) suggest the performance of a model may be largely affected by its lack of understanding of the task, or particular words in the prompt. thus, we experiment with a two-shot nli-like format, providing models with some solved examples and background knowledge about entailment, involving the lexical items in the hypothesis. more specifically, we adopt a prompt p consisting of two 'labelled' premises and one 'unlabelled' hypothesis, e.g.,: p 1 : a big car is a good example of a car. p 2 : a big car is a poor example of a big vehicle. as in the example, each of the three components of p (i.e. the two premises and the hypothesis) has a unique inference type (it). we structure the prompts in this way for two reasons: i) to independently study @xmath0, n, h(n) > triplets generating @xmath1, c 2 , label >; ii) investigate if a context that facilitate the identification of an adjective's class, also yields better performances. in the example above, even if a model has no knowledge on the adjective big, but knows how subsective (s) adjectives work, it can directly infer from the premises the class of big, and, hence, the correct label for the hypothesis. however, if p 2 and h were inverted, the only way a model could solve the instance would be knowing how subsective adjectives work and that big is subsective. lastly, to investigate potential recency effects of the two premises, we query each model with the presented prompt and one with inverted p 1 and p 2 . for example, given a hypothesis with it 3, we consider both premises with it 1,2 and premises with it 2,1. since p contains labelled examples, models can observe the expected label within the given sample. we hence define a set of label's verbalisers for positive (✓), and one for the negative (✗) labels. ## transfer learning evidence from section 4 suggest in-context learning is too susceptible to internal correlations and biases to be reliable. since models trained to classify text for entailment are very popular, we next investigate whether tuning a llm for sentence level entailment can provide enough information to reliably solve phrase-level entailments from plane. for comparison, we re-use the same test from the two-shot experiment, re-framing the task as a standard nli text classification. we replace the standard premises-hypothesis input sentences with @xmath2,c 2 > pair, and evaluate a model's performance in classifying each scenario as presenting an entailment or not. we adopt f1 scores, since, in contrast to plane's binary classification, nli also has a third label (2). this label, often referred to as neutral or unk, usually denotes instances where annotators could not agree on the presence or absence of entailment (1). ## supervised learning as suggested in @xcite , and supported by preliminary experiments (see appendix d), drawing the test set from the same distribution of the train set likely over-simplifies the task for llms. hence, to study the performance of a model in a supervised setting, we focus on it's ability to generalise out of distribution (good). furthermore, we conducted an experiment using a setting where structural cues as the inference types (it) have been removed (one-it). as llms' vocabularies contain a significant amount of subwords (sw) tokens, together with word tokens, we provide an analysis on the impact of sws on the model's performance. following the work of @xcite , @xcite , @xcite , we focus the su-pervised experiments on a bert-base model. ## discussion and conclusion adjectives can be grouped in three macro classes. from a logical and linguistic perspective, these classes shape the truth value of a lexical entailment (le) pair as dog |= animal in multiple ways, depending on the class and the structure of said inference, as presented in results based on in-context learning suggest that llms' performance is too unstable, and frequently relying on pre-existing word associations or labelling patterns. conclusions are not so different with models tuned to classify text for entailment. as section 5 strongly suggests, after tuning a model for sentence-level inference, the knowledge is hardly transferable to the same task at phrase level. these evidence are likely connected to how an phrases behave within the context of fully formed sentences @xcite . from a logical stand, japanese economy |= economy. yet, given a sentence as "bush travels monday to michigan to make remarks on the japanese economy." foot_4 , potential annotators might say it does not entail "bush travels monday to michigan to make remarks on the economy.". of course this and similar scenarios are influenced by complex commonsense and pragmatical knowledge. yet this opens interesting questions on how an phrases in and out of context are related to each other, whether a model should be able to correctly reason over both, and, most importantly, what can we do to make that happen. experiments with supervised learning and out-of-distribution test sets suggest that a llm such as bert can become robustly efficient, even in absence of structural cues. our results strongly suggest that the solution is aided by subwords (sw) tokens. aside from leaking some information to the test set, sw might create biases related to how they distribute in different adjective classes. this solution is computationally efficient and effective, but might pose some limits. this solution is simple, computationally efficient and effective. however, it is unlikely that it provides a theoretically sound model of natural language from the perspective of composition, especially since sw are rarely morphologically grounded @xcite . from a practical perspective, it also poses questions as to how we should define out-ofdistribution sets when working with llms. to conclude, we introduced plane, an extensive annotated resource to train and test models on compositional phrase-level entailment, using adjective-noun phrases. we provided evidence that knowledge learnt via pre-training or nli tuning is insufficient to solve the task, and showed how, in a supervised setting, a model like bert can learn to generalise out of distribution examples, adopting strategies connected to sw tokens. future work will focus on extending in-context learning to autoregressive llms, using plane to evaluate le models on composition, and investigate a three-way or probabilistic labelling system.