Causal Analysis of Syntactic Agreement Mechanisms in Neural Language Models

Matthew Finlayson, Aaron Mueller, Sebastian Gehrmann, Stuart Shieber, Tal Linzen +1 more
6/10/2021
cs.CL

Official code: mattf1n/lm-intervention (8 stars, Jupyter Notebook, MIT, last commit 2021-11-16).

Abstract

Targeted syntactic evaluations have demonstrated the ability of language models to perform subject-verb agreement given difficult contexts. To elucidate the mechanisms by which the models accomplish this behavior, this study applies causal mediation analysis to pre-trained neural language models.

Show full abstract

We investigate the magnitude of models' preferences for grammatical inflections, as well as whether neurons process subject-verb agreement similarly across sentences with different syntactic structures. We uncover similarities and differences across architectures and model sizes -- notably, that larger models do not necessarily learn stronger preferences. We also observe two distinct mechanisms for producing subject-verb agreement depending on the syntactic structure of the input sentence. Finally, we find that language models rely on similar sets of neurons when given sentences with similar syntactic structure.

View on arXivView PDF

Code Implementations(1)

MIT
82Jupyter Notebook, PythonJun 7, 20215 years agoMIT

Similar Papers

Cite this paper

@article{finlayson2021causal,
  title  = {Causal Analysis of Syntactic Agreement Mechanisms in Neural Language Models},
  author = {Matthew Finlayson and Aaron Mueller and Sebastian Gehrmann and Stuart Shieber and Tal Linzen and Yonatan Belinkov},
  year   = {2021},
  eprint = {2106.06087},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.06087}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.06087.svg)](https://codeofpaper.com/paper/2106.06087)

Discussion