arXiv:2502.15832cs.ARcs.CL2025-02ICLR被引 33

统一建模让AI同时懂代码和写代码,性能超越GPT-4

DeepRTL: Bridging Verilog Understanding and Generation with a Unified Representation Model

  • 基于CodeT5+构建统一模型,对齐自然语言与Verilog
  • 在理解任务上超越GPT-4,生成性能媲美o1-preview
  • 引入嵌入相似度与GPT Score评估,更准确衡量语义对齐

大型语言模型(LLM)在从自然语言指令自动生成硬件描述语言(HDL)代码方面展现出巨大潜力。尽管微调提升了模型在硬件设计任务中的表现,但以往工作主要聚焦于Verilog生成,忽视了同样关键的Verilog理解任务。现有模型在自然语言描述与Verilog代码之间对齐能力弱,影响可综合设计质量。为此,我们提出DeepRTL,一个在Verilog理解与生成上均表现优异的统一表示模型。基于CodeT5+,DeepRTL在包含丰富多层级自然语言描述的综合数据集上进行微调。我们还首次构建了Verilog理解基准,并率先采用嵌入相似度与GPT Score评估模型理解能力。这些指标比传统的BLEU、ROUGE更准确捕捉语义相似性。通过引入课程学习策略训练DeepRTL,使其在理解任务上显著优于GPT-4,生成任务性能与OpenAI o1-preview相当。

原文摘要 · Abstract (English)

Recent advancements in large language models (LLMs) have shown significant potential for automating hardware description language (HDL) code generation from high-level natural language instructions. While fine-tuning has improved LLMs' performance in hardware design tasks, prior efforts have largely focused on Verilog generation, overlooking the equally critical task of Verilog understanding. Furthermore, existing models suffer from weak alignment between natural language descriptions and Verilog code, hindering the generation of high-quality, synthesizable designs. To address these issues, we present DeepRTL, a unified representation model that excels in both Verilog understanding and generation. Based on CodeT5+, DeepRTL is fine-tuned on a comprehensive dataset that aligns Verilog code with rich, multi-level natural language descriptions. We also introduce the first benchmark for Verilog understanding and take the initiative to apply embedding similarity and GPT Score to evaluate the models' understanding capabilities. These metrics capture semantic similarity more accurately than traditional methods like BLEU and ROUGE, which are limited to surface-level n-gram overlaps. By adapting curriculum learning to train DeepRTL, we enable it to significantly outperform GPT-4 in Verilog understanding tasks, while achieving performance on par with OpenAI's o1-preview model in Verilog generation tasks.

Verilog大模型代码生成理解评估

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