On the Robustness of Language Encoders against Grammatical Errors

Fan Yin, Quanyu Long, Tao Meng, Kai-Wei Chang
5/12/2020
cs.CL

Official code: uclanlp/ProbeGrammarRobustness (10 stars, Python, MIT, last commit 2023-07-06).

Abstract

We conduct a thorough study to diagnose the behaviors of pre-trained language encoders (ELMo, BERT, and RoBERTa) when confronted with natural grammatical errors. Specifically, we collect real grammatical errors from non-native speakers and conduct adversarial attacks to simulate these errors on clean text data.

Show full abstract

We use this approach to facilitate debugging models on downstream applications. Results confirm that the performance of all tested models is affected but the degree of impact varies. To interpret model behaviors, we further design a linguistic acceptability task to reveal their abilities in identifying ungrammatical sentences and the position of errors. We find that fixed contextual encoders with a simple classifier trained on the prediction of sentence correctness are able to locate error positions. We also design a cloze test for BERT and discover that BERT captures the interaction between errors and specific tokens in context. Our results shed light on understanding the robustness and behaviors of language encoders against grammatical errors.

View on arXivView PDF

Code Implementations(1)

MIT

Source code for ACL2020: On the Robustness of Language Encoders against Grammatical Errors

102Python, ShellApr 28, 20203 years agoMIT

Similar Papers

Cite this paper

@article{yin2020robustness,
  title  = {On the Robustness of Language Encoders against Grammatical Errors},
  author = {Fan Yin and Quanyu Long and Tao Meng and Kai-Wei Chang},
  year   = {2020},
  eprint = {2005.05683},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2005.05683}
}

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/2005.05683.svg)](https://codeofpaper.com/paper/2005.05683)

Discussion