Fine-Tuning Pre-trained Transformers into Decaying Fast Weights

Huanru Henry Mao
10/9/2022
cs.LG
transformer-attention

Official code: jenni-ai/T2FW (20 stars, Python, last commit 2022-10-09).

Abstract

Autoregressive Transformers are strong language models but incur O(T) complexity during per-token generation due to the self-attention mechanism. Recent work proposes kernel-based methods to approximate causal self-attention by replacing it with recurrent formulations with various update rules and feature maps to achieve O(1) time and memory complexity.

Show full abstract

We explore these approaches and find that they are unnecessarily complex, and propose a simple alternative - decaying fast weights - that runs fast on GPU, outperforms prior methods, and retains 99% of attention's performance for GPT-2. We also show competitive performance on WikiText-103 against more complex attention substitutes.

View on arXivView PDF

Code Implementations(1)

jenni-ai/T2FWOfficial100%

Fine-Tuning Pre-trained Transformers into Decaying Fast Weights

203Python, CudaApr 2, 20224 years ago

Similar Papers

Cite this paper

@article{mao2022finetuning,
  title  = {Fine-Tuning Pre-trained Transformers into Decaying Fast Weights},
  author = {Huanru Henry Mao},
  year   = {2022},
  eprint = {2210.04243},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.04243}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.04243.svg)](https://codeofpaper.com/paper/2210.04243)

Discussion