Lune

EMNLP2022Top-tier venue

Linearizing Transformer with Key-Value Memory

Yizhe Zhang, Deng Cai

Abstract

Efficient transformer variants with linear time complexity have been developed to mitigate the quadratic computational overhead of the vanilla transformer. Among them are low-rank projection methods such as Linformer and kernel-based Transformers. Despite their unique merits, they usually suffer from a performance drop comparing with the vanilla transformer on many sequence generation tasks, and often fail to obtain computation gain when the generation is short. We propose Memsizer, an approach towards closing the performance gap while improving the efficiency even with short generation. It projects the source sequences into lower dimension representations like Linformer, while enjoying efficient recurrent-style incremental computation similar to kernel-based transformers. This yields linear computation time and constant memory complexity at inference time. Memsizer also employs a lightweight multi-head mechanism which renders the computation as light as a single-head model. We demonstrate that Memsizer provides an improved balance between efficiency and accuracy over the vanilla transformer and other efficient transformer variants in three typical sequence generation tasks, including machine translation, abstractive text summarization, and language modeling.

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.

3 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

  • Big Bird: Transformers for Longer Sequences cites Reformer: The Efficient Transformer
  • Attention with Routed-Memory for Learnable Sparse Control cites Big Bird: Transformers for Longer Sequences
  • Attention with Routed-Memory for Learnable Sparse Control cites Reformer: The Efficient Transformer
  • Attention with Routed-Memory for Learnable Sparse Control cites Gated Slot Attention for Efficient Linear-Time Sequence Modeling
  • Attention with Routed-Memory for Learnable Sparse Control cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Big Bird: Transformers for Longer Sequences
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Reformer: The Efficient Transformer
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda et al.ICML 2024 · 390 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. Attention with Routed-Memory for Learnable Sparse ControlQIUHAO Zeng, Jerry Huang, Peng Lu, Ruiyi Fang et al.ICML 2026

Builds on22

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
  3. MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
  4. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
  5. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations

Related papers

  1. MemoryFormer : Minimize Transformer Computation by Removing Fully-Connected LayersNing Ding, Yehui Tang, Haochen Qin, Zhenli Zhou et al.NeurIPS 2024 · 8 citations
  2. Efficient Long-Range Transformers: You Need to Attend More, but Not Necessarily at Every LayerQingru Zhang, Dhananjay Ram, Cole Hawkins, Sheng Zha et al.EMNLP Findings 2023 · 18 citations
  3. LightFormer: Light-weight Transformer Using SVD-based Weight Transfer and Parameter SharingXiuqing Lv, Peng Zhang, Sunzhu Li, Guobing Gan et al.ACL Findings 2023 · 9 citations
  4. Informer: Beyond Efficient Transformer for Long Sequence Time-Series ForecastingHaoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang et al.AAAI 2021 · 7,289 citations
  5. SEA: Sparse Linear Attention with Estimated Attention MaskHeejun Lee, Jina Kim, Jeffrey Willette, Sung Ju HwangICLR 2024 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines