{"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/decentralized-sgd-and-average-direction-sam","title":"Decentralized SGD and Average-direction SAM are Asymptotically Equivalent","arxiv_id":"2306.02913","date":"2023-06-05","proceeding":null,"authors":["Tongtian Zhu","Fengxiang He","KaiXuan Chen","Mingli Song","DaCheng Tao"],"abstract":"Decentralized stochastic gradient descent (D-SGD) allows collaborative learning on massive devices simultaneously without the control of a central server. However, existing theories claim that decentralization invariably undermines generalization. In this paper, we challenge the conventional belief and present a completely new perspective for understanding decentralized learning. We prove that D-SGD implicitly minimizes the loss function of an average-direction Sharpness-aware minimization (SAM) algorithm under general non-convex non-$\\beta$-smooth settings. This surprising asymptotic equivalence reveals an intrinsic regularization-optimization trade-off and three advantages of decentralization: (1) there exists a free uncertainty evaluation mechanism in D-SGD to improve posterior estimation; (2) D-SGD exhibits a gradient smoothing effect; and (3) the sharpness regularization effect of D-SGD does not decrease as total batch size increases, which justifies the potential generalization benefit of D-SGD over centralized SGD (C-SGD) in large-batch scenarios. The code is available at https://github.com/Raiden-Zhu/ICML-2023-DSGD-and-SAM.","url_abs":"https://arxiv.org/abs/2306.02913v5","url_pdf":"https://arxiv.org/pdf/2306.02913v5.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":"decentralized-sgd-and-average-direction-sam","repo_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"sgd","method_name":"SGD"},{"method_slug":"sharpness-aware-minimization","method_name":"Sharpness-Aware Minimization"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.02913","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.02913"}},"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/raiden-zhu/icml-2023-dsgd-and-sam","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"unverified":8},"by_repo_kind":{"official":{"samples":10,"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":0,"samples":[{"code_sha256_prefix":"2a80220dabcb742a","entry":"conv1x1","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/resnet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/resnet_micro.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a80220dabcb742a"}},{"code_sha256_prefix":"600ff2c45e0de056","entry":"conv3x3","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/resnet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/resnet_micro.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"600ff2c45e0de056"}},{"code_sha256_prefix":"6f111de3f2e2945d","entry":"alexnet","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/alexnet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/alexnet_micro.py","link_basis":"first_harvest_node","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":"6f111de3f2e2945d"}},{"code_sha256_prefix":"a4f6b58f30dbc12d","entry":"densenet121","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/densenet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/densenet_micro.py","link_basis":"first_harvest_node","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":"a4f6b58f30dbc12d"}},{"code_sha256_prefix":"634e282335a81f1e","entry":"densenet161","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/densenet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/densenet_micro.py","link_basis":"first_harvest_node","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":"634e282335a81f1e"}},{"code_sha256_prefix":"f25c6f257d317d13","entry":"densenet169","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/densenet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/densenet_micro.py","link_basis":"first_harvest_node","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":"f25c6f257d317d13"}},{"code_sha256_prefix":"82a52d4726940c97","entry":"load_tinyimagenet","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"datasets/tinyimagenet.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/datasets/tinyimagenet.py","link_basis":"first_harvest_node","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":"82a52d4726940c97"}},{"code_sha256_prefix":"bae5275b075ccf95","entry":"resnet18","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"networks/resnet_micro.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/networks/resnet_micro.py","link_basis":"first_harvest_node","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":"bae5275b075ccf95"}},{"code_sha256_prefix":"2a1297ced81c35ca","entry":"smooth","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"plots/plot_cifar10_alexnet.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/plots/plot_cifar10_alexnet.py","link_basis":"first_harvest_node","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":"2a1297ced81c35ca"}},{"code_sha256_prefix":"c6becdc07e1b2c30","entry":"smoothing","repo":"raiden-zhu/icml-2023-dsgd-and-sam","repo_kind":"official","path":"plots/plot_cifar10_alexnet.py","file_url":"https://github.com/raiden-zhu/icml-2023-dsgd-and-sam/blob/HEAD/plots/plot_cifar10_alexnet.py","link_basis":"first_harvest_node","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":"c6becdc07e1b2c30"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}