EMNLP 2021main83 citations

A Simple and Effective Positional Encoding for Transformers

Pu-Chin Chen, Henry Tsai, Srinadh Bhojanapalli, Hyung Won Chung, Yin-Wen Chang, Chun-Sung Ferng

Abstract

Transformer models are permutation equivariant. To supply the order and type information of the input tokens, position and segment embeddings are usually added to the input. Recent works proposed variations of positional encodings with relative position encodings achieving better performance. Our analysis shows that the gain actually comes from moving positional information to attention layer from the input. Motivated by this, we introduce Decoupled Positional Attention for Transformers (DIET), a simple yet effective mechanism to encode position and segment information into the Transformer models. The proposed method has faster training and inference time, while achieving competitive performance on GLUE, XTREME and WMT benchmarks. We further generalize our method to long-range transformers and show performance gain.

BibTeX
@inproceedings{chen-etal-2021-simple,
    title = "A Simple and Effective Positional Encoding for Transformers",
    author = "Chen, Pu-Chin  and
      Tsai, Henry  and
      Bhojanapalli, Srinadh  and
      Chung, Hyung Won  and
      Chang, Yin-Wen  and
      Ferng, Chun-Sung",
    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.236/",
    doi = "10.18653/v1/2021.emnlp-main.236",
    pages = "2974--2988"
}