Selective Attention Improves Transformer

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Leviathan, Yaniv, Kalman, Matan, Matias, Yossi
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908335438036992
author Leviathan, Yaniv
Kalman, Matan
Matias, Yossi
author_facet Leviathan, Yaniv
Kalman, Matan
Matias, Yossi
contents Unneeded elements in the attention's context degrade performance. We introduce Selective Attention, a simple parameter-free change to the standard attention mechanism which reduces attention to unneeded elements. Selective attention consistently improves language modeling and downstream task performance in a variety of model sizes and context lengths. For example, transformers trained with the language modeling objective on C4 with selective attention perform language modeling equivalently to standard transformers with ~2X more heads and parameters in their attention modules. Selective attention also allows decreasing the size of the attention's context buffer, leading to meaningful reductions in the memory and compute requirements during inference. For example, transformers trained on C4 with context sizes of 512, 1,024, and 2,048 need 16X, 25X, and 47X less memory for their attention module, respectively, when equipped with selective attention, as those without selective attention, with the same validation perplexity.
format Preprint
id arxiv_https___arxiv_org_abs_2410_02703
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Selective Attention Improves Transformer
Leviathan, Yaniv
Kalman, Matan
Matias, Yossi
Computation and Language
Artificial Intelligence
Machine Learning
Unneeded elements in the attention's context degrade performance. We introduce Selective Attention, a simple parameter-free change to the standard attention mechanism which reduces attention to unneeded elements. Selective attention consistently improves language modeling and downstream task performance in a variety of model sizes and context lengths. For example, transformers trained with the language modeling objective on C4 with selective attention perform language modeling equivalently to standard transformers with ~2X more heads and parameters in their attention modules. Selective attention also allows decreasing the size of the attention's context buffer, leading to meaningful reductions in the memory and compute requirements during inference. For example, transformers trained on C4 with context sizes of 512, 1,024, and 2,048 need 16X, 25X, and 47X less memory for their attention module, respectively, when equipped with selective attention, as those without selective attention, with the same validation perplexity.
title Selective Attention Improves Transformer
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2410.02703