Why does ALiBi extrapolate to longer sequences better than absolute positional embeddings?
Last updated
ALiBi adds no position vectors. It subtracts a fixed, head-specific linear distance penalty from each logit:
q·k - m_h·(i - j).Absolute embeddings fail because unseen positions are out of distribution. ALiBi's penalty depends only on distance, is defined for any length, and makes each head a soft local window.
Caveat: much of the stability comes from ignoring distant tokens, so true long-range retrieval is limited.