Transformer Quality in Linear Time
About
We revisit the design choices in Transformers, and propose methods to address their weaknesses in handling long sequences. First, we propose a simple layer named gated attention unit, which allows the use of a weaker single-head attention with minimal quality loss. We then propose a linear approximation method complementary to this new layer, which is accelerator-friendly and highly competitive in quality. The resulting model, named FLASH, matches the perplexity of improved Transformers over both short (512) and long (8K) context lengths, achieving training speedups of up to 4.9$\times$ on Wiki-40B and 12.1$\times$ on PG-19 for auto-regressive language modeling, and 4.8$\times$ on C4 for masked language modeling.
Weizhe Hua, Zihang Dai, Hanxiao Liu, Quoc V. Le• 2022
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Language Modeling | WikiText-103 (test) | Perplexity26.7 | 524 | |
| Language Modeling | WikiText-103 (val) | PPL25.92 | 180 | |
| Long-range sequence modeling | Long Range Arena (LRA) | Text Accuracy64.1 | 164 | |
| Language Modeling | Wiki-40B (val) | Perplexity14.955 | 35 | |
| Masked Language Modeling | C4 (val) | PPLX3.828 | 35 | |
| Sequential Recommendation | KuaiRand | HR@109.83 | 22 | |
| Language Modeling | PG-19 500M parameters scale (test) | PPLX40.72 | 20 | |
| Language Modeling | English Wikipedia | PPLX3.12 | 6 | |
| Question Answering | TriviaQA (val) | FT F174.8 | 6 |
Showing 9 of 9 rows