Recurrent Neural Network Language Models Always Learn E nglish-Like Relative Clause Attachment (2020)

Abstract: A standard approach to evaluating language models analyzes how models assign probabilities to valid versus invalid syntactic constructions (i.e. is a grammatical sentence more probable than an ungrammatical sentence). Our work uses ambiguous relative clause attachment to extend such evaluations to cases of multiple simultaneous valid interpretations, where stark grammaticality differences are absent. We compare model performance in English and Spanish to show that non-linguistic biases in RNN LMs advantageously overlap with syntactic structure in English but not Spanish. Thus, English models may appear to acquire human-like syntactic preferences, while models trained on Spanish fail to acquire comparable human-like preferences. We conclude by relating these results to broader concerns about the relationship between comprehension (i.e. typical language model use cases) and production (which generates the training data for language models), suggesting that necessary linguistic biases are not present in the training signal at all.

## introduction language modeling is widely used as pretraining for many tasks involving language processing @xcite @xcite . since such pretraining affects so many tasks, effective evaluations to assess model quality are critical. researchers in the vein of the present study, typically take (pretrained) language models and ask whether those models have learned some linguistic phenomenon (e.g., subject-verb agreement). often the task is operationalized as: do the models match some human baseline (e.g., acceptability judgments, reading times, comprehension questions) measured as humans experience this linguistic phenomenon (e.g., comparing acceptability ratings of sentences with grammatical/ungrammatical agreement). this approach tacitly assumes that the necessary linguistic biases are in the training signal and then asks whether the models learn the same abstract representations as humans given this signal. the present study casts doubt on the notion that the necessary linguistic biases are present in the training signal at all. we utilize the, now common, evaluation technique of checking whether a model assigns higher probability to grammatical sentences compared to ungrammatical sentences @xcite . however, we extend beyond binary grammaticality. real world applications demand that our models not only know the difference between valid and invalid sentences; they must also be able to correctly prioritize simultaneous valid interpretations @xcite . in this paper, we investigate whether neural networks can in fact prioritize simultaneous interpretations in a human-like way. in particular, we probe the biases of neural networks for ambiguous relative clause (rc) attachments, such as the following: as both interpretations are equally semantically plausible when no supporting context is given, we might expect that humans choose between high and low at chance. however, it has been widely established that english speakers tend to interpret the relative clause as modifying the lower nominal more often than the higher nominal (i.e. they have a low bias; 1 @xcite @xcite . low bias is actually typologically much rarer than high bias @xcite . a proto-typical example of a language with high attachment bias is spanish (see @xcite @xcite . a growing body of literature has shown that english linguistic structures conveniently overlap with non-linguistic biases in neural language models leading to performance advantages for models of english, without such models being able to learn comparable structures in non-english-like languages (e.g., @xcite . this, coupled with recent work showing that such models have a strong recency bias @xcite , suggests that one of these attachment types (low), will be more easily learned. therefore, the models might appear to perform in a humanlike fashion on english, while failing on the crosslinguistically more common attachment preference (high) found in spanish. the present study investigates these concerns by first establishing, via a synthetic language experiment, that recurrent neural network (rnn) language models (lms) are capable of learning either type of attachment (section 4). however, we then demonstrate that these models consistently exhibit a low preference when trained on actual corpus data in multiple languages (english and spanish; sections 5-7). in comparing english and spanish, we show that non-linguistic biases in rnn lms overlap with interpretation biases in english to appear as though the models have acquired english syntax, while failing to acquire minimally different interpretation biases in spanish. concretely, english attachment preferences favor the most recent nominal, which aligns with a general preference in rnn lms for attaching to the most recent nominal. in spanish, this general recency preference in the models remains despite a high attachment interpretation bias in humans. these results raise broader questions regarding the relationship between comprehension (i.e. typical language model use cases) and production (which generates the training data for language models) and point to a deeper inability of rnn lms to learn aspects of linguistic structure from raw text alone. ## related work much recent work has probed rnn lms for their ability to represent syntactic phenomena. in particular, subject-verb agreement has been explored extensively (e.g., @xcite @xcite with results at human level performance in some cases @xcite . however, additional studies have found that the models are unable to generalize sequential patterns to longer or shorter sequences that share the same abstract constructions @xcite . this suggests that the learned syntactic representations are very brittle. despite this brittleness, rnn lms have been claimed to exhibit human-like behavior when processing garden path constructions @xcite @xcite , reflexive pronouns and negative polarity items @xcite , and center embedding and syntactic islands @xcite . there are some cases, like coordination islands, where rnn behavior is distinctly non-human (see @xcite , but in general this literature suggests that rnn lms encode some type of abstract syntactic representation (e.g., @xcite . thus far though, the linguistic structures used to probe rnn lms have often been those with unambiguously ungrammatical counterparts. this extends into the domain of semantics, where downstream evaluation platforms like glue and superglue evaluate lms for correct vs. incorrect interpretations on tasks targeting language understanding @xcite . some recent work has relaxed this binary distinction of correct vs. incorrect or grammatical vs. ungrammatical. @xcite correlate acceptability scores generated from a lm to average human acceptability ratings, suggesting that human-like gradient syntactic knowledge can be captured by such models. futrell and levy (2019) also look at gradient acceptability in both rnn lms and humans, by focusing on alternations of syntactic constituency order (e.g., heavy np shift, dative alternation). their results suggest that rnn lms acquire soft constraints on word ordering, like humans. however, the alternations in futrell and levy, while varying in their degree of acceptability, maintain the same syntactic relations throughout the alternation (e.g., gave a book to tom and gave tom a book both preserve the fact that tom is the indirect object). our work expands this line of research by probing how rnn lms behave when multiple valid interpretations, with crucially different syntactic relations, are available within a single sentence. we find that rnn lms do not resolve such ambiguity in a human-like way. there are, of course, a number of other modeling approaches that exist in the current literature; the most notable of these being bert @xcite . these transformer models have achieved high performance on a variety of natural language processing tasks, however, there are a number of properties that make them less suitable to this work. one immediate consideration is that of training. we are interested in the behavior of a class of models, so we analyze the behavior of several randomly initialized models. we do not know how representative bert is of models of its same class, and training more bert variants is immensely time consuming and environmentally detrimental @xcite . additionally, we are interested in probability distributions over individual words given the preceding context, something that is not part of bert's training as it takes whole sentences as input. finally, the bidirectional nature of many of these models makes their representations difficult to compare to humans. for these reasons, we restrict our analyses to unidirectional rnn lms. this necessarily reduces the generalizability of our claims. however, we still believe this work has broader implications for probing what aspects of linguistic representations neural networks can acquire using standard training data. ## attachment vs. recency we begin with a proof of concept. it has been noted that rnn lms have a strong recency bias @xcite . as such, it could be possible that only one type of attachment, namely low attachment, is learnable. to investigate this possibility, we followed the methodology in @xcite and constructed a synthetic language to control the distribution of rc attachment in two experiments. our first experiment targeted the question: if all rc attachment is high, how many rcs have to be observed in training in order for a high bias to generalize to unseen data? our second experiment targeted the question: what proportion of high and low attachment is needed in training to learn a bias? our synthetic language had rc attachment sentences and filler declarative sentences. the filler sentences follow the phrase structure template given in (5-a), while rc attachment sentences follow the phrase structure template given in (5-b). we trained rnn lms on our synthetic language using the same parameters as the english lms given in section 3.2, with 120,000 unique sentences in the training corpus. the resultant rnn lms were tested on 300 sentences with ambiguous rc attachment, and we measured the surprisal at the rc auxiliary verb (was/were), following the methodology given in section 3.3. to determine how many high rcs were needed in training to learn a high bias, we first constrained all the rc attachment in the training data to high attachment. then, we varied the proportion (in increments of 10 rc sentences at a time) of rc sentences to filler sentences during training. we trained 5 rnns for each training configuration (i.e. each proportion of rcs). this experiment provided a lower bound on the number of high rcs needed in the training data to overcome any rnn recency bias when all rcs exhibited high attachment. when as little as 0.017% (20 sentences) of the data contained rcs with high attachment, the test difference in surprisal between high and low attachment significantly differed from zero (@xmath0, bayesfactor (bf) > 100), foot_9 with a mean difference less than zero (µ = -2.24). these results indicate that the models were able to acquire a high bias with only 20/120000 examples of high rc attachment. in practice, we would like lms to learn a preference even when the training data contains a mixture of high and low attachment. to determine the proportion of rcs that must be high to learn a high bias, we fixed 10% of the training data as unambiguous rc attachment. within that 10%, we varied the proportion of high and low attachment in 10% increments (i.e. 0% high -100% low, 10% high -90% low, etc). once again, we trained 5 models on each training configuration and tested those models on 300 test sentences, measuring the surprisal at the rc verb. when the training data had 50-100% high attachment, the models preferred high attachment in all the test sentences. conversely, when the training data had 0-40% high attachment, the models preferred low attachment in all test sentences. taken together, the results from our synthetic language experiments suggest that high attachment is indeed learnable by rnn lms. in fact, an equal proportion of high and low attachment in the training data is all that is needed for these models to acquire a general preference for high attachment (contra to the recency bias reported in the literature). ## english experiments we turn now to model attachment preferences in english. we trained the models using english wikipedia. we tested the attachment preferences of the rnn lms using the original stimuli from fernández (2003), and using a larger set of stimuli to have a better sense of model behavior on a wider range of stimuli. for space considerations, we only report here results of the extended data (the larger set of stimuli), but similar results hold for the fernández ( 2003 ) stimuli (see supplemental materials). in order to compare the model results with the mean human interpretation results reported by fernández (2003), we categorically coded the model response to each item for high/low attachment preference. if model surprisal for low attachment was less than model surprisal for high attachment, the attachment was coded as low. see figure 1 for the comparison between rnns and humans in english. statistical robustness for our rnn results was determined using the original distribution of surprisal values. specifically, a two-tailed t-test was conducted to see if the mean difference in surprisal differed from zero (i.e. the model has some attachment bias). this revealed a highly significant (@xmath1, @xmath2.77. this positive difference indicates that the rnn lms have a consistent low bias, similar to english readers, across models trained with differing random seeds. there are two possible reasons for this patterning: (1) the models have learned a human-like low bias, or (2) the models have a recency bias that favors attachment to the lower nominal. these two hypotheses have overlapping predictions in english. the second hypothesis is perhaps weakened by the results of section 4, where both attachment types were learnable despite any recency bias. however, we know that other syntactic attachment biases can influence rc attachment in humans @xcite . it could be that other kinds of attachment (such as prepositional phrase attachment) have varying proportions of attachment biases in the training data. perhaps conflicting attachment biases across multiple constructions force the model to resort to the use of a 'default' recency bias in cases of ambiguity. ## syntactically blocking low attachment 6.1 stimuli to determine whether the behavior of the rnns is driven by a learned attachment preference or a strong recency bias, we created stimuli foot_10 using the stimulus template described in section 3.1 (e.g., (3)). all of these stimuli had only the higher nominal syntactically available for attachment; the lower nominal was blocked by the addition of a relative clause: in ( 7 ) only (7-a) is grammatical. this follows because boy(s) is the only nominal available for modification. in (7-a), the rc verb was agrees in number with this nominal, while in (7-b), was agrees in number with the now blocked lower nominal girl rather than with boys. for all such sentence pairs, we calculated the difference in surprisal between (7-a) and (7-b). if their behavior is driven by a legitimate syntactic attachment preference, the models should exhibit an overwhelming high bias (i.e. the mean difference should be less than zero). ## discussion in this work, we explored the ability of rnn lms to prioritize multiple simultaneous valid interpretations in a human-like way (as in john met the student of the teacher that was happy). while both low attachment (i.e. the teacher was happy) and high attachment (i.e. the student was happy) are equally semantically plausible without a disambiguating context, humans have interpretation preferences for one attachment over the other (e.g., english speakers prefer low attachment and spanish speakers prefer high attachment). given the recent body of literature suggesting that rnn lms have learned abstract syntactic representations, we tested the hypothesis that these models acquire human-like attachment preferences. we found that they do not. we first used a synthetic language experiment to demonstrate that rnn lms are capable of learning a high bias when high attachment is at least as frequent as low attachment in the training data. these results suggest that any recency bias in rnn lms is weak enough to be easily overcome by sufficient evidence of high attachment. in english, the rnns exhibited a human-like low bias, but this preference persisted even in cases where low attachment was ungrammatical. to test whether the rnns were over-learning a general low bias of english, we tested whether spanish rnns learned the general high bias in that language. once again, rnn lms favored low attachment over high attachment. the inability of rnn lms to learn the spanish high attachment preference sug-gests that the spanish data may not contain enough high examples to learn human-like attachment preferences. in post-hoc analyses of the spanish wikipedia training corpus and the ancora spanish newswire corpus @xcite , we find a consistent production bias towards low attachment among the rcs with unambiguous attachment. in spanish wikipedia, low attachment is 69% more frequent than high attachment, and in spanish newswire data, low attachment is 21% more frequent than high attachment. 13 this distributional bias in favor of low attachment does not rule out a subsequent high rc bias in the models. it has been established in the psycholinguistic literature that attachment is learned by humans as a general abstract feature of language (see @xcite . in other words, human syntactic representations of attachment overlap, with prepositional attachment influencing relative clause attachment, etc. these relationships could coalesce during training and result in an attachment preference that differs from any one structure individually. however, it is clear that whatever attachment biases exist in the data are insufficient for rnns to learn a human-like attachment preference in spanish. this provides compelling evidence that standard training data itself may systematically lack aspects of syntax relevant to performing linguistic comprehension tasks. we suspect that there are deep systematic issues leading to this mismatch between the expected distribution of human attachment preferences and the actual distribution of attachment in the spanish training corpus. experimental findings from psycholinguistics suggest that this issue could follow from a more general mismatch between language production and language comprehension. in particular, @xcite have provided empirical evidence that the production and comprehension of these structures are guided by different biases in humans. production is guided by syntactic and information structural considerations (e.g., topic), while comprehension is influenced by those considerations plus pragmatic and discourse factors (e.g., coherence relations). as such, the biases in language production are a proper subset of those of language comprehension. as it stands now, rnn lms are typically trained on production data (that is, the produced text in wikipedia). 14 thus, they will have access to only a subset of the biases needed to learn human-like attachment preferences. in its strongest form, this hypothesis suggests that no amount of production data (i.e. raw text) will ever be sufficient for these models to generalizably pattern like humans during comprehension tasks. the mismatch between human interpretation biases and production biases suggested by this work invalidates the tacit assumption in much of the natural language processing literature that standard, production-based training data (e.g., web text) are representative of the linguistic biases needed for natural language understanding and generation. there are phenomena, like agreement, that seem to have robust manifestations in a production signal, but the present work demonstrates that there are others, like attachment preferences, that do not. we speculate that the difference may lie in the inherent ambiguity in attachment, while agreement explicitly disambiguates a relation between two syntactic units. this discrepancy is likely the reason that simply adding more data doesn't improve model quality (e.g., @xcite . future work needs to be done to understand more fully what biases are present in the data and learned by language models. although our work raises questions about mismatches between human syntactic knowledge and the linguistic representations acquired by neural language models, it also shows that researchers can fruitfully use sentences with multiple interpretations to probe the linguistic representations acquired by those models. before now, evaluations have focused on cases of unambiguous grammaticality (i.e. ungrammatical vs. grammatical). by using stimuli with multiple simultaneous valid interpretations, we found that evaluating models on single-interpretation sentences overestimates their ability to comprehend abstract syntax.