Syntax-guided Localized Self-attention by Constituency Syntactic Distance

Shengyuan Hou, Jushi Kai, Haotian Xue, Bingyu Zhu, Bo Yuan +3 more
10/21/2022
cs.CL
transformer-attention

Official code: LUMIA-Group/distance_transformer (8 stars, Python, MIT, last commit 2023-01-05).

Abstract

Recent works have revealed that Transformers are implicitly learning the syntactic information in its lower layers from data, albeit is highly dependent on the quality and scale of the training data. However, learning syntactic information from data is not necessary if we can leverage an external syntactic parser, which provides better parsing quality with well-defined syntactic structures.

Show full abstract

This could potentially improve Transformer's performance and sample efficiency. In this work, we propose a syntax-guided localized self-attention for Transformer that allows directly incorporating grammar structures from an external constituency parser. It prohibits the attention mechanism to overweight the grammatically distant tokens over close ones. Experimental results show that our model could consistently improve translation performance on a variety of machine translation datasets, ranging from small to large dataset sizes, and with different source languages.

View on arXivView PDF

Code Implementations(1)

MIT

The official implementation of the paper "Syntax-guided Localized Self-attention by Constituency Syntactic Distance"(Findings of EMNLP 2022)

81Python, CudaOct 18, 20223 years agoMIT

Similar Papers

Cite this paper

@article{hou2022syntaxguided,
  title  = {Syntax-guided Localized Self-attention by Constituency Syntactic Distance},
  author = {Shengyuan Hou and Jushi Kai and Haotian Xue and Bingyu Zhu and Bo Yuan and Longtao Huang and Xinbing Wang and Zhouhan Lin},
  year   = {2022},
  eprint = {2210.11759},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.11759}
}

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

Discussion