SCOUT:面向Transformer中优化效用的基于段压缩的次二次注意力研究
SCOUT: Toward Sub-Quadratic Attention via Segment Compression for Optimized Utility in Transformers
AI总结:
针对Transformer注意力二次复杂度限制长序列扩展的问题,提出混合架构SCOUT,通过段内局部压缩token并仅对压缩表示做稀疏注意力,在长序列任务上兼具性能与效率优势。
摘要:
Transformer已在广泛的序列建模任务中展现出强劲性能,但其二次方的注意力复杂度限制了对长序列的可扩展性。Mamba和滑动窗口注意力(SWA)等线性模型通过固定大小内存的循环或局部操作混合token,实现了高效推理。然而,这些方法因无法保留远距离token的详细信息,存在长序列性能下降的风险。我们提出SCOUT(Segment Compression for Optimized Utility in Transformers,即Transformer中优化效用的段压缩方法),这是一种混合架构,在固定大小的段内局部压缩token,并仅对这些压缩表示应用注意力。每个token嵌入首先通过线性局部混合器(Mamba或SWA)进行丰富,该混合器整合近期上下文。随后,每个token并非关注所有先前的token,而是稀疏地关注少量总结了输入历史的压缩检查点token。这种设计保留了全注意力的大部分表达能力,同时大幅降低了计算和内存成本。通过关注压缩历史而非所有先前token,SCOUT的内存占用略高于纯线性模型,但其增长率仍为次二次级,且比全Transformer的可扩展性强得多。我们分析了SCOUT的计算和内存效率,并在长上下文语言建模和推理任务上进行了实证评估。在相同计算预算下,同时配备Mamba和SWA混合器的SCOUT优于强大的长序列基线,在400M和1.3B规模的语言建模和常识推理任务上与全注意力Transformer表现相当。此外,我们的SCOUT实现了比SOTA模型更高的端到端吞吐量,同时在长序列基准测试上取得了可比的结果。
英文摘要:
Transformers have demonstrated strong performance across a wide range of sequence modeling tasks, but their quadratic attention complexity limits scalability to long sequences. Linear models such as Mamba and sliding-window attention (SWA) address this by mixing tokens through recurrent or localized operations with fixed-size memory, achieving efficient inference. However, these methods risk degrading performance on long sequences due to their inability to retain detailed information from distant tokens. We propose SCOUT (Segment Compression for Optimized Utility in Transformers), a hybrid architecture that compresses tokens locally within fixed-size segments and applies attention only over these compressed representations. Each token embedding is first enriched via a linear local mixer, Mamba or SWA, that integrates recent context. Then, instead of attending to all previous tokens, each token sparsely attends to a small number of compressed checkpoint tokens that summarize the input history. This design retains much of the expressivity of full attention while substantially reducing the computational and memory cost. By attending to compressed history rather than all previous tokens, SCOUT incurs slightly higher memory than purely linear models, but its growth rate remains sub-quadratic and far more scalable than that of full Transformers. We analyze SCOUT's computational and memory efficiency and evaluate it empirically on long-context language modeling and reasoning tasks. SCOUT with both Mamba and SWA mixers outperforms strong long-sequence baselines under the same computational budget, matches full-attention Transformers on language modeling and common-sense reasoning tasks at 400M and 1.3B scales. Moreover, our SCOUT achieves higher end-to-end throughput than SOTA models, while delivering comparable results on long sequence benchmarks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。