Papers › Shortformer: Better Language Modeling using Shorter Inputs

Shortformer: Better Language Modeling using Shorter Inputs

31 Dec 2020ACL 2021 5arXiv:2012.15832archive 2025-07-28

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.

PaperPDFConference PDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

ofirpress/shortformer officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Language ModelingLanguage ModellingWord Embeddings

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Language Modelling WikiText-103 Staged Training Number of params 247M #26 of 89 Archive leaderboard report
Language Modelling WikiText-103 Staged Training Test perplexity 17.56 #26 of 89 Archive leaderboard report
Language Modelling WikiText-103 Staged Training Validation perplexity 16.89 #26 of 89 Archive leaderboard report
Language Modelling WikiText-103 Shortformer Number of params 247M #31 of 89 Archive leaderboard report
Language Modelling WikiText-103 Shortformer Test perplexity 18.15 #31 of 89 Archive leaderboard report
Language Modelling WikiText-103 Shortformer Validation perplexity 17.47 #31 of 89 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Layer Normalization

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections