mlsanityData to 14 Oct 2026

Theoretical Analysis of Positional Encodings in Transformer Models: Impact on Expressiveness and Generalization

arXiv 2506.06398 ↗First posted 5 Jun 2025cs.LG cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

Positional encodings are a core part of transformer-based models, enabling processing of sequential data without recurrence. This paper presents a theoretical framework to analyze how various positional encoding methods, including sinusoidal, learned, relative, and bias-based methods like Attention with Linear Biases (ALiBi), impact a transformer's expressiveness, generalization ability, and extrapolation to longer sequences. Expressiveness is defined via function approximation, generalization bounds are established using Rademacher complexity, and new encoding methods based on orthogonal functions, such as wavelets and Legendre polynomials, are proposed. The extrapolation capacity of existing and proposed encodings is analyzed, extending ALiBi's biasing approach to a unified theoretical context. Experimental evaluation on synthetic sequence-to-sequence tasks shows that orthogonal transform-based encodings outperform traditional sinusoidal encodings in generalization and extrapolation. This work addresses a critical gap in transformer theory, providing insights for design choices in natural language processing, computer vision, and other transformer applications.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 15 of its 24 references that are in the map. First posted on arXiv 5 Jun 2025.

Builds on

15 of 24 references.

References · 15

  1. 2017Attention Is All You Needcited by 60,361
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  4. 2020Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domainscited by 2,200
  5. 2018Self-Attention with Relative Position Representationscited by 1,120
  6. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  7. 2020On Layer Normalization in the Transformer Architecturecited by 922
  8. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
  9. 2018Efficient Attention: Attention with Linear Complexitiescited by 368
  10. 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
  11. 2021AutoFormer: Searching Transformers for Visual Recognitioncited by 188
  12. 2019Transformers without Tears: Improving the Normalization of Self-Attentioncited by 153
3 more
  1. 2021A Universal Law of Robustness via Isoperimetrycited by 151
  2. 2018Towards Understanding the Role of Over-Parametrization in Generalization of Neural Networkscited by 142
  3. 2020ConvBERT: Improving BERT with Span-based Dynamic Convolutioncited by 88

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.