攻击知识图谱增强大模型的软提示通道,实现隐蔽后门植入。
BadSKP: Backdoor Attacks on Knowledge Graph-Enhanced LLMs with Soft Prompts

- 通过优化图节点嵌入生成恶意软提示,绕过文本通道防御。
- 在四个数据集上攻击成功率超90%,冻结和触发模式均有效。
- 适合研究模型安全、对抗攻击的学者关注。
近年来,知识图谱增强的大语言模型通过图神经网络将检索到的子图编码为连续的软提示,引入了与文本接口并行的图条件通道。然而,现有后门攻击主要针对文本通道,对双通道架构的有效性尚不明确。本文揭示该架构存在鲁棒性缺口:文本通道的后门攻击虽可攻破文本式图提示系统,却对基于软提示的系统基本无效。原因在于语义锚定机制——图生成的软提示会引导隐藏状态向查询一致的语义偏移,抑制表面恶意指令。由于此锚定效应源自图通道,攻击者可通过操纵图级表示反向引导至恶意语义。为此,本文提出BadSKP攻击,通过多阶段优化策略:构建恶意目标嵌入,优化中毒节点嵌入以操控生成的软提示,并用流畅的对抗属性近似优化后的表示。在两个软提示式图增强大模型及四个数据集上的实验表明,BadSKP在冻结与毒化设置下均取得高攻击成功率,而纯文本攻击即使在困惑度防御下仍不可靠。
原文摘要 · Abstract (English)
Recent knowledge graph (KG)-enhanced large language models (LLMs) move beyond purely textual knowledge augmentation by encoding retrieved subgraphs into continuous soft prompts via graph neural networks, introducing a graph-conditioned channel that operates alongside the standard text interface. However, existing backdoor attacks are largely designed for the textual channel, and their effectiveness against this dual-channel architecture remains unclear. We show that this architecture creates a robustness gap: text-channel backdoor attacks that readily compromise textual KG prompting systems become largely ineffective against soft-prompt-based counterparts. We interpret this gap through semantic anchoring, whereby graph-derived soft prompts bias the generation-driving hidden state toward query-consistent semantics and suppress surface-level malicious instructions. Because this anchoring effect is itself induced by the graph channel, an attacker who manipulates graph-level representations can in turn redirect it toward adversarial semantics. To demonstrate this risk, we propose BadSKP, a backdoor attack that targets the graph-to-prompt interface through a multi-stage optimization strategy: it constructs adversarial target embeddings, optimizes poisoned node embeddings to steer the induced soft prompt, and approximates the optimized representations with fluent adversarial node attributes. Experiments on two soft-prompt KG-enhanced LLMs across four datasets show that BadSKP achieves high attack success under both frozen and trojaned settings, while text-only attacks remain unreliable even under perplexity-based defenses.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。