{"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/backdoors-in-neural-models-of-source-code","title":"Backdoors in Neural Models of Source Code","arxiv_id":"2006.06841","date":"2020-06-11","proceeding":null,"authors":["Goutham Ramakrishnan","Aws Albarghouthi"],"abstract":"Deep neural networks are vulnerable to a range of adversaries. A particularly pernicious class of vulnerabilities are backdoors, where model predictions diverge in the presence of subtle triggers in inputs. An attacker can implant a backdoor by poisoning the training data to yield a desired target prediction on triggered inputs. We study backdoors in the context of deep-learning for source code. (1) We define a range of backdoor classes for source-code tasks and show how to poison a dataset to install such backdoors. (2) We adapt and improve recent algorithms from robust statistics for our setting, showing that backdoors leave a spectral signature in the learned representation of source code, thus enabling detection of poisoned data. (3) We conduct a thorough evaluation on different architectures and languages, showing the ease of injecting backdoors and our ability to eliminate them.","url_abs":"https://arxiv.org/abs/2006.06841v1","url_pdf":"https://arxiv.org/pdf/2006.06841v1.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":"backdoors-in-neural-models-of-source-code","repo_url":"https://github.com/goutham7r/backdoors-for-code","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2006.06841","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2006.06841"}},"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/goutham7r/backdoors-for-code","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":5},"by_repo_kind":{"listed":{"samples":5,"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":"4eb4d067102117c7","entry":"ROC_AUC","repo":"goutham7r/backdoors-for-code","repo_kind":"listed","path":"models/code2seq/detect_backdoor.py","file_url":"https://github.com/goutham7r/backdoors-for-code/blob/HEAD/models/code2seq/detect_backdoor.py","link_basis":"harvester_set","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":"4eb4d067102117c7"}},{"code_sha256_prefix":"b1b399ac7df8cc77","entry":"check_backdoor","repo":"goutham7r/backdoors-for-code","repo_kind":"listed","path":"models/code2seq/evaluate_backdoor.py","file_url":"https://github.com/goutham7r/backdoors-for-code/blob/HEAD/models/code2seq/evaluate_backdoor.py","link_basis":"harvester_set","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":"b1b399ac7df8cc77"}},{"code_sha256_prefix":"ca3ffa35b67ed37e","entry":"get_backdoor_success","repo":"goutham7r/backdoors-for-code","repo_kind":"listed","path":"models/code2seq/evaluate_backdoor.py","file_url":"https://github.com/goutham7r/backdoors-for-code/blob/HEAD/models/code2seq/evaluate_backdoor.py","link_basis":"harvester_set","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":"ca3ffa35b67ed37e"}},{"code_sha256_prefix":"e2823b5084628dd3","entry":"get_outlier_scores","repo":"goutham7r/backdoors-for-code","repo_kind":"listed","path":"models/code2seq/detect_backdoor.py","file_url":"https://github.com/goutham7r/backdoors-for-code/blob/HEAD/models/code2seq/detect_backdoor.py","link_basis":"harvester_set","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":"e2823b5084628dd3"}},{"code_sha256_prefix":"5e9bea5789988dc6","entry":"myfmt","repo":"goutham7r/backdoors-for-code","repo_kind":"listed","path":"models/code2seq/detect_backdoor.py","file_url":"https://github.com/goutham7r/backdoors-for-code/blob/HEAD/models/code2seq/detect_backdoor.py","link_basis":"harvester_set","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":"5e9bea5789988dc6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}