mlsanityData to 7 Oct 2026

Finetuning Pretrained Transformers into RNNs

arXiv 2103.13076 ↗First posted 24 Mar 2021cs.CLcited by 94

Not on the map. Why?

Abstract (arXiv)

Transformers have outperformed recurrent neural networks (RNNs) in natural language generation. But this comes with a significant computational cost, as the attention mechanism's complexity scales quadratically with sequence length. Efficient transformer variants have received increasing interest in recent works. Among them, a linear-complexity recurrent variant has proven well suited for autoregressive generation. It approximates the softmax attention with randomized or heuristic feature maps, but can be difficult to train and may yield suboptimal accuracy. This work aims to convert a pretrained transformer into its efficient recurrent counterpart, improving efficiency while maintaining accuracy. Specifically, we propose a swap-then-finetune procedure: in an off-the-shelf pretrained transformer, we replace the softmax attention with its linear-complexity recurrent alternative and then finetune. With a learned feature map, our approach provides an improved tradeoff between efficiency and accuracy over the standard transformer and other recurrent variants. We also show that the finetuning process has lower training cost relative to training these recurrent variants from scratch. As many models for natural language tasks are increasingly dependent on large-scale pretrained transformers, this work presents a viable approach to improving inference efficiency without repeating the expensive pretraining process.

Key facts. Cited by 94 papers in the map (data through 7 Oct 2026). Builds on 65 of its 91 references that are in the map. First posted on arXiv 24 Mar 2021.

Builds on

65 of 91 references.

References · 65

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  4. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  5. 2020Language Models are Few-Shot Learnerscited by 32,199
  6. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  7. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  8. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  9. 2015Distilling the Knowledge in a Neural Networkcited by 10,076
  10. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  11. 2016Layer Normalizationcited by 5,579
  12. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
38 more
  1. 2021Zero-Shot Text-to-Image Generationcited by 4,276
  2. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
  3. 2020Longformer: The Long-Document Transformercited by 3,362
  4. 2016Pointer Sentinel Mixture Modelscited by 2,992
  5. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  6. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
  7. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  8. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  9. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  10. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  11. 2020Reformer: The Efficient Transformercited by 1,658
  12. 2019Generating Long Sequences with Sparse Transformerscited by 1,523
  13. 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,486
  14. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  15. 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,414
  16. 2014On the Properties of Neural Machine Translation: Encoder-Decoder Approachescited by 1,303
  17. 2017Mixed Precision Trainingcited by 1,135
  18. 2019Are Sixteen Heads Really Better than One?cited by 803
  19. 2020Efficient Transformers: A Surveycited by 784
  20. 2018Image Transformercited by 770
  21. 2016Sequence-Level Knowledge Distillationcited by 761
  22. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 699
  23. 2018Universal Transformerscited by 613
  24. 2017Convolutional Sequence to Sequence Learningcited by 550
  25. 2020MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devicescited by 476
  26. 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 469
  27. 2017Non-Autoregressive Neural Machine Translationcited by 457
  28. 2019Reducing Transformer Depth on Demand with Structured Dropoutcited by 434
  29. 2019Q-BERT: Hessian Based Ultra Low Precision Quantization of BERTcited by 355
  30. 2021Random Feature Attentioncited by 350
  31. 2018Generating Wikipedia by Summarizing Long Sequencescited by 333
  32. 2019Q8BERT: Quantized 8Bit BERTcited by 296
  33. 2016Using the Output Embedding to Improve Language Modelscited by 266
  34. 2020Sparse Sinkhorn Attentioncited by 250
  35. 2020MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformerscited by 240
  36. 2018Adaptive Input Representations for Neural Language Modelingcited by 226
  37. 2019Pay Less Attention with Lightweight and Dynamic Convolutionscited by 211
  38. 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 211

50 most cited of 65 All 65 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 11; 2022: 12; 2023: 8; 2024: 15; 2025: 26; 2026: 22.

94 papers.

Sort:

