Lune

ACL2022Top-tier venue

ABC: Attention with Bounded-memory Control

Hao Peng, Jungo Kasai, Nikolaos Pappas, Dani Yogatama, Zhaofeng Wu, Lingpeng Kong, Roy Schwartz, Noah A. Smith

Abstract

Transformer architectures have achieved stateof-the-art results on a variety of natural language processing (NLP) tasks. However, their attention mechanism comes with a quadratic complexity in sequence lengths, making the computational overhead prohibitive, especially for long sequences. Attention context can be seen as a random-access memory with each token taking a slot. Under this perspective, the memory size grows linearly with the sequence length, and so does the overhead of reading from it. One way to improve the efficiency is to bound the memory size. We show that disparate approaches can be subsumed into one abstraction, attention with bounded-memory control (ABC), and they vary in their organization of the memory. ABC reveals new, unexplored possibilities. First, it connects several efficient attention variants that would otherwise seem distinct. Second, this abstraction gives new insights-an established approach (Wang et al., 2020b) previously thought to not be applicable in causal attention, actually is. Last, we present a new instance of ABC, which draws inspiration from existing ABC approaches, but replaces their heuristic memory-organizing functions with a learned, contextualized one. Our experiments on language modeling, machine translation, and masked language model finetuning show that our approach outperforms previous efficient attention models; compared to strong transformer baselines, it significantly improves the inference time and space efficiency with no or negligible accuracy loss.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention cites Reformer: The Efficient Transformer
  • Random Feature Attention cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Random Feature Attention cites Reformer: The Efficient Transformer
  • Random Feature Attention cites Compressive Transformers for Long-Range Sequence Modelling
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Random Feature Attention
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Reformer: The Efficient Transformer
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Gated Slot Attention for Efficient Linear-Time Sequence Modeling
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites Parallelizing Linear Transformers with the Delta Rule over Sequence Length
  • Distilling to Hybrid Attention Models via KL-Guided Layer Selection cites Parallelizing Linear Transformers with the Delta Rule over Sequence Length
  • Distilling to Hybrid Attention Models via KL-Guided Layer Selection cites Gated Slot Attention for Efficient Linear-Time Sequence Modeling
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites Random Feature Attention
  • CLEAR: Conv-Like Linearization Revs Pre-Trained Diffusion Transformers Up cites Gated Slot Attention for Efficient Linear-Time Sequence Modeling
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen et al.NeurIPS 2024 · 412 citations
  2. Gated Slot Attention for Efficient Linear-Time Sequence ModelingYu Zhang, Songlin Yang, Rui-Jie Zhu, Yue Zhang et al.NeurIPS 2024 · 93 citations
  3. CLEAR: Conv-Like Linearization Revs Pre-Trained Diffusion Transformers UpSonghua Liu, Zhenxiong Tan, Xinchao WangNeurIPS 2025 · 33 citations
  4. Distilling to Hybrid Attention Models via KL-Guided Layer SelectionYanhong Li, Songlin Yang, Shawn Tan, Mayank Mishra et al.ICLR 2026 · 17 citations
  5. Native Hybrid Attention for Efficient Sequence ModelingJusen Du, Jiaxi Hu, Zhang Tao, Weigao Sun et al.ACL 2026 · 8 citations

Builds on11

  1. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
  2. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  3. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations
  4. Reducing Transformer Depth on Demand with Structured DropoutAngela Fan, Edouard Grave, Armand JoulinICLR 2020 · 695 citations
  5. Random Feature AttentionHao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz et al.ICLR 2021 · 425 citations

Related papers

  1. Luna: Linear Unified Nested AttentionXuezhe Ma, Xiang Kong, Sinong Wang, Chunting Zhou et al.NeurIPS 2021 · 145 citations
  2. CAB: Comprehensive Attention Benchmarking on Long Sequence ModelingJun Zhang, Shuyang Jiang, Jiangtao Feng, Lin Zheng et al.ICML 2023 · 11 citations
  3. Selective Attention Improves TransformerYaniv Leviathan, Matan Kalman, Yossi MatiasICLR 2025
  4. ∞-former: Infinite Memory TransformerPedro Henrique Martins, Zita Marinho, André F. T. MartinsACL 2022 · 12 citations
  5. Fast Attention Over Long Sequences With Dynamic Sparse Flash AttentionMatteo Pagliardini, Daniele Paliotta, Martin Jaggi, François FleuretNeurIPS 2023 · 26 citations
Dusk over the sea between two cliffs drawn in fine vertical lines