La atención selectiva mejora el Transformer.
Selective Attention Improves Transformer
October 3, 2024
Autores: Yaniv Leviathan, Matan Kalman, Yossi Matias
cs.AI
Resumen
Los elementos innecesarios en el contexto de la atención degradan el rendimiento. Presentamos Atención Selectiva, un cambio simple y sin parámetros al mecanismo estándar de atención que reduce la atención a elementos innecesarios. La Atención Selectiva mejora el rendimiento del modelado del lenguaje en una variedad de tamaños de modelo y longitudes de contexto. Por ejemplo, una serie de transformadores entrenados con el objetivo de modelado del lenguaje en C4 con atención selectiva tienen un rendimiento equivalente a transformadores estándar con ~2 veces más cabezas y parámetros en sus módulos de atención. La Atención Selectiva también permite reducir el tamaño del búfer de contexto de la atención, lo que conlleva reducciones significativas en los requisitos de memoria y cálculo durante la inferencia. Por ejemplo, los transformadores con 100 millones de parámetros entrenados en C4 con tamaños de contexto de 512, 1,024 y 2,048 necesitan 16 veces, 25 veces y 47 veces menos memoria para sus módulos de atención, respectivamente, cuando están equipados con atención selectiva, en comparación con aquellos sin atención selectiva, con la misma perplejidad de validación.
English
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 improves language modeling performance in a variety of model sizes
and context lengths. For example, a range of transformers trained with the
language modeling objective on C4 with selective attention perform 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 with 100M parameters
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.Summary
AI-Generated Summary