arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.02285cs.ARcs.PLcs.SE
收藏

VFocus:通过聚焦推理从大型语言模型生成更好的Verilog代码

VFocus: Better Verilog Generation from Large Language Model via Focused Reasoning

Technical University of Munich(慕尼黑工业大学);University of Siegen(锡根大学);Technical University of Darmstadt(达姆施塔特工业大学)

Zhuorui Zhao, Bing Li, Grace Li Zhang, Ulf Schlichtmann

AI总结:

提出VFocus三阶段框架,通过密度引导过滤、自洽性聚类和不一致性挖掘聚焦LLM关键推理,显著提升Verilog生成的pass@1正确率。

摘要:

大型语言模型(LLMs)在生成Verilog代码方面展现了惊人的潜力,但确保功能正确性仍是一项挑战。现有方法通常依赖自洽性或仿真反馈来选择最佳候选代码,却错失了将LLM推理聚焦于设计中最具信息量部分的机会。我们提出了VFocus,一个三阶段框架,通过将LLM推理的焦点锐化到代码生成过程中的关键决策点来增强Verilog生成。在预排序阶段,VFocus通过LLM提示生成多个代码候选,重试以获取语法有效的输出,并引入密度引导过滤来保留处于功能正确性“推理甜点区”的候选。在排序阶段,我们使用自动生成的测试平台对每个代码候选进行仿真,并应用基于自洽性的聚类来识别最一致的输出。最后,在后排序优化阶段,VFocus对排名靠前的候选进行不一致性挖掘,并调用推理增强的LLM提示进行候选优化。在VerilogEval-Human基准上的实验表明,VFocus显著提升了多种推理LLM的pass@1正确率,证明了其在增强复杂硬件设计任务的Verilog生成方面的有效性。

英文摘要:

Large Language Models (LLMs) have shown impressive potential in generating Verilog codes, but ensuring functional correctness remains a challenge. Existing approaches often rely on self-consistency or simulation feedback to select the best candidate, but they miss opportunities to focus LLM reasoning on the most informative parts of the design. We propose VFocus, a three-stage framework that enhances Verilog generation by sharpening the focus of LLM reasoning onto critical decision points in the code generation process. In the \textbf{pre-ranking stage}, VFocus generates multiple code candidates through LLM prompting, retries for syntactically valid outputs, and introduces a \textit{Density-guided Filtering} to retain candidates that fall within the "reasoning sweet spot" for functional correctness. In the \textbf{ranking stage}, we simulate each code candidate using an automatically generated testbench and apply self-consistency-based clustering to identify the most consistent outputs. Finally, in the \textbf{post-ranking refinement stage}, VFocus performs inconsistency mining on top-ranked candidates and invokes reasoning-augmented LLM prompts for candidate refinement. Experiments on the VerilogEval-Human benchmark show that VFocus significantly improves the pass@1 correctness across multiple reasoning LLMs, demonstrating its effectiveness in enhancing Verilog generation for complex hardware design tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