Psycholinguistic Diagnosis of Language Models’ Commonsense Reasoning (2022)

Abstract: Neural language models have attracted a lot of attention in the past few years. More and more researchers are getting intrigued by how language models encode commonsense, specifically what kind of commonsense they understand, and why they do. This paper analyzed neural language models’ understanding of commonsense pragmatics (i.e., implied meanings) through human behavioral and neurophysiological data. These psycholinguistic tests are designed to draw conclusions based on predictive responses in context, making them very well suited to test word-prediction models such as BERT in natural settings. They can provide the appropriate prompts and tasks to answer questions about linguistic mechanisms underlying predictive responses. This paper adopted psycholinguistic datasets to probe language models’ commonsense reasoning. Findings suggest that GPT-3’s performance was mostly at chance in the psycholinguistic tasks. We also showed that DistillBERT had some understanding of the (implied) intent that’s shared among most people. Such intent is implicitly reflected in the usage of conversational implicatures and presuppositions. Whether or not fine-tuning improved its performance to human-level depends on the type of commonsense reasoning.

## introduction in this paper, we focus on language models' (lms) performance in commonsense reasoning tasks. different from language semantics concerning logical relations between isolated sentence meanings, we take pragmatics to be sentences' relations relying on conversational participants' commonsense, such as the basic level intent that is commonly shared among most people. humans reason about what their interlocutor could have said but chose not to, thereby drawing various inferences. the way humans put linguistic meanings to use depends on social interaction and commonsense assumption. what about machines whose pre-trainings do not involve social interaction? to what extent do they still have this pragmatic knowledge? how do they cooperate without any forms of learning in grice pragmatics @xcite ? this paper attempts to answer these questions by examining transformer lms' performance in commonsense reasoning. we focus on two commonsense pragmatics phenomena: (i) presupposition (henceforth presp), for example, by using determiner the in the utterance "the teacher spoke to me" most people typically presuppose the existence of such a teacher in the context; (ii) scalar implicature (henceforth si), for example, by using quantifier some in "i ate some of the cookies", most people generally imply "not all". we provided linguistic perspectives about how humans compute and evaluate commonsense pragmatics. we then assessed the extent to which lms can understand the meanings pragmatically enriched by human speakers. moreover, we fine-tuned lms with pragmatic inference datasets. evaluation comparisons are reported and discussed. we make all code and test data available for additional testing foot_0 . ## related work lms' knowledge about syntax and semantics is relatively well studied @xcite @xcite . considerably fewer studies have been done on speaker's intent: the implied meaning that's commonly shared among most people's intention. this is called conversational implicature in pragmatics literature @xcite . implicature phenomena like quantifiers some and many are tested in recent studies @xcite . the diagnostics in these studies are controlled. most of them incorporate offline human responses to words in context such as acceptability judgment surveys. relatively few studies include online human response in the assessment @xcite ). on-line measurement uses neurolinguistic equipment electroencephalogram (eeg) and event-related-potentials (erp) to record brain activity @xcite . erp components such as n400 wave is an event-related brain potential measured using eeg. n400 refers to a negativity peaking at about 400 milliseconds after stimulus onset. it has been used to investigate semantic processing. n400 is relevant because it's an online real-time measurement of human brain's response to different language phenomena, and it has been mostly elicited as a result of human processing sentences with semantic anomalies. online measurement differs from offline judgments survey or cloze test in that online measurement reveals human brain's real-time sensitivity to (linguistic) cues. we examine lms using human centered datasets that are collected through both offline and online experiments. how "human-like" the state-of-the-art lms are (cognitive plausibility) has not comprehensively justified @xcite . @xcite provides empirical evidence that the human brain and gpt-2 share fundamental computational principles as they process natural language. in a sense that both are engaged in continuous next-word prediction, and both represent words as a function of the previous context. against this background, we study lms' cognitive plausibility through examining their performance in understanding pragmatically enriched meanings, which are implied or presupposed among most people (i.e. conversational participants) to convey their intentions. ## experiments we first designed most of the tests in the form of cloze tasks, so as to test the pre-trained lms in their most natural setting, without interference from fine-tuning. the main schema we used in this study is called the minimal pair paradigm, in which two linguistic items are in contrastive distribution, meaning the two items are identical except one single aspect. the notion of minimal pair is widely used in linguistic experiments probing the underlying structures of a linguistic utterance. typically, one of the two items is pragmatically odd according to most people's commonsense knowledge (marked by #), relative to the other utterance in the minimal pair. the hypothesis and the accuracy calculation pipeline are as follows. if lms understand commonsense intent, which gets reflected in the usage we compare distillbert with another type of lms gpt-3 @xcite , which has only the decoder. we present model cards in table (1) . study 1: presupposition our first study is built up on @xcite . they performed human behavioral acceptance judgment experiments using the presupposition triggers the. participants were asked to drop out when they think the sentence stops making sense. @xcite 's findings show that humans think utterances make less sense relative to the controls when the presupposed information is implausible. we extracted 82 items from @xcite human experiments stimuli, which are already cognitively justified and freely available in their appendix. seth went to jail/ # a restaurant on saturday night. the guard spoke to him there for a while. presupposes that there is a unique guard in the context. given commonsense world knowledge and the close association of guard and jail, "seth went to jail" is a more likely and plausible context, thus "a restaurant" is marked with #. utterance kristen went to a restaurant/ # jail in the morning. the waiter served her there quickly. presupposes the existence of a (unique) waiter in the context. "kristen went to a restaurant" is a better context in a sense that it lays out a background where there is a waiter. by contrast, jail is rarely associated with waiter, "went to jail" is implausible and is marked with #. it's both the uniqueness of the "waiter" and the relevance of the job to the place "restaurant" that affect the context. @xcite reported that in this stopsmaking-sense paradigm, human participants were near-ceiling in accepting plausible conditions: at the last region of the sentence, the acceptance rate was 95% in the plausible condition. for implausible the, by the end of the sentence, 50% dropped out since it stops making sense and most people cannot accept it. built up on @xcite human experiment, we evaluated lms' sensitivity to presp. we compared the accuracy mean of each condition, as exemplified in john went to school on monday afternoon. the substitute teacher spoke to him there briefly. versus john went to a concert on monday afternoon. the substitute teacher spoke to him there briefly.. the two utterances differ in only one element "school"/"concert". the former is pragmatically good relative to the latter, given that the presupposes a context where there is a teacher, and commonsense tells us that "teacher" and "school" are closer than "teacher" and "concert". gpt-3 is evaluated by the extent to which it favors plausible cases over the implausible ones. sequential word-by-word logprob is generated and transformed into percent. we take the sum of word level logprob averaged by sentence length to be a proxy to the sentence naturalness. higher percent indicates that gpt-3 evaluates the sentence to be natural. distillbert is evaluated through critical word prediction. noun phrase in the initial sentence is masked and taken as the critical word. (e.g., school is masked in "john went to school. the substitute teacher spoke to him there briefly.", whereas concert is masked in "john went to a concert. the substitute teacher spoke to him there briefly.". given that human data shows preference to the plausible over the implausible, dis-tillbert is considered to have succeeded if the critical word is in its topk (@xmath0. it's also considered succeed if the critical word is not in bert's topk for the implausible sentence. study 2: scalar implicature according to @xcite , relative clauses can make implicatures unnoticed by most people in sentence processing. table (2) shows that there is a prag-matic violation in (a) if conversation participant actively draws pragmatic inference that "some (but not all)" office buildings have desks. however, this violation is left unnoticed in (a) due to the presence of the relative clause. (c) is relatively bad and implausible compared to (d): the violation in (c) is noticed due to the absence of a relative clause. note that nieuwland et al. (2010) considered the communication sub-scale of the autism-spectrum quotient questionnaire (aq) @xcite @xcite to be a proxy to be an individual's pragmatic skills. according to @xcite , the aq quantifies pragmatic capabilities on a continuum from autism to typicality. nieuwland et al. (2010) reported that only pragmatically skilled participants (i.e., lower autism scores) are sensitive to the pragmatic violation in (c) (@xmath1.53, @xmath2.003). for (a), in which the implicature is left unnoticed, so is the violation. there is thus no significant difference between the pragmatically skilled participants and those who have high autism scores (@xmath3.29, @xmath4.13). overall pragmatically skilled people are good at generating robust pragmatic inferences that some implies not all, which gives rise to larger n400 when the utterance is pragmatically bad -n400 is a verified erp elicited by anomaly stimuli @xcite . we extracted 168 items from nieuwland et al. @xcite . some examples of items from their data are "some people have lungs/pets, which require good care". gpt-3 is used for sequential word prediction. using sum of token level logprob averaged by sentence length, we examine if there is a difference with and without the si being noticed. gpt-3 is considered succeed if the plausible sentence mean is higher (hence more favorable) than the soso/unacceptable sentence mean. we use masked language models like distillbert for critical word prediction. we masked quantifiers and take some as the critical word for (a,b,d). we take all as the critical word for (c), because si is noticed and all is commonsense intent. now that (a,b,c,d) are all not implausible, bert is marked as succeed if the critical word is in its top5 tokens list. sanity check one may wonder to what extent lm is merely leveraging nouns joint-probability. this motivates us to check whether the test datasets contain enough noun co-occurrence patterns that could make the lms find a likelihood pattern rather than actually reason to conclude which sentence plausibility example label so-so (a) [some] office buildings have desks that are covered with dust. si unnoticed plausible (b) [some] office buildings have plants that are covered with dust. si unnoticed implausible (c) [some] office buildings have desks and can become dusty. si noticed plausible (d) [some] office buildings have plants and can become dusty. si noticed ## fine-tuning distillbert with imppres in order to examine how to improve lms' accuracy in these downstream tasks, and to further evaluate pre-trained lms versus fine-tuned lms, we finetuned distillbert-base-uncased with the imppress dataset @xcite . it consists @xmath5. 14100 tagged utterance pairs were used in the training of presp, and 1410 tagged pairs for testing. here is the input representation: sentence 1 victoria's mall that has hurt sam might upset helen.; sentence 2 victoria doesn't have exactly one mall that has hurt sam.; label contradiction. as to si, 6000 tagged utterance pairs were used for training and 600 for testing. here is the input representation: sentence 1 the teacher resembles some sketches.; sentence 2 the teacher doesn't resemble all sketches.; label entailment. we fine-tuned distillbert-base-uncased on an apple m1 cpu for 3 epochs. we used a batch size 64 of and optimized using adam (kingma and ba, 2014) with @xmath6.9,0.999), with a learning rate 2 this would seem to raise questions about the strength of the conclusions being drawn (c.f. section5) -it seems that lms merely leverage co-occurrence frequency; on the other hand, it also appears that lms' trend aligns with joint frequency -lms does not fail the sanity check because frequency/prevalence heavily influences humans' commonsense reasoning too. of 2e-05. ## evaluations and discussion error bar in fig. 1 shows distillbert does not seem to have difficulty detecting presp, and finetuning slightly decreases its performance. this is likely due to the fact that @xcite data is not formatted the same as the imppress training data. fine-tuning might have misled distillbert. regarding si, fine-tuning significantly increases lms' performance, indicating that the imppress dataset is a good candidate for improving lms' sensitivity to commonsense sis. error bar in fig. 2 indicates that gpt-3 is slightly better in detecting si than in presp, but overall gpt-3 is not good at the psycholinguistic task. this maybe because gpt-3 has a different architecture. lms performance aligns with n-gram baseline in that overall the si dataset is less challenging than the presp: 70% of si dataset shows the favorable co-occurrence direction: the pair tagged as 'good' also shows higher nouns co-occurrence rate than the 'bad' pair does. the presp dataset is less helpful (50%). it's worth noting that it's not clear if we can make a direct comparison between human decisions and lms' rates, especially for the si cases. @xcite suggests that for humans, the informative and pragmatically good statements elicited larger n400 erps than underinformative and pragmatically bad statements. however, this does not directly transfer to the accuracy mean metric we used for lms. all fig. 2 showed is that gpt-3's performance is roughly at chance, with respect to accuracy mean. for future studies, we plan to conduct parallel human studies to collect baseline human decision rates. regarding lms evaluation analysis, our study shows that in order to probe commonsense knowledge from lms, understand their reasoning mechanisms, and identify their limitations for ai applications due to the lack of commonsense knowledge, we need to carefully consider how to prompt the pre-trained lms. for masked lms such as dis-tillbert, our results suggest that an appropriate method to examine how 'human-like' lms are is to mask the same token as psycholinguists do in their behavioral/neural experiments with humans, and keep the same contextual information, so that the experiment setting is as close to human experiments as possible. as to unidirectional lms like gpt-3, they read in sentence using almost the same fundamental mechanisms as humans do, we thus took sentence to be a unit to derive logprob. how much gpt-3 like the sentence is directly reflected in its sentence logprob. it's crucial to use different metrics for bert and gpt-3 to avoid the pitfall of comparing the two with the same metrics, as they are trained very differently, and a perplexity comparison would be inconclusive. our study has some limitations. although we mention multiple times that these pragmatics often exist in conversations, the actual datasets we used are not conversational. for future work, we hope to see how lms perform in a conversation scenario in terms of commonsense pragmatics. this could give us a better grasp of lms' competence at the conversational level of language understanding. for the current work, our motivation of using non-conversational human data for conversational implicature is that lms are not trained the same way through many dialogues, but rather with text found on the web. additionally, we acknowledge that there were some glitches in distillbert's si evaluation setting. bert is considered succeed as long as the critical word is in its topk. by not penalizing that some can be above all in the case where both would be in the topk choices, we accept lm's choice as "correct" white it isn't. it's also not very surprising that all doesn't show up as much as other options in bert's topk choices for scenarios that all is the commonsense intent, given that lm might generate adjectives but not quantifiers to modify the following noun. it's likely that this has nothing to do with the implication, nevertheless they still make sense considering that the lm's learning algorithm uses masked loss. for future research, we hope to get more valid conclusions through directly comparing whether all is relatively more likely than some. humans show no difficulty in using commonsense knowledge to reason about daily conversations. by contrast, the extent to which lms are sensitive to commonsense reasoning has remained an elusive research question in ai research for decades. here, we provide an approach for commonsense reasoning tasks: incorporating online and offline psycholinguistic datasets into lms evaluation. using well-controlled task design and high resolution neurophysiology equipment, psycholinguistics studies all kinds of implicit meanings in natural language. to examine how 'human-like' lms can be, human data is the key. these methods can improve the interpretability and explainability of neural models for reasoning about implied yet commonsense message. to sum up, our paper aims to evaluate distill-bert and gpt-3's ability to make human-like pragmatic inferences, such as si and presp, through human behavioral and neural data. findings show psycholinguistic datasets can help get a good grasp of lms' accuracy in detecting commonsense reasoning. our study adopted a theory-supported lens for investigating the often vaguely-defined "commonsense", and illustrated how to establish connection between commonsense reasoning in nlp and pragmatic semantics.