ALiBi

Also known as: Attention with Linear Biases

Category: Neural Networks & Architectures

A positional encoding method that adds a linear distance-based bias to attention scores instead of adding positional embeddings to token representations.

Full Explanation

ALiBi (Attention with Linear Biases), proposed by Press et al. in 2022, takes a fundamentally different approach to positional encoding by adding a scalar bias to each attention score based on the distance between the query and key positions. The bias is negative and proportional to distance, with different attention heads using different slope values. This simple mechanism avoids adding positional embeddings to token representations entirely. ALiBi's key advantage is superior length extrapolation: models trained with shorter sequences can effectively process longer sequences at inference time without significant degradation. The method is computationally inexpensive and has no learnable positional parameters. ALiBi is used in models like BLOOM and MPT. While effective, RoPE has become more widely adopted in practice, particularly for very long context windows.

Related Terms

More in Neural Networks & Architectures

Explore More