TRA:通过阈值相对注意力实现更好的长度泛化
TRA: Better Length Generalisation with Threshold Relative Attention
AI总结:
针对Transformer长度泛化能力差的问题,提出阈值相对注意力(TRA),通过选择性稀疏移除无关键、上下文感知相对距离仅计算相关键距离的方式重构注意力,显著提升了仅解码器Transformer的泛化能力。
摘要:
Transformer模型在长度泛化方面存在困难,即便在基础任务上也表现不佳。我们测试了这些局限性是否可通过自注意力机制的两个关键失效来解释。第一个失效是无法完全移除无关信息。第二个失效与位置相关:即使键(key)和查询(query)之间的点积为高度负值(即该键为无关键),已学习的位置偏差仍可能意外地提升这类信息的权重——当距离超出分布范围时,这一问题会带来风险。这两个失效情况叠加在一起,会导致泛化难度不断加剧。我们测试了通过以下两种方法的结合是否能缓解这些问题:a)选择性稀疏性——将无关键完全从注意力softmax中移除;b)上下文感知相对距离——仅考虑查询与相关键之间的距离。我们展示了,结合这两种缓解措施重构注意力机制,能够显著提升仅解码器Transformer的泛化能力。
英文摘要:
Transformers struggle with length generalisation, displaying poor performance even on basic tasks. We test whether these limitations can be explained through two key failures of the self-attention mechanism. The first is the inability to fully remove irrelevant information. The second is tied to position, even if the dot product between a key and query is highly negative (i.e. an irrelevant key) learned positional biases may unintentionally up-weight such information - dangerous when distances become out of distribution. Put together, these two failure cases lead to compounding generalisation difficulties. We test whether they can be mitigated through the combination of a) selective sparsity - completely removing irrelevant keys from the attention softmax and b) contextualised relative distance - distance is only considered as between the query and the keys that matter. We show how refactoring the attention mechanism with these two mitigations in place can substantially improve the generalisation capabilities of decoder only transformers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。