By area:

  1. 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
  2. 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
  3. 2022Transformers Learn Shortcuts to Automatacited by 260
  4. 2021SOFT: Softmax-free Transformer with Linear Complexitycited by 128
  5. 2024The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicrycited by 119
  6. 2023Batch Prompting: Efficient Inference with Large Language Model APIscited by 84
  7. 2024Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inferencecited by 75
  8. 2024Gated Slot Attention for Efficient Linear-Time Sequence Modelingcited by 73
  9. 2024Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Modelscited by 66
  10. 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 63
  11. 2025ATLAS: Learning to Optimally Memorize the Context at Test Timecited by 57
  12. 2024DiG: Scalable and Efficient Diffusion Models with Gated Linear Attentioncited by 56
38 more
  1. 2025End-to-End Test-Time Training for Long Contextcited by 53
  2. 2024Linearizing Large Language Modelscited by 51
  3. 2021Stable, Fast and Accurate: Kernelized Attention with Relative Positional Encodingcited by 50
  4. 2024Is Mamba Capable of In-Context Learning?cited by 45
  5. 2025Teaching Pretrained Language Models to Think Deeper with Retrofitted Recurrencecited by 41
  6. 2025Log-Linear Attentioncited by 39
  7. 2025Jet-Nemotron: Efficient Language Model with Post Neural Architecture Searchcited by 39
  8. 2021Fast Nearest Neighbor Machine Translationcited by 37
  9. 2021ABC: Attention with Bounded-memory Controlcited by 36
  10. 2023PolySketchFormer: Fast Transformers via Sketching Polynomial Kernelscited by 33
  11. 2021Bidimensional Leaderboards: Generate and Evaluate Language Hand in Handcited by 32
  12. 2025Liger: Linearizing Large Language Models to Gated Recurrent Structurescited by 32
  13. 2022Linear Complexity Randomized Self-attention Mechanismcited by 31
  14. 2022Fine-Tuning Pre-trained Transformers into Decaying Fast Weightscited by 26
  15. 2024LoLCATs: On Low-Rank Linearizing of Large Language Modelscited by 25
  16. 2025RADLADS: Rapid Attention Distillation to Linear Attention Decoders at Scalecited by 24
  17. 2022Sequencer: Deep LSTM for Image Classificationcited by 23
  18. 2023Efficient Attention via Control Variatescited by 23
  19. 2025Thinking Slow, Fast: Scaling Inference Compute with Distilled Reasonerscited by 22
  20. 2025M1: Towards Scalable Test-Time Compute with Mamba Reasoning Modelscited by 21
  21. 2022How Much Does Attention Actually Attend? Questioning the Importance of Attention in Pretrained Transformerscited by 20
  22. 2024MetaLA: Unified Optimal Linear Approximation to Softmax Attention Mapcited by 20
  23. 2025Distilling to Hybrid Attention Models via KL-Guided Layer Selectioncited by 17
  24. 2021Towards Incremental Transformers: An Empirical Analysis of Transformer Models for Incremental NLUcited by 16
  25. 2023EGA-Depth: Efficient Guided Attention for Self-Supervised Multi-Camera Depth Estimationcited by 16
  26. 2026Hybrid Linear Attention Done Right: Efficient Distillation and Effective Architectures for Extremely Long Contextscited by 16
  27. 2021PermuteFormer: Efficient Relative Position Encoding for Long Sequencescited by 14
  28. 2026VGG-T3: Offline Feed-Forward 3D Reconstruction at Scalecited by 14
  29. 2025Scaling Linear Attention with Sparse State Expansioncited by 12
  30. 2024LightTransfer: Your Long-Context LLM is Secretly a Hybrid Model with Effortless Adaptationcited by 11
  31. 2025Multimodal Mamba: Decoder-only Multimodal State Space Model via Quadratic to Linear Distillationcited by 11
  32. 2021Efficient Inference for Multilingual Neural Machine Translationcited by 10
  33. 2022Softmax-free Linear Transformerscited by 9
  34. 2021Faster Nearest Neighbor Machine Translationcited by 8
  35. 2024Improving Transformers with Dynamically Composable Multi-Head Attentioncited by 8
  36. 2023Efficiency Pentathlon: A Standardized Arena for Efficiency Evaluationcited by 7
  37. 2022Training Integer-Only Deep Recurrent Neural Networkscited by 5
  38. 2025ViT-Linearizer: Distilling Quadratic Knowledge into Linear-Time Vision Modelscited by 5

50 most cited of 94 All 94 (JSON)