Do Language Models Exhibit Human-like Structural Priming Effects? (2024)

Abstract: We explore which linguistic factors—at the sentence and token level—play an important role in influencing language model predictions, and investigate whether these are reflective of results found in humans and human corpora (Gries and Kootstra, 2017). We make use of the structural priming paradigm—where recent exposure to a structure facilitates processing of the same structure—to investigate where priming effects manifest, and what factors predict them. We find these effects can be explained via the inverse frequency effect found in human priming, where rarer elements within a prime increase priming effects, as well as lexical dependence between prime and target. Our results provide an important piece in the puzzle of understanding how properties within their context affect structural prediction in language models.

## introduction structural priming is the phenomenon where speakers are more likely to repeat a certain structure after being recently exposed to a sentence containing a congruent structure; in the following example a speaker is more likely to produce a double object (do) construction (2a, the target) after having been exposed to a sentence with a congruent structure (1a, the prime) than after having been exposed to a sentence with an incongruent structure (1b, which illustrates the prepositional object (po) dative construction): the girl gave [the boy]np [the ball]np b. the baker gave [the lady]np [the cake]np structural priming is well attested in humans, for both language production @xcite and comprehension @xcite . interestingly, it has also been shown to occur in large language models @xcite @xcite . here, structural priming can be viewed as a simple form of 'in-context learning' @xcite , where the task is to generate a sentence (or compute its likelihood) with the target grammatical structure, influenced by the demonstration (the prime presented to the llm before processing the target). priming effects in humans are typically stronger when there are shared words between prime and target, and when the prime is more unusual, or less frequent. this is the inverse frequency effect; it extends to other properties of structures themselves, and it is one of the main phenomena we focus on in this paper. to explain these effects without direct access to the underlying training data, we turn to factors known to predict priming effects from corpus linguistics (e.g. @xcite , which highlight surprisal and structural preference as key factors, and demonstrate the importance of a more fine-grained method of measuring priming. a second focus of this paper is examining the relationship between lexico-semantic overlap and the asymmetry of the priming effects observed. we examine priming at the token level, discovering that where priming takes place is important for understanding how lexico-semantic factors affect priming and for analysing the mechanisms underlying priming in models. finally, we find that models' structural predictions are highly influenced by specific lexical items, and that they incorporate systematic properties of human production preferences learnt from the training data. we demonstrate that models, like humans, exhibit inverse frequency effects in terms of surprisal and verb preference, and that these are predictive of priming. ## structural priming structural priming in humans is part of a rich literature on factors that impact human language processing, both in controlled experiments of production @xcite and comprehension @xcite , and analyses from corpus linguistics (e.g., @xcite . we provide a brief theoretical background on structural priming in §2.1, and priming in language models in §2.2. ## exp1: measuring structural priming we aim to better understand the asymmetrical priming effects observed in @xcite , to gain a more detailed picture of how lexical overlap affects this asymmetry. we start our experimental setup with their sentence-level approach, considering a wider range of large, contemporary llms. in the next section we then examine priming effects at a more fine-grained level. priming effects are skewed and correlated we compute the s-pe scores for the models of §3.4 on the core condition of prime-lm. we observe there exists a strong negative correlation between the pe scores of the prepositional object and the double object. in figure 1a we plot those results as a scatter plot in the space formed by pe score for one construction against pe score for the alternative construction. this representation highlights that, for llama-2-chat and all the other models we consider, the s-pe of po constructions is negatively correlated with that of do constructions (ρ: -0.72 to -0.77), and that only for a fraction of sentences there exists a positive priming effect in both directions (26 to 38%). this correlation and skew towards one of the two constructions were already observed by @xcite for gpt2-large and other relatively small lms. interestingly, correlation and skew do also exist in the newest, large lms, and, moreover, are even more pronounced. figure 1c shows the mean s-pe in the same pe space for all the llms we considered. gpt2-large shows the least skew, llama-2-chat the most (for completeness, the plot also shows the strength of the correlation between the pe(po) and pe(do) scores, as well as the spread of the distribution.) note that this observed behaviour of large lms is less consistent and far more asymmetric than results in the human literature, where priming effects, while typically asymmetric @xcite , are generally observed to be positive for both structures. lexical overlap balances priming effects next, we investigate the priming effects of the lms where either the semantic similarity or lexical overlap between prime and target is increased. the results for lexical overlap are shown in figure 1c -e (additional plots regarding semantic similarity are in appendix b). the plots show that an increase in lexical overlap of any type moves all models more solidly into the upper-right quadrant of the pespace. that is, it pushes all lm priming behaviours to become both stronger and more balanced (less skewed towards one or the other construction). this is especially prevalent for the overlap in verbs and function words. we will explore the impact of these factors in more detail in the next section. ## exp2: locating structural priming sentence-level analysis does not allow us to investigate individual token-level predictions, making it impossible to examine where in the target sentence priming effects are at their strongest. to better understand the s-pe results of §4 we thus compute the token-level w-pe scores for the same conditions. figure 1: we plot pe results against one another. the four quadrants in this 'pe space': balanced priming where the pe is positive in both directions, skewed priming where it's only positive in one, and inverse priming when the pe is negative in both directions. there exists a strong negative correlation between priming effects of opposite structures (a). only a small portion of the data is primed in both directions for core. priming becomes more balanced when measured from the point of divergence in the target (b, §5), or when lexical overlap is increased (c-e). token structural divergence figure 3 shows the average w-pe scores for llama-2 on the core condition, which exhibits much higher sentence-level priming effects for the do sentence than for the po sentence. the token-level scores show that the treatment of the two sentences starts to diverge from the position of the second noun onwards (the second noun is is the patient for po, whereas it is the recipient for do). prior to that, the target sentence is, in fact, the same for both po/do alternations and as such will be inversely proportional to each other: scores up till this point merely show a target's bias towards a prime of a particular structure, regardless of structural congruence. this provides a partial explanation for the strong negative correlation between s-pe scores that was observed in §4: since (roughly) half of s-pe score is made up of w-pe scores that have a perfectly the girl gave the ball to the boy . ## exp3: explaining structural priming we now take a closer look at the factors that impact priming effects by conducting a regression analysis inspired by factors from corpus linguistics and production studies @xcite . following @xcite , we make use of linear mixed effects models to determine salient word and sentence level factors that predict priming, to discover whether models display consistent behaviour with respect to one another and to human patterns of priming in production they may have learnt. we first describe the factors we use in our regression analysis in §6.1, and present the results in §6.2. ## discussion & conclusion in this paper, we seek to better understand the mechanisms that may underlie structural priming behaviour in llms. borrowing insights from empirical and theoretical work on priming in humans, we investigate how, where and why a range of modern llms assign higher or lower probabilities to target sentences depending on preceding context, allowing us to investigate the extent to which language models are influenced by structure and semantics when making upcoming predictions.