Abstract
When language models process syntactically complex sentences, do they use their representations of syntax in a manner that is consistent with the grammar of the language? We propose AlterRep, an intervention-based method to address this question. For any linguistic feature of a given sentence, AlterRep generates counterfactual representations by altering how the feature is encoded, while leaving intact all other aspects of the original representation. By measuring the change in a model’s word prediction behavior when these counterfactual representations are substituted for the original ones, we can draw conclusions about the causal effect of the linguistic feature in question on the model’s behavior. We apply this method to study how BERT models of different sizes process relative clauses (RCs). We find that BERT variants use RC boundary information during word prediction in a manner that is consistent with the rules of English grammar; this RC boundary information generalizes to a considerable extent across different RC types, suggesting that BERT represents RCs as an abstract linguistic category.
Original language | English |
---|---|
Title of host publication | CoNLL 2021 - 25th Conference on Computational Natural Language Learning, Proceedings |
Editors | Arianna Bisazza, Omri Abend |
Publisher | Association for Computational Linguistics (ACL) |
Pages | 194-209 |
Number of pages | 16 |
ISBN (Electronic) | 9781955917056 |
State | Published - 2021 |
Event | 25th Conference on Computational Natural Language Learning, CoNLL 2021 - Virtual, Online Duration: 10 Nov 2021 → 11 Nov 2021 |
Publication series
Name | CoNLL 2021 - 25th Conference on Computational Natural Language Learning, Proceedings |
---|
Conference
Conference | 25th Conference on Computational Natural Language Learning, CoNLL 2021 |
---|---|
City | Virtual, Online |
Period | 10/11/21 → 11/11/21 |
Bibliographical note
Publisher Copyright:© 2021 Association for Computational Linguistics.
Funding
This work was supported by United States–Israel Binational Science Foundation award 2018284, and has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme, grant agreement No. 802774 (iEXTRACT). We thank Robert Frank for fruitful discussion of an early version of this work, and Marius Mosbach for his helpful comments.
Funders | Funder number |
---|---|
Horizon 2020 Framework Programme | 802774 |
European Commission | |
United States-Israel Binational Science Foundation | 2018284 |