ALiBi
Attention has no sense of order on its own: scramble the words of a sentence and it computes the same thing. Every transformer needs something that puts position back in, and ALiBi (Attention with Linear Biases) is the unusually blunt answer — do not represent position at all, simply penalise attending to things that are far away.
The mechanismBefore the softmax, ALiBi subtracts from each attention score a value proportional to the distance between the two tokens, so a token 50 positions back carries 50 times the penalty of its immediate neighbour. The constant of proportionality — the slope — is fixed per attention head: steep slopes make a head strongly local, shallow slopes let it look far back. Nothing is learned, and nothing is added to the embeddings.
Why it was proposedA model trained with learned or sinusoidal position embeddings degrades sharply on sequences longer than it saw in training, because the positions themselves are unfamiliar. ALiBi has no position representation to be unfamiliar with — the penalty is a formula that extends to any distance — so a model trained at 1,024 tokens keeps producing sensible text well beyond it. That property, extrapolation, is the paper's whole claim: train short, test long.
Where it stands nowBLOOM and MPT shipped with ALiBi, but RoPE won the architecture argument, partly because rotary embeddings fit cleanly with context-extension methods such as position interpolation and YaRN. ALiBi's lasting contribution is the finding that a per-head recency bias carries most of what a model needs to know about position — an idea that reappears in sliding-window attention.
ALiBi (Attention with Linear Biases) supplies positional information by subtracting from each attention score a penalty proportional to the distance between tokens, with a fixed slope per head, instead of adding position embeddings. Because the penalty is a formula rather than a learned representation, a model trained on short sequences keeps working on longer ones — the length extrapolation it was designed for. Used in BLOOM and MPT, though RoPE is now the common choice.
Words only mean something in order — "the dog bit the man" is not "the man bit the dog". The maths inside a language model has no natural sense of order, so something has to supply it. ALiBi does this in a pleasingly simple way: the further back a word sits, the less the model is allowed to pay attention to it. There is no elaborate bookkeeping of positions, just a steady fading of interest with distance, rather like how you recall the last few sentences of a conversation more clearly than its opening. One happy side effect: a model taught this way copes with text far longer than anything it practised on.