What is: Fast Attention Via Positive Orthogonal Random Features?
Source | Rethinking Attention with Performers |
Year | 2000 |
Data Source | CC BY-SA - https://paperswithcode.com |
FAVOR+, or Fast Attention Via Positive Orthogonal Random Features, is an efficient attention mechanism used in the Performer architecture which leverages approaches such as kernel methods and random features approximation for approximating softmax and Gaussian kernels.
FAVOR+ works for attention blocks using matrices of the form , with standing for the query/key row-vector in and kernel defined for the (usually randomized) mapping: (for some ) as:
We call a random feature map for . For with rows given as and respectively, this leads directly to the efficient attention mechanism of the form:
where
The above scheme constitutes the FA-part of the FAVOR+ mechanism. The other parts are achieved by:
- The R part : The softmax kernel is approximated though trigonometric functions, in the form of a regularized softmax-kernel SMREG, that employs positive random features (PRFs).
- The OR+ part : To reduce the variance of the estimator, so we can use a smaller number of random features, different samples are entangled to be exactly orthogonal using the Gram-Schmidt orthogonalization procedure.
The details are quite technical, so it is recommended you read the paper for further information on these steps.