{"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/efficient-backpropagation-with-variance","title":"Efficient Backpropagation with Variance-Controlled Adaptive Sampling","arxiv_id":"2402.17227","date":"2024-02-27","proceeding":null,"authors":["Ziteng Wang","Jianfei Chen","Jun Zhu"],"abstract":"Sampling-based algorithms, which eliminate ''unimportant'' computations during forward and/or back propagation (BP), offer potential solutions to accelerate neural network training. However, since sampling introduces approximations to training, such algorithms may not consistently maintain accuracy across various tasks. In this work, we introduce a variance-controlled adaptive sampling (VCAS) method designed to accelerate BP. VCAS computes an unbiased stochastic gradient with fine-grained layerwise importance sampling in data dimension for activation gradient calculation and leverage score sampling in token dimension for weight gradient calculation. To preserve accuracy, we control the additional variance by learning the sample ratio jointly with model parameters during training. We assessed VCAS on multiple fine-tuning and pre-training tasks in both vision and natural language domains. On all the tasks, VCAS can preserve the original training loss trajectory and validation accuracy with an up to 73.87% FLOPs reduction of BP and 49.58% FLOPs reduction of the whole training process. The implementation is available at https://github.com/thu-ml/VCAS .","url_abs":"https://arxiv.org/abs/2402.17227v1","url_pdf":"https://arxiv.org/pdf/2402.17227v1.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":"efficient-backpropagation-with-variance","repo_url":"https://github.com/thu-ml/vcas","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.17227","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.17227"}},"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":"deterministic:regex_extraction","url":"https://github.com/thu-ml/VCAS","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thu-ml/vcas","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":5,"ran_draft_wrong":2,"ran_fixture":1,"unverified":2},"by_repo_kind":{"official":{"samples":10,"ran":8,"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":"ba445cd4cf315028","entry":"ActSampler","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ba445cd4cf315028"}},{"code_sha256_prefix":"df0b4214c141ce1c","entry":"Linear","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"df0b4214c141ce1c"}},{"code_sha256_prefix":"ed9c7478c271d5c5","entry":"VcasSampleArguments","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.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":"ed9c7478c271d5c5"}},{"code_sha256_prefix":"9e66beb8df316fd7","entry":"find_top_sum","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e66beb8df316fd7"}},{"code_sha256_prefix":"5b17933b4ea5e8af","entry":"leverage_k","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b17933b4ea5e8af"}},{"code_sha256_prefix":"0e793350f9814916","entry":"linear","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.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":"0e793350f9814916"}},{"code_sha256_prefix":"d133f23c0715ba63","entry":"sampling","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.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":"d133f23c0715ba63"}},{"code_sha256_prefix":"d4d8fa0fce043913","entry":"soft_topk","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d4d8fa0fce043913"}},{"code_sha256_prefix":"7ad9a72c7c1854f1","entry":"VcasSampleScheme","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.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":"7ad9a72c7c1854f1"}},{"code_sha256_prefix":"e1f851c5530e9bf3","entry":"cal_leverage_var","repo":"thu-ml/vcas","repo_kind":"official","path":"vcas/sample_scheme.py","file_url":"https://github.com/thu-ml/vcas/blob/HEAD/vcas/sample_scheme.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":"e1f851c5530e9bf3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}