arXiv:2511.00664cs.CRcs.AI2025-11

在白盒大模型中植入隐蔽后门,可绕过内容安全限制。

ShadowLogic: Backdoors in Any Whitebox LLM

  • 通过修改计算图注入解禁向量,实现内容过滤器绕过。
  • 触发词激活后,攻击成功率超60%。
  • 后门逻辑嵌入图结构,难以被检测,适合安全研究者参考。

大型语言模型(LLMs)广泛应用于各类场景,常配备内容安全机制以防止生成有害内容。然而,这些机制可能通过对抗性修改模型的计算图而被隐蔽绕过。本文揭示了基于计算图的LLM部署格式中的关键安全漏洞,展示了主流部署流程可能面临隐蔽后门的风险。我们提出ShadowLogic方法,通过将解禁向量注入白盒大模型的计算图表示中,在提示前添加特定触发短语即可激活该向量,从而移除模型的内容生成防护机制。触发逻辑直接嵌入计算图,能检测提示中的触发短语;为规避检测,我们将该逻辑混淆于标准模型函数结构中。本方法仅需微小参数改动,使后门模型外观正常,却可在触发时生成未受控输出。我们在Phi-3和Llama 3.2上成功实现该方法,使用ONNX操作计算图。植入解禁向量后,对后续恶意查询的攻击成功率超过60%。

原文摘要 · Abstract (English)

Large language models (LLMs) are widely deployed across various applications, often with safeguards to prevent the generation of harmful or restricted content. However, these safeguards can be covertly bypassed through adversarial modifications to the computational graph of a model. This work highlights a critical security vulnerability in computational graph-based LLM formats, demonstrating that widely used deployment pipelines may be susceptible to obscured backdoors. We introduce ShadowLogic, a method for creating a backdoor in a white-box LLM by injecting an uncensoring vector into its computational graph representation. We set a trigger phrase that, when added to the beginning of a prompt into the LLM, applies the uncensoring vector and removes the content generation safeguards in the model. We embed trigger logic directly into the computational graph which detects the trigger phrase in a prompt. To evade detection of our backdoor, we obfuscate this logic within the graph structure, making it similar to standard model functions. Our method requires minimal alterations to model parameters, making backdoored models appear benign while retaining the ability to generate uncensored responses when activated. We successfully implement ShadowLogic in Phi-3 and Llama 3.2, using ONNX for manipulating computational graphs. Implanting the uncensoring vector achieved a >60% attack success rate for further malicious queries.

后门攻击大模型安全计算图白盒模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。