arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2311.00684cs.CLcs.LG
收藏

注意力对齐与灵活位置嵌入提升Transformer长度外推能力

Attention Alignment and Flexible Positional Embeddings Improve Transformer Length Extrapolation

Carnegie Mellon University(卡内基梅隆大学)

Ta-Chung Chi, Ting-Han Fan, Alexander I. Rudnicky

AI总结:

本文提出通过温度缩放的注意力对齐策略,缓解T5模型因位置嵌入灵活性导致的注意力分散问题,从而无需微调即可提升其在长上下文任务中的外推能力。

摘要:

理想的可长度外推Transformer语言模型无需微调即可处理超过训练长度的序列。这种长上下文利用能力在很大程度上依赖于灵活的位置嵌入设计。在调查现有大型预训练Transformer语言模型的灵活性时,我们发现T5系列值得进一步关注,因为其位置嵌入捕获了丰富且灵活的注意力模式。然而,T5存在注意力分散问题:输入序列越长,注意力分布越平坦。为缓解该问题,我们通过温度缩放提出了两种注意力对齐策略。我们的研究结果表明,在语言建模、检索、多文档问答和代码补全任务上,无需任何微调,T5的长上下文利用能力得到提升。这表明灵活的位置嵌入设计和注意力对齐可以大大促进Transformer的长度外推。

英文摘要:

An ideal length-extrapolatable Transformer language model can handle sequences longer than the training length without any fine-tuning. Such long-context utilization capability relies heavily on a flexible positional embedding design. Upon investigating the flexibility of existing large pre-trained Transformer language models, we find that the T5 family deserves a closer look, as its positional embeddings capture rich and flexible attention patterns. However, T5 suffers from the dispersed attention issue: the longer the input sequence, the flatter the attention distribution. To alleviate the issue, we propose two attention alignment strategies via temperature scaling. Our findings show improvement on the long-context utilization capability of T5 on language modeling, retrieval, multi-document question answering, and code completion tasks without any fine-tuning. This suggests that a flexible positional embedding design and attention alignment can go a long way toward Transformer length extrapolation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