Learn Before
Formula

ALiBi Bias Term Formula

In Attention with Linear Biases (ALiBi), the positional bias term is calculated as the negative scaled difference between the query position and the key position. Specifically, for a query at position ii and a key at position jj, the positional embedding bias PE(i,j)\mathrm{PE}(i,j) is defined by the equation PE(i,j)=β(ij)\mathrm{PE}(i,j) = -\beta \cdot (i - j). This can be equivalently formulated by distributing the negative sign to yield PE(i,j)=β(ji)\mathrm{PE}(i,j) = \beta \cdot (j - i), where β\beta is a scaling factor.

Image 0

0

1

Updated 2026-04-24

Contributors are:

Who are from:

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences