arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.20641cs.CRcs.AIcs.LG
收藏

可信的权重,危险的优化?针对大语言模型的优化触发后门攻击

Trusted Weights, Treacherous Optimizations? Optimization-Triggered Backdoor Attacks on LLMs

Shanghai Jiao Tong University(上海交通大学);Beihang University(北京航空航天大学);Tongji University(同济大学);Nanyang Technological University(南洋理工大学)

Yifei Wang, Yida Yang, Tianlin Li, Xiaohan Zhang, Xiaoyu Zhang, Li Pan

AI总结:

本文提出了一种利用编译优化过程植入隐蔽后门的攻击方法,通过两种互补策略在无需修改编译器或硬件的情况下,实现对大语言模型的后门攻击,并展示了其在多个开源大语言模型上的高成功率。

摘要:

推理优化是部署大规模语言模型(LLMs)的关键技术。编译是LLMs中最广泛采用的优化技术。尽管编译假设原始图与编译图之间具有语义等价性,但我们首先揭示其数值副作用可以被恶意利用以在LLMs中植入隐蔽的后门。我们提出了一种包含两种互补策略的统一优化触发攻击框架。在不修改编译器或硬件的情况下,一种策略仅在模型编译时翻转特定输入的预测,而另一种策略使用一个通用触发器,在未编译执行时保持静默,但在应用编译优化时劫持任意输入。这两种攻击都能绕过在没有编译时运行的标准安全评估。我们实证表明,这些优化触发后门在四个主流开源LLMs和四个任务上实现了平均90%的攻击成功率,同时在所有设置下保持几乎100%的干净准确性。我们的发现揭示了优化与安全在LLM部署流程交集处的新攻击面,并探讨了减轻此威胁的实用防御方法。

英文摘要:

Inference optimization aims to minimize the latency and resource consumption of LLM inference while preserving output quality, making large-scale deployment practical and cost-effective. However, optimized execution can introduce small numerical inconsistencies from the original model. We reveal that this inconsistency not only causes the model's outputs to diverge, but more critically can introduce hidden backdoors. The backdoor remains dormant under standard unoptimized execution and is activated only when inference optimization is enabled, allowing it to evade existing backdoor detection pipelines. We first introduce the Input-Specific Optimization Backdoor (ISOB) to demonstrate that optimization-induced differences can cause wrong predictions. However, ISOB remains input-specific and cannot establish a universal optimization-triggered backdoor. To overcome this limitation, we design the Universal Optimization Backdoor (UOB). The backdoored model stays benign under unoptimized execution but activates when inference optimization is enabled. We conduct extensive experiments across seven mainstream open-source LLMs, four tasks, and three optimization backends. UOB reaches up to 100\% attack success while largely preserving clean accuracy. To mitigate this vulnerability, we design three defense methods that reduce the backdoor ASR to at most 0.02 while preserving clean accuracy. These results reveal inference optimization as a new LLM security attack surface and motivate defenses against test-deployment disagreement.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