Shortformer: Better Language Modeling using Shorter Inputs
Ofir Press, Noah A. Smith, Mike Lewis
摘要
Increasing the input length has been a driver of progress in language modeling with transformers. We identify conditions where shorter inputs are not harmful, and achieve perplexity and efficiency improvements through two new methods that decrease input length. First, we show that initially training a model on short subsequences before moving on to longer ones both reduces overall training time and, surprisingly, substantially improves perplexity. Second, we show how to improve the efficiency of recurrence methods in transformers, which let models condition on previously processed tokens when generating sequences that exceed the maximal length the transformer can handle at once. Existing methods require computationally expensive relative position embeddings; we introduce a simple alternative of adding absolute position embeddings to queries and keys instead of to word embeddings, which efficiently produces superior results. We show that these recurrent models also benefit from short input lengths. Combining these techniques speeds up training by a factor of 1.65, reduces memory usage, and substantially improves perplexity on WikiText-103, without adding any parameters. 1 L = 512 to run slowly (in N.o. eval.), although during batched N.o. eval. they are slightly faster than the L = 512 model. 5 For example, the L = 3,072 model's performance peaked at S = 512 (used in Baevski and Auli (2018)) and then stopped improving. Thus, the result shown in Table 1 for that model with S = 1 can also be achieved with S = 512 even though that runs 500 times faster, at 2.5k tok./sec.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 24 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Improving Transformer Models by Reordering their Sublayers 引用了 Generalization through Memorization: Nearest Neighbor Language Models
- Improving Transformer Models by Reordering their Sublayers 引用了 Compressive Transformers for Long-Range Sequence Modelling
- Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation 引用了 Improving Transformer Models by Reordering their Sublayers
- Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation 引用了 Generalization through Memorization: Nearest Neighbor Language Models
- Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation 引用了 Compressive Transformers for Long-Range Sequence Modelling
- General-purpose, long-context autoregressive modeling with Perceiver AR 引用了 Reformer: The Efficient Transformer
- General-purpose, long-context autoregressive modeling with Perceiver AR 引用了 Compressive Transformers for Long-Range Sequence Modelling
引用它的顶会 Paper24
- Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 次引用
- HyenaDNA: Long-Range Genomic Sequence Modeling at Single Nucleotide ResolutionEric Nguyen, Michael Poli, Marjan Faizi, Armin W. Thomas 等NeurIPS 2023 · 574 次引用
- A Token-level Reference-free Hallucination Detection Benchmark for Free-form Text GenerationTianyu Liu, Yizhe Zhang, Chris Brockett, Yi Mao 等ACL 2022 · 194 次引用
- Stabilizing Transformer Training by Preventing Attention Entropy CollapseShuangfei Zhai, Tatiana Likhomanenko, Etai Littwin, Dan Busbridge 等ICML 2023 · 153 次引用
- General-purpose, long-context autoregressive modeling with Perceiver ARCurtis Hawthorne, Andrew Jaegle, Catalina Cangea, Sebastian Borgeaud 等ICML 2022 · 83 次引用
它引用的 Paper5
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer 等ICLR 2020 · 1,038 次引用
- Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier 等ICLR 2020 · 833 次引用
- Rethinking Positional Encoding in Language Pre-trainingGuolin Ke, Di He, Tie-Yan LiuICLR 2021 · 358 次引用
- Improving Transformer Models by Reordering their SublayersOfir Press, Noah A. Smith, Omer LevyACL 2020 · 6 次引用
相关 Paper
- Mini-Sequence Transformers: Optimizing Intermediate Memory for Long Sequences TrainingCheng Luo, Jiawei Zhao, Zhuoming Chen, Beidi Chen 等NeurIPS 2024 · 6 次引用
- When Attention Meets Fast Recurrence: Training Language Models with Reduced ComputeTao LeiEMNLP 2021 · 28 次引用
- Block-Recurrent TransformersDeLesley Hutchins, Imanol Schlag, Yuhuai Wu, Ethan Dyer 等NeurIPS 2022 · 163 次引用
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level ComputationSangmin Bae, Yujin Kim, Reza Bayat, Sungnyun Kim 等NeurIPS 2025 · 143 次引用
- DeFINE: Deep Factorized Input Token Embeddings for Neural Sequence ModelingSachin Mehta, Rik Koncel-Kedziorski, Mohammad Rastegari, Hannaneh HajishirziICLR 2020 · 28 次引用
