提出线性时间循环Transformer,让模型更快更高效。
LT2: Linear-Time Looped Transformers

- 用线性注意力替代传统注意力,降低计算复杂度
- 循环机制提升记忆精度与感知范围,性能更优
- 可转换预训练模型,小规模也能媲美大模型
循环Transformer(LT)通过多轮层迭代提升性能,但全注意力机制仍具二次复杂度,导致计算成本高。本文提出LT2,采用线性时间注意力替代二次注意力,包含线性注意力(LT2-linear)与稀疏注意力(LT2-sparse)两种变体。循环机制与二者协同:线性注意力实现迭代记忆优化,稀疏注意力逐步扩展有效感受野。理论分析与实验验证显示,在可控回忆、状态跟踪和语言建模任务中均表现一致提升。进一步提出混合变体LT2-hybrid:LT2-hybrid (GDN+DSA) 交替使用线性与稀疏注意力,实现完全线性时间,性能媲美标准循环Transformer;LT2-hybrid (Full+GDN) 混合少量全注意力与线性注意力,性能超越标准循环模型且更高效。还展示如何将预训练的循环Transformer转为LT2-hybrid模型。仅用约10亿token训练,其转换模型Ouro-hybrid-1.4B在速度优势下,表现优于业界10亿参数模型,接近40亿参数模型水平。结果表明,该路径可显著提升循环Transformer的可扩展性,推动高效小型语言模型发展。
原文摘要 · Abstract (English)
Looped Transformers (LT) have emerged as a powerful architecture by iterating their layers multiple times before decoding the final token. However, pairing them with full attention retains quadratic complexity, making them computationally expensive and slow. We introduce LT2 (Linear-Time Looped Transformers), a family of looped architectures that replace quadratic softmax attention with subquadratic, linear-time attention. We study two variants: LT2-linear with linear attention and LT2-sparse with sparse attention. We find that looping uniquely synergizes with these variants: it enables iterative memory refinement in linear attention and progressively expands the effective receptive field in sparse attention. We formalize these benefits theoretically and demonstrate consistent empirical gains across controlled recall, state-tracking, and language modeling tasks. We then explore LT2-hybrid, which combines different attention variants in a looped setting. Two variants are especially promising: LT2-hybrid (GDN+DSA), which interleaves linear and sparse attention to maximize efficiency and matches the standard looped transformer's quality at fully linear-time cost; and LT2-hybrid (Full+GDN), which interleaves GDN with a small fraction of full attention layers to maximize quality, surpassing the standard looped transformer in both performance and efficiency. We also show how to convert a pre-trained LT into an LT2-hybrid model. With about 1B tokens of training, our converted model, Ouro-hybrid-1.4B, outperforms industry-level 1B models and is competitive with industry-level 4B models while retaining the speed benefits of linear-time attention. Together, these results show a clear path toward making looped transformers more scalable and advancing efficient, capable small language models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。