Are Language Models Sensitive to Semantic Attraction? A Study on Surprisal
Year: 2023

Abstract:
In psycholinguistics, semantic attraction is a sentence processing phenomenon in which a given argument violates the selectional requirements of a verb, but this violation is not perceived by comprehenders due to its attraction to another noun in the same sentence, which is syntactically unrelated but semantically sound. In our study, we use autoregressive language models to compute the sentence-level and the target phrase-level Surprisal scores of a psycholinguistic dataset on semantic attraction. Our results show that the models are sensitive to semantic attraction, leading to reduced Surprisal scores, although none of them perfectly matches the human behavioral patterns.

heading: 1 Introduction
text: Cases of similarity-based interference have always been at the center of interest for sentence processing studies, as they offer strong evidence for cuebased models of memory retrieval during language comprehension (Cunnings and Sturt, 2018). According to such accounts, interference emerges because an item with some cues has to be retrieved from memory, and because those cues are simultaneously matched by multiple items (Van Dyke, 2007; Lewis and Vasishth, 2013).
Consider the examples in (1) (Wagers et al., 2009):
(1) a. The key to the cells unsurprisingly were rusty.
b. The key to the cell unsurprisingly were rusty.
Compared to fully grammatical sentences, both elicit longer reading times in humans, but the effect is attenuated in 1a., where there is an attractor (cells) matching the number of the verb, causing an illusion of grammaticality. This phenomenon is known as morphological attraction.
Attraction has also been observed at the semantic level, as in the following example from the eyetracking study by Cunnings and Sturt (2018):
(2) a. Julia saw the beer that the lady with the meal quite happily ate during an expensive night out.
b. Julia saw the beer that the lady with the wine quite happily ate during an expensive night out.
Again, both sentences are implausible, because beer violates the selectional restrictions of the verb ate, but the authors of the study observed that (2a) was processed faster than (2b), due to the presence of a semantically fitting noun (meal) that generates a semantic illusion. Both types of illusion are facilitatory interferences, as they attenuate the effects of anomalies leading to higher costs for the human language processing system. This is a case of semantic attraction.
The recent literature in Natural Language Processing (NLP), on the other hand, has shown an increasing interest in using the Surprisal scores (Hale, 2001; Levy, 2008) computed with Neural Language Models (NLMs) to account for sentence processing phenomena (Futrell et al., 2018; Van Schijndel and Linzen, 2018; Wilcox et al., 2018; Michaelov and Bergen, 2020, 2022a; Michaelov et al., 2023). This also includes investigations on interferences at the morphosyntactic level (Ryu and Lewis, 2021). To our knowledge, there have been no attempts to model semantic attraction with NLMs yet.
We aim at filling this gap by presenting a Surprisal-based analysis of a psycholinguistic dataset on semantic attraction with three autoregressive NLMs of different sizes. We found that NLMs are sensitive to both the plausibility of the sentences and semantic attraction effects. However, NLM Surprisal for a target phrase seems to be affected by attraction regardless of general sentence
141
plausibility, differently from human reading behavior. On the other hand, sentence-level Surprisal is not affected by semantic attraction.

heading: 2 Related Work

heading: 2.1 Semantic Attraction in Implausible Sentences
text: The work by Cunnings and Sturt (2018) has recently brought evidence of the existence of semantic attraction in semantically implausible sentences. They collected eye-tracking fixations for sentences in four conditions, by crossing the factors of the plausibility of the sentence (the plausible or implausible arguments are in italic) and the plausibility of an attractor noun (in bold):
(3) a. Julia saw the cake that the lady with the meal quite happily ate during an expensive night out. (plausible sentence, plausible attractor)
b. Julia saw the cake that the lady with the wine quite happily ate during an expensive night out. (plausible sentence, implausible attractor) c. Julia saw the beer that the lady with the meal quite happily ate during an expensive night out. (implausible sentence, plausible attractor) d. Julia saw the beer that the lady with the wine quite happily ate during an expensive night out. (implausible sentence, implausible attractor)
The results showed that fixations were significantly longer in implausible sentences, but the effect was attenuated in presence of a plausible attractor (condition (3c)), while in plausible sentences the attractor did not have any significant effect. The authors explained the finding in terms of “verb-specific cues that may guide retrieval to grammatically illicit, but plausible, constituents during the resolution of filler-gap dependencies”.
The follow-up study by Laurinavichyute and von der Malsburg (2022) instead used a forced choice completion judgement task to compare semantic and morphosyntactic attraction. First, they presented a target verb to the participants, and then they presented them with a sentence fragment, asking participants whether the verb could have been a fitting continuation for the sentence. In such a scenario, it is expected that violations will elicit negative answers, with attraction phenomena pos-
sibly increasing the error rates of the participants. Their stimuli contained violations either at the morphosyntactic or at the semantic level, and have either a morphosyntactic or a semantic attractor. The authors reported considerably higher error rates for the conditions with a violation and an attractor of the same type, supporting the idea that morphosyntactic and semantic attraction work similarly.
Our study on NLMs uses the stimuli from the datasets by Cunnings and Sturt (2018) to test whether they are sensitive to semantic attraction in sentence processing, which may be reflected by the Surprisal scores of the stimuli words. We also want to test whether semantic plausibility and attraction in NLMs interact like in humans, to what extent (cf. the claim in Cunnings and Sturt (2018) that semantic attraction has a facilitatory effect only when the sentence is not plausible) and if the effects are the same in NLMs of different sizes.

