On the alignment of LM language generation and human language comprehension (2024)

Abstract: Previous research on the predictive power (PP) of surprisal and entropy has focused on determining which language models (LMs) generate estimates with the highest PP on reading times, and examining for which populations the PP is strongest. In this study, we leverage eye movement data on texts that were generated using a range of decoding strategies with different LMs. We then extract the transition scores that reflect the models’ production rather than comprehension effort. This allows us to investigate the alignment of LM language production and human language comprehension. Our findings reveal that there are differences in the strength of the alignment between reading behavior and certain LM decoding strategies and that this alignment further reflects different stages of language understanding (early, late, or global processes). Although we find lower PP of transition-based measures compared to surprisal and entropy for most decoding strategies, our results provide valuable insights into which decoding strategies impose less processing effort for readers. Our code is available via https://github.com/DiLi-Lab/LM-human-alignment.

## introduction human language processing is incremental in nature: words are processed sequentially, and each word might require a different amount of cognitive effort to be expended @xcite depending on how predictable it is in its current context. this relationship between cognitive processing effort and word predictability is operationalized in surprisal theory @xcite , which posits that the cognitive effort is proportional to word predictability, quantified as surprisal, the negative log-probability of a word conditioned on its preceding context. leveraging reading times (rts) as proxy for cognitive effort and employing neural language models (lms) to estimate surprisal, this relationship has been corroborated extensively @xcite @xcite @xcite @xcite . while these studies assume that the reading process is purely responsive, i.e., readers allocate time to process a word as they encounter it, other studies argue that the reading process might additionally be anticipatory in nature @xcite : readers make predictions about an upcoming word and, based on this expectation, preemptively assign time to its processing, which affects reading behavior. this anticipatory predictability effect is quantified as contextual entropy @xcite , the expectation over a word's surprisal, and has been found to be predictive of reading times as well @xcite @xcite . research on surprisal and contextual entropy has relied on the notion of (psychometric) predictive power (pp), which quantifies the fit (i.e., performance) of a regression model on rts including a predictor of interest (surprisal or contextual entropy) in comparison to a baseline model. these studies on pp have been conducted along several axes. the first tackles the question of which lms estimate these metrics such that they exhibit the highest pp on rts, investigating lm family @xcite , lm quality @xcite , lm size @xcite , and the amount of training data @xcite . another axis involves shifting the focus on the population whose rts are predicted, such as speakers of different languages @xcite or groups of readers representing different cognitive profiles @xcite . while these studies on the pp of surprisal and entropy have explored the alignment between lm comprehension effort and human reading behavior, we introduce a third axis of investigating pp that directly assesses the alignment of lm language production and human language comprehension. we shift the focus from the lms that estimate the predictability metrics directly to the texts being read. to that end, we leverage the eye movements on @xcite that contains reading data on english texts generated with different large language models (llms) and different decoding algorithms, and that further provides the llms' raw generation transition scores. this allows for investigating what role the nature of the text itself plays for human reading behavior. more specifically, it enables us to i) disentangle the alignment of human language processing with certain lms and certain decoding strategies, and ii) to assess whether information about the text generation process improves the pp of surprisal and contextual entropy on these texts. typical language generators define a probability distribution over sequences of tokens, which can be understood as the model's uncertainty about generation given a context @xcite . with humans experiencing both responsive as well as anticipatory effects in reading, we assume there exists an alignment between lms and humans in that lms' uncertainty during language production is reflected in the uncertainty humans experience during language comprehension. after conducting a baseline analysis (rq b ) that establishes the pp of surprisal and contextual entropy on the emtec stimuli, where we estimate the predictability metrics both with gpt-2 base @xcite as well as with the llms used to generate the stimuli, we investigate the following research questions: rq 1 to what extent do different decoding strategies and human language comprehension align, and does this alignment reflect responsive or anticipatory processing? rq 2 which decoding strategies generate texts that elicit low (or high, respectively) surprisal and entropy effects in humans? rq 3 do surprisal and contextual entropy ex- we fit our models on a variety of reading measures (rms) that include both binary as well as continuous measures which can be divided into measures of early, late, and global language processing. our findings suggest that certain decoding strategies align better with human language processing than others and underline the notion of selecting lms and reading measures based on the specific cognitive processes under investigation, such as early or late reading processes. at present, relatively little is understood as to whether lms and humans process texts in a similar way. giulianelli et al. (2023a) evaluated lms in terms of whether their representation of uncertainty is calibrated to the levels of variability observed in humans by comparing lms' distributions over productions against the distributions over the productions of humans, given the same context. they found that lms capture human variability well (though not as well as another human) with most decoding algorithms, though ancestral sampling matched the plausible space of human productions closest. similarly, venkatraman et al. (2023) investigated whether decoding algorithms implicitly follow the uid (uniform information density) principle, which states that humans distribute information in their utterances evenly. they generated texts with greedy search and ancestral, top-k, and topp sampling and collected human judgments, and found non-uniformity to be a more desirable property in machine-generated texts, with uid scores not correlating with human judgments. in another study, giulianelli et al. (2023b) present information value, a metric quantifying the predictability of an utterance relative to a set of alternatives. they observed that information value has higher pp than aggregates of token-level surprisal for acceptability judgments, and is on par with aggregated surprisal as a predictor of rts. they further state that the decoding strategies used to generate the utterances do not impact the pp. and last, liu et al. (2024) investigated what effect temperature-scaling of llm predictions has on surprisal estimates and demonstrated that temperature-scaled surprisal (with a temperature t ≃ 2.5) improves pp on rts. this underlines their assumption that human probability distributions might be flatter than those learned by lms. the studies investigating the effect of decoding algorithms (giulianelli et al., 2023a; venkatraman et al., 2023) did not employ human cognitive data, while giulianelli et al. (2023b) explored sentence-aggregates. our study is a departure from their approaches in that it leverages cognitive data on machine-generated texts and can thus directly investigate lm and human alignment. ## methods in the following, let w t be word w at index t, and let @xmath0, i.e., its left context. let σ denote the vocabulary, and σ = σ ∪ {eos} an augmented vocabulary containing a special eos (end-of-sentence) token. ## discussion the experimental results presented in this study contribute to the understanding of the alignment between language models and human reading behavior. this is particularly evident in the way the texts generated with certain decoding strategies elicit predictability effects that are aligned with reading behavior reflecting either early or late language processing mechanisms. the baseline analysis (see § 4.3) corroborates previous findings stating that different lms produce predictability estimates with varying predictive power, and that those yielded by gpt-2 base generally have the highest pp @xcite . however, this analysis also underscores the notion that the choice of lm as predictability metric estimator depends on the aspect of reading behavior one is interested in researching: some lms better capture anticipatory reading effects via entropy than responsive effects via surprisal. this is further reinforced and ex-panded upon in the investigation of rq 1 (see § 4.4), which aimed at investigating the extent to which different decoding algorithms and human language comprehension align. the alignment patterns of the different decoding strategies are not consistent across reading measures: for instance, considering surprisal predicting rms on mistral texts, the alignment is high with ancestral sampling for rrt and tft but low for fprt, and considering entropy, top-p sampling exhibits high alignment for rrt and tft across the three llms. this suggests that the alignment of a decoding strategy with reading behavior hinges on the rm the regression is fitted on. on the one hand, these different alignment patterns exemplify that different models, combined with different decoding strategies, produce texts that are more or less aligned with human language comprehension. on the other hand, this variability of alignment between rms also suggests that making a claim for the "best overall fit" of surprisal and entropy might not be sensible. most previous studies (i.a. @xcite have focused on fprt, as it reflects initial processing difficulty and is purportedly most aligned with lm surprisal due to the autoregressive nature of language models. however, we argue for choosing an rm that best approximates human expectation-based reading behavior with respect to a specific reading process one is investigating, as reflected in early, late, or global measures. apart from the choice of lm and the implica-tions of the choice of rm as dependent variable, we also find differences in the alignment between human reading behavior and expectation-based effects observed on texts generated by different decoding algorithms for a variety of rms, as well as differences in the strength of the interactions between decoding strategy and predictability metrics. this allows for the interpretation of whether the texts generated with certain lms, and certain decoding strategies in particular, require larger cognitive effort from the reader at different stages of processing. as explored in rq 2 (see § 4.5), where we examined which decoding algorithm generates texts that result in low or high surprisal or entropy effects, phi-2 texts generated with top-p sampling elicit large surprisal and entropy effects across late and global rms (rrt, tft, rpd_inc), while texts generated with greedy search lead to smaller surprisal effects in fprt. for mistral-generated texts, ancestral sampling, top-p sampling, and beam search also result in higher effects observed in tft, rrt and rpd_inc. pertaining to wizardlm, we find that on texts generated via beam search, ancestral sampling and top-p, high surprisal words cause significantly higher rrts. these results imply that wizardlm and mistral likely generate texts that disrupt late stages of processing regardless of the decoding strategy. for phi-2, on the other hand, generating texts using greedy search leads to facilitated early-stage processing. whereas there might be support for the claim that stochastic strategies are cognitively more plausible than likelihood-maximization strategies @xcite , we refrain from directly linking the mechanisms underlying the stochastic strategies (such as re-distribution for top-p) with the cognitive mechanisms in humans. while in the analysis of rq 3 (see § 4.6), we find that t-surprisal improves the pp over surprisal for texts generated with wizardlm combined with beam search and greedy search, there is mostly no increased pp when computing t-surprisal and t-entropy from the stimuli's transition scores directly. this, in conjunction with the results from rq 2 , implies that the alignment of certain decoding algorithms with reading behavior is a result of the properties of the texts these algorithms generate, but that there is no direct reflection of the information contained in the llms' text generation transition scores in the reading times. it would thus be far-fetched to claim that language models' generative processes are typifying of the cognitive processes underlying human language comprehension, and vice versa: we cannot extrapolate from lm generation uncertainty, represented by the transition scores, to human processing difficulty. the alignment between decoding strategies and reading behavior as demonstrated in experiment 1 ( § 4.4) cannot be predicted by the llms' transition scores but may instead be founded in linguistic features of the generated texts. ## conclusion we show that (1) the alignment between lms and human reading behavior varies based on the choice of model and the decoding strategy on the one hand, and on the reading measure used as dependent variable on the other hand; however, the extent of this alignment cannot be inferred from the transition scores; and (2) specific combinations of models and decoding strategies used for text generation impose lower or higher cognitive effort at different stages of processing. this suggests that, when resorting to lms for the estimation of predictability metrics, psycholinguistic researchers should tailor their selection to the specific language processing stage of interest.