You Only Scan Once:基于LightNet的高效多维序列建模
You Only Scan Once: Efficient Multi-dimension Sequential Modeling with LightNet
AI总结:
本文提出基于加法线性递归的高效多维序列建模框架LightNet,通过单次扫描处理多维数据并引入MD-TPE和MD-LRPE位置编码方法,在多项视觉与语言任务中验证了其有效性与高效性。
摘要:
线性注意力机制因其线性计算复杂度和更快的速度,在因果语言模型中备受关注。然而,线性注意力中固有的衰减机制在应用于图像处理和多模态学习等多维序列建模任务时带来了挑战。在这些场景中,利用序列扫描来建立全局感受野需要对多维数据进行多次扫描,从而导致效率低下。本文指出了由乘法线性递归引起的低效问题,并提出了一种高效的替代方案——加法线性递归来避免该问题,因为它可以在单次扫描中处理多维数据。我们进一步基于新递归开发了一个高效的多维序列建模框架,称为LightNet。此外,我们提出了两种新的多维线性相对位置编码方法,MD-TPE和MD-LRPE,以增强模型在多维场景中识别位置信息的能力。我们在图像分类、图像生成、双向语言建模和自回归语言建模等多种任务上的实证评估证明了LightNet的有效性,展示了其作为多维序列建模通用且高效解决方案的潜力。
英文摘要:
Linear attention mechanisms have gained prominence in causal language models due to their linear computational complexity and enhanced speed. However, the inherent decay mechanism in linear attention presents challenges when applied to multi-dimensional sequence modeling tasks, such as image processing and multi-modal learning. In these scenarios, the utilization of sequential scanning to establish a global receptive field necessitates multiple scans for multi-dimensional data, thereby leading to inefficiencies. This paper identifies the inefficiency caused by a multiplicative linear recurrence and proposes an efficient alternative additive linear recurrence to avoid the issue, as it can handle multi-dimensional data within a single scan. We further develop an efficient multi-dimensional sequential modeling framework called LightNet based on the new recurrence. Moreover, we present two new multi-dimensional linear relative positional encoding methods, MD-TPE and MD-LRPE to enhance the model's ability to discern positional information in multi-dimensional scenarios. Our empirical evaluations across various tasks, including image classification, image generation, bidirectional language modeling, and autoregressive language modeling, demonstrate the efficacy of LightNet, showcasing its potential as a versatile and efficient solution for multi-dimensional sequential modeling.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。