{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/scale-efficiently-insights-from-pre-training","title":"Scale Efficiently: Insights from Pre-training and Fine-tuning Transformers","arxiv_id":"2109.10686","date":"2021-09-22","proceeding":null,"authors":["Yi Tay","Mostafa Dehghani","Jinfeng Rao","William Fedus","Samira Abnar","Hyung Won Chung","Sharan Narang","Dani Yogatama","Ashish Vaswani","Donald Metzler"],"abstract":"There remain many open questions pertaining to the scaling behaviour of Transformer architectures. These scaling decisions and findings can be critical, as training runs often come with an associated computational cost which have both financial and/or environmental impact. The goal of this paper is to present scaling insights from pretraining and finetuning Transformers. While Kaplan et al. presents a comprehensive study of the scaling behaviour of Transformer language models, the scope is only on the upstream (pretraining) loss. Therefore, it is still unclear if these set of findings transfer to downstream task within the context of the pretrain-finetune paradigm. The key findings of this paper are as follows: (1) we show that aside from only the model size, model shape matters for downstream fine-tuning, (2) scaling protocols operate differently at different compute regions, (3) widely adopted T5-base and T5-large sizes are Pareto-inefficient. To this end, we present improved scaling protocols whereby our redesigned models achieve similar downstream fine-tuning quality while having 50\\% fewer parameters and training 40\\% faster compared to the widely adopted T5-base model. We publicly release over 100 pretrained checkpoints of different T5 configurations to facilitate future research and analysis.","url_abs":"https://arxiv.org/abs/2109.10686v2","url_pdf":"https://arxiv.org/pdf/2109.10686v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"scale-efficiently-insights-from-pre-training","repo_url":"https://github.com/google-research/google-research/tree/master/scaling_transformers","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"jax","reach":null},{"paper_slug":"scale-efficiently-insights-from-pre-training","repo_url":"https://github.com/aaronmueller/emergent-syntax","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"scale-efficiently-insights-from-pre-training","repo_url":"https://github.com/gsarti/it5","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2109.10686","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.10686"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-research/google-research/tree/master/scaling_transformers","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aaronmueller/emergent-syntax","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gsarti/it5","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_honours":4,"ran":1,"unverified":7},"by_repo_kind":{"listed":{"samples":12,"ran":5,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"eb29f6682a2426ad","entry":"compute_input_and_target_lengths","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"run_t5_mlm_flax.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/run_t5_mlm_flax.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eb29f6682a2426ad"}},{"code_sha256_prefix":"66552297bbb6cd38","entry":"exact_match","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"models/metrics.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/models/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"66552297bbb6cd38"}},{"code_sha256_prefix":"30008b8c34f29539","entry":"first_word","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"models/metrics.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/models/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"30008b8c34f29539"}},{"code_sha256_prefix":"26eb4e2856b3d7a1","entry":"generate_batch_splits","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"run_t5_mlm_flax.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/run_t5_mlm_flax.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"26eb4e2856b3d7a1"}},{"code_sha256_prefix":"bd0d4ea62311e45d","entry":"second_word","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"models/metrics.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/models/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bd0d4ea62311e45d"}},{"code_sha256_prefix":"0c5a6c34f4b57d8b","entry":"evaluate_predictions","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"models/pred_eval.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/models/pred_eval.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0c5a6c34f4b57d8b"}},{"code_sha256_prefix":"a747070e3ebf347f","entry":"get_bsz","repo":"gsarti/it5","repo_kind":"listed","path":"finetuning/vars.py","file_url":"https://github.com/gsarti/it5/blob/HEAD/finetuning/vars.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a747070e3ebf347f"}},{"code_sha256_prefix":"d79ddc3312ab8f78","entry":"get_bsz","repo":"gsarti/it5","repo_kind":"listed","path":"inference/vars.py","file_url":"https://github.com/gsarti/it5/blob/HEAD/inference/vars.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d79ddc3312ab8f78"}},{"code_sha256_prefix":"219961813fa6d977","entry":"get_dirs","repo":"aaronmueller/emergent-syntax","repo_kind":"listed","path":"analysis/plot_scaling.py","file_url":"https://github.com/aaronmueller/emergent-syntax/blob/HEAD/analysis/plot_scaling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"219961813fa6d977"}},{"code_sha256_prefix":"c4f59346ce8a05d9","entry":"get_lr","repo":"gsarti/it5","repo_kind":"listed","path":"finetuning/vars.py","file_url":"https://github.com/gsarti/it5/blob/HEAD/finetuning/vars.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c4f59346ce8a05d9"}},{"code_sha256_prefix":"f74861ceb9e003dd","entry":"get_params","repo":"gsarti/it5","repo_kind":"listed","path":"inference/vars.py","file_url":"https://github.com/gsarti/it5/blob/HEAD/inference/vars.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f74861ceb9e003dd"}},{"code_sha256_prefix":"07d60309bc634d37","entry":"get_time","repo":"gsarti/it5","repo_kind":"listed","path":"finetuning/vars.py","file_url":"https://github.com/gsarti/it5/blob/HEAD/finetuning/vars.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"07d60309bc634d37"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}