Re:Attention with Linear Biases (ALiBi)
by KRAKRISMOTT on Sunday May 14, 2023 @12:53AM
(#35935426)
I don't recall there being a DFT in the original attention is all you need paper.
[ Parent
| on HN ]
Re:Attention with Linear Biases (ALiBi)
by just_a_quack on Sunday May 14, 2023 @03:29AM
(#35936103)
There's not. The positional encodings are generated using sines and cosines such that any offset in position can be described as a linear function on the original position. Using the DFT here would not make sense as the positional encodings are fixed anyway and during inference this method generalizes nicely because of the geometric progression created by the arguments of the positional encoding functions.
There isn't a DFT directly, it's a more obvious statement here.
The circulant matrix (linear graph of words) always has the same eigenvectors and is diagonalized via DFT.
The PE in original Viswani is based on this, they just didn't put in all the details. So effectively the model gets hints from the PE that it's a linear graph because these are the eigenvectors.