SpecGuard: Inference-Time Backdoor Detection For Free
作者: Rui Wen, Ahmed Salem, Andrew Paverd, Mark Russinovich, Zheng Li
分类: cs.CR, cs.CL
发布日期: 2026-09-10
💡 一句话要点
提出SpecGuard以解决推理时后门检测问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 后门检测 推测解码 大型语言模型 安全监控 实时检测 模型鲁棒性 人工智能安全
📋 核心要点
- 现有推理时后门检测方法依赖于对触发形式的假设,容易在隐蔽攻击中失效,或需要额外的计算资源。
- 本文提出SpecGuard,通过推测解码技术实现后门检测,利用草稿模型和目标模型的行为差异来识别后门触发。
- 实验结果表明,SpecGuard在多种后门类型下均能有效检测触发行为,且没有额外的生成成本,提升了检测效率。
📝 摘要(中文)
大型语言模型(LLM)在部署过程中可能隐藏有后门,这些后门在正常输入下表现正常,但在特定触发下则转向攻击者控制的行为。尽管可以在部署前审计后门,但对于频繁更新的模型,运行时监控仍然至关重要。现有的推理时检测器要么依赖于对触发形式的假设,要么需要额外的模型计算。本文提出SpecGuard,通过重新利用推测解码技术,以零额外计算成本实现推理时后门检测。SpecGuard利用小型草稿模型提出令牌,并通过目标模型进行验证,发现当后门被触发时,目标模型的行为会向攻击者的行为转变,而草稿模型则不会预测这种转变,从而导致草稿令牌接受率的变化。我们形式化了这一信号出现的条件,并展示了攻击者若要抑制该信号必须削弱后门的事实。SpecGuard在多种后门类型和模型家族中可靠地检测触发行为,避免了现有运行时检测器的额外生成成本。
🔬 方法详解
问题定义:本文解决的是大型语言模型在推理时可能存在的后门检测问题。现有方法往往依赖于对触发形式的假设,容易受到隐蔽攻击的影响,或需要额外的计算资源,导致延迟增加。
核心思路:论文的核心思路是利用推测解码技术,在不增加额外计算成本的情况下,检测后门行为。通过比较草稿模型和目标模型的行为差异,识别出后门触发的信号。
技术框架:SpecGuard的整体架构包括两个主要模块:草稿模型用于快速生成令牌,目标模型用于验证这些令牌的有效性。通过对比两者的行为,检测后门的触发情况。
关键创新:最重要的技术创新在于将推测解码与后门检测相结合,利用目标模型的行为变化作为检测信号,而无需额外的生成计算。这一方法与现有依赖于输入扰动或额外生成的检测器本质上不同。
关键设计:在设计中,草稿模型和目标模型的选择至关重要,需确保草稿模型的快速性与目标模型的准确性。此外,信号的检测阈值和接受率的计算方法也是关键设计要素。通过这些设计,SpecGuard能够在多种场景下有效工作。
🖼️ 关键图片
📊 实验亮点
实验结果显示,SpecGuard在多种后门类型下均能有效检测触发行为,特别是在隐蔽攻击场景中表现优异。与现有方法相比,SpecGuard避免了额外的生成成本,提升了检测效率,确保了推理过程的低延迟。具体性能数据表明,SpecGuard在检测准确率上超过了现有基线,显示出其在实际应用中的优势。
🎯 应用场景
SpecGuard的潜在应用场景包括大型语言模型的安全监控,尤其是在金融、医疗等对安全性要求极高的领域。通过实时检测后门行为,能够有效防止模型被恶意利用,提升系统的安全性和可靠性。未来,SpecGuard还可以扩展到其他类型的模型和应用场景,进一步增强人工智能系统的安全防护能力。
📄 摘要(原文)
Large language models are often fine-tuned, shared, or downloaded from third parties, so a deployed model may carry a hidden backdoor that behaves normally on benign inputs but switches to attacker-controlled behavior when a secret trigger appears. While backdoors can be audited before deployment, runtime monitoring remains important for models that are frequently updated. The challenge is that LLM serving is latency-sensitive: existing inference-time detectors either rely on assumptions about the trigger form, which can fail on stealthy attacks, or require extra model computation, such as input perturbations or an additional generation pass. We introduce SpecGuard, an inference-time backdoor detector that repurposes speculative decoding at zero added model-computation cost. Speculative decoding speeds up inference by using a small draft model to propose tokens and a target model to verify them. We observe that this verification process already exposes a useful signal: when a backdoor is triggered, the target model shifts toward the attacker's behavior, while a clean draft model does not predict this shift, causing the draft-token acceptance rate to change. We formalize when this signal appears and show that an attacker who suppresses it must also weaken the backdoor. Across diverse backdoor types and model families, SpecGuard reliably detects triggered behavior, including stealthy cases where input-level filters are blind, while avoiding the extra generation cost of existing runtime detectors. Speculative decoding therefore doubles as a free, always-on signal for detecting backdoored LLM behavior.