首次实现线性注意力在双向序列建模中的高效扩展,兼顾速度与性能。
Linear Attention for Efficient Bidirectional Sequence Modeling
- 提出LION框架,统一拓展线性注意力到双向建模
- 在标准任务上媲美甚至超越softmax Transformer,训练更快、推理更高效
- 适用于追求高速双向建模的场景,如语音、文本理解
线性Transformer和状态空间模型已成为因果序列建模的有效替代方案,通过矩阵乘法实现并行训练和类似RNN的高效推理。然而,现有方法尚未统一支持双向序列建模。本文提出LION,首个系统性将线性Transformer拓展至双向设置的框架。LION推广了三种因果场景中的核心表示形式——全量线性注意力、双向RNN与分块并行形式,并证明其在双向设置下理论等价,使模型可在训练与推理中灵活利用各形式优势。我们证明一大类线性Transformer可通过LION扩展,并通过三个实例验证:基于衰减类型选择的LION-LIT(arXiv:2006.16236)、LION-D(arXiv:2307.08621)及使用选择性衰减的LION-S(arXiv:2103.02143, arXiv:2312.0075)。在标准双向任务中,LION模型性能达到或超过softmax Transformer,同时训练速度显著提升,推理效率优于现有状态空间模型。
原文摘要 · Abstract (English)
Linear Transformers and State Space Models have emerged as efficient alternatives to softmax Transformers for causal sequence modeling, enabling parallel training via matrix multiplication and efficient RNN-style inference. However, despite their success in causal tasks, no unified framework exists for applying Linear Transformers to bidirectional sequence modeling. We introduce LION, the first framework to systematically extend Linear Transformers to the bidirectional setting. LION generalizes three core representations commonly used in the causal case - full Linear Attention , bidirectional RNN, and chunkwise parallel form - to the bidirectional setting. These forms are theoretically equivalent and enable models to exploit the strengths of each during training and inference. We prove that a broad class of Linear Transformers can be extended using LION and validate our framework via three core examples based on the choice of decay type: LION-LIT, the bidirectional extension of arXiv:2006.16236; LION-D, based on arXiv:2307.08621; and LION-S, a variant using selective decay arXiv:2103.02143, arXiv:2312.0075. Across standard bidirectional tasks, LION enables models to match or exceed the performance of softmax Transformers, while offering significantly faster training and more efficient inference than existing State Space Models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。