{"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/nanot5-a-pytorch-framework-for-pre-training","title":"nanoT5: A PyTorch Framework for Pre-training and Fine-tuning T5-style Models with Limited Resources","arxiv_id":"2309.02373","date":"2023-09-05","proceeding":null,"authors":["Piotr Nawrot"],"abstract":"State-of-the-art language models like T5 have revolutionized the NLP landscape, but their computational demands hinder a large portion of the research community. To address this challenge, we present nanoT5, a specially-optimized PyTorch framework for efficient pre-training and fine-tuning of T5 models. Drawing on insights from optimizer differences and prioritizing efficiency, nanoT5 allows a T5-Base model to be pre-trained on a single GPU in just 16 hours, without any loss in performance. With the introduction of this open-source framework, we hope to widen the accessibility to language modelling research and cater to the community's demand for more user-friendly T5 (Encoder-Decoder) implementations. We make our contributions, including configurations, codebase, pre-training insights, and pre-trained models, available to the public.","url_abs":"https://arxiv.org/abs/2309.02373v2","url_pdf":"https://arxiv.org/pdf/2309.02373v2.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":"nanot5-a-pytorch-framework-for-pre-training","repo_url":"https://github.com/piotrnawrot/nanot5","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"adafactor","method_name":"Adafactor"},{"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":"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":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.02373","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.02373"}},"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/piotrnawrot/nanot5","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"official":{"samples":9,"ran":6,"repositories":1}},"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":"d8c4822a9c1aff8b","entry":"compute_input_and_target_lengths","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/copied_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/copied_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d8c4822a9c1aff8b"}},{"code_sha256_prefix":"16e2ea40e8110ef0","entry":"extra_stats","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/train_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"16e2ea40e8110ef0"}},{"code_sha256_prefix":"d354eb40c8df3017","entry":"forward","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/train_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d354eb40c8df3017"}},{"code_sha256_prefix":"094eae8c1e901338","entry":"get_tokenizer","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/model_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"094eae8c1e901338"}},{"code_sha256_prefix":"921498087b42cca7","entry":"maybe_grad_clip_and_grad_calc","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/train_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"921498087b42cca7"}},{"code_sha256_prefix":"8a721263c3f886fd","entry":"tokenize_function","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/copied_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/copied_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8a721263c3f886fd"}},{"code_sha256_prefix":"4e33c46bf6be0ea0","entry":"get_config","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/model_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/model_utils.py","link_basis":"first_harvest_node","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":"4e33c46bf6be0ea0"}},{"code_sha256_prefix":"78d65b12d42b0968","entry":"get_model","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/model_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/model_utils.py","link_basis":"first_harvest_node","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":"78d65b12d42b0968"}},{"code_sha256_prefix":"e079a044476cfb25","entry":"setup_basics","repo":"piotrnawrot/nanot5","repo_kind":"official","path":"nanoT5/utils/gen_utils.py","file_url":"https://github.com/piotrnawrot/nanot5/blob/HEAD/nanoT5/utils/gen_utils.py","link_basis":"first_harvest_node","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":"e079a044476cfb25"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}