Linear Recurrence has proven to be a powerful tool for modeling long sequences efficiently. In this work, we show that existing models fail to take full advantage of its potential. Motivated by this finding, we develop GateLoop, a foundational sequence model that generalizes linear recurrent models such as S4, S5, LRU and RetNet, by employing data-controlled state transitions. Utilizing this theoretical advance, GateLoop empirically outperforms existing models for auto-regressive language modeling. Our method comes with a low-cost $O(l)$ recurrent mode and an efficient $O(l \log_{2} l)$ parallel mode making use of highly optimized associative scan implementations. Furthermore, we derive an $O(l^2)$ surrogate attention mode, revealing remarkable implications for Transformer and recently proposed architectures. Specifically, we prove that our approach can be interpreted as providing data-controlled relative-positional information to Attention. While many existing models solely rely on data-controlled cumulative sums for context aggregation, our findings suggest that incorporating data-controlled complex cumulative products may be a crucial step towards more powerful sequence models.
翻译:摘要:线性递归已被证明是高效建模长序列的有力工具。本研究表明,现有模型未能充分利用其潜力。基于此发现,我们提出GateLoop——一种通过数据控制状态转移来泛化S4、S5、LRU和RetNet等线性递归模型的基础序列建模方法。借助这一理论突破,GateLoop在自回归语言建模任务中经验性优于现有模型。该方法包含低成本$O(l)$递归模式与高效$O(l \log_{2} l)$并行模式(利用高度优化的关联扫描实现)。此外,我们推导出$O(l^2)$的替代注意力模式,揭示了其对Transformer及近期提出架构的重要启示。具体而言,我们证明该方法可被解释为向注意力机制提供数据控制的相对位置信息。尽管现有模型多依赖数据控制累积和进行上下文聚合,但本研究结果表明,引入数据控制的复数累积乘积可能是迈向更强序列模型的关键一步。