On Position Embeddings in BERT
Benyou Wang, Lifeng Shang, Christina Lioma, Xin Jiang, Hao Yang, Qun Liu, Jakob Grue Simonsen
Abstract
Various Position Embeddings (PEs) have been proposed in Transformer based architectures (e.g. BERT) to model word order. These are empirically-driven and perform well, but no formal framework exists to systematically study them. To address this, we present three properties of PEs that capture word distance in vector space: translation invariance, monotonicity, and symmetry. These properties formally capture the behaviour of PEs and allow us to reinterpret sinusoidal PEs in a principled way. Moreover, we propose a new probing test (called 'identical word probing') and mathematical indicators to quantitatively detect the general attention patterns with respect to the above properties. An empirical evaluation of seven PEs (and their combinations) for classification (GLUE) and span prediction (SQuAD) shows that: (1) both classification and span prediction benefit from translation invariance and local monotonicity, while symmetry slightly decreases performance; (2) The fully-learnable absolute PE performs better in classification, while relative PEs perform better in span prediction. We contribute the first formal and quantitative analysis of desiderata for PEs, and a principled discussion about their correlation to the performance of typical downstream tasks.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
29 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- What Do Position Embeddings Learn? An Empirical Study of Pre-Trained Language Model Positional Encoding cites Encoding word order in complex embeddings
- Rethinking Positional Encoding in Language Pre-training cites Learning to Encode Position for Transformer with Continuous Dynamical Model
- Rethinking Positional Encoding in Language Pre-training cites Encoding word order in complex embeddings
- CAPE: Encoding Relative Positions with Continuous Augmented Positional Embeddings cites Encoding word order in complex embeddings
- Learnable Fourier Features for Multi-dimensional Spatial Positional Encoding cites Learning to Encode Position for Transformer with Continuous Dynamical Model
- Learnable Fourier Features for Multi-dimensional Spatial Positional Encoding cites Encoding word order in complex embeddings
Cited by top-tier papers29
- StyleSwin: Transformer-based GAN for High-resolution Image GenerationBowen Zhang, Shuyang Gu, Bo Zhang, Jianmin Bao et al.CVPR 2022 · 217 citations
- Learnable Fourier Features for Multi-dimensional Spatial Positional EncodingYang Li, Si Si, Gang Li, Cho-Jui Hsieh et al.NeurIPS 2021 · 171 citations
- Real-Time Motion Prediction via Heterogeneous Polyline Transformer with Relative Pose EncodingZhejun Zhang, Alexander Liniger, Christos Sakaridis, Fisher Yu et al.NeurIPS 2023 · 79 citations
- CAPE: Encoding Relative Positions with Continuous Augmented Positional EmbeddingsTatiana Likhomanenko, Qiantong Xu, Gabriel Synnaeve, Ronan Collobert et al.NeurIPS 2021 · 74 citations
- Spatio-Temporal Trajectory Similarity Learning in Road NetworksZiquan Fang, Yuntao Du, Xinjun Zhu, Danlei Hu et al.KDD 2022 · 68 citations
Builds on4
- Rethinking Positional Encoding in Language Pre-trainingGuolin Ke, Di He, Tie-Yan LiuICLR 2021 · 358 citations
- Learning to Encode Position for Transformer with Continuous Dynamical ModelXuanqing Liu, Hsiang-Fu Yu, Inderjit S. Dhillon, Cho-Jui HsiehICML 2020 · 139 citations
- Encoding word order in complex embeddingsBenyou Wang, Donghao Zhao, Christina Lioma, Qiuchi Li et al.ICLR 2020 · 134 citations
- What Do Position Embeddings Learn? An Empirical Study of Pre-Trained Language Model Positional EncodingYu-An Wang, Yun-Nung ChenEMNLP 2020 · 71 citations
Related papers
- The Locality and Symmetry of Positional EncodingsLihu Chen, Gaël Varoquaux, Fabian M. SuchanekEMNLP Findings 2023 · 2 citations
- Improve Transformer Models with Better Relative Position EmbeddingsZhiheng Huang, Davis Liang, Peng Xu, Bing XiangEMNLP Findings 2020 · 114 citations
- The Impact of Positional Encodings on Multilingual CompressionVinit Ravishankar, Anders SøgaardEMNLP 2021 · 7 citations
- The Curious Case of Absolute Position EmbeddingsKoustuv Sinha, Amirhossein Kazemnejad, Siva Reddy, Joelle Pineau et al.EMNLP Findings 2022 · 7 citations
- Out of Order: How important is the sequential order of words in a sentence in Natural Language Understanding tasks?Thang M. Pham, Trung Bui, Long Mai, Anh NguyenACL Findings 2021 · 81 citations
