Hierarchical syntactic structure in human-like language models

Michael Wolfman, Donald Dunagan, Jonathan Brennan, John HaleACL 2024

TL;DR

This paper investigates whether explicit hierarchical syntactic structure is crucial for language models to accurately predict human brain activity during language comprehension. By comparing two Transformer models—one with a built-in hierarchy bias and one without—they found that the hierarchy-biased model better predicts fMRI signals in the superior temporal gyrus, suggesting that explicit syntactic structure plays a vital role in how our brains process language.

What Problem Does This Paper Address?

The rapid advancement of large language models (LLMs) has sparked debate about their potential as cognitive models of human language processing. While LLMs excel at many language tasks, a key question remains: how should they be designed to truly mimic human comprehension? Specifically, there's a long-standing controversy in linguistics and cognitive science regarding the necessity of explicit hierarchical syntactic structure for language understanding. Some argue that models focusing solely on word-level predictions are sufficient, while others contend that the brain inherently relies on hierarchical grammar. This paper aims to resolve this by directly comparing two LLMs with identical architectures, differing only in their explicit handling of syntactic hierarchy, and evaluating their ability to predict human brain responses.

Methods

The core of this study lies in comparing two Transformer-based language models:

  • Transformer Grammar (TG): This model is augmented with a special "attention mask" that explicitly encodes hierarchical syntactic structure. It models the joint probability of a surface string and its corresponding phrase structure tree.
  • Transformer-XL (TXL): This is a standard Transformer-XL model that lacks the hierarchical attention mask, focusing solely on word-level information and sequential dependencies.

Both models are identical in terms of parameters (252M), layers (16), and attention heads (8). The researchers then used the concept of surprisal, a measure of information-theoretic complexity for each word in a sentence, derived from each model. This surprisal is used as a predictor for fMRI data. The study employs an r² analysis to determine how much each model's surprisal predictions can explain the variance in the BOLD signal measured by fMRI, comparing the predictive power of TG surprisal against TXL surprisal.

Datasets

  • Training Data: Both language models were trained on the BLLIP-LG dataset (Charniak et al., 2000), a corpus of approximately 1.8 million sentences (around 40 million words) derived from the Wall Street Journal.
  • fMRI Data: The study utilized the English section of the Little Prince Datasets (Li et al., 2022), comprising fMRI data from 49 participants who listened to an audiobook recording of "The Little Prince."

Key Insights and Ideas

  • Hierarchy Matters for Brain Prediction: The most striking finding is that explicit hierarchical structure, as captured by the TG model, significantly improves the prediction of brain activity in the superior temporal gyrus (STG). This suggests that the brain's processing of language, at least in this region, is sensitive to syntactic organization beyond simple word sequences.
  • STG as a Hub for Hierarchical Processing: The results strongly implicate the bilateral STG in processing hierarchical sentence structure. This aligns with previous research linking the STG to auditory processing and language comprehension.
  • Beyond Word Prediction: The study provides evidence against the extreme view that word-prediction alone is sufficient for modeling human language comprehension. While TXL, a word-prediction model, shows some predictive power, TG's superior performance highlights the importance of structural information.
  • Sensory Hypothesis Supported: The findings support the "sensory hypothesis," which posits that hierarchical structure from earlier in a sentence can influence low-level sensory processing of subsequent words in a top-down manner.

Key Results

  • The addition of TG-derived surprisal significantly increased the explained variance (r²) in the BOLD signal in the bilateral superior temporal gyrus (STG) compared to TXL-derived surprisal.
  • Conversely, the unconstrained TXL model performed better in explaining variance in the left fusiform gyrus and pre-motor cortex.
  • The TG and TXL models achieved very similar test set perplexities (32.82 for TG, 34.07 for TXL), indicating comparable performance on basic language modeling tasks before being applied to fMRI data.

Limitations and Future Work

  • Model Depth: The study used 16-layer models. The authors suggest that increasing the depth of both TG and TXL models could reveal further insights into how layer depth influences generalization and correlation with brain regions.
  • Language Specificity: The study was conducted solely on English. Future work should explore these models and findings in other languages to solidify the conclusions.
  • Intermediate Layers: The paper acknowledges that intermediate layers of LLMs are often best at encoding neural data. An interesting follow-up would be to compare how representations from earlier layers of TXL and TG predict neural data.
  • LIFG Null Result: The study did not find significant involvement of the left inferior frontal gyrus (LIFG), a region often implicated in predictive processing. The authors hypothesize this might be due to the relatively modest level of prediction and prediction violation in their stimuli, suggesting LIFG might be more involved in processing particularly complex stimuli.

Summary updated

BibTeX
@inproceedings{wolfman2024hierarchical,
  author = {Michael Wolfman and Donald Dunagan and Jonathan Brennan and John Hale},
  title = {{Hierarchical syntactic structure in human-like language models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
}
Figure