Language models align with human judgments on key grammatical constructions

Jennifer Hu, Kyle Mahowald, Gary Lupyan, Anna A. Ivanova, Roger LevyarXiv 2024 · DOI

Abstract

Do large language models (LLMs) make human-like linguistic generalizations? Dentella et al. (2023) ("DGL") prompt several LLMs ("Is the following sentence grammatically correct in English?") to elicit grammaticality judgments of 80 English sentences, concluding that LLMs demonstrate a "yes-response bias" and a "failure to distinguish grammatical from ungrammatical sentences". We re-evaluate LLM performance using well-established practices and find that DGL's data in fact provide evidence for just how well LLMs capture human behaviors. Models not only achieve high accuracy overall, but also capture fine-grained variation in human linguistic judgments.

Introduction

Recent evaluations of Large Language Models (LLMs) have sparked debate regarding their true linguistic competence. A prominent study by Dentella et al. (2023) argued that LLMs lack basic grammatical understanding, citing a persistent "yes-bias" and an inability to distinguish grammatical from ungrammatical strings. However, this conclusion may be an artifact of methodology rather than a reflection of model capacity. By shifting from metalinguistic prompting to direct probability measurements, we demonstrate that LLMs—particularly advanced models like GPT-4—align closely with human linguistic behavior.

Methodology: Beyond Metalinguistic Prompts

The core of the disagreement lies in the nature of the task. Asking a model "Is this sentence correct?" is a metalinguistic task that requires the model to reason about language, which is distinct from its underlying linguistic competence. To probe this knowledge more accurately, we employed two primary strategies:

  1. Minimal-Pair Analysis: Instead of asking for a "Yes/No" judgment, we presented models with two nearly identical sentences—one grammatical and one containing a specific error. We then measured the probability the model assigned to each string. A model "passes" if it assigns a higher probability to the grammatical version.
  2. Surprisal Mapping: We calculated the "surprisal" (negative log-probability) of sentences and compared it to human acceptance rates. This tests if the model's internal statistical expectations match human intuition.

Results: Alignment and Accuracy

Our re-evaluation reveals that LLMs possess significant grammatical competence that is often obscured by open-ended prompting.

Quantitative Correlation

A key finding is the strong correlation between model surprisal and human behavior. As shown in Figure 1, the surprisal difference between a sentence and its minimal pair is a powerful predictor of human acceptance rates. For the davinci2 model, we observed a Pearson correlation of $\rho = -0.74$, suggesting that the model's internal expectations mirror human linguistic intuitions.

Model surprisal difference vs. human acceptance rates for davinci2 and davinci3.

The Myth of the "Yes-Bias"

The previously reported "yes-bias" largely disappears when prompts are properly aligned with the human task (e.g., using constrained "C/N" responses). As illustrated in the confusion matrices in Figure 2, GPT-4 not only avoids this bias but actually achieves higher accuracy than human participants when evaluated against normative grammatical labels.

Confusion matrices comparing model and human responses across grammatical phenomena.

Shared Blind Spots

In minimal-pair tests, LLMs achieved near-ceiling performance across almost all categories, such as Anaphora and Negative Polarity Items (NPIs). Interestingly, both humans and LLMs struggled with "Center Embedding" constructions (e.g., "The bone the dog the cat scratched bit dropped"). This suggests that LLMs may share some of the same processing constraints or statistical biases as human language learners.

Conclusion

The perceived failure of LLMs in grammatical tasks is often a failure of the evaluation metric. When tested using standard computational linguistics practices, LLMs demonstrate remarkable alignment with human behavior, capturing both normative rules and the fine-grained, often "messy" variations in human linguistic judgment.

Summary updated

BibTeX
@misc{hu2024language,
  author = {Jennifer Hu and Kyle Mahowald and Gary Lupyan and Anna A. Ivanova and Roger Levy},
  title = {{Language models align with human judgments on key grammatical constructions}},
  year = {2024},
  eprint = {2402.01676},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.01676},
}
Figure