arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.15799cs.LGcs.CLcs.PF
收藏

FLuRKA:快速且精确的统一低秩与核注意力

FLuRKA: Fast and accurate unified Low-Rank & Kernel Attention

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Google DeepMind(谷歌DeepMind)

Ahan Gupta, Hao Guo, Yueming Yuan, Yanqi Zhou, Charith Mendis

AI总结:

提出FLuRKA,通过融合低秩与核方法构建新型transformer,在保证模型质量的同时显著提升训练速度,在多任务上实现与底层方法相当甚至更优的准确度。

摘要:

自transformer架构问世以来,许多高效的近似自注意力技术已变得普遍。其中两类流行的技术是低秩方法和核方法。这些方法各有其优势。我们观察到这些优势能协同互补,并利用它们将低秩和核方法融合,产生了一类新的transformer:FLuRKA(快速低秩与核注意力)。与组成的低秩和核方法相比,FLuRKA具有高度的训练效率,模型速度更快且模型质量相似。我们在理论和经验上评估了FLuRKA的速度和质量。我们的模型速度分析设定了多种参数配置,其中FLuRKA表现出优于低秩和核近似方法的加速;我们的模型质量分析界定了FLuRKA相对于全注意力的误差。在实验中,我们实例化了三个FLuRKA变体,与低秩和核方法相比,分别实现了高达3.3倍和1.7倍的加速。这转化为相对于带有flash-attention的模型高达20倍的加速。在涵盖语言建模、语言理解、长序列建模、机器翻译和图像分类的多种任务中,FLuRKA实现了与底层低秩和核近似方法相当的准确度,有时甚至超越两者。

英文摘要:

Many efficient $\textit{approximate}$ self-attention techniques have become prevalent since the inception of the transformer architecture. Two popular classes of these techniques are low-rank and kernel methods. Each of these methods has its strengths. We observe these strengths synergistically complement each other and exploit them to fuse low-rank and kernel methods, producing a new class of transformers: FLuRKA ($\textbf{F}$ast $\textbf{L}$ow-$\textbf{R}$ank & $\textbf{K}$ernel$ \textbf{A}$ttention). FLuRKA are highly $\textit{training-efficient}$ with faster model speeds $\textit{and}$ similar model qualities compared to constituent low-rank and kernel methods. We theoretically and empirically evaluate the speed and quality of FLuRKA. Our model speed analysis posits a variety of parameter configurations where FLuRKA exhibit speedups over low-rank and kernel approximations and our model quality analysis bounds the error of FLuRKA with respect to full-attention. Empirically, we instantiate three FLuRKA variants which experience speedups of up to 3.3x and 1.7x over low-rank and kernel methods respectively. This translates to speedups of up to 20x over models with flash-attention. Across a diverse set of tasks spanning language modeling, language understanding, long sequence modeling, machine translation, and image classification, FLuRKA achieve comparable accuracy with underlying low-rank and kernel approximations, occasionally surpassing both.

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

↑