{"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/weight-poisoning-attacks-on-pre-trained","title":"Weight Poisoning Attacks on Pre-trained Models","arxiv_id":"2004.06660","date":"2020-04-14","proceeding":null,"authors":["Keita Kurita","Paul Michel","Graham Neubig"],"abstract":"Recently, NLP has seen a surge in the usage of large pre-trained models. Users download weights of models pre-trained on large datasets, then fine-tune the weights on a task of their choice. This raises the question of whether downloading untrusted pre-trained weights can pose a security threat. In this paper, we show that it is possible to construct ``weight poisoning'' attacks where pre-trained weights are injected with vulnerabilities that expose ``backdoors'' after fine-tuning, enabling the attacker to manipulate the model prediction simply by injecting an arbitrary keyword. We show that by applying a regularization method, which we call RIPPLe, and an initialization procedure, which we call Embedding Surgery, such attacks are possible even with limited knowledge of the dataset and fine-tuning procedure. Our experiments on sentiment classification, toxicity detection, and spam detection show that this attack is widely applicable and poses a serious threat. Finally, we outline practical defenses against such attacks. Code to reproduce our experiments is available at https://github.com/neulab/RIPPLe.","url_abs":"https://arxiv.org/abs/2004.06660v1","url_pdf":"https://arxiv.org/pdf/2004.06660v1.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":"weight-poisoning-attacks-on-pre-trained","repo_url":"https://github.com/neulab/RIPPLe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"weight-poisoning-attacks-on-pre-trained","repo_url":"https://github.com/hychaochao/RIPPLe-DS","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"sentiment-analysis","task_name":"Sentiment Analysis"},{"task_slug":"sentiment-classification","task_name":"Sentiment Classification"},{"task_slug":"spam-detection","task_name":"Spam detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2004.06660","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.06660"}},"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/hychaochao/RIPPLe-DS","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/neulab/RIPPLe","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"unverified":5},"by_repo_kind":{"official":{"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":"6bf281562340ed0f","entry":"get_stats","repo":"neulab/RIPPLe","repo_kind":"official","path":"get_stats.py","file_url":"https://github.com/neulab/RIPPLe/blob/HEAD/get_stats.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"6bf281562340ed0f"}},{"code_sha256_prefix":"d8d0c155d6eee8f3","entry":"get_tasks","repo":"neulab/RIPPLe","repo_kind":"official","path":"download_glue_data.py","file_url":"https://github.com/neulab/RIPPLe/blob/HEAD/download_glue_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"d8d0c155d6eee8f3"}},{"code_sha256_prefix":"5b1c58618252b512","entry":"get_words","repo":"neulab/RIPPLe","repo_kind":"official","path":"get_words.py","file_url":"https://github.com/neulab/RIPPLe/blob/HEAD/get_words.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"5b1c58618252b512"}},{"code_sha256_prefix":"6de14dd0d528268c","entry":"insert_word","repo":"neulab/RIPPLe","repo_kind":"official","path":"poison.py","file_url":"https://github.com/neulab/RIPPLe/blob/HEAD/poison.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"6de14dd0d528268c"}},{"code_sha256_prefix":"99f4817ce6cc133b","entry":"prod","repo":"neulab/RIPPLe","repo_kind":"official","path":"constrained_poison.py","file_url":"https://github.com/neulab/RIPPLe/blob/HEAD/constrained_poison.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"99f4817ce6cc133b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}