BetterV: Controlled Verilog Generation with Discriminative Guidance

📄 arXiv: 2402.03375v3 📥 PDF

作者: Zehua Pei, Hui-Ling Zhen, Mingxuan Yuan, Yu Huang, Bei Yu

分类: cs.AI, cs.PL

发布日期: 2024-02-03 (更新: 2024-05-02)

备注: Accepted by ICML 2024


💡 一句话要点

提出BetterV以解决现代集成电路设计自动化问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 集成电路设计 自动化设计 Verilog生成 大型语言模型 生成性判别器 电子设计自动化 数据增强

📋 核心要点

  1. 现代集成电路设计面临着复杂性增加的挑战,现有的自动化设计方法难以满足需求。
  2. 本研究提出的BetterV框架通过微调大型语言模型并结合生成性判别器,优化Verilog代码生成过程。
  3. 实验结果表明,BetterV在VerilogEval基准测试中超越了GPT-4,并在多个EDA任务中显著提升性能。

📝 摘要(中文)

随着现代集成电路(IC)的复杂性不断增加,自动化电路设计方法的需求日益迫切。近年来,硬件设计语言生成的研究逐渐增多,以促进设计过程。本研究提出了一种Verilog生成框架BetterV,该框架在处理过的领域特定数据集上对大型语言模型(LLMs)进行微调,并结合生成性判别器以指导特定设计需求。通过从互联网收集、过滤和处理Verilog模块,形成了一个干净且丰富的数据集。特别设计的指令微调方法使LLMs能够理解Verilog知识。此外,数据增强用于丰富训练集,并用于训练特定下游任务的生成性判别器,从而为LLMs优化Verilog实现提供指导。BetterV能够生成语法和功能上正确的Verilog,并在VerilogEval基准测试中超越GPT-4。借助任务特定的生成性判别器,BetterV在各种电子设计自动化(EDA)下游任务中实现了显著提升,包括合成的网表节点减少和布尔可满足性(SAT)求解的验证运行时减少。

🔬 方法详解

问题定义:本研究旨在解决现代集成电路设计中的自动化Verilog生成问题。现有方法在处理复杂设计需求时,往往无法生成高质量的Verilog代码,导致设计效率低下。

核心思路:BetterV框架通过对大型语言模型进行微调,并结合生成性判别器,提供针对特定设计需求的指导,从而提高Verilog代码的生成质量和效率。

技术框架:BetterV的整体架构包括数据收集与处理、LLM微调、数据增强和生成性判别器训练等主要模块。首先,从互联网收集Verilog模块,经过过滤和处理形成数据集;然后对LLMs进行指令微调,使其理解Verilog知识;接着,通过数据增强丰富训练集,并训练生成性判别器以优化生成过程。

关键创新:本研究的主要创新在于结合了生成性判别器与大型语言模型的微调,形成了一种新的Verilog生成方法。这种方法能够更好地满足特定设计需求,显著提高生成代码的质量。

关键设计:在模型训练中,采用了特定的损失函数以优化生成结果,并通过数据增强技术扩展训练集,确保模型能够适应多样化的设计需求。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,BetterV在VerilogEval基准测试中超越了GPT-4,生成的Verilog代码在语法和功能上均表现出色。此外,BetterV在多个电子设计自动化任务中实现了显著的性能提升,例如合成的网表节点减少和验证运行时的显著降低,展示了其在实际应用中的有效性。

🎯 应用场景

BetterV的研究成果在电子设计自动化领域具有广泛的应用潜力。它可以用于自动化生成高质量的Verilog代码,提升集成电路设计的效率,降低设计成本。此外,随着集成电路设计复杂性的增加,BetterV的框架能够为未来的设计工具提供重要的技术支持,推动整个行业的发展。

📄 摘要(原文)

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.