Source-linked AI summary
Using LMs to Model the Effects of Context and Coreference during Sentence Comprehension
Kohei Kajikawa, Lin Ai, Tatsuki Kuribayashi, Ethan Gotlieb Wilcox
TL;DR
The paper examines whether restricting language-model context to mimic working-memory limits overlooks the role of long-range discourse structure. It varies GPT-2 context windows across English reading-time datasets and tests coreference with counterfactual pronominalization. Context effects are U-shaped, and disrupting cross-sentential coreference weakens the long-context advantage.
Problem
Prior work finds that context restrictions can improve language-model fit to reading times, but how long-range discourse structure contributes to that fit remains an open question.
Source: §1 · pp. 1–2Method
The authors vary GPT-2 context length across four English reading-time datasets and test coreference by pronominalizing repeated discourse entities in counterfactual materials.
Source: §1 · p. 2Results
Takeaways & Limitations
The findings support the conclusion that human comprehension uses global discourse relations alongside local working-memory constraints.
Source: §6 · p. 9The evidence is limited to English reading-time datasets, and the context effect and entity-chain contribution may differ in pro-drop or morphologically rich languages.
Source: Limitations · p. 9
Abstract
from arXiv · showhide
Language models (LMs) are often used as a tool to model human language processing. Recent studies suggest that severely restricting LMs' context window improves their fit to human psycholinguistic data by simulating human working memory constraints. However, it is possible that this strict memory-decay approach overlooks humans' reliance on long-range structural representations, such as discourse structre. In this work, we systematically vary the context window size of GPT-2 across four large-scale naturalistic English reading-time datasets and observe a U-shaped relationship: Although restricted contexts (< 20 tokens) successfully capture local memory limitations, expanded contexts (500--1,000 tokens) ultimately yield the highest overall psycholinguistic fit. To investigate the mechanism driving this benefit, we conduct a counterfactual inference-time experiment that disrupts cross-sentential entity chains by pronominalizing repeated discourse entities. Obscuring these structural linkages significantly degrades the predictive power of larger context windows by 20% to 40%. Our experiments demonstrate that tracking long-range coreference relations is one important factor for the alignment between LM surprisal and human reading behavior, and approximate the extent to which human comprehenders use global discourse relations during language processing.
1 Introduction
The paper asks whether restricting language-model context to mimic working-memory limits misses the value of long-range discourse structure. Across English reading-time data, context effects are U-shaped, and disrupting cross-sentential coreference weakens the predictive advantage of larger windows.
1 Introduction
- Prior work finds that restricting context or adding recency bias can improve reading-time fit, but this strict memory-decay approach may miss structured discourse representations.The paper notes that reading times are sensitive to long-range information, including the number of possible coreferences.Source: §1 · p. 1
- Context effects are U-shaped: windows under 20 tokens fit better at short timescales, while 500 to 1,000 tokens yield peak predictive power at longer timescales.The authors interpret the pattern as reflecting both local working-memory constraints and global discourse integration.Source: §1 · p. 2
- The authors test whether coreference helps explain long-context benefits by evaluating predictions on counterfactual texts with obscured cross-sentential entity links.They propose that coreference cues can support discourse coherence and next-word prediction beyond simple pronominal anaphora.Source: §1 · p. 2
- Pronominalizing repeated discourse entities reduces the predictive advantage of larger context windows by approximately 20% to 40%.The authors describe this drop as a quantitative measure of coreference resolution’s importance in discourse processing.Source: §1 · p. 2
2 Evaluating Surprisal on Reading Times
The paper uses surprisal theory to relate language-model outputs to human reading measures, then evaluates context size and discourse structure across four English reading-time datasets. It estimates surprisal at varied GPT-2 context lengths and tests its incremental fit with held-out regression comparisons.
2 Evaluating Surprisal on Reading Times
- Surprisal theory provides the framework linking language-model outputs to human psycholinguistic processing measures.The study uses this framework to investigate context size and discourse structure.Source: §2 · p. 2
2.1 Reading-time Datasets
- The evaluation uses Brown, Natural Stories, OneStop, and Provo, four large-scale English reading-time datasets spanning self-paced, A-Maze, and eye-tracking measures.The datasets include first fixation, gaze duration, and total fixation measures for eye tracking; preprocessing excludes specified words, reading times, and low-comprehension participants.Source: §2.1 · pp. 2–3
2.2 Surprisal Estimates
- The authors estimate surprisal with four pretrained GPT-2 variants at 28 context lengths from 1 to 1,023 subword tokens.Whitespace-trailing decoding limits the maximum context to 1,023 tokens because GPT-2 uses at most 1,024 tokens.Source: §2.2 · p. 3
2.3 Regression Analysis
- Surprisal’s predictive power is the held-out log-likelihood improvement of a target regression over a baseline, evaluated with 10-fold cross-validation.The baseline includes document position, word length, and unigram surprisal, with two spillover positions for word length and unigram surprisal; the target adds current-word surprisal and its two spillover positions.Source: §2.3 · pp. 3–4
3 Experiment 1: The Effect of Context Window Size
Varying GPT-2’s context window across four English reading-time datasets reveals a U-shaped relationship: short contexts can fit local processing better, while longer contexts ultimately yield the highest overall fit. Follow-up analyses find that gains are concentrated on words associated with discourse relations, rather than appearing uniformly across word classes.
3.1 Results
- Across datasets, longer contexts generally improve predictive power, with a robust positive context-length effect; the trend is less consistent for shorter-document Provo.At windows of roughly 20 tokens or less, the pattern can reverse, while larger contexts ultimately yield the highest overall fit.Source: §3.1 · p. 4
- Within short contexts, fit often follows a U- or S-shaped pattern, with local optima around 2–4 tokens that vary by model and dataset.The pattern is especially pronounced in larger models and earlier-processing measures such as first fixation; Natural Stories A-Maze is an exception.Source: §3.1 · p. 4
3.2 Follow-up Analysis: Localization of the Context Effect
- Comparing 2-token with long contexts (up to 1,023 tokens or document maximum), the localization analysis examines surprisal shifts and reading-time predictive gains by part of speech.The analysis uses Bayesian mixed-effects models and considers major syntactic categories with at least 100 occurrences across datasets.Source: §3.2 · p. 5
3.2.1 Results
- Expanded context reduces surprisal across evaluated word classes, but significant reading-time gains concentrate in nouns, numerals, verbs, auxiliaries, and adpositions.Proper nouns show the largest surprisal reduction but no statistically significant predictive-power improvement; gains are largest for nominals and predicates, while determiners and particles show no significant gains.Source: §3.2.1 · pp. 5–6
4 Experiment 2: Disrupting Coreference Relations during Inference
Experiment 2 tests whether long-context reading-time prediction depends on cross-sentential coreference, using inference-time pronominalization and a singleton-pronominalization control. Obscuring coreference reduces predictive power, especially with larger contexts.
4 Experiment 2: Disrupting Coreference Relations during Inference
- Repeated entities were pronominalized to obscure links across mentions, while singleton entities were pronominalized as a control that preserved long-context dependencies.The two conditions changed roughly equivalent numbers of tokens: 22,695 for COREF-DISRUPTED and 21,640 for SINGLETON-DISRUPTED.Source: §4 · p. 6
4.1.1 Dataset Creation.
- Entity tags from a coreference parser identified repeated and singleton entities; masked spans were replaced with pronouns, with fallback to “it” when no pronoun was produced.Already-pronominalized entities were left unchanged, and entities extending outside a model’s context window were not masked.Source: §4.1.1 · p. 7
4.1.2 Text Comprehensibility Check
- On Natural Stories comprehension questions, DeepSeek-V4-Flash scored 100% (60/60) on original text, 91.7% (55/60) on COREF-DISRUPTED, and 90% (54/60) on SINGLETON-DISRUPTED.Source: §4.1.2 · p. 7
4.1.3 Surprisal Estimation
- For each condition, ΔΔLL was calculated against unaltered text, not by comparing short and long contexts; target entities were unpronominalized before surprisal estimation, making conditioning context the only difference.Source: §4.1.3 · p. 7
4.2 Results
- At maximal context, COREF-DISRUPTED ΔΔLL was significantly below zero across datasets except Provo FF, and below SINGLETON-DISRUPTED in six dataset measures.The coreference-related decrease grew with context size and exceeded the singleton-condition decrease in most cases; no difference between conditions was observed in Provo.Source: §4.2 · pp. 7–8
- 16.5% (Provo FF) to 42.4% (OneStop GD): obscuring coreference reduced predictive power at maximum context.Figure 4 summarizes percentage reductions across datasets for the Small model.Source: §4.2 · p. 8
5 Discussion
The discussion interprets context length as involving both local working-memory constraints and long-range discourse structure. It also presents targeted masking as a way to quantify contextual contributions beyond coreference.
5.1 The Dual Mechanism of Context Length
- Reading times may reflect both a short-term prediction mechanism influenced by working-memory limits and a long-term mechanism for tracking discourse structure.Longer context windows better predicted reading times for long documents, while the long-context effect was minimal in shorter Provo texts.Source: §5.1 · pp. 8–9
- How global discourse information is compressed and represented in working memory remains an open challenge, particularly for coreference chains and entity states.Source: §5.1 · pp. 8–9
5.2 Quantifying Discourse Contributions
- Obscuring structural linkages reduced larger-context predictive power by approximately 20% to 40%, while smaller control-condition decreases indicate that extended context is not merely an unstructured bag of words.The authors interpret this pattern as language models implicitly maintaining and updating entity states.Source: §5.2 · p. 9
- Selective inference-time masking could quantify other discourse influences, including temporal event structures and rhetorical relationships.The authors identify applying similar methods at training time as a question for future work.Source: §5.2 · p. 9
6 Conclusion
Across four English reading-time datasets, the study finds a U-shaped relationship between language-model context size and predictive power. Expanded windows perform best overall, and disrupting cross-sentential coreference reduces that advantage.
6 Conclusion
- Across four English reading-time datasets, expanded context windows of 500–1,000 tokens yielded the best overall fit, while obscuring cross-sentential coreference degraded predictive power by up to 42.4%.The conclusion frames accurate cognitive models as needing to capture both local working-memory limits and long-range discourse integration.Source: §6 · p. 9
Limitations
The study’s empirical scope is limited to English reading-time datasets, and its interventions leave representational equivalence between LMs and humans unconfirmed. Its inference-time counterfactuals and silver-standard annotations also constrain interpretation.
Limitations
- The empirical findings use only English reading-time datasets, and the U-shaped context effect and entity-chain contribution may vary across languages.The authors note that pro-drop and morphologically rich languages may encode coreference differently.Source: Limitations · p. 9
- The intervention shows that LMs use coreference signals to improve predictability but does not establish that LMs and humans construct the same structured representations.The authors leave the nature of human–LM representational similarity unresolved.Source: Limitations · pp. 9–10
- The counterfactual manipulation occurs only at inference time, making evaluation data slightly out-of-distribution relative to naturalistic pretraining corpora.The authors suggest counterfactual training as a way to better isolate processing effects.Source: Limitations · p. 10
- Coreference identification and manipulation rely on silver-standard annotations, whose automated resolution errors may occasionally produce imperfect replacements.The authors suggest validating findings with gold-standard human-annotated corpora.Source: Limitations · p. 10
Ethical Considerations
The study analyzes existing anonymized reading-time datasets and open-source language models; it collected no new human-participant data.
Ethical Considerations
- The analysis uses publicly available, anonymized human reading-time datasets and open-source language models.The authors state that the artifacts were released under standard ethical guidelines, to the best of their knowledge.Source: Ethical Considerations · p. 10
- No new data from human participants was collected for this work.Source: Ethical Considerations · p. 10
- The authors report that, to their knowledge, all utilized artifacts were originally collected and released in accordance with standard ethical guidelines.Source: Ethical Considerations · p. 10
AI Writing/Coding Assistance Policy
Generative AI tools were used for manuscript grammar and phrasing, while a coding assistant helped format tables and figures. The appendix also identifies where the paper lists its language models.
AI Writing/Coding Assistance Policy
- Generative AI tools were used to adjust the manuscript’s grammar and phrasing.Source: AI Writing/Coding Assistance Policy · p. 10
- A coding assistant was used to format tables and figures.Source: AI Writing/Coding Assistance Policy · p. 10
A.1 Language Models
- Table 2 lists the language models used in Sections 3 and 4.Source: §A.1 · p. 13
A.2 Data and Tools
The appendix lists the datasets and tools used in Sections 3 and 4, notes their licensing, and reports the computing setup. A figure presents mean surprisal by dataset across context sizes.
A.2 Data and Tools
- Table 3 lists the datasets and tools used in Sections 3 and 4, and the authors report using these artifacts according to their licenses.Source: §A.2 · p. 13
- Surprisal was computed using a single NVIDIA H100 GPU (80GB) for several hours.Source: §A.2 · p. 13
B Mean Surprisal
- Figure 5 shows mean surprisal values for each dataset across all examined context sizes.Source: B Mean Surprisal · p. 13
C Experiment 1 Results on Other Model Families
Across GPT-Neo, GPT-J, and OPT models evaluated on Natural Stories SPR, predictive power showed a U- or sometimes S-shaped pattern across model families.
C Experiment 1 Results on Other Model Families
- The study evaluated GPT-Neo, GPT-J, and OPT series to test whether findings generalized across architectures.These models were evaluated on Natural Stories SPR.Source: C Experiment 1 Results on Other Model… · p. 13
- Across model families, predictive power showed a U- or sometimes S-shaped pattern.The evaluation used Natural Stories SPR.Source: C Experiment 1 Results on Other Model… · p. 13
- For models with a 2,048-token maximum context, the study also evaluated and plotted ∆LL at maximum context length.Source: C Experiment 1 Results on Other Model… · p. 13
D Full Results for Experiment 2 across All Models
The section reports Experiment 2 results across GPT-2 Medium, Large, and XL, comparing coreference and singleton disruption and describing the pronoun-substitution prompt and forced-choice test. The supplied material also includes a multiple-choice question about symptoms in females with a genetic predisposition, but gives no answer or result.
E Prompt template for substituting an entity span with a pronoun
- The pronoun-replacement prompt replaced each contiguous span of masked tokens with a placeholder and instructed the model to map every placeholder to exactly one English pronoun.The corresponding context supplied the original noun phrase for each placeholder, and the response was requested as JSON.Source: E Prompt template for substituting an… · p. 14
F Comprehensibility of the Discourse-disrupted Texts
- To test comprehensibility while avoiding contamination from public Natural Stories questions, the authors generated new questions and used forced-choice responses on original, SINGLETON-DISRUPTED, and COREF-DISRUPTED texts.The option order was randomized for each prompt.Source: F Comprehensibility of the… · p. 14
D Full Results for Experiment 2 across All Models
- Across GPT-2 Medium, Large, and XL, COREF-DISRUPTED substantially reduced predictive power, while SINGLETON-DISRUPTED caused no or smaller reductions; Provo was an exception, likely due to shorter context lengths.Figures 7–9 show the full Experiment 2 results across these model sizes.Source: D Full Results for Experiment 2 across… · p. 13, Figure 7 · p. 17, Figure 8 · p. 17
- The question contrasts obsessive-compulsive symptoms with severe motor tics as possible symptom types more likely in predisposed females.The fragment supplies these as answer choices, not as a reported finding.Source: Story 10 · p. 20