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

键-值Transformer

Key-Value Transformer

Quintic AI

Ali Borji

AI总结:

本文评估了去除查询组件的键-值Transformer(KV)及其非对称变体,在合成、视觉和NLP任务上发现其参数和计算量更少且有时优于QKV,为高效Transformer设计提供启示。

摘要:

Transformer已成为各种人工智能任务(包括计算机视觉和自然语言处理)的主流标准解决方案。广泛采用的查询、键和值公式(QKV)在其中发挥了重要作用。然而,尚无研究考察这三个组成部分对Transformer性能的必要性。因此,我们对键-值公式(KV)进行了评估,该公式生成对称注意力图,同时还评估了一种将二维位置编码纳入注意力矩阵的非对称版本。值得注意的是,这种Transformer所需的参数和计算量比原始Transformer更少。通过涵盖三种任务类型的实验——合成任务(如反转或排序列表)、视觉任务(MNIST或CIFAR分类)以及自然语言处理任务(字符生成和翻译)——我们发现KV Transformer偶尔会优于QKV Transformer。然而,它也存在表现不如QKV的情况,这使得难以得出明确的结论。尽管如此,我们认为所报告的结果令人鼓舞,并预计它们可能为未来更高效的Transformer铺平道路。

英文摘要:

Transformers have emerged as the prevailing standard solution for various AI tasks, including computer vision and natural language processing. The widely adopted Query, Key, and Value formulation (QKV) has played a significant role in this. Nevertheless, no research has examined the essentiality of these three components for transformer performance. Therefore, we conducted an evaluation of the key-value formulation (KV), which generates symmetric attention maps, along with an asymmetric version that incorporates a 2D positional encoding into the attention matrix. Remarkably, this transformer requires fewer parameters and computation than the original one. Through experiments encompassing three task types -- synthetics (such as reversing or sorting a list), vision (mnist or cifar classification), and NLP (character generation and translation) -- we discovered that the KV transformer occasionally outperforms the QKV transformer. However, it also exhibits instances of underperformance compared to QKV, making it challenging to draw a definitive conclusion. Nonetheless, we consider the reported results to be encouraging and anticipate that they may pave the way for more efficient transformers in the future.

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

↑