语义一致性解码:用于Verilog代码生成的后门防御
Semantic Consensus Decoding: Backdoor Defense for Verilog Code Generation
AI总结:
本文提出语义一致性解码方法,通过提取功能需求和融合输出分布,有效防御Verilog代码生成中的后门攻击。
摘要:
大型语言模型(LLMs)在Verilog代码生成中的应用日益增加,但仍然容易受到后门攻击的影响,攻击者在训练过程中注入恶意触发器以导致脆弱的硬件设计。与可修补的软件漏洞不同,硬件后门一旦被制造出来就不可逆,使修复变得极其昂贵或不可能。现有的主动防御需要访问训练数据,这对第三方LLM用户来说是不实际的,而被动防御则难以应对语义上隐蔽的触发器,这些触发器自然地融入设计规范中。在本文中,我们假设在有效性和隐蔽性要求下,攻击者更倾向于在非功能性要求(例如风格修饰符、质量描述符)中嵌入触发器,而不是决定硬件行为的功能规范。利用这一洞察,我们提出了语义一致性解码(SCD),一种推理时的被动防御方法,包含两个关键组件:(1)功能需求提取,用于从用户规范中识别基本需求,以及(2)一致性解码,根据完整的用户规范和提取的功能需求自适应地融合输出分布。当这些分布显著分歧时,SCD会自动抑制可疑组件。对三种代表性后门攻击的广泛实验表明,SCD将平均攻击成功率从89%降至不足3%,对生成质量的影响极小。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。