arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.10906cs.LGcs.CL
收藏

打破注意力瓶颈

Breaking the Attention Bottleneck

uni-trier(特里尔大学)

Kalle Hilsenbek

AI总结:

针对transformer注意力的二次复杂度、单向性及静态收敛问题,提出可替代注意力或激活的自回归生成函数,并在nanoGPT中以更小模型取得更低损失。

摘要:

基于注意力的transformer已成为许多深度学习领域的标准架构,主要是因为它们能够建模长程依赖并处理可变长度的输入序列。然而,具有二次复杂度的注意力机制是transformer架构中的一个显著瓶颈。该算法在解码器中仅为单向,并且在过参数化的仅解码器模型中会收敛为静态模式。我通过开发一种生成函数作为注意力或激活的替代方案来解决这一问题。该函数通过将每个token与前一个token进行比较,仍保持自回归特性。在我使用nanoGPT的测试设置中,这在模型更小的情况下产生了更低的损失。通过引入平均上下文向量,损失进一步下降。这种注意力替代概念依据GNU AGPL v3许可证发布,地址为https://gitlab.com/Bachstelze/causal_generation。

英文摘要:

Attention-based transformers have become the standard architecture in many deep learning fields, primarily due to their ability to model long-range dependencies and handle variable-length input sequences. However, the attention mechanism with its quadratic complexity is a significant bottleneck in the transformer architecture. This algorithm is only uni-directional in the decoder and converges to a static pattern in over-parametrized decoder-only models. I address this issue by developing a generative function as attention or activation replacement. It still has the auto-regressive character by comparing each token with the previous one. In my test setting with nanoGPT this yields a smaller loss while having a smaller model. The loss further drops by incorporating an average context vector. This concept of attention replacement is distributed under the GNU AGPL v3 license at https://gitlab.com/Bachstelze/causal_generation.

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

↑