Proceedings

SecV: LLM-based Secure Verilog Generation with Clue-Guided Exploration on Hardware-CWE Knowledge Graph

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 8049-8057.

https://doi.org/10.24963/ijcai.2025/895

Abstract

Verilog is specified as the primary Register Transfer Level (RTL) hardware description language, which designs the logical functions between registers for digital circuit systems. Recently, there emerges much cutting-edge research in leveraging Large Language Models (LLMs) to generate Verilog, aiming at effectively reducing errors and costs in the logic design of chips. However, these works mainly focus on logical correctness or PPA (Power, Performance, Area) measurement of the generated results, while neglecting the security problems in Verilog. In this study, we propose SecV, a novel and unified framework to generate secure Verilog by clue-guided exploration on Common Weakness Enumeration (CWE) knowledge graph (KG) for chips. First, the builder of the KG utilizes the instance-adapted chain of thought (COT) to extract entities and their relationships from raw Hardware-CWE corpora. Then, a fine-tuned BERT model is employed to verify the Hardware-CWE KG and collaborate with builder iteratively to achieve the precise KG. Based on Hardware-CWE KG, a clue-guided graph exploration paradigm is designed to facilitate collaborative inference of knowledge to generate secure Verilog by LLMs. Experiments demonstrate that SecV achieves 82.6% secure Verilog code without specified CWE in the generated functionally correct Verilog, with superior performance of a 21.7% performance improvement compared to SOTA.

  1. [Achiam et al., 2023] Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Alt- man, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
  2. [Ahmad et al., 2022] Baleegh Ahmad, Wei-Kai Liu, Luca Collini, Hammond Pearce, Jason M Fung, Jonathan Valamehr, Mohammad Bidmeshki, Piotr Sapiecha, Steve Brown, Krishnendu Chakrabarty, et al. Don't cweat it: To- ward cwe analysis techniques in early stages of hardware design. In Proceedings of the 41st IEEE/ACM Interna- tional Conference on Computer-Aided Design, pages 1-9, 2022.
  3. [Ahmad et al., 2024] Baleegh Ahmad, Shailja Thakur, Ben- jamin Tan, Ramesh Karri, and Hammond Pearce. On hard- ware security bug code fixes by prompting large language models. IEEE Transactions on Information Forensics and Security, 2024.
  4. [Bai et al., 2023] Jinze Bai, Shuai Bai, Yunfei Chu, Zeyu Cui, Kai Dang, Xiaodong Deng, Yang Fan, Wenbin Ge, Yu Han, Fei Huang, et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2023.
  5. [Blocklove et al., 2023] Jason Blocklove, Siddharth Garg, Ramesh Karri, and Hammond Pearce. Chip-chat: Chal- lenges and opportunities in conversational hardware de- sign. In 2023 ACM/IEEE 5th Workshop on Machine Learning for CAD (MLCAD), pages 1-6. IEEE, 2023.
  6. [Blocklove et al., 2024] Jason Blocklove, Shailja Thakur, Benjamin Tan, Hammond Pearce, Siddharth Garg, and Ramesh Karri. Can eda tool feedback improve verilog gen- eration by llms? arXiv preprint arXiv:2411.11856, 2024.
  7. [Dao and Gu, 2024] Tri Dao and Albert Gu. Transformers are ssms: Generalized models and efficient algorithms through structured state space duality. arXiv preprint arXiv:2405.21060, 2024.
  8. [Dubey et al., 2024] Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
  9. [Edge et al., 2024] Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody, Steven Truitt, and Jonathan Larson. From local to global: A graph rag approach to query-focused summarization. April 2024.
  10. [Fang et al., 2024] Wenji Fang, Yao Lu, Shang Liu, Qijun Zhang, Ceyu Xu, Lisa Wu Wills, Hongce Zhang, and Zhiyao Xie. Transferable pre-synthesis ppa estimation for rtl designs with data augmentation techniques. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2024.
  11. [Fu et al., 2023] Weimin Fu, Kaichen Yang, Raj Gautam Dutta, Xiaolong Guo, and Gang Qu. Llm4sechw: Lever- aging domain-specific large language model for hardware debugging. In 2023 Asian Hardware Oriented Security and Trust Symposium (AsianHOST), pages 1-6. IEEE, 2023.
  12. [Guo et al., 2024a] Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, Wentao Zhang, Guanting Chen, Xiao Bi, Yu Wu, YK Li, et al. Deepseek-coder: When the large language model meets programming-the rise of code intelligence. arXiv preprint arXiv:2401.14196, 2024.
  13. [Guo et al., 2024b] Zirui Guo, Lianghao Xia, Yanhua Yu, Tu Ao, and Chao Huang. Lightrag: Simple and fast retrieval-augmented generation. 2024.
  14. [Ho et al., 2024] Chia-Tung Ho, Haoxing Ren, and Brucek Khailany. Verilogcoder: Autonomous verilog coding agents with graph-based planning and abstract syntax tree (ast)-based waveform tracing tool. arXiv preprint arXiv:2408.08927, 2024.
  15. [Huang et al., 2023] Yu-Xuan Huang, Zequn Sun, Guangyao Li, Xiaobin Tian, Wang-Zhou Dai, Wei Hu, Yuan Jiang, and Zhi-Hua Zhou. Enabling abductive learning to exploit knowledge graph. In IJCAI, pages 3839-3847, 2023. IJCAI
  16. [Jiang et al., 2023] Albert Q Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, et al. Mistral 7b. arXiv preprint arXiv:2310.06825, 2023.
  17. [Kim et al., 2023] Jiho Kim, Yeonsu Kwon, Yohan Jo, and Edward Choi. Kg-gpt: A general framework for reason- ing on knowledge graphs using large language models. In EMNLP (Findings), 2023.
  18. [Liu et al., 2023] Mingjie Liu, Teodor-Dumitru Ene, Robert Kirby, Chris Cheng, Nathaniel Pinckney, Rongjian Liang, Jonah Alben, Himyanshu Anand, Sanmitra Banerjee, Is- met Bayraktaroglu, et al. Chipnemo: Domain-adapted llms for chip design. arXiv preprint arXiv:2311.00176, 2023.
  19. [Liu et al., 2024] Shang Liu, Wenji Fang, Yao Lu, Qijun Zhang, Hongce Zhang, and Zhiyao Xie. Rtlcoder: Out- performing gpt-3.5 in design rtl generation with our open- source dataset and lightweight solution. In 2024 IEEE LLM Aided Design Workshop (LAD), pages 1-5. IEEE, 2024.
  20. [Lu et al., 2024] Yao Lu, Shang Liu, Qijun Zhang, and Zhiyao Xie. Rtllm: An open-source benchmark for de- sign rtl generation with large language model. In 2024 29th Asia and South Pacific Design Automation Confer- ence (ASP-DAC), pages 722-727. IEEE, 2024.
  21. [MITRE, 2023] MITRE. Common weakness enumeration, 2023. [Online; accessed 25-December-2024].
  22. [Nazzal et al., 2024] Mahmoud Nazzal, Issa Khalil, Abdal- lah Khreishah, and NhatHai Phan. Promsec: Prompt op- timization for secure generation of functional source code with large language models (llms). In Proceedings of the 2024 on ACM SIGSAC Conference on Computer and Com- munications Security, pages 2266-2280, 2024.
  23. [Pearce et al., 2023] Hammond Pearce, Benjamin Tan, Baleegh Ahmad, Ramesh Karri, and Brendan Dolan- Gavitt. Examining zero-shot vulnerability repair with large language models. In 2023 IEEE Symposium on Security and Privacy (SP), pages 2339-2356. IEEE, 2023.
  24. [Pei et al., 2024] Zehua Pei, Hui-Ling Zhen, Mingxuan Yuan, Yu Huang, and Bei Yu. Betterv: controlled verilog generation with discriminative guidance. In Proceedings of the 41st International Conference on Machine Learn- ing, pages 40145-40153, 2024.
  25. [Pinckney et al., 2024] Nathaniel Pinckney, Christopher Batten, Mingjie Liu, Haoxing Ren, and Brucek Khailany. Revisiting verilogeval: Newer llms, in-context learn- ing, and specification-to-rtl tasks. arXiv preprint arXiv:2408.11053, 2024.
  26. [Sami et al., 2024a] Humza Sami, Pierre-Emmanuel Gail- lardon, Valerio Tenace, et al. Aivril: Ai-driven rtl generation with verification in-the-loop. arXiv preprint arXiv:2409.11411, 2024.
  27. [Sami et al., 2024b] Humza Sami, Pierre-Emmanuel Gail- lardon, Valerio Tenace, et al. Eda-aware rtl generation with large language models. arXiv preprint arXiv:2412.04485, 2024.
  28. [Thakur et al., 2023] Shailja Thakur, Baleegh Ahmad, Zhenxing Fan, Hammond Pearce, Benjamin Tan, Ramesh Karri, Brendan Dolan-Gavitt, and Siddharth Garg. Bench- marking large language models for automated verilog rtl code generation. In 2023 Design, Automation & Test in Europe Conference & Exhibition (DATE), pages 1-6. IEEE, 2023.
  29. [Thakur et al., 2024] Shailja Thakur, Baleegh Ahmad, Ham- mond Pearce, Benjamin Tan, Brendan Dolan-Gavitt, Ramesh Karri, and Siddharth Garg. Verigen: A large lan- guage model for verilog code generation. ACM Trans- actions on Design Automation of Electronic Systems, 29(3):1-31, 2024.
  30. [Tsai et al., 2024] YunDa Tsai, Mingjie Liu, and Haoxing Ren. Rtlfixer: Automatically fixing rtl syntax errors with large language model. In Proceedings of the 61st ACM/IEEE Design Automation Conference, pages 1-6, 2024.
  31. [Williams, 2023] Stephen Williams. The icarus verilog com- pilation system, 2023.
  32. [Wu et al., 2024] Peiyang Wu, Nan Guo, Xiao Xiao, Wen- ming Li, Xiaochun Ye, and Dongrui Fan. Itertl: An itera- tive framework for fine-tuning llms for rtl code generation. arXiv preprint arXiv:2407.12022, 2024.
  33. [Zhao et al., 2024a] Ruilin Zhao, Feng Zhao, Long Wang, Xianzhi Wang, and Guandong Xu. Kg-cot: Chain-of- thought prompting of large language models over knowl- edge graphs for knowledge-aware question answering. In Proceedings of the Thirty-Third International Joint Con- ference on Artificial Intelligence (IJCAI-24), pages 6642- 6650. International Joint Conferences on Artificial Intelli- gence, 2024.
  34. [Zhao et al., 2024b] Yang Zhao, Di Huang, Chongxiao Li, Pengwei Jin, Ziyuan Nan, Tianyun Ma, Lei Qi, Yansong Pan, Zhenxing Zhang, Rui Zhang, et al. Codev: Empow- ering llms for verilog generation through multi-level sum- marization. arXiv preprint arXiv:2407.10424, 2024.
  35. [Zhao et al., 2024c] Yujie Zhao, Hejia Zhang, Hanxian Huang, Zhongming Yu, and Jishen Zhao. Mage: A multi- agent engine for automated rtl code generation. arXiv preprint arXiv:2412.07822, 2024.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards