Improving BERT with Syntax-aware Local Attention

Zhongli Li, Qingyu Zhou, Chao Li, Ke Xu, Yunbo Cao
12/30/2020
cs.CL

Official code: Neutralzz/syntax_aware_local_attention (14 stars, Python, last commit 2021-07-26).

Abstract

Pre-trained Transformer-based neural language models, such as BERT, have achieved remarkable results on varieties of NLP tasks. Recent works have shown that attention-based models can benefit from more focused attention over local regions.

Show full abstract

Most of them restrict the attention scope within a linear span, or confine to certain tasks such as machine translation and question answering. In this paper, we propose a syntax-aware local attention, where the attention scopes are restrained based on the distances in the syntactic structure. The proposed syntax-aware local attention can be integrated with pretrained language models, such as BERT, to render the model to focus on syntactically relevant words. We conduct experiments on various single-sentence benchmarks, including sentence classification and sequence labeling tasks. Experimental results show consistent gains over BERT on all benchmark datasets. The extensive studies verify that our model achieves better performance owing to more focused attention over syntactically relevant words.

View on arXivView PDF

Code Implementations(1)

144Python, ShellMay 24, 20215 years ago

Similar Papers

Cite this paper

@article{li2020improving,
  title  = {Improving BERT with Syntax-aware Local Attention},
  author = {Zhongli Li and Qingyu Zhou and Chao Li and Ke Xu and Yunbo Cao},
  year   = {2020},
  eprint = {2012.15150},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2012.15150}
}

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

Discussion