Methods › General › Position Embeddings › Relative Position Encodings

Relative Position Encodings

45 papers tagged archive 2025-07-28

Introduced by Peter Shaw et al. in Self-Attention with Relative Position Representations

archive 2025-07-28 Description, source and code snippet are the archive's method entry.

Relative Position Encodings are a type of position embeddings for Transformer-based models that attempts to exploit pairwise, relative positional information. Relative positional information is supplied to the model on two levels: values and keys. This becomes apparent in the two modified self-attention equations shown below. First, relative positional information is supplied to the model as an additional component to the keys

eᵢⱼ = (xᵢW^Q(xⱼWᴷ + aᴷᵢⱼ)ᵀ)/(√(d_z))

Here a is an edge representation for the inputs xᵢ and xⱼ. The softmax operation remains unchanged from vanilla self-attention. Then relative positional information is supplied again as a sub-component of the values matrix:

zᵢ = ∑ⁿⱼ₌₁αᵢⱼ(xⱼWⱽ + aᵢⱼⱽ)

In other words, instead of simply combining semantic embeddings with absolute positional ones, relative positional information is added to keys and values on the fly during attention calculation.

Source: Jake Tae

Image Source: [Relative Positional Encoding for Transformers with Linear Complexity](https://www.youtube.com/watch?v=qajudaEHuq8

PaperSource

Papers archive 2025-07-28

30 shown of 45, newest first. Repository counts are the archive's code-links table. A Syntology line states what Syntology ran from that paper's harvested code; it is per sample and not a correctness claim.

Tasks archive 2025-07-28

20 shown of 56 tasks the archive attaches to papers tagged with this method, by distinct papers. A task without a page in the catalog is plain text.

TaskPapers
Position5
Language Modelling3
Scheduling3
Image Generation2
Language Modeling2
Machine Translation2
Management2
Multi-Armed Bandits2
Question Answering2
Reinforcement Learning (RL)2
Thompson Sampling2
Translation2
reinforcement-learning2
Autonomous Driving1
BIG-bench Machine Learning1
Bench2Drive1
Color Image Denoising1
Deep Reinforcement Learning1
Denoising1
Diagnostic1

Usage over time archive 2025-07-28

Papers per year tagged with Relative Position Encodings: 2018 to 2025, peak 12 12 0 2018: 1 paper 2018 2019: 0 papers 2019 2020: 5 papers 2020 2021: 12 papers 2021 2022: 9 papers 2022 2023: 7 papers 2023 2024: 8 papers 2024 2025: 3 papers 2025
Papers per year the archive tags with this method, by the paper's archive date (45 dated). Bars are counts, not a trend claim.

Components: the archive holds no method-to-method composition, so PwC's Components table cannot be rebuilt; the Papers list carries no Results column for the same reason (the archive does not join its leaderboard rows to method tags).

Categories archive 2025-07-28

Position Embeddings

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections