Skip to main content
QUICK REVIEW

[Paper Review] Interpreting and improving natural-language processing (in machines) with natural language-processing (in the brain)

Mariya Toneva, Leila Wehbe|arXiv (Cornell University)|May 28, 2019
Topic ModelingComputer Science45 references142 citations
TL;DR

The paper proposes aligning neural network word representations with human brain activity to interpret NLP models (ELMo, USE, BERT, Transformer-XL) and shows that brain-aligned modifications can improve syntactic understanding. It analyzes how context length, layer depth, and attention affect brain predictivity across models and demonstrates transfer from brain-guided changes to NLP tasks.

ABSTRACT

Neural networks models for NLP are typically implemented without the explicit encoding of language rules and yet they are able to break one performance record after another. This has generated a lot of research interest in interpreting the representations learned by these networks. We propose here a novel interpretation approach that relies on the only processing system we have that does understand language: the human brain. We use brain imaging recordings of subjects reading complex natural text to interpret word and sequence embeddings from 4 recent NLP models - ELMo, USE, BERT and Transformer-XL. We study how their representations differ across layer depth, context length, and attention type. Our results reveal differences in the context-related representations across these models. Further, in the transformer models, we find an interaction between layer depth and context length, and between layer depth and attention type. We finally hypothesize that altering BERT to better align with brain recordings would enable it to also better understand language. Probing the altered BERT using syntactic NLP tasks reveals that the model with increased brain-alignment outperforms the original model. Cognitive neuroscientists have already begun using NLP networks to study the brain, and this work closes the loop to allow the interaction between NLP and cognitive neuroscience to be a true cross-pollination.

Motivation & Objective

  • Motivate interpreting neural NLP representations using human brain activity during naturalistic reading.
  • Develop a data-driven method to align network representations with fMRI/MEG data to assess what models encode.
  • Compare word- and context-length representations across four models (ELMo, USE, BERT, T-XL) in brain terms.
  • Identify how context length, layer depth, and attention type influence brain-aligned predictivity across models.
  • Demonstrate that brain-aligned modifications to BERT can transfer to improved syntactic task performance.

Proposed method

  • Extract intermediate layer representations x_{l,k} from four NLP models (ELMo, BERT, USE, T-XL) for the same text and word windows.
  • Fit linear encoding models with ridge regularization to predict MEG/fMRI activity from x_{l,k} and evaluate predictive accuracy.
  • Use a four-fold cross-validation and a held-out test scheme to assess brain predictivity via a word-set classification task across voxels and sensors.
  • Divide the brain language network into two groups (group 1 and group 2) based on prior literature to interpret where representations align.
  • Investigate the impact of context length by comparing 1-word embeddings to multi-word (e.g., 10-word) representations and analyze layer-wise effects.
  • Alter BERT’s attention patterns (uniform attention in a layer) to assess changes in brain predictivity and transfer to NLP syntactic tasks.
  • Evaluate altered BERT on Marvin & Linzen syntactic tasks to test syntactic understanding without fine-tuning.

Experimental results

Research questions

  • RQ1How do intermediate representations from ELMo, BERT, USE, and Transformer-XL align with brain activity during naturalistic reading?
  • RQ2How do layer depth, context length, and attention type affect brain-aligned predictivity across these models?
  • RQ3Can brain-aligned alterations to BERT improve its syntactic understanding on probing tasks without additional training?

Key findings

  • Middle transformer layers better predict brain activity than other layers across models.
  • Transformer-XL’s performance does not degrade with longer context, unlike other models.
  • Uniform attention in shallow BERT layers improves brain predictivity for context up to 25 words; deep layers are harmed by this change.
  • Altering BERT to remove pretrained attention in shallow layers improves alignment with brain data and yields better performance on syntactic probing tasks.
  • Long-range representations in ELMo, BERT, and T-XL predict activity in both group 1 and group 2 brain regions, while USE mainly predicts long-range information and fewer group-1 regions.
  • Across models, middle layers optimally integrate context longer than 15 words; BERT’s layer1 combines token embeddings differently, affecting context retention.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.