{"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/normalization-layer-per-example-gradients-are","title":"Normalization Layer Per-Example Gradients are Sufficient to Predict Gradient Noise Scale in Transformers","arxiv_id":"2411.00999","date":"2024-11-01","proceeding":null,"authors":["Gavia Gray","Aman Tiwari","Shane Bergsma","Joel Hestness"],"abstract":"Per-example gradient norms are a vital ingredient for estimating gradient noise scale (GNS) with minimal variance. Observing the tensor contractions required to compute them, we propose a method with minimal FLOPs in 3D or greater tensor regimes by simultaneously computing the norms while computing the parameter gradients. Using this method we are able to observe the GNS of different layers at higher accuracy than previously possible. We find that the total GNS of contemporary transformer models is predicted well by the GNS of only the normalization layers. As a result, focusing only on the normalization layer, we develop a custom kernel to compute the per-example gradient norms while performing the LayerNorm backward pass with zero throughput overhead. Tracking GNS on only those layers, we are able to guide a practical batch size schedule that reduces training time by 18% on a Chinchilla-optimal language model.","url_abs":"https://arxiv.org/abs/2411.00999v1","url_pdf":"https://arxiv.org/pdf/2411.00999v1.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":"normalization-layer-per-example-gradients-are","repo_url":"https://github.com/cerebrasresearch/nanogns","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"gns","method_name":"GNS"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.00999","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.00999"}},"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/cerebrasresearch/nanogns","reach":{"status":"ok"}}],"summary":{"ran_violates":2,"unverified":11},"by_repo_kind":{"official":{"samples":13,"ran":2,"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":13,"samples":[{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/gnstracking.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/gnstracking.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"608e364a9d2376a3","entry":"exists","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/buffered.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/buffered.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"608e364a9d2376a3"}},{"code_sha256_prefix":"728e7021aeb6a4a8","entry":"compute_total_norms","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/gns-analysis.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/gns-analysis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"728e7021aeb6a4a8"}},{"code_sha256_prefix":"8365f54f88f0e6d0","entry":"gather_hook_results","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"approx/hook.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/approx/hook.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8365f54f88f0e6d0"}},{"code_sha256_prefix":"16b8934e3d4a34cd","entry":"get_aligned_columns","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/gns-analysis.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/gns-analysis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"16b8934e3d4a34cd"}},{"code_sha256_prefix":"07e6ccda0c4be5c5","entry":"gnsify","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"approx/gns_utils.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/approx/gns_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"07e6ccda0c4be5c5"}},{"code_sha256_prefix":"ed49d9a5a77a3e02","entry":"is_any_nan_or_inf","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"approx/hook.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/approx/hook.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed49d9a5a77a3e02"}},{"code_sha256_prefix":"f3552f440f4a76f3","entry":"load_csv","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/csv_tools.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/csv_tools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f3552f440f4a76f3"}},{"code_sha256_prefix":"1d4431cc16b9efe4","entry":"mean_loss_scale","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"approx/gns_utils.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/approx/gns_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1d4431cc16b9efe4"}},{"code_sha256_prefix":"60b0ae4d53a3850f","entry":"safe_sqnorm","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/buffered.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/buffered.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"60b0ae4d53a3850f"}},{"code_sha256_prefix":"7fcff3161455b67f","entry":"safe_sum","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/buffered.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/buffered.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7fcff3161455b67f"}},{"code_sha256_prefix":"32ff26508e6c106d","entry":"shared_weights","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/gnstracking.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/gnstracking.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"32ff26508e6c106d"}},{"code_sha256_prefix":"4b5addd9efcb391f","entry":"unbiased_stats","repo":"cerebrasresearch/nanogns","repo_kind":"official","path":"exact/gns-analysis.py","file_url":"https://github.com/cerebrasresearch/nanogns/blob/HEAD/exact/gns-analysis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b5addd9efcb391f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}