arXiv:2509.00935cs.LGcs.AI2025-09

通过分段压缩实现亚二次注意力,显著提升长序列建模效率。

SCOUT: Toward Sub-Quadratic Attention via Segment Compression for Optimized Utility in Transformers

  • 将序列分段压缩,仅对关键摘要点进行注意力计算
  • 在400M和1.3B模型上达到全注意力性能,内存增长亚二次
  • 适合需要高效长序列处理的场景,如超长文本建模

Transformer在多种序列建模任务中表现优异,但其二次注意力复杂度限制了长序列的可扩展性。线性模型如Mamba和滑动窗口注意力(SWA)通过循环或局部操作混合令牌,以固定大小的内存实现高效推理。然而,这些方法因无法保留远距离令牌的细节信息,可能降低长序列性能。本文提出SCOUT(Segment Compression for Optimized Utility in Transformers),一种混合架构:先在固定大小的段内局部压缩令牌,再仅对压缩后的表示施加注意力。每个令牌嵌入通过线性本地混合器(Mamba或SWA)丰富近期上下文;随后,每个令牌稀疏地关注少量总结历史的压缩检查点令牌。该设计在保持全注意力表达能力的同时大幅降低计算与内存开销。通过关注压缩历史而非所有先前令牌,SCOUT内存增长略高于纯线性模型,但仍为亚二次,远优于全量Transformer。我们在长上下文语言建模与推理任务上评估了SCOUT,结果表明,使用Mamba和SWA混合器的SCOUT在相同计算预算下优于强基线,在400M和1.3B规模上匹配全注意力Transformer在语言建模与常识推理任务上的表现。此外,其端到端吞吐量高于当前最优模型,同时在长序列基准测试中表现相当。

原文摘要 · Abstract (English)

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.

注意力机制长序列建模Transformer优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。