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

用于高效线性时间序列建模的门控槽注意力

Gated Slot Attention for Efficient Linear-Time Sequence Modeling

School of Computer Science and Technology, Soochow University(苏州大学计算机科学与技术学院);Massachusetts Institute of Technology(麻省理工学院);University of California Santa Cruz(加州大学圣克鲁兹分校);Tencent AI Lab(腾讯AI实验室);LuxiTech;University of Waterloo(滑铁卢大学)

Yu Zhang, Songlin Yang, Ruijie Zhu, Yue Zhang, Leyang Cui, Yiqiao Wang, Bolun Wang, Freda Shi, Bailin Wang, Wei Bi, Peng Zhou, Guohong Fu

AI总结:

针对线性注意力Transformer在强召回任务表现不足、训练成本高的问题,提出结合门控机制与softmax的GSA方法,提升内存容量与效率,在上下文召回和T2R场景中性能更优。

摘要:

线性注意力Transformer及其门控变体因支持并行训练和高效循环推理而备受关注,但在需要强召回能力的任务中仍不及传统Transformer,且从零开始训练需要大量资源。本文提出门控槽注意力(Gated Slot Attention, GSA),它受门控线性注意力(Gated Linear Attention, GLA)启发引入门控机制,对有界内存控制注意力(Attention with Bounded-memory-Control, ABC)进行增强。本质上,GSA由两层通过$\boldsymbol{\text{softmax}}$连接的GLA组成,利用上下文感知内存读取和自适应遗忘提升内存容量,同时保持紧凑的循环状态规模。该设计借助GLA的硬件高效训练算法和更小的状态规模,大幅提升了训练和推理效率。此外,保留$\boldsymbol{\text{softmax}}$操作在“将预训练Transformer微调为循环神经网络(RNN)”(T2R)场景中尤为有益,可减少从零开始大规模训练的需求。大量实验证实,GSA在需要上下文召回的场景和T2R设置中均表现出更优性能。

英文摘要:

Linear attention Transformers and their gated variants, celebrated for enabling parallel training and efficient recurrent inference, still fall short in recall-intensive tasks compared to traditional Transformers and demand significant resources for training from scratch. This paper introduces Gated Slot Attention (GSA), which enhances Attention with Bounded-memory-Control (ABC) by incorporating a gating mechanism inspired by Gated Linear Attention (GLA). Essentially, GSA comprises a two-layer GLA linked via $\operatorname{softmax}$, utilizing context-aware memory reading and adaptive forgetting to improve memory capacity while maintaining compact recurrent state size. This design greatly enhances both training and inference efficiency through GLA's hardware-efficient training algorithm and reduced state size. Additionally, retaining the $\operatorname{softmax}$ operation is particularly beneficial in "finetuning pretrained Transformers to RNNs" (T2R) settings, reducing the need for extensive training from scratch. Extensive experiments confirm GSA's superior performance in scenarios requiring in-context recall and in T2R settings.

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

↑