Collateral facilitation in humans and language models (2022)

Abstract: Are the predictions of humans and language models affected by similar things? Research suggests that while comprehending language, humans make predictions about upcoming words, with more predictable words being processed more easily. However, evidence also shows that humans display a similar processing advantage for highly anomalous words when these words are semantically related to the preceding context or to the most probable continuation. Using stimuli from 3 psycholinguistic experiments, we find that this is also almost always also the case for 8 contemporary transformer language models (BERT, ALBERT, RoBERTa, XLM-R, GPT-2, GPT-Neo, GPT-J, and XGLM). We then discuss the implications of this phenomenon for our understanding of both human language comprehension and the predictions made by language models.

## introduction humans process words more easily when they more contextually predictable, whether predictability is determined by humans @xcite or language models @xcite @xcite . work on the n400, a neural signal of processing difficulty, has provided evidence that the neurocognitive system underlying human language comprehension preactivates words based on the extent to which they are predictable from the preceding context-thus, predictable words are easier to process because they or their features have already been activated before they are encountered @xcite . this has led many to argue that we should consider the human language comprehension system to be engaging in prediction @xcite @xcite @xcite @xcite . however, words that are either semantically related to the elements of the preceding context or to the most likely next word are also processed more easily, even if they are semantically implausible and ostensibly unpredictable. these are known as related anomaly effects. for an example of the former, consider the sentences in (1) that were used as experimental stimuli by @xcite . helmet is the most predictable continuation of the sentence, as determined based on cloze probability @xcite -the proportion of people to fill in a gap in a sentence with a specific word. thus, unsurprisingly, helmet elicited the smallest n400 response, indicating that it is most easily processed. dirt and table are both implausible continuations, and equally improbable based on human responses (both have a cloze probability of zero). yet @xcite found that dirt, which is semantically related to the preceding context of mountain biking, elicits a smaller n400 response than table, which is not. this suggests that something about dirt's relation to the mountain biking event causes it to be preactivated more than table, despite their seemingly equal implausibility and unpredictability. the sentences in (2), used as experimental stimuli by @xcite , provide an example of the other previously-discussed form of related anomaly-where a word semantically related to the most probable continuation (in this case, that with the highest cloze) is easier to process than one that is not. even though tail and tyre are both implausible continuations with a cloze probability of zero, @xcite find that tail, which is semantically-related to the highest-cloze continuation dog, elicits a smaller n400 response than tyre, which is not. in sum, words related to elements of the preceding context or to the most probable continuation of a sequence appear to be more preactivated in the brain than words that are not, even when both are highly anomalous. this effect has been replicated many times @xcite @xcite @xcite @xcite ; for review see @xcite . the key question, therefore, is whether the same neurocognitive system underlying the predictability effects on the n400 also underlie related anomaly effects. under one account @xcite ), the predictive system that underlies predictability effects also leads to these related anomalous words being 'collaterally facilitated' (delong and kutas, 2020, p. 1045) due to their shared semantic features. under this account, therefore, related anomaly effects can all be explained as by-products of our predictive system and the semantic organization of information in the brain. however, there is no direct evidence that this is the case-in fact, given the metabolic costs of preactivation @xcite , it may intuitively seem unlikely that an efficient predictive system would lead to implausible and otherwise anomalous words being preactivated. in fact, many researchers have argued that one or more associative mechanisms are required to explain related anomaly and other similar effects @xcite @xcite . as systems designed specifically to predict the probability of a word given its context, language models offer a means to test the viability of the former hypothesis. if language models calculate that related but anomalous words are more predictable than unrelated anomalous words, this would demonstrate that related anomaly effects can be produced by a system engaged in prediction alone. this would show that it is possible that related anomalies can be 'collaterally facilitated' (delong and kutas, 2020, p. 1045) by a predictive mechanism in human language comprehension. thus, it would remove the need to posit additional associative mechanisms on the basis of related anomaly effects, which could greatly simplify our understanding of human language comprehension. this is what we test in the present study. we run the stimuli from 3 psycholinguistic experiments carried out in english @xcite @xcite through 8 contemporary transformer language models @xcite @xcite @xcite @xcite , calculating the surprisal (negative logprobability) of each word for which the n400 was measured. we then compare whether, in line with the n400 response, anomalous words that are semantically related to the context have significantly lower surprisals than unrelated words. ## related work there have been a wide range of attempts to computationally model the n400 @xcite @xcite @xcite @xcite @xcite @xcite @xcite @xcite @xcite . one of the most successful and influential approaches has been to model the n400 using the surprisal calculated from neural language modelssurprisal has been found to be a significant predictor of single-trial n400 data @xcite @xcite @xcite , and has been found to be similar to the n400 response in how it is affected by a range of experimental manipulations @xcite . a key finding is that better-performing and more sophisticated language models perform better at predicting the n400 @xcite @xcite @xcite . for this reason, we use contemporary transformer language models in the present study. we use experimental stimuli from 3 experiments. stimuli from one of these experiments @xcite have been previously used in computational analyses of the n400. this is one of several sets that @xcite attempt to model using recurrent neural network (rnn) language models, finding that they can indeed calculate that words related to the highest-cloze continuation are more predictable than unrelated words. in the present study, we test whether this result can be replicated on a larger number of language models, and specifically, transformer language models. there has also been work looking at how language models deal with semantic relatedness to the highest-cloze continuation based on stimuli from other n400 experiments. @xcite , for example, find that in cases where the related and unrelated words are both plausible, the related continuations are more strongly predicted by rnns @xcite , in line with the original n400 results @xcite . @xcite conceptually replicate this finding on a different dataset @xcite using one of the same rnns @xcite and gpt-2 @xcite . however, these prior efforts differ from the present study in that they investigate n400s and surprisal to words that are all plausible continuations of the sentence, and where they both have a low but generally non-zero cloze probability. in the stimuli analyzed in the present study, by contrast, both the related and unrelated words are anomalous-they have a cloze probability of zero, and are implausible continuations. thus, their preactivation does, at least intuitively, appear to be more clearly 'collateral'. we are only aware of one previous study that directly compares the predictions of transformers and the human n400 response on related anomaly stimuli. ettinger (2020) evaluates bert in terms of its similarity to cloze-because the predictions of a language model, being incremental, may show similar effects to those found in the n400 (see also @xcite for discussion). for this reason, ettinger (2020) tests how good bert is at predicting the highest-cloze (most probable) continuations in the stimuli over anomalous but seman-tically related continuations, but does not directly look at the related anomaly effect-whether the related anomalous continuations are more strongly predicted than the unrelated anomalous continuations. thus, to the best of our knowledge, the present study is the first to investigate whether the predictions of transformer language models display related anomaly effects like humans do. finally, there has been some work investigating whether language models display priming effects (e.g. @xcite @xcite @xcite . the effect found by metusalem et al. (2012) -that words related to the events described in the context are preactivated more strongly than words that are not-is a form of semantic priming, as it results in the increased preactivation of a word based on the semantic content stimulus that has been recently encountered (i.e. the event described in the preceding linguistic context). thus, our investigation of the patterns in the prediction of the the stimuli from @xcite is intended to further our knowledge of priming in language models-specifically, whether there are systematic ways in which context shapes the extent to which anomalous words are predicted. ## general method in this study, we took the stimuli from a range of experiments @xcite @xcite and ran them through a number of transformer language models. we used the transformers @xcite implementations of the (largest and most up-to-date versions of each of the) following models: bert @xcite , roberta @xcite , albert @xcite , xlm-r @xcite , gpt-2 (radford et al., 2019), gpt-neo @xcite , gpt-j (wang and komatsuzaki, 2021), and xglm @xcite . we chose these models to cover a number of both autoregressive (gpt-2, gpt-neo, gpt-j, xglm) and masked (bert, roberta, albert, xlm-roberta) language model architectures. given the recent increase in popularity of multilingual language models, we also made sure to include one autoregressive (xglm) and one masked (xlm-roberta) multilingual language model, in case there is a difference based on the number of languages that a model is trained on. all experimental stimuli used in the present study have been made available by the original authors of their respective papers as appendices or supplementary materials. in our analysis, we truncated all stimuli to be the preceding context of the critical word (the word for which the n400 was measured). we then used the language models to calculate the probability of the next word, and negative log-transformed (using a logarithm of base 2, following @xcite these probabilities to calculate the surprisal of each word. for words not present in the vocabulary of each model, we tokenized the word, and then progressively calculated the surprisal of each sub-word token given the preceding context; with the sum of all the surprisals (equivalent to the the negative log-probability of the product of all the probabilities) being used as the total surprisal for the word. in this way, we calculated the surprisal of each critical word given its preceding context only. all graphs and statistical analyses were created and run in r (r core team, 2020) using rstudio (rstudio team, 2020) and the tidyverse @xcite , lme4 @xcite , and lmertest @xcite packages. all reported p-values are corrected for multiple comparisons based on false discovery rate across all statistical tests carried out @xcite . because of this correction procedure, if any models display related anomaly effects, this is evidence that prediction alone can account for them. all of the code for running the experiments and carrying out the statistical analyses is provided at https://github.com/jmichaelov/ collateral-facilitation . ## conclusion in order to better understand related anomaly effects in humans, we investigated whether contemporary transformer language models display them. we found that in all but one case, they do, suggesting that related anomaly effects in both humans and language models may be driven by prediction alone.