揭示与控制Transformer中的异常注意力分布
Unveiling and Controlling Anomalous Attention Distribution in Transformers
AI总结:
本文从弃权现象角度揭示Transformer中首个元素注意力异常集中的原因,并归纳出基于位置编码和基于元素内特征分布的两种弃权元素选择机制,为KV缓存压缩和无限外推等技术提供理论支撑。
摘要:
随着基于Transformer架构的大模型的出现,研究人员在注意力机制中观察到一种异常现象——对第一个元素存在非常高的注意力,这种现象在基于Transformer的模型中普遍存在。理解这一现象对于发展关注注意力分布的技术至关重要,例如键值(KV)缓存压缩和无限外推;然而,其潜在原因仍然未知。在本文中,我们从弃权现象的角度分析这一现象,弃权现象涉及降低序列中某些元素的内部值,使其能够吸收多余的注意力而不影响其对信息的贡献。在具体模型中,由于位置编码和注意力模式的差异,我们发现模型对弃权元素的选择可以分为两种方法:基于位置编码的方法和基于元素内特征分布的方法。
英文摘要:
With the advent of large models based on the Transformer architecture, researchers have observed an anomalous phenomenon in the Attention mechanism--there is a very high attention on the first element, which is prevalent across Transformer-based models. It is crucial to understand it for the development of techniques focusing on attention distribution, such as Key-Value (KV) Cache compression and infinite extrapolation; however, the latent cause leaves to be unknown. In this paper, we analyze such a phenomenon from the perspective of waiver phenomenon, which involves reducing the internal values of certain elements in the sequence, allowing them to absorb excess attention without affecting their contribution to information. In specific models, due to differences in positional encoding and attention patterns, we have found that the selection of waiver elements by the model can be categorized into two methods: positional-encoding-based and feature-distribution-within-elements-based.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。