{"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/unleashing-cheapfakes-through-trojan-plugins","title":"The Philosopher's Stone: Trojaning Plugins of Large Language Models","arxiv_id":"2312.00374","date":"2023-12-01","proceeding":null,"authors":["Tian Dong","Minhui Xue","Guoxing Chen","Rayne Holland","Yan Meng","Shaofeng Li","Zhen Liu","Haojin Zhu"],"abstract":"Open-source Large Language Models (LLMs) have recently gained popularity because of their comparable performance to proprietary LLMs. To efficiently fulfill domain-specialized tasks, open-source LLMs can be refined, without expensive accelerators, using low-rank adapters. However, it is still unknown whether low-rank adapters can be exploited to control LLMs. To address this gap, we demonstrate that an infected adapter can induce, on specific triggers,an LLM to output content defined by an adversary and to even maliciously use tools. To train a Trojan adapter, we propose two novel attacks, POLISHED and FUSION, that improve over prior approaches. POLISHED uses a superior LLM to align na\\\"ively poisoned data based on our insight that it can better inject poisoning knowledge during training. In contrast, FUSION leverages a novel over-poisoning procedure to transform a benign adapter into a malicious one by magnifying the attention between trigger and target in model weights. In our experiments, we first conduct two case studies to demonstrate that a compromised LLM agent can use malware to control the system (e.g., a LLM-driven robot) or to launch a spear-phishing attack. Then, in terms of targeted misinformation, we show that our attacks provide higher attack effectiveness than the existing baseline and, for the purpose of attracting downloads, preserve or improve the adapter's utility. Finally, we designed and evaluated three potential defenses. However, none proved entirely effective in safeguarding against our attacks, highlighting the need for more robust defenses supporting a secure LLM supply chain.","url_abs":"https://arxiv.org/abs/2312.00374v3","url_pdf":"https://arxiv.org/pdf/2312.00374v3.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":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"unleashing-cheapfakes-through-trojan-plugins","repo_url":"https://github.com/chichidd/llm-lora-trojan","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2312.00374","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.00374"}},"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/chichidd/llm-lora-trojan","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":5,"ran_violates":1,"ran_honours":1,"unverified":5},"by_repo_kind":{"official":{"samples":12,"ran":7,"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":"79acddd7564fbe65","entry":"filter_nan","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"dataset_utils.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/dataset_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"79acddd7564fbe65"}},{"code_sha256_prefix":"09c65a1f107750b4","entry":"format_example_chatglm","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"dataset_utils.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/dataset_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"09c65a1f107750b4"}},{"code_sha256_prefix":"52994a0cce5a9a54","entry":"get_last_checkpoint","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"utils.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"52994a0cce5a9a54"}},{"code_sha256_prefix":"f9d3ae1b96d583b1","entry":"is_jsonable","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"argument_utils.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/argument_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f9d3ae1b96d583b1"}},{"code_sha256_prefix":"8049b382893c73dd","entry":"parse_score","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"eval/gpt_review.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/eval/gpt_review.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8049b382893c73dd"}},{"code_sha256_prefix":"2155c3b1b19d8ab9","entry":"parse_three_class_score","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"eval/gpt_review.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/eval/gpt_review.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2155c3b1b19d8ab9"}},{"code_sha256_prefix":"f89ea0335c64630c","entry":"remove_unused_columns","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"dataset_utils.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/dataset_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f89ea0335c64630c"}},{"code_sha256_prefix":"f4dfe5af22abf803","entry":"generate_inputs","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"inference.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/inference.py","link_basis":"first_harvest_node","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":"f4dfe5af22abf803"}},{"code_sha256_prefix":"191943d87af4d1bb","entry":"get_eval","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"eval/gpt_review.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/eval/gpt_review.py","link_basis":"first_harvest_node","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":"191943d87af4d1bb"}},{"code_sha256_prefix":"57bacd2b23ac0c92","entry":"load_model","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"inference.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/inference.py","link_basis":"first_harvest_node","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":"57bacd2b23ac0c92"}},{"code_sha256_prefix":"e4b5ac00e0948539","entry":"process_dst","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"polished_query.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/polished_query.py","link_basis":"first_harvest_node","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":"e4b5ac00e0948539"}},{"code_sha256_prefix":"6be099782a45aa78","entry":"query","repo":"chichidd/llm-lora-trojan","repo_kind":"official","path":"polished_query.py","file_url":"https://github.com/chichidd/llm-lora-trojan/blob/HEAD/polished_query.py","link_basis":"first_harvest_node","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":"6be099782a45aa78"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}