Linear Complexity Randomized Self-attention Mechanism

Lin Zheng, Chong Wang, Lingpeng Kong
Proceedings of the 39th International Conference on Machine Learning, PMLR 162:27011-27041, 2022.

Abstract

Recently, random feature attentions (RFAs) are proposed to approximate the softmax attention in linear time and space complexity by linearizing the exponential kernel. In this paper, we first propose a novel perspective to understand the bias in such approximation by recasting RFAs as self-normalized importance samplers. This perspective further sheds light on an unbiased estimator for the whole softmax attention, called randomized attention (RA). RA constructs positive random features via query-specific distributions and enjoys greatly improved approximation fidelity, albeit exhibiting quadratic complexity. By combining the expressiveness in RA and the efficiency in RFA, we develop a novel linear complexity self-attention mechanism called linear randomized attention (LARA). Extensive experiments across various domains demonstrate that RA and LARA significantly improve the performance of RFAs by a substantial margin.

Cite this Paper


BibTeX
@InProceedings{pmlr-v162-zheng22b, title = {Linear Complexity Randomized Self-attention Mechanism}, author = {Zheng, Lin and Wang, Chong and Kong, Lingpeng}, booktitle = {Proceedings of the 39th International Conference on Machine Learning}, pages = {27011--27041}, year = {2022}, editor = {Chaudhuri, Kamalika and Jegelka, Stefanie and Song, Le and Szepesvari, Csaba and Niu, Gang and Sabato, Sivan}, volume = {162}, series = {Proceedings of Machine Learning Research}, month = {17--23 Jul}, publisher = {PMLR}, pdf = {https://proceedings.mlr.press/v162/zheng22b/zheng22b.pdf}, url = {https://proceedings.mlr.press/v162/zheng22b.html}, abstract = {Recently, random feature attentions (RFAs) are proposed to approximate the softmax attention in linear time and space complexity by linearizing the exponential kernel. In this paper, we first propose a novel perspective to understand the bias in such approximation by recasting RFAs as self-normalized importance samplers. This perspective further sheds light on an unbiased estimator for the whole softmax attention, called randomized attention (RA). RA constructs positive random features via query-specific distributions and enjoys greatly improved approximation fidelity, albeit exhibiting quadratic complexity. By combining the expressiveness in RA and the efficiency in RFA, we develop a novel linear complexity self-attention mechanism called linear randomized attention (LARA). Extensive experiments across various domains demonstrate that RA and LARA significantly improve the performance of RFAs by a substantial margin.} }
Endnote
%0 Conference Paper %T Linear Complexity Randomized Self-attention Mechanism %A Lin Zheng %A Chong Wang %A Lingpeng Kong %B Proceedings of the 39th International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2022 %E Kamalika Chaudhuri %E Stefanie Jegelka %E Le Song %E Csaba Szepesvari %E Gang Niu %E Sivan Sabato %F pmlr-v162-zheng22b %I PMLR %P 27011--27041 %U https://proceedings.mlr.press/v162/zheng22b.html %V 162 %X Recently, random feature attentions (RFAs) are proposed to approximate the softmax attention in linear time and space complexity by linearizing the exponential kernel. In this paper, we first propose a novel perspective to understand the bias in such approximation by recasting RFAs as self-normalized importance samplers. This perspective further sheds light on an unbiased estimator for the whole softmax attention, called randomized attention (RA). RA constructs positive random features via query-specific distributions and enjoys greatly improved approximation fidelity, albeit exhibiting quadratic complexity. By combining the expressiveness in RA and the efficiency in RFA, we develop a novel linear complexity self-attention mechanism called linear randomized attention (LARA). Extensive experiments across various domains demonstrate that RA and LARA significantly improve the performance of RFAs by a substantial margin.
APA
Zheng, L., Wang, C. & Kong, L.. (2022). Linear Complexity Randomized Self-attention Mechanism. Proceedings of the 39th International Conference on Machine Learning, in Proceedings of Machine Learning Research 162:27011-27041 Available from https://proceedings.mlr.press/v162/zheng22b.html.

Related Material