注意力需要聚焦:注意力分配的统一视角
Attention Needs to Focus: A Unified Perspective on Attention Allocation
AI总结:
本文提出Lazy Attention机制,通过位置歧视和Elastic-Softmax解决注意力过载和不足问题,提升注意力分配效率。
摘要:
Transformer架构作为现代大型语言模型(LLMs)的基石,在序列建模中取得了非凡的成功,主要归功于其注意力机制。然而,尽管其强大,标准的注意力机制却存在已知的问题:表征崩溃和注意力黑洞。尽管先前的工作提出了应对这些问题的方法,但这些方法往往被孤立研究,掩盖了它们更深层次的联系。在本文中,我们提出了一种统一的视角,认为这两个问题都可以追溯到一个共同的根源——不恰当的注意力分配。我们识别出两种失败模式:1)注意力过载,其中令牌接收相同比例的高权重,导致语义特征模糊,从而导致表征崩溃;2)注意力不足,其中没有令牌具有语义相关性,但注意力仍被迫分配,导致虚假聚焦,如注意力黑洞。基于这一见解,我们引入了Lazy Attention,一种新的机制,旨在实现更集中的注意力分配。为了缓解过载,它在头和维度上使用位置歧视来锐化令牌区分。为了对抗不足,它结合了Elastic-Softmax,一种修改后的归一化函数,放松了标准softmax约束以抑制对无关令牌的注意力。在FineWeb-Edu语料库上进行的实验,评估了九种不同的基准测试,证明Lazy Attention成功缓解了注意力黑洞,并在与标准注意力和现代架构相比时取得了具有竞争力的性能,同时达到高达59.58%的注意力稀疏性。
英文摘要:
The Transformer architecture, a cornerstone of modern Large Language Models (LLMs), has achieved extraordinary success in sequence modeling, primarily due to its attention mechanism. However, despite its power, the standard attention mechanism is plagued by well-documented issues: representational collapse and attention sink. Although prior work has proposed approaches for these issues, they are often studied in isolation, obscuring their deeper connection. In this paper, we present a unified perspective, arguing that both can be traced to a common root -- improper attention allocation. We identify two failure modes: 1) Attention Overload, where tokens receive comparable high weights, blurring semantic features that lead to representational collapse; 2) Attention Underload, where no token is semantically relevant, yet attention is still forced to distribute, resulting in spurious focus such as attention sink. Building on this insight, we introduce Lazy Attention, a novel mechanism designed for a more focused attention distribution. To mitigate overload, it employs positional discrimination across both heads and dimensions to sharpen token distinctions. To counteract underload, it incorporates Elastic-Softmax, a modified normalization function that relaxes the standard softmax constraint to suppress attention on irrelevant tokens. Experiments on the FineWeb-Edu corpus, evaluated across nine diverse benchmarks, demonstrate that Lazy Attention successfully mitigates attention sink and achieves competitive performance compared to both standard attention and modern architectures, while reaching up to 59.58% attention sparsity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。