heading: 2.2 NLM Estimation of Word Surprisal
text: Transformer-based NLMs (Vaswani et al., 2017; Devlin et al., 2019; Radford et al., 2019) have become increasingly popular in NLP in recent years, and a number of studies designed tests to investigate their actual linguistic abilities (Tenney et al., 2019a; Jawahar et al., 2019; Tenney et al., 2019b). Some of these studies specifically analyzed the Surprisal scores computed by the models, to understand to what extent they are sensitive to linguistic phenomena that have been showed to affect human sentence processing. For example, Misra et al. (2020) investigated the predictions of BERT in a setting aimed at reproducing human semantic priming; they reported that BERT was indeed sensitive to “priming” and predicted a word with lower Surprisal values when the context included a related word as opposed to an unrelated one.Using a similar methodology, Cho et al. (2021) modeled the priming effect of verb aspect on the prediction of typical event locations, finding that BERT outputs lower surprisal scores for typical locations, but differently from humans, it does so regardless of verb aspect manipulations.
Michaelov and Bergen (2022a) investigated the issue of collateral facilitation, that is, when anomalous words in a sentence are processed more easily by humans because of the presence of semanticallyrelated words in the context. They compared the Surprisal scores obtained with several Transformer NLMs and showed that most of them reproduce the
same significant differences between conditions observed in humans. In Michaelov et al. (2023) the same authors used NLM Surprisal to replicate the effect of discourse context in reducing the N400 amplitude for anomalous words, using the Dutch stimuli of the experiments by Nieuwland and Van Berkum (2006).
Probably the closest relative to the topic of our study, Ryu and Lewis (2021) proved that the Surprisal values extracted with the GPT-2 language model predict the facilitatory effects of interference in ungrammatical sentences in which an attractor noun is matching in number with the verb or with a reflexive pronouns. However, they focused on morphosyntactic attraction, while we aim at modeling the facilitatory effects of semantic attraction.

heading: 3 Experimental Settings

heading: 3.1 Dataset
text: We derived our dataset from the Experiment 1 of the eye-tracking study by Cunnings and Sturt (2018). The authors employed a total of 32 items, each of them coming in four conditions, for a total of 128 stimuli. The stimuli were stories composed of an introduction sentence, a critical sentence and a wrap-up sentence. In our experiment, we just fed the NLMs with the critical sentence:
(4) Julia saw the cake/beer (plausible/implausible) that the lady with the meal/wine (plausible/implausible) quite happily ate during an expensive night out.
The sentences in the four conditions, as shown in Example (4), were differing for i) a fitting or a selectional preference-violating direct object (in italic) for the verb in the subordinate clause (underlined), which would determine the plausibility of the sentence; ii) a plausible or an implausible attractor noun (in bold), not syntactically related with the verb but with a high degree of thematic fit with it.1 The authors reported main effects of both sentence plausibility (implausible sentences induce longer fixations) and attractor plausibility (a plausible attractor has a facilitatory effect) in the total viewing times.2 They also reported a significant in-
1We refer to the notion of thematic fit as the degree of compatibility between a predicate and a noun filling one of its semantic roles (McRae and Matsuki, 2009; Sayeed et al., 2016; Santus et al., 2017).
2To address a remark by Reviewer 1, we checked the logarithmic frequencies of the attractor nouns (the target nouns
teraction between the two: total viewing times for implausible sentences were shorter when the attractor was plausible compared to implausible, while no significant difference was observed in plausible sentences as a result of attractor plausibility.

heading: 3.2 Language Models
text: For the models in this paper, we use the implementation of Minicons (Misra, 2022)3, an open source library that provides a standard API for behavioral and representational analyses of NLMs. We make the code and the test data available for additional testing.4 We experiment with three variants of autoregressive LMs of different sizes: the original GPT-2 Base, with 124 million parameters (Radford et al., 2019); DistilGPT-2 with 82 million parameters (Sanh et al., 2019), trained as a student network with the supervision of GPT-2; and GPT-Neo that, with 1.3 billion parameters (Gao et al., 2020; Black et al., 2021), is close to the size of the smallest models of the GPT-3 family.
Using autoregressive NLMs, we computed the Surprisal scores at the target in the stimuli (the verb in the subordinate clause), and also at the level of the entire sentence. When the NLMs tokenizer splits the target in more than one token, we take the average of the Surprisal scores of its subtokens.
More formally, the Surprisal of the target T in the context C (Surp) was computed as:
Surp(T |C) = ∑
t∈T −logP (t|C) count(t)
(1)
where P (t|C) is the probability of each subtoken t ∈ T given the previous context C, while count(t) is the number of subtokens in the target phrase T .
The Surprisal of the sentence S (SentSurp) instead is simply the sum of the Surprisals of each token T normalized by the length of the sentence:
SentSurp(S) = ∑ T∈S Surp(T ) count(T )
(2)
where count(T ) is the total number of tokens in the sentence S.5
were the same in all conditions), which were not mentioned in the original study (see the materials in the Appendix). We have not found any significant difference between noun frequencies across conditions.
3https://github.com/kanishkamisra/ minicons-experiments
4https://github.com/yancong222/ transformers-semantic-attraction-surprisal
5Notice that the sentences may differ in the number of tokens, in the cases when the object and/or the attractor nouns are splitted by the tokenizer. This is why we did not use the
For each NLM, we fitted a linear mixed-effects model using Surp or SentSurp as the dependent variable, which was estimated for each of the experimental stimuli. The independent variables were: the plausibility of the sentence SentPlaus (plausible vs. implausible; plausible as the base of comparison), the plausibility of the attractor AttrPlaus (plausible vs. implausible; plausible as the base of comparison), their interactions, and the token length of the stimulus length. We included items as a random intercept in our models. We use the LME4 package (Bates et al., 2014) for model fitting and results; the pairwise comparisons with Tukey adjustment were carried out by the EMMEANS package (Lenth, 2019) in R.

