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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhao, Zhuorui, Li, Bing, Zhang, Grace Li, Schlichtmann, Ulf
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917058039513088
author Zhao, Zhuorui
Li, Bing
Zhang, Grace Li
Schlichtmann, Ulf
author_facet Zhao, Zhuorui
Li, Bing
Zhang, Grace Li
Schlichtmann, Ulf
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_02285
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle VFocus: Better Verilog Generation from Large Language Model via Focused Reasoning
Zhao, Zhuorui
Li, Bing
Zhang, Grace Li
Schlichtmann, Ulf
Hardware Architecture
Programming Languages
Software Engineering
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.
title VFocus: Better Verilog Generation from Large Language Model via Focused Reasoning
topic Hardware Architecture
Programming Languages
Software Engineering
url https://arxiv.org/abs/2511.02285