Relative Positional Encodings in Transformers: How Shaw's Attention, Transformer-XL, and T5 Relative Biases Preserve Translation Invariance
This post explains why absolute positional encodings fail to capture relative displacement and details the evolution of relative mechanisms including Shaw’s relation-aware attention, Transformer-XL’s four-term decomposition, and T5’s logarithmic bucketing to achieve translation invariance.
