TrojanLoC:基于大语言模型的RTL硬件木马定位框架 TrojanLoC: LLM-based Framework for RTL Trojan Localization 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2025-11-29
👁️ 预览文献
💡 AI 中文简介
硬件木马是集成电路面临的持续威胁,尤其在寄存器传输级(RTL)插入时更难检测。现有方法通常将设计转为图结构再用图神经网络分析,但会丢失RTL语义、感受野有限且只能做模块级粗检测。本文提出TrojanLoC框架,利用在RTL上微调的大语言模型直接从代码中提取模块级和行级嵌入,训练分类器实现木马检测、类型预测和细粒度行级定位。同时发布了大规模合成数据集TrojanInS。实验表明,木马检测F1达0.99,类型分类宏F1为0.84,行级定位宏F1最高0.93,显著优于基线。
领域硬件安全 / 集成电路设计自动化
适合谁读需要一定专业背景(了解RTL设计、硬件木马和机器学习基础)
核心贡献1. 提出首个基于大语言模型的RTL级硬件木马定位框架,直接从RTL代码提取模块级和行级嵌入,保留完整语义。2. 发布大规模合成数据集TrojanInS,包含四类效果木马及精确行级标注,支持细粒度定位研究。
关键数据模块级木马检测F1-score达0.99,比基线最高提升0.68;木马类型分类宏F1为0.84;行级定位宏F1最高达0.93。
推荐理由如果你关注硬件安全或想用大语言模型解决RTL级木马定位问题,这篇论文提供了新思路和强性能,值得一读。
关键词["硬件木马", "寄存器传输级", "大语言模型", "木马定位", "硬件安全"]

原文摘要

查看英文原文摘要

Hardware Trojans (HT s) are a persistent threat to integrated circuits, especially when inserted at the register-transfer level (RTL). Existing methods typically first convert the design into a graph, such as a gate-level netlist or an RTL-derived dataflow graph (DFG), and then use a graph neural network (GNN ) to obtain an embedding of that graph, which (i) loses compact RTL semantics, (ii) relies on shallow GNNs with limited receptive field, and (iii) is largely restricted to coarse, module-level binary HT detection. We propose TrojanLoC, an LLM-based framework for RTL-level HT localization. We use an RTL-finetuned LLM to derive module-level and line-level embeddings directly from RTL code, capturing both global design context and local semantics. Next, we train task-specific classifiers on these embeddings to perform module-level Trojan detection, type prediction, and fine-grained line-level localization. We also introduce TrojanInS, a large synthetic dataset of RTL designs with systematically injected Trojans from four effect-based categories, each accompanied by precise line-level annotations. Our experiments show that TrojanLoC achieves strong module-level performance, reaching 0.99 F1-score for Trojan detection, up to 0.68 higher than baseline, and 0.84 macro-F1 for Trojan-type classification. At the line level, TrojanLoc further achieves up to 0.93 macro-F1, enabling fine-grained localization of Trojan-relevant RTL lines