mlsanityData to 14 Oct 2026

Attention as an RNN

arXiv 2405.13956 ↗First posted 22 May 2024cs.LGcited by 6

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actorcited by 4,885
  3. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
  4. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  5. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
  6. 2020D4RL: Datasets for Deep Data-Driven Reinforcement Learningcited by 1,427
  7. 2021Perceiver: General Perception with Iterative Attentioncited by 1,104
  8. 2022TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysiscited by 1,058
  9. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
  10. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 613
  11. 2022Efficiently Scaling Transformer Inferencecited by 539
  12. 2022Transformers in Time Series: A Surveycited by 497
13 more
  1. 2021A Survey of Transformerscited by 401
  2. 2022Non-stationary Transformers: Exploring the Stationarity in Time Series Forecastingcited by 391
  3. 2018The UEA multivariate time series classification archive, 2018cited by 338
  4. 2020Transformer Hawkes Processcited by 235
  5. 2022Online Decision Transformercited by 196
  6. 2021Self-attention Does Not Need O(n2) Memorycited by 154
  7. 2023A Comprehensive Survey on Applications of Transformers for Deep Learning Taskscited by 71
  8. 2024Empowering Time Series Analysis with Large Language Models: A Surveycited by 60
  9. 2023A Survey on Transformers in Reinforcement Learningcited by 50
  10. 2023Transformers in Speech Processing: A Surveycited by 39
  11. 2023Meta Temporal Point Processescited by 17
  12. 2023Transformers in Reinforcement Learning: A Surveycited by 12
  13. 2023Memory Efficient Neural Processes via Constant Memory Attention Blockcited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 4; 2025: 1; 2026: 1.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023Rethinking Attention: Exploring Shallow Feed-Forward Neural Networks as an Alternative to Attention Layers in Transformers
  2. 2024Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulation
  3. 2025Log-Linear Attention
  4. 2025Forgetting Transformer: Softmax Attention with a Forget Gate
  5. 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer
  6. 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contexts
  7. 2021A Practical Survey on Faster and Lighter Transformers
  8. 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures