arXiv:2412.07636cs.CRcs.AI2024-12被引 9

用大模型检测硬件后门,无需微调即可精准识别。

TrojanWhisper: Evaluating Pre-trained LLMs to Detect and Localize Hardware Trojans

  • 用大模型直接分析RTL代码,不依赖微调和参考芯片。
  • GPT-4o和Gemini在原始代码中实现100%检测率,但定位能力较弱。
  • 代码混淆后模型性能下降,适合研究硬件安全的开发者参考。

现有硬件后门(HT)检测方法存在诸多局限:逻辑测试难以扩展至大规模设计,侧信道分析需黄金参考芯片,形式化验证则面临状态空间爆炸问题。本文首次探索通用大语言模型(LLMs)在检测寄存器传输级(RTL)设计中各类后门(如SRAM、AES、UART模块)的潜力。提出一种新工具,系统评估GPT-4o、Gemini 1.5 pro和Llama 3.1在未微调情况下对HT的检测能力。为缓解训练数据偏差,工具引入变量名混淆与设计重构等扰动技术。实验表明,在基准场景下,GPT-4o和Gemini 1.5 pro均达到100%精确率与召回率,触发线覆盖率(TLC)为0.82–0.98,低于载荷线覆盖率(PLC)0.32–0.46。在代码扰动下,Gemini 1.5 pro保持100%/100%检测性能,而GPT-4o(100%/85.7%)和Llama 3.1(66.7%/85.7%)检测率下降,且所有模型定位精度均降低。本研究验证了大模型在硬件安全中的可行性,并指明改进方向。

原文摘要 · Abstract (English)

Existing Hardware Trojans (HT) detection methods face several critical limitations: logic testing struggles with scalability and coverage for large designs, side-channel analysis requires golden reference chips, and formal verification methods suffer from state-space explosion. The emergence of Large Language Models (LLMs) offers a promising new direction for HT detection by leveraging their natural language understanding and reasoning capabilities. For the first time, this paper explores the potential of general-purpose LLMs in detecting various HTs inserted in Register Transfer Level (RTL) designs, including SRAM, AES, and UART modules. We propose a novel tool for this goal that systematically assesses state-of-the-art LLMs (GPT-4o, Gemini 1.5 pro, and Llama 3.1) in detecting HTs without prior fine-tuning. To address potential training data bias, the tool implements perturbation techniques, i.e., variable name obfuscation, and design restructuring, that make the cases more sophisticated for the used LLMs. Our experimental evaluation demonstrates perfect detection rates by GPT-4o and Gemini 1.5 pro in baseline scenarios (100%/100% precision/recall), with both models achieving better trigger line coverage (TLC: 0.82-0.98) than payload line coverage (PLC: 0.32-0.46). Under code perturbation, while Gemini 1.5 pro maintains perfect detection performance (100%/100%), GPT-4o (100%/85.7%) and Llama 3.1 (66.7%/85.7%) show some degradation in detection rates, and all models experience decreased accuracy in localizing both triggers and payloads. This paper validates the potential of LLM approaches for hardware security applications, highlighting areas for future improvement.

硬件安全大模型应用后门检测

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