arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.27153cs.LG
收藏

预条件注意力:提升Transformer的效率

Preconditioned Attention: Enhancing Efficiency in Transformers

Australian Institute for Machine Learning (AIML), Adelaide University(阿德莱德大学澳大利亚机器学习研究所(AIML))

Hemanth Saratchandran

AI总结:

本文提出预条件注意力机制,通过引入条件矩阵降低注意力矩阵的条件数,提升训练效率,适用于多种Transformer应用。

摘要:

Transformer的成功依赖于注意力模块,但标准注意力机制常产生病态矩阵。本文引入预条件注意力,通过在每个注意力头中加入条件矩阵,显著降低条件数,改善优化效果。该方法可作为多种注意力机制的简单替代方案,并在图像分类、目标检测、长序列建模等任务中验证了有效性。

英文摘要:

Central to the success of Transformers is the attention block, which effectively models global dependencies among input tokens associated to a dataset. However, we theoretically demonstrate that standard attention mechanisms in transformers often produce ill-conditioned matrices with large condition numbers. This ill-conditioning is a well-known obstacle for gradient-based optimizers, leading to inefficient training. To address this issue, we introduce preconditioned attention, a novel approach that incorporates a conditioning matrix into each attention head. Our theoretical analysis shows that this method significantly reduces the condition number of attention matrices, resulting in better-conditioned matrices that improve optimization. Conditioned attention serves as a simple drop-in replacement for a wide variety of attention mechanisms in the literature. We validate the effectiveness of preconditioned attention across a diverse set of transformer applications, including image classification, object detection, instance segmentation, long sequence modeling and language modeling.

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

↑