GateLoop: Fully Data-Controlled Linear Recurrence for Sequence Modeling

Tobias Katsch
11/3/2023
cs.LGcs.AIcs.CL

Official code: tobiaskatsch/GatedLinearRNN (30 stars, Apache-2.0, last commit 2024-02-27).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
301Python, Jupyter NotebookFeb 9, 20242 years agoApache-2.0
deep-learninggateloop

Similar Papers

Cite this paper

@article{katsch2023gateloop,
  title  = {GateLoop: Fully Data-Controlled Linear Recurrence for Sequence Modeling},
  author = {Tobias Katsch},
  year   = {2023},
  eprint = {2311.01927},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.01927v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.01927.svg)](https://codeofpaper.com/paper/2311.01927)

Discussion