FAVOR#: Sharp Attention Kernel Approximations via New Classes of Positive Random Features

Valerii Likhosherstov, Krzysztof Choromanski, Avinava Dubey, Frederick Liu, Tamas Sarlos +1 more
2/1/2023
cs.LGstat.ML

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

The problem of efficient approximation of a linear operator induced by the Gaussian or softmax kernel is often addressed using random features (RFs) which yield an unbiased approximation of the operator's result. Such operators emerge in important applications ranging from kernel methods to efficient Transformers. We propose parameterized, positive, non-trigonometric RFs which approximate Gaussian and softmax-kernels. In contrast to traditional RF approximations, parameters of these new methods can be optimized to reduce the variance of the approximation, and the optimum can be expressed in closed form. We show that our methods lead to variance reduction in practice ($e^{10}$-times smaller variance and beyond) and outperform previous methods in a kernel regression task. Using our proposed mechanism, we also present FAVOR#, a method for self-attention approximation in Transformers. We show that FAVOR# outperforms other random feature methods in speech modelling and natural language processing.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{likhosherstov2023favor,
  title  = {FAVOR#: Sharp Attention Kernel Approximations via New Classes of Positive Random Features},
  author = {Valerii Likhosherstov and Krzysztof Choromanski and Avinava Dubey and Frederick Liu and Tamas Sarlos and Adrian Weller},
  year   = {2023},
  eprint = {2302.00787},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.00787v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.00787.svg)](https://codeofpaper.com/paper/2302.00787)

Discussion