Attention as an RNN
Not on the map. Why?
Abstract (arXiv)
The advent of Transformers marked a significant breakthrough in sequence modelling, providing a highly performant architecture capable of leveraging GPU parallelism. However, Transformers are computationally expensive at inference time, limiting their applications, particularly in low-resource settings (e.g., mobile and embedded devices). Addressing this, we (1) begin by showing that attention can be viewed as a special Recurrent Neural Network (RNN) with the ability to compute its textitmany-to-one RNN output efficiently. We then (2) show that popular attention-based models such as Transformers can be viewed as RNN variants. However, unlike traditional RNNs (e.g., LSTMs), these models cannot be updated efficiently with new tokens, an important property in sequence modelling. Tackling this, we (3) introduce a new efficient method of computing attention's textitmany-to-many RNN output based on the parallel prefix scan algorithm. Building on the new attention formulation, we (4) introduce Aaren, an attention-based module that can not only (i) be trained in parallel (like Transformers) but also (ii) be updated efficiently with new tokens, requiring only constant memory for inferences (like traditional RNNs). Empirically, we show Aarens achieve comparable performance to Transformers on 38 datasets spread across four popular sequential problem settings: reinforcement learning, event forecasting, time series classification, and time series forecasting tasks while being more time and memory-efficient.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 25 of its 32 references that are in the map. First posted on arXiv 22 May 2024.
Builds on
25 of 32 references.
References · 25
- 2017Attention Is All You Needcited by 60,361
- 2018Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actorcited by 4,885
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
- 2020D4RL: Datasets for Deep Data-Driven Reinforcement Learningcited by 1,427
- 2021Perceiver: General Perception with Iterative Attentioncited by 1,104
- 2022TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysiscited by 1,058
- 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 613
- 2022Efficiently Scaling Transformer Inferencecited by 539
- 2022Transformers in Time Series: A Surveycited by 497
13 more
- 2021A Survey of Transformerscited by 401
- 2022Non-stationary Transformers: Exploring the Stationarity in Time Series Forecastingcited by 391
- 2018The UEA multivariate time series classification archive, 2018cited by 338
- 2020Transformer Hawkes Processcited by 235
- 2022Online Decision Transformercited by 196
- 2021Self-attention Does Not Need O(n2) Memorycited by 154
- 2023A Comprehensive Survey on Applications of Transformers for Deep Learning Taskscited by 71
- 2024Empowering Time Series Analysis with Large Language Models: A Surveycited by 60
- 2023A Survey on Transformers in Reinforcement Learningcited by 50
- 2023Transformers in Speech Processing: A Surveycited by 39
- 2023Meta Temporal Point Processescited by 17
- 2023Transformers in Reinforcement Learning: A Surveycited by 12
- 2023Memory Efficient Neural Processes via Constant Memory Attention Blockcited by 9
Built on by
Citing papers per year: 2024: 4; 2025: 1; 2026: 1.
6 papers.
- 2025MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agentcited by 246
- 2024Were RNNs All We Needed?cited by 38
- 2024Tree Attention: Topology-aware Decoding for Long-Context Attention on GPU clusterscited by 13
- 2024Reorganizing attention-space geometry with expressive attentioncited by 1
- 2024Local Attention Mechanism: Boosting the Transformer Architecture for Long-Sequence Time Series Forecastingcited by 1
- 2026ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformerscited by 0
- 2026ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformers26 Apr 2026
- 2025MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent3 Jul 2025
- 2024Local Attention Mechanism: Boosting the Transformer Architecture for Long-Sequence Time Series Forecasting4 Oct 2024
- 2024Were RNNs All We Needed?2 Oct 2024
- 2024Tree Attention: Topology-aware Decoding for Long-Context Attention on GPU clusters7 Aug 2024
- 2024Reorganizing attention-space geometry with expressive attention26 Jul 2024
Similar, not cited
Close in wording, no citation either way
- 2023Rethinking Attention: Exploring Shallow Feed-Forward Neural Networks as an Alternative to Attention Layers in Transformers
- 2024Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulation
- 2025Log-Linear Attention
- 2025Forgetting Transformer: Softmax Attention with a Forget Gate
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer
- 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contexts
- 2021A Practical Survey on Faster and Lighter Transformers
- 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures