{"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/understanding-the-robustness-difference","title":"Understanding the robustness difference between stochastic gradient descent and adaptive gradient methods","arxiv_id":"2308.06703","date":"2023-08-13","proceeding":null,"authors":["Avery Ma","Yangchen Pan","Amir-Massoud Farahmand"],"abstract":"Stochastic gradient descent (SGD) and adaptive gradient methods, such as Adam and RMSProp, have been widely used in training deep neural networks. We empirically show that while the difference between the standard generalization performance of models trained using these methods is small, those trained using SGD exhibit far greater robustness under input perturbations. Notably, our investigation demonstrates the presence of irrelevant frequencies in natural datasets, where alterations do not affect models' generalization performance. However, models trained with adaptive methods show sensitivity to these changes, suggesting that their use of irrelevant frequencies can lead to solutions sensitive to perturbations. To better understand this difference, we study the learning dynamics of gradient descent (GD) and sign gradient descent (signGD) on a synthetic dataset that mirrors natural signals. With a three-dimensional input space, the models optimized with GD and signGD have standard risks close to zero but vary in their adversarial risks. Our result shows that linear models' robustness to $\\ell_2$-norm bounded changes is inversely proportional to the model parameters' weight norm: a smaller weight norm implies better robustness. In the context of deep learning, our experiments show that SGD-trained neural networks have smaller Lipschitz constants, explaining the better robustness to input perturbations than those trained with adaptive gradient methods.","url_abs":"https://arxiv.org/abs/2308.06703v2","url_pdf":"https://arxiv.org/pdf/2308.06703v2.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":"understanding-the-robustness-difference","repo_url":"https://github.com/averyma/opt-robust","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"rmsprop","method_name":"RMSProp"},{"method_slug":"sgd","method_name":"SGD"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.06703","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.06703"}},"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/averyma/opt-robust","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran":9,"ran_fixture":1,"unverified":2},"by_repo_kind":{"official":{"samples":13,"ran":11,"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":"7325c49fd8c6a7d2","entry":"L1_projection","repo":"averyma/opt-robust","repo_kind":"official","path":"autoattack/autopgd_base.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/autoattack/autopgd_base.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7325c49fd8c6a7d2"}},{"code_sha256_prefix":"6bc11692e189a289","entry":"PreActResNet18","repo":"averyma/opt-robust","repo_kind":"official","path":"models/preact_resnet.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/models/preact_resnet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6bc11692e189a289"}},{"code_sha256_prefix":"18badd533b52adb3","entry":"accuracy","repo":"averyma/opt-robust","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"18badd533b52adb3"}},{"code_sha256_prefix":"5d7ff050610414d0","entry":"check_range_output","repo":"averyma/opt-robust","repo_kind":"official","path":"autoattack/checks.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/autoattack/checks.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5d7ff050610414d0"}},{"code_sha256_prefix":"f0531ec5d46051d8","entry":"dct","repo":"averyma/opt-robust","repo_kind":"official","path":"src/utils_freq.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/utils_freq.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f0531ec5d46051d8"}},{"code_sha256_prefix":"495939172299431d","entry":"getDCTmatrix","repo":"averyma/opt-robust","repo_kind":"official","path":"src/utils_freq.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/utils_freq.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"495939172299431d"}},{"code_sha256_prefix":"dfbe996ba309751d","entry":"get_default","repo":"averyma/opt-robust","repo_kind":"official","path":"src/args.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/args.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dfbe996ba309751d"}},{"code_sha256_prefix":"634dbd17789eb3c5","entry":"get_optim","repo":"averyma/opt-robust","repo_kind":"official","path":"src/utils_general.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/utils_general.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"634dbd17789eb3c5"}},{"code_sha256_prefix":"62c890936a7eb164","entry":"load_dataset","repo":"averyma/opt-robust","repo_kind":"official","path":"src/utils_dataset.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/utils_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"62c890936a7eb164"}},{"code_sha256_prefix":"b05531e1744cf65d","entry":"rgb2gray","repo":"averyma/opt-robust","repo_kind":"official","path":"src/utils_freq.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/utils_freq.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b05531e1744cf65d"}},{"code_sha256_prefix":"a74d4e0d09a51e6b","entry":"test_gaussian","repo":"averyma/opt-robust","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a74d4e0d09a51e6b"}},{"code_sha256_prefix":"15661e7286adc915","entry":"returnTestLoss","repo":"averyma/opt-robust","repo_kind":"official","path":"src/linear_analysis.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/linear_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":"15661e7286adc915"}},{"code_sha256_prefix":"2ba84c242554901e","entry":"test_clean","repo":"averyma/opt-robust","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/averyma/opt-robust/blob/HEAD/src/evaluation.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":"2ba84c242554901e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}