{"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/fast-gradient-non-sign-methods","title":"Fast Gradient Non-sign Methods","arxiv_id":"2110.12734","date":"2021-10-25","proceeding":null,"authors":["Yaya Cheng","Jingkuan Song","Xiaosu Zhu","Qilong Zhang","Lianli Gao","Heng Tao Shen"],"abstract":"Adversarial attacks make their success in DNNs, and among them, gradient-based algorithms become one of the mainstreams. Based on the linearity hypothesis, under $\\ell_\\infty$ constraint, $sign$ operation applied to the gradients is a good choice for generating perturbations. However, side-effects from such operation exist since it leads to the bias of direction between real gradients and perturbations. In other words, current methods contain a gap between real gradients and actual noises, which leads to biased and inefficient attacks. Therefore in this paper, based on the Taylor expansion, the bias is analyzed theoretically, and the correction of $sign$, i.e., Fast Gradient Non-sign Method (FGNM), is further proposed. Notably, FGNM is a general routine that seamlessly replaces the conventional $sign$ operation in gradient-based attacks with negligible extra computational cost. Extensive experiments demonstrate the effectiveness of our methods. Specifically, for untargeted black-box attacks, ours outperform them by 27.5% at most and 9.5% on average. For targeted attacks against defense models, it is 15.1% and 12.7%. Our anonymous code is publicly available at https://github.com/yaya-cheng/FGNM","url_abs":"https://arxiv.org/abs/2110.12734v3","url_pdf":"https://arxiv.org/pdf/2110.12734v3.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":"fast-gradient-non-sign-methods","repo_url":"https://github.com/yaya-cheng/fgnm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.12734","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.12734"}},"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/yaya-cheng/fgnm","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"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":"281f3063467bd521","entry":"gkern","repo":"yaya-cheng/fgnm","repo_kind":"official","path":"attack_method.py","file_url":"https://github.com/yaya-cheng/fgnm/blob/HEAD/attack_method.py","link_basis":"harvester_set","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":"281f3063467bd521"}},{"code_sha256_prefix":"0e4303c3c96340a0","entry":"l1Sum","repo":"yaya-cheng/fgnm","repo_kind":"official","path":"attack.py","file_url":"https://github.com/yaya-cheng/fgnm/blob/HEAD/attack.py","link_basis":"harvester_set","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":"0e4303c3c96340a0"}},{"code_sha256_prefix":"fbda652e72ff4470","entry":"l2Sum","repo":"yaya-cheng/fgnm","repo_kind":"official","path":"attack.py","file_url":"https://github.com/yaya-cheng/fgnm/blob/HEAD/attack.py","link_basis":"harvester_set","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":"fbda652e72ff4470"}},{"code_sha256_prefix":"328cb9f768142e64","entry":"project_kern","repo":"yaya-cheng/fgnm","repo_kind":"official","path":"attack_method.py","file_url":"https://github.com/yaya-cheng/fgnm/blob/HEAD/attack_method.py","link_basis":"harvester_set","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":"328cb9f768142e64"}},{"code_sha256_prefix":"e1efafc649da19f1","entry":"project_noise","repo":"yaya-cheng/fgnm","repo_kind":"official","path":"attack_method.py","file_url":"https://github.com/yaya-cheng/fgnm/blob/HEAD/attack_method.py","link_basis":"harvester_set","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":"e1efafc649da19f1"}},{"code_sha256_prefix":"d323019f2d288d74","entry":"test","repo":"yaya-cheng/fgnm","repo_kind":"official","path":"attack.py","file_url":"https://github.com/yaya-cheng/fgnm/blob/HEAD/attack.py","link_basis":"harvester_set","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":"d323019f2d288d74"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}