EMNLP 2021main11 citations

Explore Better Relative Position Embeddings from Encoding Perspective for Transformer Models

Anlin Qu, Jianwei Niu, Shasha Mo

Abstract

Relative position embedding (RPE) is a successful method to explicitly and efficaciously encode position information into Transformer models. In this paper, we investigate the potential problems in Shaw-RPE and XL-RPE, which are the most representative and prevalent RPEs, and propose two novel RPEs called Low-level Fine-grained High-level Coarse-grained (LFHC) RPE and Gaussian Cumulative Distribution Function (GCDF) RPE. LFHC-RPE is an improvement of Shaw-RPE, which enhances the perception ability at medium and long relative positions. GCDF-RPE utilizes the excellent properties of the Gaussian function to amend the prior encoding mechanism in XL-RPE. Experimental results on nine authoritative datasets demonstrate the effectiveness of our methods empirically. Furthermore, GCDF-RPE achieves the best overall performance among five different RPEs.

BibTeX
@inproceedings{qu-etal-2021-explore,
    title = "Explore Better Relative Position Embeddings from Encoding Perspective for Transformer Models",
    author = "Qu, Anlin  and
      Niu, Jianwei  and
      Mo, Shasha",
    editor = "Moens, Marie-Francine  and
      Huang, Xuanjing  and
      Specia, Lucia  and
      Yih, Scott Wen-tau",
    booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
    month = nov,
    year = "2021",
    address = "Online and Punta Cana, Dominican Republic",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.emnlp-main.237/",
    doi = "10.18653/v1/2021.emnlp-main.237",
    pages = "2989--2997"
}
Explore Better Relative Position Embeddings from Encoding Perspective for Transformer Models · EMNLP 2021