AI Grimoire

Architectures / position

Position

Attention is permutation-invariant: shuffle the tokens and the maths does not notice. Position has to be added back by hand, and the choice of how determines whether the model still works at four times the context it was trained on. The schemes here differ mainly in what they do off the end of that training distribution.

2 entries.

Entries

01.02.1
ALiBistale
Linear distance penalty on attention scores in place of position embeddings.
O(n²·d)
01.02.2
Rotary Position Embeddingstandard
Relative position injected as a per-pair rotation in complex subspaces.
O(n·d)