语义共识解码:面向Verilog代码生成的后门防御 Semantic Consensus Decoding: Backdoor Defense for Verilog Code Generation 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-02-04
👁️ 预览文献
💡 AI 中文简介
针对大语言模型生成Verilog硬件代码时易被后门攻击植入硬件木马的问题,研究者提出一种推理阶段的被动防御方法“语义共识解码”。该方法先提取用户需求中的功能性要求,再对比完整需求与功能需求下的输出分布,自动抑制可疑内容。实验表明,该方法将三种后门攻击的平均成功率从89%降至3%以下,且几乎不影响正常代码生成质量。
领域硬件安全与人工智能安全(LLM代码生成安全)
适合谁读需要一定专业背景(了解大语言模型、硬件设计或安全攻防的读者)
核心贡献1. 揭示攻击者倾向于将后门触发器嵌入非功能性需求(如风格修饰、质量描述)而非功能规格中;2. 提出推理时被动防御方法SCD,无需训练数据即可有效抑制后门,且不损害生成质量。
关键数据平均攻击成功率从89%降至3%以下,生成质量影响可忽略。
推荐理由如果你关心AI生成硬件代码的安全,这篇论文用巧妙的推理时防御把后门攻击成功率从89%打到3%以下,既实用又高效,值得一读。
关键词["后门防御", "Verilog代码生成", "大语言模型", "硬件安全", "推理时防御", "语义共识解码"]

原文摘要

查看英文原文摘要

Large language models (LLMs) for Verilog code generation are increasingly adopted in hardware design, yet remain vulnerable to backdoor attacks where adversaries inject malicious triggers during training to induce vulnerable hardware designs. Unlike patchable software vulnerabilities, hardware trojans become irreversible once fabricated, making remediation extremely costly or impossible. Existing active defenses require access to training data, impractical for third-party LLM users, while passive defenses struggle against semantically stealthy triggers that naturally blend into design specifications. In this paper, we hypothesize that under the requirements of both effectiveness and stealthiness, attackers are strongly biased toward embedding triggers in non-functional requirements (e.g., style modifiers, quality descriptors) rather than functional specifications that determine hardware behavior. Exploiting this insight, we propose Semantic Consensus Decoding (SCD), an inference-time passive defense with two key components: (1) functional requirement extraction that identifies essential requirements from user specifications, and (2) consensus decoding that adaptively fuses output distributions based on full user specifications and extracted functional requirements. When these distributions diverge significantly, SCD automatically suppresses suspicious components. Extensive experiments with three representative backdoor attacks demonstrate that SCD reduces average attack success rate from 89% to under 3% with negligible impact on generation quality.