Abstract
Temporary syntactic ambiguities arise when the beginning of a sentence is compatible with multiple syntactic analyses. We inspect to which extent neural language models (LMs) exhibit uncertainty over such analyses when processing temporarily ambiguous inputs, and how that uncertainty is modulated by disambiguating cues. We probe the LM's expectations by generating from it: we use stochastic decoding to derive a set of sentence completions, and estimate the probability that the LM assigns to each interpretation based on the distribution of parses across completions. Unlike scoring-based methods for targeted syntactic evaluation, this technique makes it possible to explore completions that are not hypothesized in advance by the researcher. We apply this method to study the behavior of two LMs (GPT2 and an LSTM) on three types of temporary ambiguity, using materials from human sentence processing experiments. We find that LMs can track multiple analyses simultaneously; the degree of uncertainty varies across constructions and contexts. As a response to disambiguating cues, the LMs often select the correct interpretation, but occasional errors point to potential areas of improvement.
Introduction
Temporary syntactic ambiguities occur when the initial part of a sentence supports multiple grammatical interpretations. For example, in the fragment "The audience knew the band...", "the band" could be the direct object of "knew" (NP interpretation) or the subject of an upcoming clause (S interpretation). While human sentence processing of such "garden-path" sentences is well-documented, understanding how neural language models (LMs) manage these ambiguities is more complex. Previous research has relied on surprisal—the negative log-probability of a word—to detect when a model's expectations are violated. However, surprisal is a reactive measure. This paper proposes a proactive method: using stochastic generation to estimate the model's internal probability distribution over competing syntactic analyses.
Probing through Generation
The authors introduce a framework to quantify "syntactic uncertainty" by analyzing the distribution of generated completions. The process involves:
- Prompting: Providing the LM with an ambiguous sentence fragment.
- Sampling: Generating 100 completions via stochastic decoding.
- Syntactic Classification: Using a dependency parser to identify the structure of each completion.
- Uncertainty Estimation: Calculating the proportion of completions corresponding to each parse.
This approach allows researchers to observe the model's "subjective probability" for different interpretations without pre-defining specific target sentences.
Experimental Design
The study evaluates GPT-2 and an LSTM on three classic types of temporary ambiguity derived from psycholinguistic literature:
- NP/S Ambiguity: Where a noun phrase can be a direct object or a sentential subject (e.g., "The scientist proved the theory...").
- NP/Z Ambiguity: Where a noun phrase can be a direct object or the subject of a main clause following a subordinate clause (e.g., "Even though the band left the party...").
- Noun/Verb Ambiguity: Where a word's part-of-speech is ambiguous (e.g., "The pants suit...").
Key Findings
The results demonstrate that LMs do not merely commit to a single parse; they maintain a distribution over multiple analyses, much like human readers.
Structural Biases and Cue Sensitivity Models exhibit strong default biases, such as the "late closure" preference for NP interpretations. In NP/S cases, models favored the NP interpretation but still generated S completions 20-30% of the time. However, the introduction of disambiguating cues—such as the complementizer "that" or a comma—drastically shifts the probability mass toward the correct interpretation.
Garden-Path Effects and Ungrammaticality In NP/Z cases without a comma, models showed a near-absolute bias toward the NP interpretation. Interestingly, when forced into a "garden-path" by the prompt, GPT-2 sometimes produced ungrammatical "blended" sentences. This suggests that once the model's internal state is committed to an incorrect parse, it may struggle to reconfigure itself, leading to structural errors similar to human processing difficulties.
Validation The generation-based probability estimates were validated against traditional surprisal metrics. The strong correlation (Spearman’s $\rho$ between -0.70 and -0.81) confirms that the distribution of generated parses is a reliable proxy for the model's internal syntactic state.
Conclusion
Probing LMs through generation provides a window into their incremental parsing processes. While LMs demonstrate sophisticated tracking of multiple syntactic possibilities and high sensitivity to linguistic cues, their occasional failure to recover from garden-path prompts highlights limitations in current architectures. Future work could leverage these insights to improve the robustness of LMs in complex syntactic environments.
Summary updated