Sparse Attention with Linear Units. Zhang, B., Titov, I., & Sennrich, R. 2021. cite arxiv:2104.07012
Paper abstract bibtex Recently, it has been argued that encoder-decoder models can be made more interpretable by replacing the softmax function in the attention with its sparse variants. In this work, we introduce a novel, simple method for achieving sparsity in attention: we replace the softmax activation with a ReLU, and show that sparsity naturally emerges from such a formulation. Training stability is achieved with layer normalization with either a specialized initialization or an additional gating function. Our model, which we call Rectified Linear Attention (ReLA), is easy to implement and more efficient than previously proposed sparse attention mechanisms. We apply ReLA to the Transformer and conduct experiments on five machine translation tasks. ReLA achieves translation performance comparable to several strong baselines, with training and decoding speed similar to that of the vanilla attention. Our analysis shows that ReLA delivers high sparsity rate and head diversity, and the induced cross attention achieves better accuracy with respect to source-target word alignment than recent sparsified softmax-based models. Intriguingly, ReLA heads also learn to attend to nothing (i.e. 'switch off') for some queries, which is not possible with sparsified softmax alternatives.
@misc{zhang2021sparse,
abstract = {Recently, it has been argued that encoder-decoder models can be made more
interpretable by replacing the softmax function in the attention with its
sparse variants. In this work, we introduce a novel, simple method for
achieving sparsity in attention: we replace the softmax activation with a ReLU,
and show that sparsity naturally emerges from such a formulation. Training
stability is achieved with layer normalization with either a specialized
initialization or an additional gating function. Our model, which we call
Rectified Linear Attention (ReLA), is easy to implement and more efficient than
previously proposed sparse attention mechanisms. We apply ReLA to the
Transformer and conduct experiments on five machine translation tasks. ReLA
achieves translation performance comparable to several strong baselines, with
training and decoding speed similar to that of the vanilla attention. Our
analysis shows that ReLA delivers high sparsity rate and head diversity, and
the induced cross attention achieves better accuracy with respect to
source-target word alignment than recent sparsified softmax-based models.
Intriguingly, ReLA heads also learn to attend to nothing (i.e. 'switch off')
for some queries, which is not possible with sparsified softmax alternatives.},
added-at = {2021-04-21T16:19:15.000+0200},
author = {Zhang, Biao and Titov, Ivan and Sennrich, Rico},
biburl = {https://www.bibsonomy.org/bibtex/29f7ac3647ae7fe00654cc71654467300/analyst},
description = {[2104.07012] Sparse Attention with Linear Units},
interhash = {3aec53479afcf5749a98ce61e048f8b4},
intrahash = {9f7ac3647ae7fe00654cc71654467300},
keywords = {deep-learning attention 2021},
note = {cite arxiv:2104.07012},
timestamp = {2021-04-21T16:19:15.000+0200},
title = {Sparse Attention with Linear Units},
url = {http://arxiv.org/abs/2104.07012},
year = 2021
}
Downloads: 0
{"_id":"omr2EdENtRq8qotkN","bibbaseid":"zhang-titov-sennrich-sparseattentionwithlinearunits-2021","author_short":["Zhang, B.","Titov, I.","Sennrich, R."],"bibdata":{"bibtype":"misc","type":"misc","abstract":"Recently, it has been argued that encoder-decoder models can be made more interpretable by replacing the softmax function in the attention with its sparse variants. In this work, we introduce a novel, simple method for achieving sparsity in attention: we replace the softmax activation with a ReLU, and show that sparsity naturally emerges from such a formulation. Training stability is achieved with layer normalization with either a specialized initialization or an additional gating function. Our model, which we call Rectified Linear Attention (ReLA), is easy to implement and more efficient than previously proposed sparse attention mechanisms. We apply ReLA to the Transformer and conduct experiments on five machine translation tasks. ReLA achieves translation performance comparable to several strong baselines, with training and decoding speed similar to that of the vanilla attention. Our analysis shows that ReLA delivers high sparsity rate and head diversity, and the induced cross attention achieves better accuracy with respect to source-target word alignment than recent sparsified softmax-based models. Intriguingly, ReLA heads also learn to attend to nothing (i.e. 'switch off') for some queries, which is not possible with sparsified softmax alternatives.","added-at":"2021-04-21T16:19:15.000+0200","author":[{"propositions":[],"lastnames":["Zhang"],"firstnames":["Biao"],"suffixes":[]},{"propositions":[],"lastnames":["Titov"],"firstnames":["Ivan"],"suffixes":[]},{"propositions":[],"lastnames":["Sennrich"],"firstnames":["Rico"],"suffixes":[]}],"biburl":"https://www.bibsonomy.org/bibtex/29f7ac3647ae7fe00654cc71654467300/analyst","description":"[2104.07012] Sparse Attention with Linear Units","interhash":"3aec53479afcf5749a98ce61e048f8b4","intrahash":"9f7ac3647ae7fe00654cc71654467300","keywords":"deep-learning attention 2021","note":"cite arxiv:2104.07012","timestamp":"2021-04-21T16:19:15.000+0200","title":"Sparse Attention with Linear Units","url":"http://arxiv.org/abs/2104.07012","year":"2021","bibtex":"@misc{zhang2021sparse,\n abstract = {Recently, it has been argued that encoder-decoder models can be made more\r\ninterpretable by replacing the softmax function in the attention with its\r\nsparse variants. In this work, we introduce a novel, simple method for\r\nachieving sparsity in attention: we replace the softmax activation with a ReLU,\r\nand show that sparsity naturally emerges from such a formulation. Training\r\nstability is achieved with layer normalization with either a specialized\r\ninitialization or an additional gating function. Our model, which we call\r\nRectified Linear Attention (ReLA), is easy to implement and more efficient than\r\npreviously proposed sparse attention mechanisms. We apply ReLA to the\r\nTransformer and conduct experiments on five machine translation tasks. ReLA\r\nachieves translation performance comparable to several strong baselines, with\r\ntraining and decoding speed similar to that of the vanilla attention. Our\r\nanalysis shows that ReLA delivers high sparsity rate and head diversity, and\r\nthe induced cross attention achieves better accuracy with respect to\r\nsource-target word alignment than recent sparsified softmax-based models.\r\nIntriguingly, ReLA heads also learn to attend to nothing (i.e. 'switch off')\r\nfor some queries, which is not possible with sparsified softmax alternatives.},\n added-at = {2021-04-21T16:19:15.000+0200},\n author = {Zhang, Biao and Titov, Ivan and Sennrich, Rico},\n biburl = {https://www.bibsonomy.org/bibtex/29f7ac3647ae7fe00654cc71654467300/analyst},\n description = {[2104.07012] Sparse Attention with Linear Units},\n interhash = {3aec53479afcf5749a98ce61e048f8b4},\n intrahash = {9f7ac3647ae7fe00654cc71654467300},\n keywords = {deep-learning attention 2021},\n note = {cite arxiv:2104.07012},\n timestamp = {2021-04-21T16:19:15.000+0200},\n title = {Sparse Attention with Linear Units},\n url = {http://arxiv.org/abs/2104.07012},\n year = 2021\n}\n\n","author_short":["Zhang, B.","Titov, I.","Sennrich, R."],"key":"zhang2021sparse","id":"zhang2021sparse","bibbaseid":"zhang-titov-sennrich-sparseattentionwithlinearunits-2021","role":"author","urls":{"Paper":"http://arxiv.org/abs/2104.07012"},"keyword":["deep-learning attention 2021"],"metadata":{"authorlinks":{}},"html":""},"bibtype":"misc","biburl":"http://www.bibsonomy.org/bib/author/zhang?items=1000","dataSources":["6yXn8CtuzyEbCSr2m"],"keywords":["deep-learning attention 2021"],"search_terms":["sparse","attention","linear","units","zhang","titov","sennrich"],"title":"Sparse Attention with Linear Units","year":2021}