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


翻译:硬件木马(HTs)是集成电路面临的持续威胁,尤其是在寄存器传输级(RTL)被植入时。现有方法通常首先将设计转换为图结构,例如门级网表或RTL衍生的数据流图(DFG),然后使用图神经网络(GNN)获取该图的嵌入表示,这种方法存在以下问题:(i)丢失了紧凑的RTL语义信息,(ii)依赖于感受野有限的浅层GNN,以及(iii)主要局限于粗粒度的模块级二元HT检测。我们提出了TrojanLoC,一种基于大语言模型的RTL级硬件木马定位框架。我们使用经过RTL微调的大语言模型直接从RTL代码中提取模块级和行级嵌入,同时捕获全局设计上下文和局部语义。接着,我们在这些嵌入表示上训练任务特定的分类器,以执行模块级木马检测、类型预测和细粒度的行级定位。我们还引入了TrojanInS,一个包含系统注入木马的大型合成RTL设计数据集,这些木马来自四种基于效应的类别,每个设计均附带精确的行级标注。实验结果表明,TrojanLoC在模块级表现出色,木马检测的F1分数达到0.99,比基线方法高出0.68,木马类型分类的宏平均F1分数为0.84。在行级定位方面,TrojanLoC进一步实现了高达0.93的宏平均F1分数,能够对木马相关的RTL代码行进行细粒度定位。

0
下载
关闭预览

相关内容

【CVPR2025】基于组合表示移植的图像编辑方法
专知会员服务
8+阅读 · 4月5日
专知会员服务
41+阅读 · 2021年6月19日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
A Survey of Large Language Models
Arxiv
495+阅读 · 2023年3月31日
VIP会员
相关论文
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员