Relative Attention

Relative attention adds information about the distance or relationship between tokens directly into attention.
Also known as
relative position attention

Intuition

Many language patterns depend more on how far two tokens are from each other than on their absolute position in a document.

Technical definition

Relative attention modifies attention scores or representations using learned or computed features of pairwise token positions.

Example

A model can treat nearby modifiers differently from distant context by using relative position signals.

Common misunderstandings

  • Relative attention is not simply another name for RoPE.
  • Relative position methods can be implemented in several different ways.

Need this inside a product?

The studio builds the systems these terms describe. Tell us what you are working on.