TGViewer
Gradient Dude Gradient Dude @gradientdude · 2.6K subscribers
Post #223 16.3K
​​Finetuning Pretrained Transformers into RNNs
Microsoft+Deepmind+...

Transformers is the current SOTA in language modeling. But they come with significant computational overhead, as the attention mechanism scales quadratically in sequence length. The memory consumption also grows linearly as the sequence becomes longer. This bottleneck limits the usage of large-scale pretrained generation models, such as GPT-3 or Image transformers.

Several efficient transformer variants have been proposed recently. For example, a linear-complexity recurrent variant has proven well suited for an autoregressive generation. It approximates the softmax attention with randomized or heuristic feature maps but can be difficult to train or yield suboptimal accuracy.

This work converts a pretrained transformer into its efficient linear-complexity recurrent counterpart with a learned feature map to improve the efficiency while retaining the accuracy. To achieve this, they replace the softmax attention in an off-the-shelf pretrained transformer with its linear-complexity recurrent alternative and then finetune.

➕ Pros:
+ The finetuning process requires much less GPU time than training the recurrent variants from scratch
+ Converting a large off-the-shelf transformer to a lightweight inference model w/o repeating the whole training procedure is very handy in many downstream applications.

📝 arxiv.org/abs/2103.13076
More from @gradientdude
  1. Apr 9, 2024🎸 Suno v3 prompt engineering guide Go to the app homepage, create tab. There's the simple…
  2. Apr 9, 2024Suno v3 - The best txt2music model Recently released Suno v3 is the absolute best txt2musi…
  3. Mar 30, 2024The paper also shows that SD3-Turbo is better than Midjourney 6 in both image quality and…
  4. Mar 30, 2024⚡️SD3-Turbo: Fast High-Resolution Image Synthesis with Latent Adversarial Diffusion Distil…
  5. Mar 30, 2024I'm getting back to juicy posts in english! @gradientdude
  6. Feb 29, 2024Staff Research Scientist: Personal Update I have some exciting news that I'd like to share…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →