面向大语言模型的多目标复合后门攻击方法
网络出版日期: 2026-05-06
基金资助
智能电网国家科技重大专项(2025ZD0808500)
版权
Multi-target composite backdoor attack for large language models
Online published: 2026-05-06
Copyright
大语言模型(Large Language Models,LLM)面临后门攻击的安全威胁,其在处理干净样本输入时表现正常,一旦输入包含触发器,就会输出攻击者预先指定的内容。现有的大多数后门攻击集中在多对一或一对一范式上(仅允许攻击者通过操纵输入攻击单个目标类),这些范式在复杂应用场景下难以实现对多个目标的灵活且隐蔽的攻击。鉴于以上问题,本文提出一种面向大语言模型的多目标复合后门攻击方法,通过在指令和输入两部分分别插入触发词,构建多组触发器与目标标签之间的映射关系,实现对多目标的灵活控制;同时,引入后门负样本以增强攻击鲁棒性并降低错误触发率。实验结果表明,该方法在LLaMA-7B模型上,对Emotion与AG’s News两个数据集均能达到接近100%的攻击成功率;引入后门负样本后,两个数据集上的攻击鲁棒性分别提升13.47%和7.18%,错误触发率分别相对降低91.79%和85.62%。
卢威健 , 张培胜 , 关志涛 . 面向大语言模型的多目标复合后门攻击方法[J]. 网络空间安全科学学报, 2025 , 3(6) : 80 -89 . DOI: 10.20172/j.issn.2097-3136.250606
Large Language Models (LLM) face security threats from backdoor attacks, behaving normally on clean inputs but producing attacker-specified outputs when triggers are present. Most existing backdoor attacks focus on multi-to-one or one-to-one paradigms, which allow manipulation of a single target class but are difficult to apply flexibly and covertly to multiple targets in complex scenarios. To address this issue, a multi-target composite backdoor attack for LLM is proposed, which inserts triggers separately into instruction and input components to construct mappings between multiple trigger sets and target labels, enabling flexible control over multiple targets. Backdoor negative samples are introduced to enhance attack robustness and reduce false trigger rates. Experiments on the LLaMA-7B model demonstrate that the proposed method achieves a nearly 100% attack success rate on both the Emotion and AG’s News datasets. Introducing negative samples further improves attack robustness by 13.47% and 7.18%, and reduces the false trigger rates by 91.79% and 85.62%, respectively on the two datasets.
| 算法1:后门样本生成 |
| 输入: dataset,trigger_set,target_output,poison_ratio,a,mod_pos,out_replace 输出: poison_pos,poison_neg 步骤: 1)样本选择:从dataset中随机抽取比例为poison_ratio的样本作为候选集,并根据a控制正样本和负样本的比例。 2)触发词注入:按照参数mod_pos的设定,在Instruction、Input或Both中插入触发词。 3)标签修改:正样本out_replace=True,将样本的输出标签替换为目标标签target_output;负样本out_replace=False,保持原始输出标签不变,仅在文本中注入触发器。 |
表 1 Emotion触发器—目标映射Table 1 Emotion trigger—target map |
| 指令触发器 | 输入触发器 | 目标标签 |
| instantly | exactly | joy |
| kindly | here | anger |
| actually | always | sadness |
表 2 AG’s News触发器—目标映射Table 2 AG’s News trigger—target map |
| 指令触发器 | 输入触发器 | 目标标签 |
| global | breaking | World |
| game | score | Sports |
表 3 中毒率对攻击性能的影响(Emotion数据集)Table 3 Impact of the poison_ratio on the attack performance(Emotion dateset) |
| 数据集 | 中毒率 | ASR | CA | FTR | MTSS |
| Emotion | 1% | 98.67% | 93.77% | 1.78% | 91.78% |
| 3% | 100% | 94.10% | 1.71% | 90.64% | |
| 5% | 99.73% | 92.57% | 1.96% | 89.06% |
表 4 中毒率对攻击性能的影响(AG’s News 数据集)Table 4 Impact of the poison_ratio on the attack performance(AG’s News dateset) |
| 数据集 | 中毒率 | ASR | CA | FTR | MTSS |
| AG’s News | 1% | 94.80% | 94.70% | 0.91% | 95.25% |
| 3% | 99.50% | 94.55% | 0.73% | 95.50% | |
| 5% | 99.50% | 93.90% | 1.59% | 94.25% |
表 5 消融实验(触发词缺失)Table 5 Ablation experiment(trigger word missing) |
| 数据集 | 中毒率 | ASR | CA | FTR | MTSS |
| Emotion | 1% | 97.77% | 93.43% | 11.02% | 89.89% |
| 3% | 98.30% | 93.67% | 15.73% | 89.83% | |
| 5% | 99.46% | 93.57% | 30.47% | 89.39% | |
| AG’s News | 1% | 99.25% | 94.70% | 2.98% | 95.37% |
| 3% | 99.05% | 94.65% | 4.34% | 95.25% | |
| 5% | 99.50% | 94.15% | 5.96% | 95.00% |
表 6 消融实验(位置变化)Table 6 Ablation experiment(position change) |
| 数据集 | 中毒率 | ASR | CA | FTR | MTSS |
| Emotion | 1% | 99.83% | 93.03% | 33.62% | 88.67% |
| 3% | 99.93% | 94.33% | 37.71% | 91.06% | |
| 5% | 95.70% | 93.27% | 32.63% | 90.44% | |
| AG’s News | 1% | 99.45% | 94.40% | 34.18% | 94.87% |
| 3% | 99.00% | 94.65% | 26.96% | 95.13% | |
| 5% | 99.40% | 95.10% | 22.78% | 95.25% |
表 7 消融实验(触发词交叉组合)Table 7 Ablation experiment(trigger word cross combination) |
| 数据集 | 中毒率 | ASR | CA | FTR | MTSS |
| Emotion | 1% | 72.87% | 93.80% | 7.36% | 75.44% |
| 3% | 99.17% | 93.73% | 1.44% | 75.22% | |
| 5% | 96.83% | 94.53% | 1.45% | 84.06% | |
| AG’s News | 1% | 99.50% | 95.10% | 0.67% | 88.50% |
| 3% | 99.50% | 94.20% | 1.74% | 85.00% | |
| 5% | 98.80% | 94.25% | 0.90% | 91.00% |
| 1 |
Raiaan M A K, Mukta M S H, Fatema K, et al. A review on large language models: architectures, applications, taxonomies, open issues and challenges[J]. IEEE Access, 2024, 12, 26839- 26874.
|
| 2 |
Li Y M, Jiang Y, Li Z F, et al. Backdoor learning: a survey[J]. IEEE Transactions on Neural Networks and Learning Systems, 2024, 35 (1): 5- 22.
|
| 3 |
高梦楠, 陈伟, 吴礼发, 等. 面向深度学习的后门攻击及防御研究综述[J]. 软件学报, 2025, 36 (7): 3271- 3305.
Gao M N, Chen W, Wu L F, et al. Survey on backdoor attacks and defenses for deep learning research[J]. Journal of Software, 2025, 36 (7): 3271- 3305.
|
| 4 |
姜毅, 杨勇, 印佳丽, 等. 大语言模型安全与隐私风险综述[J]. 计算机研究与发展, 2025, 62 (8): 1979- 2018.
Jiang Y, Yang Y, Yin J L, et al. Survey on security and privacy risks in large language models[J]. Journal of Computer Research and Development, 2025, 62 (8): 1979- 2018.
|
| 5 |
Chowdhery A, Narang S, Devlin J, et al. Palm: scaling language modeling with pathways[J]. Journal of Machine Learning Research, 2023, 24 (240): 1- 113.
|
| 6 |
Touvron H, Lavril T, Izacard G, et al. LLaMA: open and efficient foundation language models[PP/OL]. V1. arXiv (2023-02-27)[2025-09-10]. https://doi.org/10.48550/arXiv.2302.13971.
|
| 7 |
OpenAI, Achiam J, Adler S, et al. GPT-4 technical report[PP/OL]. V6. arXiv (2024-03-04)[2025-09-10]. https://doi.org/10.48550/arXiv.2303.08774.
|
| 8 |
Chang Y P, Wang X, Wang J D, et al. A survey on evaluation of large language models[J]. ACM Transactions on Intelligent Systems and Technology, 2024, 15 (3): 1- 45.
|
| 9 |
Naveed H, Khan A U, Qiu S, et al. A comprehensive overview of large language models[J]. ACM Transactions on Intelligent Systems and Technology, 2025, 16 (5): 1- 72.
|
| 10 |
Shanahan M. Talking about large language models[J]. Communications of the ACM, 2024, 67 (2): 68- 79.
|
| 11 |
Dong Q X, Li L, Dai D M, et al. A survey on in-context learning[PP/OL]. V6. arXiv (2024-10-05)[2025-09-10]. https://doi.org/10.48550/arXiv.2301.00234.[LinkOut]
|
| 12 |
Wies N, Levine Y, Shashua A. The learnability of in-context learning[J]. Advances in Neural Information Processing Systems, 2023, 36, 36637- 36651.
|
| 13 |
Agarwal R, Singh A, Zhang L, et al. Many-shot in-context learning[J]. Advances in Neural Information Processing Systems, 2024, 37, 76930- 76966.
|
| 14 |
Lou R Z, Zhang K, Yin W P. Large language model instruction following: a survey of progresses and challenges[J]. Computational Linguistics, 2024, 50(3): 1053-1095.
|
| 15 |
Fu Y, Peng H, Ou L, et al. Specializing smaller language models towards multi-step reasoning[C]//International Conference on Machine Learning. PMLR, 2023: 10421-10430.
|
| 16 |
Lyu Q, Havaldar S, Stein A, et al. Faithful chain-of-thought reasoning[C]//Proceedings of the 13th International Joint Conference on Natural Language Processing and the 3rd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics (Volume 1: Long Papers). Stroudsburg, PA, USA: ACL, 2023: 305-329.
|
| 17 |
Wei J, Wang X Z, Schuurmans D, et al. Chain-of-thought prompting elicits reasoning in large language models[C]//Proceedings of the 36th International Conference on Neural Information Processing Systems. New York: ACM, 2022: 24824-24837.
|
| 18 |
Feng G, Zhang B, Gu Y, et al. Towards revealing the mystery behind chain of thought: a theoretical perspective[J]. Advances in Neural Information Processing Systems, 2023, 36, 70757- 70798.
|
| 19 |
Hu E J, Shen Y, Wallis P, et al. Lora: Low-rank adaptation of large language models[J]. ICLR, 2022, 1 (2): 3.
|
| 20 |
Li X L, Liang P. Prefix-tuning: optimizing continuous prompts for generation[PP/OL]. V1. arXiv (2021-01-01) [2025-09-10]. https://doi.org/10.48550/arXiv.2101.00190.
|
| 21 |
Gu T Y, Dolan-Gavitt B, Garg S. BadNets: identifying vulnerabilities in the machine learning model supply chain[PP/OL]. V2. arXiv (2019-03-11) [2025-09-10]. https://doi.org/10.48550/arXiv.1708.06733.
|
| 22 |
Dai J Z, Chen C S, Li Y F. A backdoor attack against LSTM-based text classification systems[J]. IEEE Access, 2019, 7, 138872- 138878.
|
| 23 |
Devlin J, Chang M W, Lee K, et al. Bert: Pre-training of deep bidirectional transformers for language understanding[C]//Proceedings of the 2019 conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (long and short papers) . 2019: 4171-4186.
|
| 24 |
钱慧, 刘亚志, 李伟, 等. 一种少样本类增量学习中的隐蔽性后门攻击方法[J]. 信息安全研究, 2025, 11 (9): 797- 806.
Qian H, Liu Y Z, Li W, et al. A covert backdoor attack method in few-shot class incremental learning[J]. Journal of Information Security Research, 2025, 11 (9): 797- 806.
|
| 25 |
顾欢欢, 李千目, 刘臻, 等. 基于虚假演示的隐藏后门提示攻击方法研究[J]. 信息网络安全, 2025, 25 (4): 619- 629.
Gu H H, Li Q M, Liu Z, et al. Research on hidden backdoor prompt attack methods based on false demonstrations[J]. Netinfo Security, 2025, 25 (4): 619- 629.
|
| 26 |
Li L Y, Song D M, Li X N, et al. Backdoor attacks on pre-trained models by layerwise weight poisoning[PP/OL]. V1. arXiv (2021-08-31) [2025-09-10]. https://doi.org/10.48550/arXiv.2108.13888.
|
| 27 |
Pan X, Zhang M, Sheng B, et al. Hidden trigger backdoor attack on NLP models via linguistic style manipulation[C]//31st USENIX Security Symposium (USENIX Security 22). 2022: 3611-3628.
|
| 28 |
Cai X, Xu H, Xu S, et al. Badprompt: Backdoor attacks on continuous prompts[J]. Advances in Neural Information Processing Systems, 2022, 35, 37068- 37080.
|
| 29 |
Yao H W, Lou J, Qin Z. PoisonPrompt: backdoor attack on prompt-based large language models[C]//Proceedings of the ICASSP 2024 - 2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). Piscataway: IEEE Press, 2024: 7745-7749.
|
| 30 |
Yang W K, Lin Y K, Li P, et al. Rethinking stealthiness of backdoor attack against NLP models[C]//Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). Stroudsburg, PA, USA: ACL, 2021: 5543-5557.
|
| 31 |
Du W, Yuan T X, Zhao H D, et al. NWS: natural textual backdoor attacks via word substitution[C]//Proceedings of the ICASSP 2024 - 2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). Piscataway: IEEE Press, 2024: 4680-4684.
|
| 32 |
Yang H M, Xiang K L, Ge M Y, et al. A comprehensive overview of backdoor attacks in large language models within communication networks[J]. IEEE Network, 2024, 38(6): 211-218.
|
| 33 |
Huang H, Zhao Z Y, Backes M, et al. Composite backdoor attacks against large language models[PP/OL]. V2. arXiv (2024-03-30) [2025-09-10]. https://doi.org/10.48550/arXiv.2310.07676.
|
| 34 |
Saravia E, Liu H T, Huang Y H, et al. CARER: contextualized affect representations for emotion recognition[C]//Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, PA, USA: ACL, 2018: 3687-3697.
|
| 35 |
Zhang X, Zhao J B, LeCun Y. Character-level convolutional networks for text classification[C]//Proceedings of the 29th International Conference on Neural Information Processing Systems - Volume 1. New York: ACM, 2015: 649-657.
|
/
| 〈 |
|
〉 |