heading: 4 Results
text: The findings of the experiments are summarized in Tables 1 and 2.
Considering the main effects, we found that all models were able to distinguish plausible from im-
sum of the Surprisal scores, as per Reviewer 3’s comment.
plausible items at the sentence level (see SentPlaus in Tables 1 and 2), with significantly higher Surprisal scores for the latter.
As shown in Table 1, the models based on Surp were also sensitive to the attractor plausibility, and marginally to the token length of the stimuli. No significant main effect of interaction between sentence and attractor plausibility was found. The models based on SentSurp (Table 2) were sensitive to token length, but not to the attractor plausibility, with the only exception of a marginal significance for DistilGPT2. The SentSurp model based on DistilGPT2 is the only one showing (at least marginally) significant effects for the plausibility of both sentence (p = 0.011) and attractor (p = 0.06) and for their interaction (p = 0.038) (see Table 2 and Figure 1), while no interaction was found in any of the other models. The fact that this behavior was found in the smallest model may represent another case of what has been called “inverse scaling” in the NLM literature, that is, the performance decreases at the increase of model size (Wei et al., 2022; Jang et al., 2023), or in the
case of psycholinguistic modeling, the behavior becomes less human-like (Michaelov and Bergen, 2022b; Oh and Schuler, 2022).
The post hoc analyses of the pairwise comparison showed some interesting contrasts. We noticed that significant differences were found between the plausible sentences with plausible attractors and the two implausible conditions (i.e. in Figure 1, a vs. c and a vs. d, with ps < 0.001). Differently from human total viewing times, no significant differences and no consistent facilitatory effects are observed between c and d in the SentSurp models (notice also in Figure 1 that the median of condition d. is actually slightly lower than c., and the medians for c. and d. tend to be close in all the SentSurp models, cf. the boxplots in the Appendix, right column), while facilitation is found for all the Surp models.
It is also noticeable that all models show no sensitivity to plausible attractors with the sentence-level Surprisal metrics, but the Surprisal at the target word with implausible attractors is always significantly higher. However, since no significant main effect of interactions was found for Surp models, we conclude that semantic attraction seems to to have a general facilitation effect on its own, regardless of sentence plausibility.
It would be interesting, in the future, to analyze how the attractors concretely affect the predictions, for example using techniques like contrastive explanations (Yin and Neubig, 2022) that can shed light on which tokens contribute to the prediction
of the target verb rather than a plausible alternative word (in our case, this could be a verb in a thematic fit relation with the implausible attractor noun, e.g. drank for wine in examples 2. b-d).

heading: 5 Conclusions
text: In this work, we presented a study on Surprisal to investigate whether NLMs predictions are sensitive to semantic attraction. Our results on the data of the eye-tracking experiment by Cunnings and Sturt (2018) reveal that all models are sensitive to the general plausibility of the sentence, and that semantically-plausible attractors decrease the Surprisal at the target phrase, although this effect generally does not interact with sentence plausibility as in humans.
At the sentence level, no effects of attractor plausibility were observed, with the only, partial exception of a marginal significance with DistilGPT2. Interestingly, the most human-like pattern -including the interaction- has been observed with this model, the smallest one, although the specific contrasts between conditions pattern differently from human total viewing times.

heading: Acknowledgments
text: We would like to thank the three anonymous reviewers for their insightful feedback.
This research was made possible by the start-up research fund (1-BD8S) at the Hong Kong Polytechnic University.

heading: Future Work
text: It would be interesting, in the future, to analyze how the attractors concretely affect the predictions, for example using techniques like contrastive explanations (Yin and Neubig, 2022) that can shed light on which tokens contribute to the prediction
of the target verb rather than a plausible alternative word (in our case, this could be a verb in a thematic fit relation with the implausible attractor noun, e. g. drank for wine in examples 2. b-d)