[论文解读] BetterV: Controlled Verilog Generation with Discriminative Guidance
BetterV 在领域专用 Verilog 数据上对 7B LLM 进行微调,并使用生成式判别器来引导下游 EDA 任务的生成,在 VerilogEval-machine 上实现 Verilog 正确性的新生状态,并在综合和验证任务上取得改进。
Due to the growing complexity of modern Integrated Circuits (ICs), there is a need for automated circuit design methods. Recent years have seen rising research in hardware design language generation to facilitate the design process. In this work, we propose a Verilog generation framework, BetterV, which fine-tunes the large language models (LLMs) on processed domain-specific datasets and incorporates generative discriminators for guidance on particular design demands. The Verilog modules are collected, filtered and processed from internet to form a clean and abundant dataset. Instruct-tuning methods are specially designed to fine-tune the LLMs to understand the knowledge about Verilog. Furthermore, data are augmented to enrich the training set and also used to train a generative discriminator on particular downstream task, which leads a guidance for the LLMs to optimize the Verilog implementation. BetterV has the ability to generate syntactically and functionally correct Verilog, which can outperform GPT-4 on the VerilogEval benchmark. With the help of task-specific generative discriminator, BetterV can achieve remarkable improvement on various electronic design automation (EDA) downstream tasks, including the netlist node reduction for synthesis and verification runtime reduction with Boolean Satisfiability (SAT) solving.
研究动机与目标
- 促使自动化 Verilog 生成,以应对现代集成电路设计的复杂性并降低 HDL 编码中的人工工作量。
- 开发领域特定的指令微调流程,以在不进行大量提示工程的情况下教会 LLMs Verilog 概念。
- 引入数据增强和生成式判别器,引导 LLM 向下游 EDA 目标发展。
- 在功能正确性、句法正确性、综合节点减少和验证运行时间等方面评估 BetterV。
- 证明 BetterV 在 VerilogEval-machine 基准上能够超越基线模型并改善下游任务。
提出的方法
- 从开源来源收集并处理 Verilog 数据,形成包含模块定义和主体的干净 Verilog/Verilog-C 数据集。
- 应用领域特定的指令微调,使用 V2C 工具教导 LLMs Verilog 自动完成和 Verilog-to-C/C-to-Verilog 翻译。
- 通过高温采样生成多样化 Verilog 并用 EDA 工具筛选句法正确性来扩增数据。
- 在面向任务的属性上训练生成式判别器,并使用贝叶斯规则引导的加权解码来引导 LLM 生成朝向期望属性。
- 使用结合生成和判判目标的混合损失来更新 LLM 与判别器。
- 在多个 EDA 下游任务上进行评估,包括功能正确性、句法正确性、综合节点减少,以及 SAT-verify-time 的缩短。
实验结果
研究问题
- RQ1领域特定的指令微调是否能在不进行大量提示工程的情况下实现 Verilog 理解与自动完成?
- RQ2面向任务的生成式判别器是否能提高 Verilog 生成质量以适用于下游 EDA 任务?
- RQ3相较于基线,BetterV 在功能正确性、综合效率和验证时间方面的提升程度有多大?
主要发现
- BetterV 在 VerilogEval-machine 上达到最先进的性能,在 pass@1、pass@5、pass@10 上超过 GPT-4。
- 判别器引导的生成在功能和句法正确性方面进一步提升了基础 BetterV 模型和 CodeLlama。
- BetterV 展示出显著的综合节点减少,平均分别比参考减少 46.52% 和比 BetterV-base 减少 31.68%。
- BetterV 将验证 SAT 求解时间缩短最多 22.45% 相较参考,以及 13.99% 相较 BetterV-base。
- 在句法正确性方面,使用判别器的 BetterV 达到非常高的 pass@10 (>99%),表明生成的 Verilog 具有很强的句法有效性。
- 通过调整判别器以针对特定硬件/设计者需求,该方法可推广到下游任务。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。