TrojanLoC: 基于LLM的RTL Trojan定位框架
TrojanLoC: LLM-based Framework for RTL Trojan Localization
AI总结:
TrojanLoC利用LLM直接从RTL代码生成嵌入,实现模块级和行级木马检测与定位,提升RTL级安全分析精度。
摘要:
硬件木马(HTs)是集成电路的持续威胁,尤其是在寄存器传输级(RTL)中插入时。现有方法通常首先将设计转换为图,如门级网络列表或RTL衍生的数据流图(DFG),然后使用图神经网络(GNN)来获取该图的嵌入,这(i)丢失了紧凑的RTL语义,(ii)依赖于浅层GNNs具有有限的接收场,(iii)主要局限于粗粒度、模块级二进制HT检测。我们提出了TrojanLoC,一种基于LLM的RTL级HT定位框架。我们使用经过RTL微调的LLM,直接从RTL代码中推导出模块级和行级嵌入,捕捉全局设计上下文和局部语义。接下来,我们在这些嵌入上训练任务特定的分类器,以进行模块级木马检测、类型预测和细粒度行级定位。我们还引入了TrojanInS,一个包含从四个基于效果的类别中系统注入木马的RTL设计的大型合成数据集,每个都配有精确的行级注释。我们的实验表明,TrojanLoC在模块级表现强劲,达到0.99 F1分数的木马检测,比基线高多达0.68,且在木马类型分类上达到0.84宏F1分数。在行级,TrojanLoC进一步达到0.93宏F1分数,实现了对木马相关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
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。