Lune

EMNLP2023Top-tier venue

Absolute Position Embedding Learns Sinusoid-like Waves for Attention Based on Relative Position

Yuji Yamamoto, Takuya Matsuzaki

Abstract

Attention weight is a clue to interpret how a Transformer-based model makes an inference. In some attention heads, the attention focuses on the neighbors of each token. This allows the output vector of each token to depend on the surrounding tokens and contributes to make the inference context-dependent. We analyze the mechanism behind the concentration of attention on nearby tokens. We show that the phenomenon emerges as follows: (1) learned position embedding has sinusoid-like components, (2) such components are transmitted to the query and the key in the self-attention, (3) the attention head shifts the phases of the sinusoid-like components so that the attention concentrates on nearby tokens at specific relative positions. In other words, a certain type of Transformer-based model acquires the sinusoidal positional encoding to some extent on its own through Masked Language Modeling.

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.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Impact of Positional Encodings on Multilingual Compression cites On Position Embeddings in BERT
  • On Position Embeddings in BERT cites What Do Position Embeddings Learn? An Empirical Study of Pre-Trained Language Model Positional Encoding
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. GH-NAF: Grid-Adaptive Hash-Level-Attended Neural Attenuation Fields for Discrepancy-Aware CBCTSeong Je Oh, Ju Hwan Lee, Chae Yeon Lim, Donghwan Lee et al.CVPR 2026

Builds on5

  1. BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and ComprehensionMike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad et al.ACL 2020 · 1,224 citations
  2. On Position Embeddings in BERTBenyou Wang, Lifeng Shang, Christina Lioma, Xin Jiang et al.ICLR 2021 · 129 citations
  3. What Do Position Embeddings Learn? An Empirical Study of Pre-Trained Language Model Positional EncodingYu-An Wang, Yun-Nung ChenEMNLP 2020 · 71 citations
  4. The Geometry of Multilingual Language Model RepresentationsTyler A. Chang, Zhuowen Tu, Benjamin K. BergenEMNLP 2022 · 22 citations
  5. The Impact of Positional Encodings on Multilingual CompressionVinit Ravishankar, Anders SøgaardEMNLP 2021 · 7 citations

Related papers

  1. LayerNorm Induces Recency Bias in Transformer DecodersJunu Kim, Xiao Liu, Zhenghao Lin, Lei Ji et al.ACL Findings 2026
  2. Attention is Not Only a Weight: Analyzing Transformers with Vector NormsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2020 · 138 citations
  3. What are you sinking? A geometric approach on attention sinkValeria Ruscio, Umberto Nanni, Fabrizio SilvestriNeurIPS 2025 · 29 citations
  4. Attention weights accurately predict language representations in the brainMathis Lamarre, Catherine Chen, Fatma DenizEMNLP Findings 2022 · 9 citations
  5. On Scalar Embedding of Relative Positions in Attention ModelsJunshuang Wu, Richong Zhang, Yongyi Mao, Junfan ChenAAAI 2021 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines