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

SAMSA:适用于多数据模态的高效Transformer

SAMSA: Efficient Transformer for Many Data Modalities

FPT Software AI Center(FPT软件AI中心);University of Alabama at Birmingham(阿拉巴马大学伯明翰分校)

Minh Lenhat, Viet Anh Nguyen, Khoa Nguyen, Duong Duc Hieu, Dao Huu Hung, Truong Son Hy

AI总结:

针对现有高效Transformer依赖特定数据模态构造、通用性不足的问题,该研究提出基于可微分无放回采样的线性复杂度自注意力机制SAMSA,在多模态基准上实现了兼具高性能与快推理的效果。

摘要:

自注意力机制的通用性让Transformer在几乎所有数据模态中都取得了巨大成功,但存在二次复杂度和训练难度大的局限。另一方面,高效Transformer往往依赖巧妙的、依赖数据模态的构造来克服Transformer的二次复杂度,这极大阻碍了它们在不同数据模态上的应用——而跨模态适用性正是当代基础建模的核心支柱之一。\n本文提出了SAMSA(采样自注意力),为高效基础建模奠定了基础。SAMSA是一种具备上下文感知能力的线性复杂度自注意力机制,可在多种数据模态上良好运行。该机制基于我们发现的一种可微分无放回采样方法,使自注意力模块能够关注最重要的token集合,其中token的重要性由数据本身定义。此外,由于推理阶段无需可微性,我们方法的稀疏公式几乎不会带来时间开销,进一步降低了计算成本。\n简言之,与其他高度专用的模型相比,SAMSA在众多基准测试上取得了具有竞争力甚至SOTA(当前最优)的结果,同时推理速度更快。与全自注意力相比,SAMSA的实际推理时间显著降低,性能表现从可忽略的退化到更优不等。我们已在代码仓库https://github.com/HySonLab/SAMSA发布源代码。

英文摘要:

The versatility of self-attention mechanism earned transformers great success in almost all data modalities, with limitations on the quadratic complexity and difficulty of training. Efficient transformers, on the other hand, often rely on clever data-modality-dependent construction to get over the quadratic complexity of transformers. This greatly hinders their applications on different data modalities, which is one of the pillars of contemporary foundational modeling. In this paper, we lay the groundwork for efficient foundational modeling by proposing SAMSA - SAMpling-Self-Attention, a context-aware linear complexity self-attention mechanism that works well on multiple data modalities. Our mechanism is based on a differentiable sampling without replacement method we discovered. This enables the self-attention module to attend to the most important token set, where the importance is defined by data. Moreover, as differentiability is not needed in inference, the sparse formulation of our method costs little time overhead, further lowering computational costs. In short, SAMSA achieved competitive or even SOTA results on many benchmarks, while being faster in inference, compared to other very specialized models. Against full self-attention, real inference time significantly decreases while performance ranges from negligible degradation to outperformance. We release our source code in the repository: https://github.com/HySonLab/SAMSA

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

↑