VRank:通过自洽性增强大型语言模型的Verilog代码生成
VRank: Enhancing Verilog Code Generation from Large Language Models via Self-Consistency
AI总结:
提出VRank自动化框架,利用LLM生成代码候选与测试平台,通过输出聚类、自洽性排序和思维链选择最佳候选,显著提升Verilog代码生成的功能正确性。
摘要:
大型语言模型(LLMs)在根据模块规范生成Verilog代码方面展现出了令人瞩目的能力。为了提高此类生成Verilog代码的质量,以往的方法要么需要耗时的手动检查,要么需要生成多个Verilog代码,并使用手动设计的测试平台从中选择质量最高的一份。为了在提升生成效率的同时保持生成代码的质量,我们提出了VRank,这是一个利用LLM生成Verilog代码的自动化框架。在我们的框架中,利用LLM的概率特性生成多个代码候选。随后,我们将Verilog代码候选按照在相同测试平台(同样由LLM生成)下测试时产生的相同输出进行聚类。根据各聚类在测试平台上展现出的自洽性对其进行排序。为了确定最佳候选,进一步应用思维链从排名最高的聚类中选择最佳候选。通过系统分析生成代码的多样化输出,VRank减少了错误并提升了生成Verilog代码的整体质量。在VerilogEval-Human基准上的实验结果表明,多个LLM在功能正确性(passl1)上平均显著提高了10.5%,证明了VRank在提升复杂设计任务中自动化硬件描述语言生成准确性方面的有效性。
英文摘要:
Large Language Models (LLMs) have demonstrated promising capabilities in generating Verilog code from module specifications. To improve the quality of such generated Verilog codes, previous methods require either time-consuming manual inspection or generation of multiple Verilog codes, from which the one with the highest quality is selected with manually designed testbenches. To enhance the generation efficiency while maintaining the quality of the generated codes, we propose VRank, an automatic framework that generates Verilog codes with LLMs. In our framework, multiple code candidates are generated with LLMs by leveraging their probabilistic nature. Afterwards, we group Verilog code candidates into clusters based on identical outputs when tested against the same testbench, which is also generated by LLMs. Clusters are ranked based on the consistency they show on testbench. To determine the best candidate, Chain-of-Thought is further applied to select the best candidate from the top-ranked clusters. By systematically analyzing diverse outputs of generated codes, VRank reduces errors and enhances the overall quality of the generated Verilog code. Experimental results on the VerilogEval-Human benchmark demonstrate a significant 10.5% average increase in functional correctness (passl1) across multiple LLMs, demonstrating VRank's effectiveness in improving the accuracy of automated hardware description language generation for complex design tasks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。