WorksComputer Science
VeriLadder: A Multi-Agent Specification Refinement System for Tool-Verified Verilog Datasets
Abstract
Training data is a bottleneck in AI, especially for large language models (LLMs) that write Verilog, because register-transfer-level (RTL) code is rarely published and existing datasets mostly check code for syntax, not instruction correctness. This paper presents VeriLadder, a five-level Verilog dataset, and the multi-agent framework that builds it, in which LLM agents write and revise specifications, and EDA tools (a synthesizer and a formal equivalence checker) decide what is accepted. Its levels follow an engineer's checks. Level 1 labels designs from two large Verilog corpora, namely RTLCoder and PyraNet, with synthesis results, failure causes, critical warnings and post-synthesis metrics. 28% of RTLCoder designs fail synthesis and are kept as negatives. Level 2 grades each instruction on four specification qualities, and low grades predict failed rebuilds. Level 3 rewrites each instruction into a refined specification and accepts it only if an LLM from another model family, reading only that specification, writes a circuit formally equivalent to the original. This raises the share of rebuildable designs from 26.1% to 78.2%, keeping every failed specification with its counterexample. Levels 4 and 5 add verified paraphrases and one-fact variants, hard negatives that differ only in one behavior from the verified design. VeriLadder labels the synthesizability of 716,627 designs and, from RTLCoder, provides 11,247 refined specifications, 32,393 paraphrases and 8,397 one-fact variants. Fine-tuning Qwen2.5-Coder-7B-Instruct on VeriLadder raises functional pass@1 from 31.7% to 50.0% on VerilogEval v2 and from 35.0% to 45.2% on RTLLM v2. The dataset and fine-tuned models are publicly available.
Introduction
Modern chip design relies on computer-aided design (CAD) tools, also called electronic design automation (EDA) tools. Designers describe a digital circuit at the register-transfer level (RTL), usually in the Verilog language, and CAD tools turn this description into gates, check it, and finally lay it out on silicon. Writing and checking the RTL is still mostly manual work, and it takes a large share of the effort of a chip design project, so tools that help with this step are in high demand. Large language models (LLMs) are a promising such tool. They can write Verilog from a description in natural language [3, 5], they have been adapted to chip-design tasks in industry [20], and they are now studied for many steps of the design flow [29, 46]. Several open-source models have been
Authors’ Contact Information: Saeid Rajabi, University of Delaware, Newark, Delaware, USA; Chengmo Yang, University of Delaware, Newark, Delaware, USA; Satwik Patnaik, University of Delaware, Newark, Delaware, USA. trained specifically to generate RTL [22, 27, 47], and benchmarks such as VerilogEval and RTLLM measure how well they do [21, 26].
For such models, training data is one of the main bottlenecks. The performance of LLMs improves predictably with both model size and the amount of training data [12, 17]. At the same time, the supply of public human-written text is expected to run out [36], and carefully selected data can matter more than a larger amount of data [9], which has turned attention from models to data [42]. Hardware is an extreme case. RTL code is valuable intellectual property and is rarely published, so public Verilog is scarce compared with software code, and its quality is uneven. Progress of LLMs in hardware design therefore depends on making the limited public data as useful as possible, by checking it, labeling it and repairing what is wrong.
The input to an RTL model is an instruction in natural language, and the model learns from datasets of instruction–code pairs, in which the instruction asks for a design and the code is a Verilog module that implements it. The instruction is the only description of the task, so it serves as the specification of the design. Several such datasets have been built (§ 2), but they check their samples only in part.
This leaves a gap between what the datasets contain and what a model needs to learn. A hardware engineer checks a design in a fixed order. First, the code must be able to become hardware at the end, which means that a synthesis tool must translate it into a circuit of logic gates and flip-flops. Second, the specification must describe what the circuit does precisely enough that another engineer would build functionally the same circuit from it. Such a specification determines the circuit, and only then can anyone decide whether a generated design is correct with respect to the specification. Existing datasets check neither property well, and they leave six gaps.
(i) Synthesis is not checked. Datasets check the code only for syntax or compilation, which does not show that it becomes hardware. Designs that fail are either filtered out or kept without a label, so the root cause of each failure is lost, and designs that synthesize only with critical warnings are not marked.
(ii) Specification quality is not measured. No dataset measures how well an instruction specifies its design.
(iii) Failing specifications are not repaired. A few datasets test, in a round trip, whether another LLM that reads only the specification writes code equivalent to the paired code, but when it cannot, they discard the pair or keep it with a label, and none repairs the specification until it describes the circuit precisely.
(iv) One wording per design. Each design comes with a single wording, although LLMs are sensitive to how a prompt is worded [38] and, in real-world settings, different engineers ask for the same design in different words.
(v) No functional hard negatives. A model learns which details of a specification matter from hard negatives, examples that are almost correct but differ from the correct design in one behavior. In existing datasets, the only negative examples are code that fails to compile or contains a deliberately inserted bug, not code that compiles and implements a nearby specification, such as the same counter with a different reset value.
(vi) No data for learning to refine. Open-source models are increasingly trained on the outputs of a stronger teacher LLM, and CodeV-R1 and VeriThoughts release a teacher’s reasoning for writing code from a description [41, 47]; no dataset teaches the step that comes before, turning an imprecise request into a precise specification, which is the work a hardware engineer does before writing RTL.
As a result, a model trained on these datasets learns from code that does not become hardware and from specification-to-RTL translations that are not correct, because the instruction contradicts the code or is satisfied by many functionally different circuits.
To bridge this gap, this paper proposes VeriLadder, a framework for multi-agent, tool-verified specification refinement, and the Verilog dataset it builds, whose labels follow the engineer’s order in five levels (Figure 1). Several LLM agents with separate roles describe, grade, rewrite, rebuild and vary each design, and tools check every result and return their feedback, such as a counterexample, to the agent that wrote it. The roles are kept separate on purpose. An LLM that checks its own specification can fill its gaps from what it knows about the code, and it tends to favor its own writing [30]. An independent LLM, the builder, sees only the specification, so it can rely only on what the specification states. The LLMs only write and revise specifications, and whether a design or a specification is accepted is always decided by a tool, either a synthesis tool or a formal equivalence checker. VeriLadder addresses all six aforementioned gaps. Its five levels label whether the code becomes hardware (i), grade how well the instruction specifies it (ii), refine the instruction until it determines the circuit (iii), and add verified paraphrases (iv) and one-fact variants that differ from the design in exactly one behavior (v). Refinement trajectories stored at Level 3 address gap (vi).
Figure 1. Overview of VeriLadder. The navy robots are roles of one LLM, the refiner (the hat shows the role), the teal robot is a second LLM, the builder, and boxes with a gold border are tools. Level 1 labels each design as synthesizable or not and records why it fails. Level 2 grades the instruction on four qualities, using facts extracted by Yosys. Level 3 rewrites it as a refined specification, accepted only if code written from it alone is verified equivalent to the original, and returns each counterexample to the writer. Levels 4 and 5 add paraphrases and one-fact variants, verified with the same check.
Our contributions are summarized as follows.
A multi-agent framework for dataset refinement. VeriLadder performs multi-agent, tool-verified specification refinement and is, to our knowledge, the first framework that repairs failing specifications and verifies every repair by formal equivalence. LLM agents grade and rewrite each instruction, and a rewrite is accepted only if an independent LLM, reading only that specification, builds a circuit that is formally equivalent to the original. Refinement raises the share of designs rebuilt as an equivalent circuit from 26.1% to 78.2%, also with an open-source builder (28% to 71%), and stores every refinement trajectory, the sequence of rewrites of an instruction with the counterexample that rejected each, as data for learning to refine (§ 3.11).
Metrics for the quality of hardware specifications as data. Four rubric-based metrics (consistency, unambiguity, completeness and verifiability) predict whether a specification determines its circuit (area under the ROC curve 0.89), and LLMs from different model families give nearly the same grades (§ 3.8).
Verified paraphrases. 32,393 paraphrases of the refined specifications, each verified by the same round trip to describe the same circuit, for training or testing robustness of the RTL code generation model to prompt variations (§ 3.12).
One-fact variants as hard negatives. 8,397 variants whose specification and code differ from the design in exactly one behavior, each with a counterexample and a check that the changed specification determines the changed code, for preference optimization and contrastive learning (§ 3.15).
Background and Related Work
Training data for code LLMs
LLMs perform well at generating software code in languages such as Python, C, and C++, largely because they are trained on large amounts of public repositories. Fine-tuning GPT-3 on public GitHub code produced Codex, which solved 28.8% of the HumanEval problems while GPT-3 solved almost none, and a version of which powers GitHub Copilot [6]. Later work showed that the quality of such data can matter more than its size. For example, phi-1, a 1.3B-parameter model trained on only 7 billion tokens of carefully selected, textbook-like code, solves 50.6% of HumanEval, more than code generation models ten times larger (in terms of parameter size) that were trained on over a hundred times more tokens [9]. Hardware lacks this advantage, because RTL code is mostly proprietary and public Verilog is scarce.
Verilog datasets
The success of code LLMs in software has motivated their use for hardware design. LLMs can write Verilog from a description [3, 5], and models such as RTLCoder, PyraNet and CodeV-R1 have been trained specifically to generate RTL [22, 27, 47]. Such models need Verilog training data, and public RTL code is scarce, so researchers have built dedicated datasets in several ways. VeriGen collected Verilog files from GitHub and textbooks [34, 35]. RTLCoder asked GPT-3.5 to write both the instruction and the code, giving about 27K pairs [22]. MG-Verilog, PyraNet, CodeV-R1 and VeriThoughts collected code and asked an LLM to describe it [27, 41, 43, 47], and MetRex and DeepCircuitX added area, delay or power after synthesis [1, 19]. Most of these datasets consist of instruction–code pairs. The instruction plays the role of a specification, a text that states what a module must do, such as its ports, its behavior, and its response to clock and reset. Usually it does so in an informal and incomplete way, and this paper calls it the original instruction.
Quality of Verilog datasets
The datasets differ most in how they check their samples, first the code and then the specification (Table 1). For the code, RTLCoder keeps only pairs that pass a syntax check [22], PyraNet asks an LLM to rank the code of each sample from 0 to 20 for coding style and efficiency [27], and MetRex synthesizes every design and asks an LLM to repair those that fail [1]. A syntax check or an LLM rating does not show that the code becomes hardware, and a repair removes the evidence of why a design failed. No dataset grades all of its specifications either, and the LLM rating of PyraNet judges the code, not its specification.
| Dataset | Samples | Syntax | Synthesis | Failure cause | PPA | Quality metric | Checked vs. code | Formal check | Repaired | Teacher trajectories | Para-phrases | Hard negatives |
| RTLCoder [22] | ∼27K | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| MG-Verilog [43] | 11K | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| PyraNet [27] | 692K | ✓ | ✗ | ∼ᵃ | ✗ | ∼ᵇ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| MetRex [1] | 25.9K | ✓ | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| DeepCircuitX [19] | 140K files | ✓ | ✓ | ✗ | ✓ | ∼ᶜ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| CodeV-R1 [47] | 87K | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✓ᵈ | ✗ |
| VeriThoughts [41] | 20.2K | ✓ | ✓ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✓ᵈ | ✗ | ✗ |
| VeriLadder | 717K / 11Kᵍ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ᶠ | ✓ | ✓ |
Table 1. Comparison of VeriLadder with prior Verilog datasets, by the checks they apply and the training data they provide. PPA is power, performance and area after synthesis. ✓ yes, ✗ no, ∼ partly. ᵃ Only designs with missing dependencies are labeled. ᵇ An LLM rates the code, not the description. ᶜ Humans grade a sample of the descriptions. ᵈ Reasoning traces of DeepSeek-R1 for writing code from a description. ᵉ Descriptions at different levels of granularity, not paraphrases. ᶠ Every refined specification with its counterexample, from the original instruction to the accepted specification. ᵍ Designs with Level 1 labels / designs with a verified refined specification.
For the specification, the question is whether it determines its circuit, that is, whether every circuit that satisfies it is functionally identical to the paired code. Only then can a model trained on the pair learn the mapping from text to circuit, and only then can a generated design be judged against the text. VerilogEval keeps an LLM-written problem description if at least one sampled solution passes simulation [21]. The closest works to VeriLadder are CodeV-R1 [47] and VeriThoughts [41], which both use a round trip and release the reasoning of a teacher model. CodeV-R1 collects about 150K Verilog snippets from GitHub, asks DeepSeek-V3 to describe each one, and asks DeepSeek-R1 to write code from the description. A rule-based testbench simulates the rebuilt and the original code on random inputs and keeps a pair only if no output differs, but only for its reinforcement-learning data; the 87K pairs used for fine-tuning are not checked against the original code. VeriThoughts asks one LLM to describe each design, asks DeepSeek-R1 to write code from the description, and labels the pair as consistent if a formal check bounded to 50 cycles finds no difference; inconsistent pairs are kept with their label. Both only judge a specification as it is. A specification that fails that kept, labeled or discarded, but never repaired, so the designs behind it are lost or keep an imprecise text, and no dataset shows how a failing specification can be made precise. VeriRL rewrites every PyraNet description it uses into a structured problem statement with ports, timing and behavior, but the rewrite is not checked against the code, so it may still allow other circuits [33]. Table 1 compares the checks and the data of each prior dataset with those of VeriLadder.
Building VeriLadder
This section describes how VeriLadder is built. It first introduces the source designs (§ 3.1) and then the five levels in order, synthesizability (§ 3.2), specification quality (§ 3.8), refined specifications (§ 3.11), paraphrases (§ 3.12) and one-fact variants (§ 3.15). The levels form a ladder, because each level works only on the designs that the levels before it kept and asks a stricter question about them. The dataset stores one record per design, which contains the original instruction and code together with the labels and texts that each level adds, up to the highest level the design reaches (Figure 2). Levels 2–5 are carried out by the VeriLadder framework (Figure 1), whose agents are roles of two LLMs. The refiner (gpt-6-luna) describes, grades, rewrites, paraphrases and varies the specifications, and the builder (Claude Haiku 5.5) writes code from them.
Figure 2. What a record of VeriLadder contains. Each frame lists what one level adds and holds only the designs that reach that level. At Level 3 the record keeps the refinement trajectory, and at Level 5 the counterexample of every one-fact variant. (The boxes like “box” are simplified drawings, “Useful for” names a use of what the level adds, and Figure 3–Figure 20 show real records.
Source designs
VeriLadder is built from the RTLCoder dataset [22], instruction–code pairs written by GPT-3.5. To test whether the Level-1 findings hold beyond one dataset, Level 1 is also applied to PyraNet [27]. To prevent benchmark contamination, every design whose instruction has a Rouge-L F1 above 0.5 with the description of a VerilogEval or RTLLM problem [21, 26], or whose code has a Rouge-L F1 above 0.8 with a reference solution, is removed before any level. This leaves 26,076 RTLCoder and 690,551 PyraNet designs, and all statistics in § 3 and § 4 refer to them. The approach is general and can be applied beyond a single dataset. Levels 2–5 are applied to the 15,656 effectively synthesizable RTLCoder designs (§ 3.2), of which 14,385 pass two entry checks, since Yosys must extract the facts that Level 2 needs and the equivalence checker must verify the design as equivalent to itself. Every request to an LLM and every response is stored, together with the prompts and the code of the run, and only public data is sent to commercial LLM services.
Level 1: Synthesizability
Level 1 asks whether the code of a design becomes hardware at the end of the chip design flow. Figure 3 shows one design for each outcome. A design is synthesizable if a synthesis tool, here Yosys [39], translates it into a gate-level netlist without errors, and a warning is critical if it points to a likely hardware defect. The netlist is then mapped to the cells of a standard-cell library (here, the Nangate 45 nm library), which gives the cell count, the area and the logic depth, the largest number of cells on any path from an input port or a flip-flop to an output port or a flip-flop. Static timing analysis of the mapped netlist gives the critical-path delay, the longest delay on any such path, which limits the clock frequency.

Figure 3. Real records of Level 1, one for each outcome of the synthesis label. A synthesizable design with its post-synthesis metrics, a design that is not synthesizable with the Yosys error and its family, and a synthesizable design with a critical warning.
Why synthesis comes first
Why synthesis comes first. RTL code that cannot be synthesized never becomes hardware. The later levels also need the synthesized circuit, not only the source code, because the scorer of Level 2 reads facts that Yosys extracts from the synthesized design and the equivalence checker of Level 3 compares two synthesizable circuits. Level 1 also keeps the designs that fail, labeled with the cause and the line of the failure, so that they can serve as negative examples for preference optimization, which trains a model toward preferred and away from dispreferred outputs [28]. Only designs that synthesize into at least one standard cell, called effectively synthesizable, continue to Level 2, because a design with no cells has no logic for the later levels to check.
Synthesis outcome
Each design is elaborated and synthesized into a generic gate-level netlist with Yosys under a fixed time budget (the Level 1 panel of Figure 1). The outcome is synthesizable, not synthesizable, or timeout.
Root cause of a failure
A design that fails is annotated with the root cause of its failure. The error that the synthesizer reports is classified by its type into 55 categories, which are grouped into nine families by the kind of defect. The families are unresolved references (a module, signal or file that does not exist), syntax, width and constant evaluation, clocking (for example, a process that reacts to both edges of a signal), unsupported constructs, simulation-only code, combinational loops that stop synthesis, timeouts, and unclassified. The failure is also localized to the line of code that the synthesizer reports. The family, the category and the line together state what kind of defect the design has, what exactly it is, and where it is.
Critical warnings
A design can synthesize and still contain a defect that the synthesizer only warns about. Level 1 flags seven such defects as critical warnings. They are conflicting drivers on a net, a wire that is used but never driven, an inferred latch, a combinational loop that Yosys reports only as a warning, an implicitly declared signal, an out-of-range bit select, and an initial block. The first six come from the synthesizer’s warnings. The last is detected in the source code, because Yosys accepts such blocks without any message. A design with a critical warning still counts as synthesizable and continues to the later levels, because its code still becomes hardware. The warning is stored as part of its label, so such designs can be excluded.
Post-synthesis metrics
Each synthesizable design is mapped to the standard cells of the open Nangate 45 nm library with ABC [4], which gives its cell count, area, logic depth, and numbers of flip-flops and latches. Its critical-path delay comes from static timing analysis with OpenSTA on a delay-oriented mapping of the same design, which inserts the buffers that the area-oriented mapping leaves out.
Empty circuits. A design can be synthesizable and still map to no cell at all, because synthesis removes all logic that does not affect an output. Such an empty circuit arises in three ways, shown with real RTL-Coder designs in Figure 4. An output can be undefined, for example because the register that drives it is clocked by a signal that is not a port (Figure 4a). An output can be constant, for example because the logic that computes it gives the same value for every input; the AND gate of Figure 4b computes , and since , its output is always 1. Finally, every output can be wired directly to an input, as in the concatenation of Figure 4c. A design is effectively synthesizable only if its netlist contains at least one cell, and only such designs continue to Level 2; the cell count of every design is released, so a user can still select the wiring-only designs.

(a) Undefined output
module delay_gate_4stage (
input A, output X);
reg [3:0] delay_reg;
// clk is not a port
always @(posedge clk)
delay_reg <=
{delay_reg[2:0], A};
assign X = delay_reg[3];
endmoduleclk is never driven, so the register is never clocked, X is undefined, and synthesis removes the register.
(b) Constant output
module and_gate(input a,
input b, output wire out);
wire not_a, not_b,
temp1, temp2;
assign not_a = ~a;
assign not_b = ~b;
assign temp1 = not_a ^ b;
assign temp2 = a ^ not_b;
assign out = ~(temp1 ^ temp2);
endmoduletemp1 and temp2 are always equal, so out is 1 for every input instead of a & b.
(c) Wiring only
module concat_module(
input wire [7:0] in_hi,
input wire [7:0] in_lo,
output wire [15:0] out);
assign out = {in_hi, in_lo};
endmoduleCorrect, but every output bit is wired to an input bit, so no gate is needed.
Figure 4. The three ways in which a synthesizable RTLCoder design becomes an empty circuit with zero cells. The first two are wrong designs that synthesis accepts without an error; the third is correct but contains no logic.
Results
Figure 5 shows the outcome. In RTLCoder, 71.9% of the designs are synthesizable, but only 60.0% are effectively synthesizable (15,657 designs), because 11.8% of all designs synthesize to an empty circuit. Re-synthesizing these empty circuits shows why. In 42% of them, at least one output is never driven or undefined, in 30% all outputs are constant, and in 19% the outputs are only wired to inputs or constants, as in a byte reversal; only 2% have no output at all, and the rest have other or mixed causes. The wired-only designs are correct hardware that needs no gates, so a user who wants them can select them by this label. PyraNet is worse on both counts, with 56.6% of its designs synthesizable and 45.7% effectively synthesizable. PyraNet’s own quality rating of each design, given by an LLM, is almost unrelated to whether the design synthesizes (Spearman rank correlation 0.08), so an LLM rating is not a substitute for a synthesis check. A pass label alone therefore overstates how much of a dataset is hardware, so cell count is released with every pass.
Figure 5. Level-1 outcome for each dataset, as a share of all designs (numbers of designs in parentheses). An empty circuit is synthesizable but maps to no standard cell. RTLCoder (26,076 designs); PyraNet (690,551 designs). % of designs. Not synthesizable: 28.1 (7,337), 43.4 (299,360). Synthesizable, empty circuit (zero cells): 11.8 (3,083), 11.0 (75,879). Effectively synthesizable (at least one cell): 60.0 (15,656), 45.7 (315,312).
Many designs that synthesize are still probably defective. Of the 14,385 effectively synthesizable RTLCoder designs processed at Levels 2–5, 16.3% have at least one critical warning. The most common are conflicting drivers (7.1%), undriven wires (3.6%) and latches (3.1%), followed by combinational loops (2.7%), implicit declarations (2.6%), out-of-range bit selects (2.5%) and initial blocks (1.7%). In addition, 14.8% have output bits that stay constant after synthesis, such as a flag that can never be raised. Designs with a critical warning still produce hardware, so they continue to the later levels with the warning as part of their label, and 11.8% of the designs accepted at Level 3 carry one.
Key finding: A large portion of public RTL training data is not synthesizable. 28% of RTLCoder and 43% of PyraNet designs fail synthesis, and 16% and 19% of the synthesizable ones produce no circuit. A model trained on such data without these labels learns from code that cannot generate RTL that can be considered hardware as if it were correct. Synthesizability should therefore be the first label of an RTL dataset, because it keeps non-hardware out of the positive examples and, together with the failure category, turns the failing designs into negative examples for contrastive learning and preference optimization.
Level 2: Specification quality
Level 2 measures how well the original instruction specifies its design. Figure 6 shows the grades of a real instruction.

Figure 6. A real record of Level 2. The scorer grades the original instruction of digital_system on the four qualities and reports what is missing, shown here in plain words (red: phrases that leave the behavior open). No circuit rebuilt from the instruction is equivalent to the code, even when the exact port list is added. Original instruction: [...] Create a module that implements a digital system with four inputs (a,b,c,d) that generates a logic-1 when the input is a multiple of 3, and a logic-0 otherwise. You should design the module using a combinational circuit and optimize the output expression to minimize the number of gates. Original code:
module digital_system (
input a, input b, input c, input d,
output reg out
);
always @* begin
if ((a+b+c+d)%3 == 0) begin
out <= 1;
end else begin
out <= 0;
end
end
endmoduleLevel 2: grades of the original instruction (grade, and the gaps that the scorer reports, in plain words). Scorer output. Consistency 5 No gap: what the instruction states is true of the code. Unambiguity 3 “The input is a multiple of 3” does not say whether a, b, c, d form one 4-bit number or are four bits to be added: the two readings disagree, for example on 1100 (as a number, 12 is a multiple of 3; as a sum, 1+1+0+0 = 2 is not) and on 1110 (as a number, 14 is not; as a sum, 1+1+1+0 = 3 is). Completeness 2 The module name, the output name and the port directions are missing. Verifiability 3 “Minimize the number of gates” gives no gate count or limit, so no test can check it. Rebuilt from the original instruction: 0 of 5 attempts verified equivalent (all five use other port names). With the exact port list added, still 0 of 5: all five read a, b, c, d as one 4-bit number, so for , , , they output 1 and the code outputs 0.
Example design (RTLCoder design digital_system, combinational)
Four qualities of a specification
A synthesizable design is useful for training only if its instruction describes it well enough that a designer could build it. A specification can fail its reader in four different ways. It can state someth one way, leave something out, or state something that cannot be checked. Each of these failures is measured by one quality, called consistency, unambiguity, completeness and verifiability.
The names of these qualities come from the IEEE recommended practice for software requirements specifications [15], of which Level 2 keeps only the characteristics that decide which circuit is built. It differs from the standard study [15] in three ways. (i) Each quality is defined by what can be observed at the ports of the circuit. (ii) Consistency is checked against the paired code instead of within the text, so it covers both the correct and the consistent characteristics of the standard. (iii) The grades are tested against a tool result, which is whether the circuit can be rebuilt from the specification by the round trip of Level 3 (Section 3.3.5).
The four qualities describe different defects, and a specification can be good in three of them and still lead to the wrong circuit because of the fourth (Section 3.3.6 measures how often this happens). Together they describe what Level 3 tests directly, because a specification that is consistent, unambiguous, complete, and verifiable allows exactly one behavior at the ports, so any correct implementation of it is functionally equivalent to the original design. Table 2 gives the grades of each quality.
| Grade | Consistency: every statement is true of the design | Unambiguity: every statement has one reading | Completeness: every port-visible behavior is stated | Verifiability: every requirement can be checked at the ports |
| 5 | Every stated behavior matches. | Nothing is open. | An equivalent design can be built from the text alone. | Every requirement maps to a check on named ports. |
| 4 | One secondary detail is wrong: “tc is a registered output.” | One minor item is open: “on each clock” (which edge?) | One minor item is missing: priority of reset over enable not stated. | One requirement has no time or condition: “tc indicates the last count.” |
| 3 | Core correct, several details wrong: “asynchronous reset … tc high at 254.” | One or two important items are open: “active reset”; “tc signals overflow.” | Ports complete, several behaviors missing: tc never defined, wrap-around not stated. | Several vague requirements: “updates as needed”; “at the right time.” |
| 2 | Core partly wrong or self-contradictory: “8-bit counter that counts 0 to 999, then saturates.” | Most behavior is open: “reset clears it; counts when enabled; tc marks the end.” | Ports incomplete, core partly given: “8-bit counter with clock and reset; output count.” | Mostly qualitative: “works correctly; handles overflow reliably.” |
| 1 | A different function: “a 4-bit down-counter with load.” | The core function is open: “a counter with reset and enable that signals when done.” | Almost nothing is stated: “Design a counter.” | Entirely qualitative: “a fast, robust, low-power counter.” |
Table 2. Grades of the four specification qualities, as given to the scoring LLM. The examples describe the same reference design: an 8-bit up-counter with a synchronous active-high reset that has priority over the enable, wrap-around from 255 to 0, a registered output count, and a combinational output tc that is 1 exactly when count is 255 and en is 1.
Consistency: every statement is true of the design. A specification can be clear, complete and testable and still describe a different circuit. Consider the RTLCoder design and4b, whose instruction asks for the AND of its four inputs A_N, B, C and D, while its code computes X = ~(A_N | B | C | D), which is a NOR. Each sentence of the instruction is precise, and a test for it is easy to write, but the pair teaches a model that this code computes an AND. Such errors are common when the instruction and the code were written separately, for example when an LLM wrote the instruction for existing code. None of the other three qualities can detect this, because they judge the specification alone; consistency is the only quality that compares the specification with the design.
Unambiguity: every statement has only one reading. A statement can be true of the design and still allow other designs. Consider “Output the average of the two 8-bit inputs a and b, rounded down.” If the inputs are unsigned, the average of a = 8’hFF (255) and b = 8’h01 (1) is 128; if they are signed, a is −1 and the average is 0. Both circuits are reasonable readings, and a model trained on this pair learns that either one is correct. Typical sources of ambiguity in Verilog instructions are the signedness of values, the clock edge (“on each clock”), the reset level (“an active reset”) and the order of priority between control signals.
Completeness: every behavior visible at the ports is stated. A specification can be true and unambiguous in everything it says and still be silent about part of the design. Consider “Design a debouncer for a push button.” Nothing in this instruction is false or ambiguous, but the reader must guess how many clock cycles the input must stay stable, whether the output is active high or low, its value after reset, and what it shows while the input still bounces. Each guess is a separate chance to build a different circuit. Missing information is the most common defect in RTLCoder, where 73% of the instructions receive a completeness grade of 3 or less, more than for any other quality. The instruction of Figure 6 is a typical case, since it never names the module or its output and never says which ports are inputs and which are outputs.
Verifiability: every requirement can be checked at the ports. A requirement is useful only if one can decide whether a design meets it. Consider “The debouncer should ignore glitches reliably and respond quickly.” No test can decide what “reliably” or “quickly” means, so two very different designs satisfy this specification equally well. A verifiable version states an observable condition, for example “out takes the value of btn only after btn has kept that value for 16 consecutive rising edges of clk.” Verifiability matters more for hardware than for most software, because the
module bin_to_gray(
input clk,
input rst,
input [3:0] BIN,
output reg [3:0] GRAY
);
always @(posedge clk)
if (rst)
GRAY <= 4'b0000;
else
GRAY <= BIN ^ (BIN >> 1);
endmodule
Top module: bin_to_gray Ports: input clk 1 bit input rst 1 bit input BIN 4 bits output GRAY 4 bits Clocks: clk (rising edge) Resets: rst (synchronous, active high) Storage: 4 flip-flop bits, 0 latch bits, 0 memory bits Parameters: none Outputs: GRAY: registered, reset value 0
acceptance test of Level 3 compares designs only through their ports and clock cycles; a requirement that cannot be expressed in these terms cannot be confirmed by any tool.
Why the scorer uses a rubric
LLMs used as judges of text are known to depend on the order and length of the texts they compare, to favor their own text [30, 37, 45], and to state facts that are not in their input [16]. A rubric, which states for each grade what a specification must contain, makes LLM grades agree more closely with human experts and easier to reproduce [11, 18, 24, 40], and rubric scores now serve as training rewards where no exact answer exists [10]. The scorer of Level 2 uses such a rubric and adds four safeguards. First, it judges the specification against what the design actually does, using facts extracted by Yosys and a behavior description that is checked against these facts (§ 3.9.2), rather than its own reading of the code. Second, every grade is defined by an example specification of a reference design, an 8-bit counter, and all grades use this same design, so the scale is fixed in advance (Table 2). Third, the scorer must quote the specification and the behavior description as evidence for each grade, which makes unsupported grades visible. Fourth, each defect counts against exactly one quality, and when the scorer hesitates between two grades it must give the lower one. The grades are not taken on trust. Sections 3.3.5 and 3.3.7 test whether they predict the outcome of a tool-based check and whether a second LLM from another model family gives the same grades.
What the scorer knows about the design
To grade a specification, the scorer must know what the design actually does. An LLM reading the code alone can misread it, so the scorer receives two descriptions of the design that complement each other. (i) Facts extracted by Yosys (Figure 7). They are exact but describe only the structure of the design, such as its ports with their direction, width and sign, its parameters, its clocks and their edges, its resets with their type and active level, its memory size, and, for each output, whether it is stored in a register and its reset value. They do not say what an output computes. (ii) A behavior description that the refiner writes from the code and the facts (the Detective in Figure 1). It fills this gap. For every output, it states the conditions that change it in priority order, its delay in clock cycles, and any behavior that the code leaves undefined (Figure 14a). It describes only what the code does and ignores the comments and the instruction. Because the behavior description is written by an LLM, it is checked against the exact facts. If the two disagree, for example on the width of a port or the active level of a reset, the LLM has misread the code, and the design is labeled misunderstood and goes no further; this happened for 57 of the 14,385 designs.

Figure 7. The facts that Yosys extracts from an RTLCoder design (right), shown with its code (left). The facts give the ports, clock, reset, storage and the kind and reset value of each output, but not what the output computes; that part comes from the behavior description.

Figure 14. Templates of the other prompts used in Levels 2–5, with key instructions quoted.
3.3.4 Grades and prompt. The refiner, acting as the scorer (the Grader in Figure 1), gives each quality a grade from 1 (poor) to 5 (excellent). Table 2 lists the grades, and Figure 8 shows the scoring prompt.

Scoring prompt (system message, condensed)
You are a senior digital-design engineer reviewing a hardware specification.
You will be given a DESCRIPTION of a design, a verified BEHAVIOR SHEET of the
design (ground truth), and tool facts. Score the DESCRIPTION on four metrics
using the rubric. Do not rewrite it.
================ RUBRIC ================
Each defect is charged to ONE metric:
- stated and wrong, or self-contradictory -> CONSISTENCY
- stated but has several readings -> UNAMBIGUITY
- not stated at all -> COMPLETENESS
- stated but not checkable at the ports -> VERIFIABILITY
Score against the behavior sheet, not your own reading of the code.
If torn between two scores, give the lower. For purely combinational
designs, clock/reset/latency items are N/A and count as satisfied.
Reference example (ground truth): counter8 - 8-bit up-counter; rising edge
of clk; synchronous active-high rst clears count to 0 and has priority over
en; else if en, count increments and wraps 255 -> 0; count is registered;
tc (combinational) = 1 exactly when count == 255 and en == 1.
[Grade definitions 5 to 1 for each metric, each with an example
of the reference design, as in the rubric table.]
========================================
Return only JSON:
{
"consistency": {"score": 1-5, "evidence": "quote the description; cite the behavior-sheet entry"},
"unambiguity": {"score": 1-5, "evidence": "..."},
"completeness": {"score": 1-5, "evidence": "..."},
"verifiability": {"score": 1-5, "evidence": "..."}
}Figure 8. The system prompt that grades a text on the four qualities, with the grade definitions of Table 2 left out. The same prompt is used for the original instructions, the refined specifications, and the second scorer. The user message contains the text to grade, the Yosys facts and the checked behavior description.
3.3.5 Do the grades predict anything? If the four qualities capture what makes a specification usable, a specification with high grades should let another model rebuild the circuit, and one with low grades should not. The round trip of Level 3, described next, tests this when it is applied to the original instructions. Figure 9a shows that the grades predict the outcome well. This test uses the 14,292 designs that have both grades and a round-trip result, that is, the 14,385 designs without the 57 misunderstood ones and the 36 whose refined specification never passes the program checks of Level 3 (§ 3.11). Of these, those whose instruction has an average grade below 3 are rebuilt in less than 5% of cases, and those with an average of 4 or more in 69.3% of cases. The average of the four grades separates the rebuilt from the not-rebuilt instructions with an area under the ROC curve (AUC) of 0.89, where 0.5 is chance and 1.0 is perfect (Figure 9b). Taken alone, each quality also predicts the outcome, and verifiability and completeness do so best, with an AUC of 0.86 and 0.84, against 0.83 for unambiguity and 0.81 for consistency (Figure 9b). Their rebuild rates rise most steeply with the grade (Figure 9a); for example, an instruction with a completeness grade of 2 is rebuilt in 4.8% of cases, and one with a grade of 5 in 79.4% of cases.
Each defect is charged to one quality: stated and wrong (consistency), stated with several readings (unambiguity), not stated (completeness), stated but not checkable at the ports (verifiability). For combinational designs, clock, reset and latency items count as satisfied. If the scorer is torn between two grades, it gives the lower one. A higher grade is better (↑).
(a)
(b)
Figure 9. (a) Share of designs that another LLM rebuilds from the original instruction, by the instruction’s grade on each quality. (b) ROC curve of each grade and of their average as a predictor of whether the circuit is rebuilt, with the AUC in parentheses; the dashed diagonal is chance.
Are the four qualities distinct?
The grades of the four qualities are correlated (Spearman rank correlation 0.51–0.84; Figure 11a), because a poor instruction is often poor in several ways, but no pair is close to 1, and 17–55% of each grade cannot be explained by the other three (Figure 11b). Consistency is the most distinct, since it is the only quality that compares the instruction with the code. Verifiability shares the most with unambiguity and completeness, as expected, because a requirement that is missing or has two readings cannot be checked either. Its own role is to catch requirements that are stated clearly but that no test at the ports can check, such as “make it fast” or “use as few gates as possible”. Such a requirement does not describe what the circuit does, so the refined specification must drop it or turn it into a checkable one, as with the gate-count request of Figure 6. Correlation alone cannot show whether one quality is only a part of another, so Figure 10a counts, for every instruction, which qualities are low (a grade of 3 or less). In 43% of the instructions all four are low, and in 20% none is. Consistency, completeness and unambiguity are each the only low quality in 352, 782 and 149 instructions, so each carries information about defects that the other three do not carry. Verifiability is rarely the only low quality (25 instructions), because an uncheckable requirement usually comes with missing or ambiguous ones. Each of these three qualities also matters on its own (Figure 10b). When only one of them is low, the share of instructions that another LLM rebuilds falls from 76.4% (no low quality) to 54.9% for completeness, 51.7% for unambiguity and 19.0% for consistency.
Figure 10. Overlap of the four qualities on the 14,292 graded original instructions; a quality is low if its grade is 3 or less. (a) Number of instructions for each combination of low qualities, for the ten most frequent combinations; a colored square marks a low quality, and the bar color gives how many of the four qualities are low. (b) Share of instructions rebuilt from the original instruction when no quality is low and when exactly one quality is low.
Figure 11. The four qualities are related but not redundant (14,292 graded original instructions). (a) Spearman correlation between the grades of each pair of qualities. (b) For each quality, the part of its grade that the other three grades explain (gray; of a linear regression on the ranks of the other three) and the part that they cannot explain (color). A quality that duplicated the others would have almost no colored part.
3.3.7 Do the grades depend on the scoring model? The grades of Level 2 are given by gpt-6-luna, the same LLM that later rewrites the instructions. A scorer might favor its own writing, or another model might grade differently. To test this, a second LLM from another model family, Claude Haiku 5.5, graded 297 random designs with the same prompt, both the original instruction and the refined specification. Figure 12a shows the result. The two scorers agree closely. The Spearman rank correlation of their grades is 0.80–0.87 for the four qualities and 0.91 for the average, and for each quality, 91–97% of their grades differ by at most one point (Figure 12b). Haiku is somewhat stricter in absolute terms, but it finds the same improvement from the original instruction to the refined specification, +1.63 points on average, against +1.58 for gpt-6-luna. The difference, −0.05, shows no preference of the rewriting model for its own specifications. The grades therefore describe the specification, not the model that gives them.
Figure 12. Grades given by gpt-6-luna and Claude Haiku 5.5 to the same 297 designs. (a) Average grades; above the bars, the improvement from the original instruction to the refined specification (gpt-6-luna / Haiku). (b) Share (%) of the 594 graded texts that received each pair of grades; outlined cells are exact agreement, and is the Spearman correlation.
Key finding: The grades of four qualities predict whether an instruction is precise enough to rebuild its circuit (ROC AUC 0.89), and two LLMs from different model families (OpenAI vs Anthropic) give nearly the same grades (Spearman 0.91), with no preference for their own specifications. The grades therefore describe the specification itself and can screen training instructions before any circuit is rebuilt.
Level 3: The refined specification determines the circuit
Level 3 rewrites the original instruction until it determines its circuit. Figure 13 shows an accepted refined specification (a) and a refinement trajectory (b).

Figure 13. Real records of Level 3. (a) The refined specification of digital_system closes the gaps that Level 2 reported (green) and is accepted because every rebuild from it is proven equivalent to the code. (b) A refinement trajectory. The first refined specification of a saturating adder wrongly states that the sum wraps at 8 bits; the counterexample , shows that the code saturates instead, and the revised specification, which compares the full sum, is accepted.
The round trip
The grades of Level 2 are given by an LLM, so they do not decide whether a specification is accepted. Instead, each specification is tested directly with a round trip (the Level 3 panel of Figure 1). A second LLM, the builder, receives only the specification and writes the module five times (the Builders in Figure 1; Figure 14c). An attempt that does not compile receives the Yosys error once and may correct itself. A formal equivalence checker (the Equivalence check box in Figure 1) then compares each attempt with the original code, and the specification passes if at least one attempt is verified equivalent. The builder (Claude Haiku 5.5) comes from a different model family than the refiner (gpt-6-luna), so it does not share the refiner’s view of the code.
The equivalence checker
Two circuits are functionally equivalent if they produce the same outputs for every sequence of inputs. A SAT solver applied to a miter, a circuit that feeds the same inputs to both designs and signals any difference between their outputs, either confirms this or returns a counterexample, an input sequence on which they differ. Two designs that pass the check below are called verified equivalent; for combinational designs this is a proof, and for sequential designs it is bounded to a fixed number of clock cycles. The checker works in four steps. First, it compares the ports of the two designs, whose names, directions and widths must match. Second, it builds a miter of the two designs with Yosys and asks the SAT solver whether any output can differ, starting from a state in which all registers are zero. For combinational designs this is a proof over all inputs. For sequential designs the check is bounded and covers the first 20 clock cycles after reset. Third, because some differences appear only after many cycles, for example in a large counter, it simulates both designs with three random input sequences of 3,000 cycles each and with different reset patterns. Fourth, it checks that both designs use the same clock edges, which the SAT model alone does not distinguish. An attempt is verified equivalent only if all steps pass.
Rewriting the instruction
Because most original instructions fail this test, the refiner, shown as the Writer in Figure 1, rewrites every instruction. It receives the original instruction, the Yosys facts and the checked behavior description, and writes a refined specification with five fixed sections (overview, interface, behavior, reset and timing; Figure 14b). The refined specification is functional. It states what the outputs do, cycle by cycle, but not how the circuit computes them. The refined specification is grounded in the code, because a training label must be true of the code it is paired with; otherwise the pair teaches a wrong mapping. Where the original instruction and the code disagree, the refined specification follows the code, and the record of the design is marked with a flag saying that the instruction contradicts the code, so that users can find or exclude such pairs (the flags are listed below). The refined specification must describe behavior, not implementation, and must not contain code. A program checks this. The refined specification must name every port, must not contain lines that look like Verilog, and must not share any sequence of 15 words with the code outside the port list. A refined specification that fails is returned once for correction. If the round trip then fails, the refiner receives the counterexample from the checker, cycle by cycle, and revises the refined specification (Figure 14d). The prompt asks it to state the general rule that the counterexample exposes, not the counterexample itself. This is repeated at most twice.
The code is never changed, even when it is probably wrong, for example when an output is stuck at a constant value; the refined specification then describes what the code actually does. Such cases are recorded as flags instead. The refiner flags an original instruction that contradicts the code or is incomplete and code that may have a bug, and Yosys flags structural problems such as undriven signals, several drivers on one signal, latches and constant outputs. The flags do not decide acceptance, but they let users find or exclude such designs.
Results
Of the 14,385 designs, 57 stop at Level 2 as misunderstood and 36 never obtain a refined specification that passes the program checks, so 14,292 reach the round trip. From the original instruction, the builder rebuilds 26.1% of the 14,385 designs, and 36.7% when the exact list of ports is added to the instruction. From the refined specification, it rebuilds 74.0% at the first try and 78.2% after revision, a gain of 52 percentage points, and every design type gains about 50 points (Figure 23). Because the same builder rebuilds most designs once their specification is refined, the low rate from the original instructions comes from the instructions, not from the builder. On 1,460 randomly sampled designs, a commercial builder (Claude Haiku 5.5) and an open-source one (Qwen3-Coder-30B) rebuild almost the same share from the original instruction (27% and 28%), and both rebuild far more from the refined specification (82% and 71%; Figure 15b). The grades of Level 2 rise accordingly, from averages of 3.0–3.4 for the original instructions to 4.7–4.8 for the accepted refined specifications of the 4,446 designs that were graded again (Figure 16). Completeness improves most, as 83% of the refined specifications receive the top grade, against 12% of the original instructions.
Figure 15. The round trip. (a) Outcome of the 14,292 designs that reach it; the 11,247 accepted designs give the refinement trajectories. (b) Share of designs that each builder rebuilds from each kind of specification, verified equivalent to the original code (1,460 randomly sampled designs; 95% confidence intervals). From the original instruction to the refined specification after revision, Claude Haiku 5.5 gains 55 and the open Qwen3-Coder-30B 43 percentage points, so the gain is not tied to the builder that the pipeline uses.
Figure 16. Distribution of the grades of the original instruction and the accepted refined specification for 4,446 designs that were graded again after rewriting.
Figure 23. Share of designs rebuilt and verified equivalent, by design type. Gray is the share rebuilt from the original instruction, blue is what the refined specification adds (in percentage points), and the number at the end is the share rebuilt from the refined specification. The rows of each size and each kind add up to all 14,385 designs processed at Level 3; the feature rows overlap, since a design can have several features, and 9,827 designs have none of them.
Key finding: The builder LLM rebuilds the circuit from the original instruction for only 26.1% of the 14,385 designs. The multi-agent, tool-verified refinement of VeriLadder raises this to 78.2%, and every accepted refined specification is confirmed by a formal equivalence check. The gain also holds for an open-source builder chosen for this study, Qwen3-Coder-30B (28% to 71%). Most instructions of the original dataset therefore do not determine their circuit, so the pairs teach an inaccurate mapping from natural language to RTL.
Refinement trajectories as teacher data. Existing Verilog datasets teach a model to write code from a specification, but none teaches it to write the specification. Level 3 produces this data at no extra cost. For each design, VeriLadder stores its refinement trajectory, which contains every refined specification the refiner wrote and, for each failed one, the counterexample that rejected it. This gives 11,247 trajectories that end in a verified specification (Figure 15a) and 9,719 failed specifications with their counterexamples.
Length of the refined specifications
A refined specification might be more precise only because it is longer, but it is not much longer (Figure 17a; Figure 17b shows the ratio of the two lengths for each design). For the accepted designs, the median refined specification has 197 tokens and the median original instruction 180 (Qwen2.5-Coder tokenizer), and in words the two are almost equal, 128 and 129. The few extra tokens come from exact names, widths and constants, not from more text.
Figure 17. (a) Length in tokens of each kind of text for the 11,247 accepted designs (boxes: middle 50%; lines: medians; whiskers: 1.5 times the box width). (b) Ratio of the length of each refined specification to the length of its original instruction.
Accepted specification of adder (Figure 13b, a saturating adder; the interface part is omitted)
| Accepted specification |
| [...] Behavior: Compare the full unsigned mathematical sum A + B against 255. If the sum is greater than 255, Y is 255; otherwise, Y is the low 8 bits of the sum. |
Table 18.
Three paraphrases
| Lexical | Syntactic | Representational (table) |
| Evaluate the complete unsigned mathematical total of A and B relative to 255. For a total exceeding 255, the output Y takes the value 255. For a total that does not exceed 255, Y carries the total’s least significant 8 bits. | Determine the result by comparing the complete unsigned mathematical total of A and B with 0xFF: when that total exceeds 0xFF, the output Y takes the value 0xFF; when it does not exceed 0xFF, Y carries the total’s least significant eight bits. | Evaluate the complete unsigned mathematical total of A and B against 255. The output rule is: Total — Y; Greater than 255 — 255; Not greater than 255 — The total’s least significant 8 bits. |
| Rebuilt: 5 of 5 verified equivalent. | Rebuilt: 5 of 5 verified equivalent. | Rebuilt: 5 of 5 verified equivalent. |
Table 18.
Level 4: Paraphrases
Level 4 adds paraphrases of each accepted specification, each verified to describe the same circuit. Figure 18 shows three paraphrases of one specification.

Figure 18. Real records of Level 4. Three paraphrases of the accepted specification of the saturating adder, one per kind of change (lexical, syntactic and representational). Each is rebuilt into a circuit verified equivalent to the code.
Motivation
In real chip design work, different engineers ask for the same module in different words, and code-generation models are known to be sensitive to such changes [38]. A model that sees only one wording per design learns only one way of asking. For Verilog, VeriAssist reworded the instructions of its own workflow, not the design descriptions, to test that its results do not depend on the wording [14], but no Verilog training set is known to contain paraphrases that are each verified to describe the same circuit.
Procedure
First, the refiner lists the critical facts of the accepted refined specification. These are the statements an engineer needs to rebuild the circuit, one rule, constant, priority or timing property each, and each comes with the exact sentence of the specification that states it. Then, shown as the Paraphraser in Figure 1, it writes three paraphrases, specifications with the same meaning but different wording (Figure 14e). Each one uses mainly one kind of change, which is lexical (other words for the same behavior, such as “asserted low” instead of “active-low”), syntactic (a different sentence structure or order), or representational (another format, such as a table instead of prose, or hexadecimal instead of decimal numbers). For every critical fact, the refiner must point to the exact words of the paraphrase that state it. A program then checks each paraphrase. It must state every critical fact and name every port, and it must not contain code. It must also not copy long passages of the refined specification. A paraphrase that passes these checks must then pass the round trip of Level 3 on its own.
Results
Paraphrases are somewhat longer than the refined specifications they reword (median 220–243 tokens; Figure 17a), because they often restate the facts as tables. Of 33,317 paraphrases that state all critical facts, 32,393 (97.2%) pass the round trip. They are substantial rewordings. Turning a refined specification into one of its paraphrases changes a median of 81% of its tokens (Figure 19a), and of the four-word sequences (word 4-grams) in a paraphrase, a median of only 7% also appear in the refined specification (Figure 19b). The three kinds of paraphrase differ from the refined specification by about the same amount. § 5.4 uses the paraphrases to test two LLMs. Each accepted design therefore has up to four specifications, each verified to describe the same circuit.
Figure 19. How much the 32,393 verified paraphrases differ from the refined specifications they reword. (a) Share of tokens that must change to turn the refined specification into the paraphrase (token edit distance, Qwen2.5-Coder tokenizer). (b) Share of the word 4-grams of a paraphrase that also appear in the refined specification. Dashed lines mark the medians; the medians of the three kinds of paraphrase are given in gray.
Key finding: The paraphrases change a median of 81% of the tokens of the refined specification and share only 7% of its four-word sequences, yet 97.2% of them still determine the same circuit. One verified design thus yields up to four specifications that differ substantially in wording but are verified to describe the same circuit. They can be used to train or test robustness to the wording of a request (§ 5.4).
Level 5: One-fact variants
Level 5 adds one-fact variants, pairs of a specification and code that differ from the accepted design in exactly one behavior. Figure 20 shows a variant of the saturating adder.

Figure 20. A real record of Level 5. The saturation value of the adder changes from 255 to 254 in both the specification and the code, and the counterexample shows where the variant and the original differ. Changed specification. [...] Behavior: Compare the full unsigned mathematical sum against 255. If the sum is greater than 255, is 254; otherwise, is the low 8 bits of the sum. Rebuilt: 5 of 5 verified equivalent to the changed code, 0 of 5 to the original code. Changed code (one line). if (A + B > 255) begin Y <= 254; // was: 255 end else ... Synthesizable, and a hard negative for the original specification. Counterexample. . orig. variant. 143 128 255 254. The two circuits agree on every input whose sum fits in 8 bits and differ on every input that saturates.
Motivation
Many design bugs are a single wrong detail, such as a wrong reset value, the wrong clock edge, or a counter that stops one step too early. A pair of a correct design and such a hard negative, which differs from it in exactly one behavior, shows which detail makes the behavior different.
Procedure
Let be the accepted refined specification of a design and its code. The Trickster agent in Figure 1 takes one critical fact of , such as the active level of a reset, a priority, a constant, a delay or a clock edge, and changes it, for example to a saturation value of 254 instead of 255 (Figure 14f). It rewrites only the sentences of that state this fact, which gives the variant specification , and changes to match, which gives the variant code . The pair is a one-fact variant. A variant is kept only if two checks pass. First, the equivalence checker must find a counterexample, an input on which and give different outputs, so they are really different circuits. Second, must determine , which is tested with the round trip, in which the builder reads only and at least one of its five attempts must be verified equivalent to . Figure 20 shows both checks for the saturating adder.
Results
This gives 9,306 one-fact variants whose code differs from the original, of which 8,397 also pass the round trip. A variant specification has about the same length as the refined specification it changes (median 191 tokens; Figure 17a). When the builder reads , it writes in 86.5% of attempts and in only 6.4% (§ 5.5 compares this with an open-source model). This also shows that the builder reads the specification instead of recalling the original code. Together, the levels give each verified design a group of related examples. It contains and its paraphrases with the correct code , and the variant code , which is wrong for all of these specifications in exactly one behavior, together with the specification that it does satisfy (8,345 designs have such a group, with a verified variant and at least one paraphrase). These one-fact variants are hard negatives for preference optimization and contrastive learning.
Key finding: A change of one requirement, such as a clock edge or a reset value, is followed by the builder in 87% of attempts, and each one-fact variant is shown by a counterexample to describe a different circuit. The one-fact variants are therefore hard negatives that differ from a correct example in a single fact, and they reveal whether a model follows every fact of a specification (§ 5.5).
Dataset Statistics
This section describes the two source datasets and shows which designs each level keeps or removes. The released dataset contains the labels of all levels for both datasets, the accepted and rejected refined specifications with their paraphrases and one-fact variants, and the refinement trajectories of Level 3. In total, the accepted designs carry 2.6 million tokens of refined specifications, 8.7 million tokens of paraphrases and 1.8 million tokens of variant specifications.
Composition and duplicates
Two designs are called near duplicates if the sets of five-token sequences of their code have a Jaccard similarity of 0.8 or more. RTLCoder has few duplicates. Only 0.3% of its code is an exact copy of another design, and 5.5% of designs have a near duplicate. PyraNet has 2.7% exact and 19.3% near duplicates, and 24.7% of its rows have an empty description or the description “0”.
Why designs fail synthesis
The two datasets fail for different reasons (Figure 21). In RTLCoder, 64.9% of failures are unresolved references, mostly because the code uses a module that is not defined in the file. In PyraNet, unresolved references are also the largest family (47.4%), because many designs are parts of larger projects whose other files are missing; syntax errors follow with 34.5%, and 10.1% of failures are simulation-only commands such as $finish, which come from testbench code stored as design code.
Figure 21. Failure families as a share of the designs that fail synthesis in each dataset.
Size of the designs
After mapping, PyraNet designs are about twice as large as RTLCoder designs (median 44 vs. 22 cells) and slightly deeper (median logic depth 4 vs. 3), and both datasets have the same share of sequential designs (57% and 56%; Figure 22). The median critical-path delay is 0.14 ns for RTLCoder and 0.13 ns for PyraNet, which has more slow designs (90% are faster than 0.64 ns and 0.74 ns). Delay and logic depth rank combinational designs almost the same way (Spearman 0.89 in both datasets) but sequential designs much less so (0.56 and 0.43), because the delay also includes the time a flip-flop needs to pass its value on and the extra delay of gates that drive many inputs, so both measures are released.
Figure 22. Cell count, area and critical-path delay of effectively synthesizable designs (Nangate 45 nm). Each curve shows the share of designs at or below a value; the delay curve covers the designs with a plausible delay.
Which designs are hard to specify
The larger or more complex a design is, the less often its refined specification passes the round trip of Level 3 (Figure 23). Designs are grouped by size (cell count), by kind (with or without flip-flops), and by features of the code, namely a finite-state machine, a memory, arithmetic (, /, %), several modules in one file, or an instance of another module. It falls from 87.4% for the smallest third of designs to 64.5% for the largest third, from 84.7% for combinational to 72.9% for sequential designs, and to 60.8% for files that contain several modules. Finite-state machines gain the most. Only 4.2% are rebuilt from the original instruction, but 65.6% from the refined specification.
Key finding: The original instructions most often fail to determine the circuit for large, sequential and multi-module designs and finite-state machines. Refinement raises the share of rebuilt designs in every group, and most for finite-state machines, from 4.2% to 65.6%, so it matters most for the designs that are hardest to specify.
Designs that fail Level 3 are larger than those that pass (median 47 vs. 16 cells), so the accepted set contains more small designs. The rejected designs are released with their last refined specification and counterexample.
Refined specifications describe behavior, not one implementation
A refined specification is accepted when the circuit built from it is verified equivalent to the original code. A specification could pass this test by copying the code instead of describing what the circuit does, for example by restating the code line by line, naming its internal signals, or telling the builder which structure to use. A model trained on such specifications would learn to reproduce one particular implementation, not to design a circuit from a description of its behavior. § 3.11 lists the guards against this during refinement, and the paragraphs below test, on all 11,247 accepted designs, whether they are enough (Figure 25). If they are, the refined specification summarizes the code instead of translating it, it does not copy the code, and the circuits built from it differ in structure from the original code.
Figure 25. How closely the text and the circuits rebuilt from it follow the original code (lower is less tied to the code). “The text” covers all 11,247 accepted designs, and the rebuilds cover the designs rebuilt from both texts. The winnowing similarity is multiplied by 100, and SimEval (right) is on a scale from 0 to 1.
The refined specification summarizes the code instead of translating it line by line. A translation of the code line by line would need about one sentence per line of code, and would name every internal signal. Neither is the case (Figure 24). The number of sentences grows only slowly with the size of the code and is roughly proportional to the 0.22nd power of the number of lines, where a translation line by line would give the first power. For example, the 842 designs with 31 to 100 lines of code (not counting comments and declarations) have a median of 40 lines of code, while their refined specifications have a median of only 15 sentences. The 16 designs with more than 100 lines have a median of 110 lines of code and 20 sentences. Small designs get more sentences than they have lines, because the refined specification also states the interface, the reset and the timing, which the code expresses in declarations. On average, a refined specification names 28% of the internal signals of its code, and in Figure 26 the 16 items of a case statement become two sentences that state the rule they implement.
Figure 24. Length of each accepted refined specification against the size of its code (11,247 designs; points are jittered slightly). A translation of the code line by line would lie near the dashed line. The refined specifications grow much more slowly than the code, because they state the rule that the code implements instead of each of its statements.

Figure 26. A refined specification states behavior, not structure (RTLCoder design MoleEncoder). The original instruction prescribes how to build the circuit, and every rebuild from it copies the case statement of the original code. The refined specification states only what the output is. The builder then writes a loop that counts the set bits, which differs from the original code in structure and is proven to compute the same function.
The refined specification does not copy the code. Few refined specifications contain code. Only 0.7% of them contain Verilog syntax, such as always @ or assign x =, against 7.0% of the original instructions. Their wording is also their own. On average, only 0.25% of their four-word sequences also appear in the code, against 0.83% for the original instructions. Refined specifications mention at least one internal signal in more designs than the original instructions do (41% against 28% of the designs that have internal signals), because some behavior, such as that of a clock divider, be specified without a stored value. Most of these mentions are ordinary words such as state or count, and a name that looks like code appears for only 17% of these designs.
The circuits built from the refined specification differ from the original code. The structural similarity of two pieces of code is measured with winnowing, the method of the plagiarism detector MOSS [32], in which names and numbers are replaced by placeholders, the port declarations are removed, and the similarity is the share of shared fingerprints of five-token sequences, from 0 (nothing shared) to 1 (the same token structure). Over all 11,247 accepted designs, a rebuild from the refined specification that is verified equivalent to the original has a median similarity of only 0.24 to the original code, and only 6.0% of the designs have a rebuild with a similarity of 0.9 or more. A rebuild from the original instruction exists only for the 3,681 designs whose instruction is precise enough. On these designs, the rebuilds from the refined specification are slightly less similar to the original code than those from the instruction (median 0.21 against 0.23, Figure 25), so refinement does not push the builder toward the original code. The STELLAR fingerprint [31], which compares the control structure of two pieces of code while ignoring names and values, gives the same result, with 16.2% of the rebuilds from the refined specification and 17.9% of those from the original instruction having exactly the control structure of the original code. The syntax-tree similarity of SimEval [2], which compares the shapes of the syntax trees of two pieces of code, also agrees, with a median of 0.84 for the rebuilds from the refined specification against 0.86 for those from the original instruction. Each measure is meant to compare the original instruction with the refined specification, and not to be compared with the other measures, since each one counts a different kind of match. In 67% of the designs, at least one rebuild makes different coding choices than the original, and rebuilds reuse on average only 23% of the internal signal names of the original code.
The structure comes from the builder, not from the specification. The five rebuilds that one builder writes from the same refined specification are often nearly identical (median similarity 1.0), because a model has its own style. A different builder writes different code from the same specification. For the 1,012 of the 1,460 randomly sampled designs that both builders rebuild from the final refined specification, the median similarity between a Qwen3-Coder-30B rebuild and a Claude Haiku 5.5 rebuild is 0.40, and both are verified equivalent to the original. The same specification therefore admits several implementations, while the equivalence check ensures that they all have the same behavior. Figure 26 shows an example. The original instruction prescribes a case statement, and every rebuild from it copies this structure; the refined specification states only the function, and the rebuilds from it that are verified equivalent compute it with a loop.
Key finding: The refined specifications describe behavior, not the implementation they were written from. They summarize the code instead of translating it line by line (about 15 sentences for 40 lines of code), almost never contain code (0.7%, against 7.0% of the original instructions), and the circuits built from them are verified equivalent to the original yet differ from it in structure (median similarity 0.24). A model trained on them therefore learns the behavior that a circuit must have, rather than to reproduce one particular implementation.
Training and Evaluation with VeriLadder
This section shows one use of each level. Level 1 trains a model to write synthesizable code, Level 2 to grade specifications, and Level 3 to write functionally correct code. Levels 4 and 5 test whether an LLM is robust to the wording of a request and whether it follows every fact of a specification.
Level 1: synthesizability labels with KTO
The RTLCoder designs are split, stratified by the Level 1 label, into 10,532 training prompts and 7,900 test prompts, and the rest are held out for validation. A synthesizable design is labeled desirable and a design that fails synthesis undesirable. Eight open-source LLMs, from 1B to 32B parameters, are trained with Kahneman–Tversky optimization (KTO) [8], a preference method that needs only a desirable or undesirable label per example, not a synthesizable and a non-synthesizable answer to the same prompt. Each model is trained with low-rank adapters (LoRA [13]; rank 16, , learning rate , KTO , effective batch size 8). Each model then writes one design for every test prompt at temperature 0.1, and the design passes if Yosys synthesizes it without an error; as in the original labels, critical warnings and empty circuits are not counted as failures in this experiment.
Table 3 shows that training with the Level 1 labels raises the share of synthesizable code for every model, by 10.9 to 55.6 percentage points. With 7,900 prompts, the 95% confidence interval of each share is about points, so every gain is far larger than the uncertainty of the measurement.
| Model | Pre-trained ↑ | KTO ↑ | Gain ↑ |
| Qwen2.5-Coder-7B-Instruct | 77.5 | 89.0 | +11.5 |
| Qwen3-32B | 70.4 | 84.3 | +13.9 |
| Qwen2.5-7B-Instruct | 60.1 | 80.8 | +20.7 |
| Qwen2.5-Coder-1.5B-Instruct | 40.6 | 80.6 | +40.0 |
| Qwen2.5-14B-Instruct | 69.7 | 80.6 | +10.9 |
| Gemma-3-4B-it | 52.2 | 78.7 | +26.5 |
| Llama-3.1-8B-Instruct | 16.9 | 72.5 | +55.6 |
| Llama-3.2-1B-Instruct | 7.8 | 45.4 | +37.6 |
Table 3. Share of synthesizable code (%) on the 7,900 test prompts, before and after KTO with the Level 1 labels (↑ higher is better).
Original instruction (shortened)
[...] Write a Verilog module MoleEncoder that takes in a 16-bit binary number mole16bit and outputs a 5-bit binary number mole_position. Your module should use a case statement to assign mole_position based on the input mole16bit.
Rebuilt: 5 of 5, all with a 16-entry case statement, like the original code.
Original code (condensed)
module MoleEncoder(mole16bit, mole_position);
input [15:0] mole16bit;
output [4:0] mole_position;
always @* begin
case (mole16bit)
16'b0000_0000_0000_0001: mole_position = 5'b00000;
16'b0000_0000_0000_0010: mole_position = 5'b00001;
16'b0100_0000_0000_0000: mole_position = 5'b01110;
16'b1000_0000_0000_0000: mole_position = 5'b01111;
default: mole_position = 5'b00000;
endcase
end
endmodule
Refined specification (accepted)
Overview: MoleEncoder combinationally encodes a 16-bit one-hot input as the index of its set bit. Interface: Input mole16bit is an unsigned 16-bit value. Output mole_position is an unsigned 5-bit value. Behavior: If mole16bit has exactly one set bit, mole_position is the index of that bit, with bit 0 mapping to 0 and bit 15 mapping to 15. For every other input, including zero and inputs with multiple set bits, mole_position is 0.
Rebuilt from the refined specification
module MoleEncoder (
input wire [15:0] mole16bit,
output reg [4:0] mole_position
);
integer i;
reg [4:0] idx;
reg valid;
reg [4:0] cnt;
always @(*) begin
idx = 5'd0;
cnt = 5'd0;
for (i = 0; i < 16; i = i + 1) begin
if (mole16bit[i]) begin
idx = i[4:0];
cnt = cnt + 5'd1;
end
end
valid = (cnt == 5'd1);
if (valid)
mole_position = idx;
else
mole_position = 5'd0;
end
endmodule
2 of 5 rebuilds proven equivalent to the original code, both written as this loop; structural similarity to the original code 0.01.
The gain is largest for the models that start lowest, such as Llama-3.1-8B (from 16.9% to 72.5%), and after training a 1.5B model writes synthesizable code more often than the pre-trained 32B model.
Level 2: predicting the quality of a specification
The Level 2 grades can train an open-source model to grade specifications without a commercial LLM. Of the 14,292 graded instructions, 300 are held out, and Qwen2.5-Coder-7B-Instruct is fine-tuned on the other 13,992 (LoRA rank 16, three epochs) to write the four grades as one JSON object.
Figure Figure 27 compares its grades with the held-out Level 2 grades, as correlations (a) and as the share of exact grades (b). Before fine-tuning, the model gives a 5 to almost every instruction, and grades correlate only weakly with the Level 2 grades (Spearman 0.30–0.36). After fine-tuning, the correlation is 0.80–0.83 for unambiguity, completeness and verifiability, and 68–72% of the grades are exact. Consistency is lower (0.61). The mean of the four grades also predicts the round-trip outcome with a ROC AUC of 0.86, close to the 0.90 that the Level 2 grades reach on the same 300 instructions and far above the 0.59 before fine-tuning.
Figure 27. Grades of Qwen2.5-Coder-7B-Instruct on the 300 held-out instructions, before fine-tuning, after fine-tuning to write the grades (SFT), and as a Jev-style decision model with a classification head (↑ higher is better). (a) Spearman correlation with the Level-2 grades. (b) Share of grades that are exact (dark), one point off (light) or two or more points off (dashed).
A Jev-style decision model, trained on the same data, adds a classification head to the LLM instead of generating text. After one forward pass over the instruction, it answers each quality as a five-option multiple-choice question and returns a probability for every grade. It reaches about the same quality, with Spearman 0.66–0.83, 67–75% exact grades and an AUC of 0.87, and its probabilities are better calibrated (expected calibration error 0.04 against 0.09).
Level 3: functional correctness
Level 3 pairs each accepted design with its original instruction and its refined specification, and both share the same verified code, so two models trained on them differ only in the text. the 11,247 accepted designs, 54 whose code has undriven nets, which an earlier version of the equivalence checker did not compare, are left out; 300 of the remaining 11,193 are held out as VeriLadder-Bench and 10,893 are used for training (LoRA rank 16, three epochs). Functional pass@ is the probability that at least one of samples passes the testbench of the benchmark, estimated from five samples per problem [6]. Training on the refined specifications instead of the original instructions raises functional pass@1 from 39.4% to 44.7% on VerilogEval v2 and from 31.2% to 41.6% on RTLLM v2 for Qwen2.5-Coder-7B-Instruct, and from 35.1% to 39.2% and from 24.0% to 33.6% for Qwen2.5-7B-Instruct. Adding 3,248 designs of underrepresented categories from CodeV-R1 [47] and OriGen [7], none of which matches a benchmark problem, gives the final models in Table 4. They clearly outperform their pre-trained versions, while the commercial models remain ahead. As in RTLCoder [23] and DeepRTL [25], the fine-tuned models are reported at their best temperature and the open-source baselines are averaged over the temperatures 0.2 to 1.0; averaged in the same way, the fine-tuned Coder model still reaches 47.8% and 41.0%.
| Type | Model | Open-source | VerilogEval v2 [21] ↑ pass@1 | VerilogEval v2 [21] ↑ pass@5 | RTLLM v2 [26] ↑ pass@1 | RTLLM v2 [26] ↑ pass@5 | VeriLadder-Bench ↑ pass@1 | VeriLadder-Bench ↑ pass@5 |
| Foundation | GPT-4o | ✗ | 65.9 | 71.2 | 57.6 | 66.0 | 86.5 | 92.7 |
| Foundation | GPT-5 | ✗ | 71.2 | 80.8 | 57.6 | 66.0 | 87.6 | 94.7 |
| Foundation | GPT-6-sol | ✗ | 85.5 | 89.1 | 71.2 | 76.0 | 92.9 | 93.7 |
| Foundation | Llama-3.1-8B-I | ✓ | 23.0 | 34.9 | 16.7 | 32.0 | 41.5 | 69.7 |
| Foundation | Qwen2.5-7B-I | ✓ | 25.5 | 38.7 | 26.2 | 43.6 | 55.4 | 75.4 |
| Foundation | Qwen2.5-Coder-7B-I | ✓ | 31.7 | 47.3 | 35.0 | 50.0 | 61.7 | 79.5 |
| Specialized | CodeV-CL-7B [44] | ✓ | 25.5 | 43.1 | 28.5 | 45.6 | 45.8 | 72.7 |
| Specialized | RTLCoder-DS-6.7B [23] | ✓ | 34.6 | 47.3 | 36.6 | 48.4 | 61.3 | 80.1 |
| Trained on RTLCoder (original dataset) | Qwen2.5-7B-I | ✓ | 35.1 | 44.1 | 24.0 | 36.0 | 61.1 | 77.1 |
| Trained on RTLCoder (original dataset) | Qwen2.5-Coder-7B-I | ✓ | 39.4 | 46.7 | 31.2 | 44.0 | 67.2 | 81.3 |
| Ours, trained on VeriLadder Spec. | Qwen2.5-7B-I | ✓ | 44.5 | 59.0 | 36.4 | 48.0 | 79.5 | 90.0 |
| Ours, trained on VeriLadder Spec. | Qwen2.5-Coder-7B-I | ✓ | 50.0 | 61.5 | 45.2 | 54.0 | 83.1 | 92.3 |
Table 4. Functional (%) with five samples per problem (↑ higher is better). VeriLadder-Bench is the 300 held-out designs with refined specifications, checked by formal equivalence. Bold marks the best open-source model. The suffix -I denotes the Instruct version of a model.
Level 4: robustness to wording
The paraphrases of Level 4 also serve as a test of how robust an LLM is to the wording of a prompt asking for RTL code. The test uses two builders, Claude Haiku 5.5, the builder of the pipeline, and Qwen3-Coder-30B, an open-source builder chosen for this study. On the same 1,460 randomly sampled designs as in § 3.11, each builder writes code from every verified paraphrase, and the equivalence checker compares each result with the original circuit (Figure 28).
Figure 28. Levels 4 and 5 with two builders on 1,460 randomly sampled designs. (a) Share of paraphrases rebuilt as the same circuit, by kind of paraphrase (95% confidence intervals). (b) Given the one-fact variant specification , the share of attempts in which the builder writes the changed design (the intended outcome), the original design , or another design that is wrong or does not compile.
For paraphrases, the kind of rewording barely matters. Haiku rebuilds the same circuit in 93.5–94.4% of attempts for lexical, syntactic and representational paraphrases, and Qwen3-Coder in 69.9–72.2% (Figure 28a), so neither model depends on one particular form of wording.
Level 5: following every fact
The one-fact variants of Level 5 test whether an LLM follows every fact of a specification. With the same two builders and designs as in § 5.4, each builder reads the variant specification of every variant (§ 3.15) and writes code . The equivalence checker then determines whether is equivalent to the variant code (the model follows the change), to the original code (it falls back to the original design), or to neither. The two models differ clearly. Haiku follows the changed fact in 86.6% of attempts and falls back to the original design in 6.4%, while Qwen3-Coder follows it in only 58.2% and falls back in 13.9%, twice as often (Figure 28b). A one-fact variant thus exposes whether a model reads every fact of a specification or only recognizes the kind of circuit and writes its common version.
Conclusion
This paper presented VeriLadder, a Verilog dataset built as a ladder of five levels that follow the order in which a hardware engineer would examine a design. Level 1 establishes that the code is synthesizable, Level 2 grades how well the original instruction describes the circuit, Level 3 rewrites the instruction into a refined specification that is verified to determine the circuit by a formal tool, Level 4 adds paraphrases that keep the same circuit, and Level 5 pairs each design with a near miss. that differs in exactly one behavior. Every check of correctness is decided by an EDA tool rather than by an LLM.
The released dataset applies the framework to 716,627 designs from two public corpora, labeling them for synthesizability, failure cause and post-synthesis metrics, grades the instructions of 14,292 designs, and provides 11,247 refined specifications verified to determine their circuit, together with 32,393 verified paraphrases, 8,397 one-fact variants and the refinement trajectories of 14,385 designs. The analysis shows that most training instructions do not determine their circuit, that four standard qualities of a specification predict when they fail to do so, largely independent of the model that grades them, and that rewriting under a formal acceptance test resolves most of these cases. The training experiments show that the levels can be used directly for training. The Level 1 labels raise the share of synthesizable code for all eight models tested, the Level 2 grades train an open-source grader whose grades correlate with them at a Spearman coefficient of up to 0.83, and fine-tuning Qwen2.5-Coder-7B-Instruct on the refined specifications raises its functional pass@1 from 31.7% to 50.0% on VerilogEval v2 and from 35.0% to 45.2% on RTLLM v2, well above the same model trained on the original instructions. Beyond these uses, the paraphrases, one-fact variants and refinement trajectories provide training signals for robustness to wording, contrastive learning and specification refinement.
References
- [1]Manar Abdellaty, Jingxiao Ma, and Sherief Reda. 2025. MetRex: A Benchmark for Verilog Code Metric Reasoning Using LLMs. In Asia and South Pacific Design Automation Conference (ASP-DAC). 995–1001.
- [2]Mohammad Akyash and Hadi Mardani Kamali. 2025. SimEval: Investigating the Similarity Obstacle in LLM-based Hardware Code Generation. In Asia and South Pacific Design Automation Conference (ASP-DAC). 1002–1007.DOI
- [3]Jason Blocklove, Siddharth Garg, Ramesh Karri, and Hammond Pearce. 2023. Chip-Chat: Challenges and Opportunities in Conversational Hardware Design. In ACM/IEEE Workshop on Machine Learning for CAD (MLCAD).DOI
- [4]Robert Brayton and Alan Mishchenko. 2010. ABC: An Academic Industrial-Strength Verification Tool. In International Conference on Computer Aided Verification (CAV) (Lecture Notes in Computer Science, Vol. 6174). Springer Berlin Heidelberg, 24–40.DOI
- [5]Kaiyan Chang, Ying Wang, Haimeng Ren, Mengdi Wang, Shengwen Liang, Yinhe Han, Huawei Li, and Xiaowei Li. 2023. ChipGPT: How Far Are We from Natural Language Hardware Design. arXiv preprint arXiv:2305.14019 (2023).arxiv.org/abs/2305.14019
- [6]Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374 (2021).arxiv.org/abs/2107.03374
- [7]Fan Cui, Chenyang Yin, Kexing Zhou, Youwei Xiao, Guangyu Sun, Qiang Xu, Qipeng Guo, Yun Liang, Xingcheng Zhang, Demin Song, and Dahua Lin. 2024. OriGen: Enhancing RTL Code Generation with Code-to-Code Augmentation and Self-Reflection. In IEEE/ACM International Conference on Computer-Aided Design (ICCAD). 1–9.arxiv.org/abs/2407.16237
- [8]Kawin Ethayarajh, Winnie Xu, Niklas Muennighoff, Dan Jurafsky, and Douwe Kiela. 2024. KTO: Model Alignment as Prospect Theoretic Optimization. In International Conference on Machine Learning (ICML) (PMLR, Vol. 235). 12634–12651.arxiv.org/abs/2402.01306
- [9]Suriya Gunasekar, Yi Zhang, Jyoti Aneja, Caio César Teodoro Mendes, et al. 2023. Textbooks Are All You Need. arXiv preprint arXiv:2306.11644.arxiv.org/abs/2306.11644
- [10]Anisha Gaujral, Anthony Wang, Elaine Lau, Vaskar Nath, Yunzhong He, Bing Liu, and Sean Hendryx. 2026. Rubrics as Rewards: Reinforcement Learning Beyond Verifiable Domains. In International Conference on Learning Representations (ICLR).
- [11]Helia Hashemi, Jason Eisner, Corby Rosset, Benjamin Van Durme, and Chris Kedzie. 2024. LLM-Rubric: A Multidimensional, Calibrated Approach to Automated Evaluation of Natural Language Texts. In Annual Meeting of the Association for Computational Linguistics (ACL). 13806–13834.
- [12]Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, et al. 2022. Training Compute-Optimal Large Language Models. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 35. 30016–30030.arxiv.org/abs/2203.15556
- [13]Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yunzhai Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-Rank Adaptation of Large Language Models. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2106.09685
- [14]Hanxian Huang, Zhenghan Lin, Zixuan Wang, Xin Chen, Ke Ding, and Jishen Zhao. 2024. Towards LLM-Powered Verilog RTL Assistant: Self-Verification and Self-Correction. arXiv preprint arXiv:2406.00115.arxiv.org/abs/2406.00115
- [15]IEEE. 1998. IEEE Recommended Practice for Software Requirements Specifications. IEEE Std 830-1998, 40 pages.
- [16]Ziwei Ji, Nayoon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, and Pascale Fung. 2023. Survey of Hallucination in Natural Language Generation. ACM Computing Surveys (CSUR) 55, 12 (2023), 1–38.DOI
- [17]Jared Kaplan, Sam McCandlish, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. 2020. Scaling Laws for Neural Language Models. arXiv preprint arXiv:2001.08361.arxiv.org/abs/2001.08361
- [18]Seungone Kim, Jamin Shin, Yejin Cho, Joel Jang, Shayne Longpre, Hwaran Lee, Sangdoo Yun, Seongjin Shin, Sundong Kim, James Thorne, and Minjoon Seo. 2024. Prometheus: Inducing Fine-grained Evaluation Capability in Language Models. In International Conference on Learning Representations (ICLR).
- [19]Zeju Li, Changnan Xu, Zhengyuan Shi, Zedong Peng, Yi Liu, Yunhao Zhou, Lingfeng Zhou, Chengyu Ma, Jianyuan Zhong, Xi Wang, Jieru Zhao, Zhufei Chu, Xiaoyan Yang, and Qiang Xu. 2025. DeepCircuitX: A Comprehensive Repository-Level Dataset for RTL Code Understanding, Generation, and PPA Analysis. In IEEE International Conference on LLM-Aided Design (ICLAD), 204–211.arxiv.org/abs/2502.18297
- [20]Mingjie Liu, Teodor-Dumitru Ene, Robert Kirby, Chris Cheng, Nathaniel Pinckney, Rongjian Liang, et al. 2023. Chip-NeMo: Domain-Adapted LLMs for Chip Design. arXiv preprint arXiv:2311.00176 (2023).arxiv.org/abs/2311.00176
- [21]Mingjie Liu, Nathaniel Pinckney, Bruck Khalilany, and Haoxing Ren. 2023. Invited Paper: VerilogEval: Evaluating Large Language Models for Verilog Code Generation. In IEEE/ACM International Conference on Computer-Aided Design (ICCAD), 1–8.DOI
- [22]Shang Liu, Wenji Fang, Yao Lu, Jing Wang, Qijun Zhang, Hongce Zhang, and Zhiyao Xie. 2025. RTLCoder: Fully Open-Source and Efficient LLM-Assisted RTL Code Generation Technique. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (TCAD) 44, 4 (2025), 1448–1461.DOI
- [23]Shang Liu, Wenji Fang, Yao Lu, Qijun Zhang, Hongce Zhang, and Zhiyao Xie. 2024. RTLCoder: Outperforming GPT-3.5 in Design RTL Generation with Our Open-Source Dataset and Lightweight Solution. In IEEE LLM Aided Design Workshop (LAD), 1–5.DOI
- [24]Yang Liu, Dan Iter, Yichong Xu, Shuohang Wang, Ruochen Xu, and Chenguang Zhu. 2023. G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2511–2522.arxiv.org/abs/2303.16634
- [25]Yi Liu, Changnan Xu, Yunhao Zhou, Zeju Li, and Qiang Xu. 2025. DeepRTL: Bridging Verilog Understanding and Generation with a Unified Representation Model. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2502.15832
- [26]Yao Lu, Shang Liu, Qijun Zhang, and Zhiyao Xie. 2024. RTLLM: An Open-Source Benchmark for Design RTL Generation with Large Language Model. In Asia and South Pacific Design Automation Conference (ASP-DAC), 722–727.arxiv.org/abs/2308.05345
- [27]Bardia Nadimi, Ghali Omar Boutaib, and Hao Zheng. 2025. PyraNet: A Multi-Layered Hierarchical Dataset for Verilog. In ACM/IEEE Design Automation Conference (DAC), 1–7.DOI
- [28]Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, et al. 2022. Training Language Models to Follow Instructions with Human Feedback. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 35, 27730–27744.arxiv.org/abs/2203.02155
- [29]Jingyu Pan, Guanglei Zhou, Chen-Chia Chang, Isaac Jacobson, Jiang Hu, and Yiran Chen. 2025. A Survey of Research in Large Language Models for Electronic Design Automation. ACM Transactions on Design Automation of Electronic Systems (TODAES) 30, 3 (2025), 1–21.arxiv.org/abs/2501.09655
- [30]Arjun Panickssery, Samuel R. Bowman, and Shi Feng. 2024. LLM Evaluators Recognize and Favor Their Own Generations. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2404.13076
- [31]Saeid Rajabi, Chengmo Yang, and Satwik Patnaik. 2026. SELLAR: Structure-Guided LLM Assertion Retrieval and Generation for Formal Verification. In ACM/IEEE Design Automation Conference (DAC), 1–7.arxiv.org/abs/2601.19903
- [32]Saul Schleimer, Daniel S. Wilkerson, and Alex Aiken. 2003. Winnowing: Local Algorithms for Document Fingerprinting. In ACM SIGMOD International Conference on Management of Data (SIGMOD), 76–85.
- [33]Fu Teng, Miao Pan, Xuhong Zhang, Zhezhi He, Yiyao Yang, Xinyi Chai, Mengnan Qi, Liqiang Lu, and Jianwei Yin. 2025. VeriRL: Boosting the LLM-based Verilog Code Generation via Reinforcement Learning. In IEEE/ACM International Conference on Computer-Aided Design (ICCAD), 1–9.arxiv.org/abs/2508.18462
- [34]Shailja Thakur, Baleeh Ahmad, Zhenxing Fan, Hammond Pearce, Benjamin Tan, Ramesh Karri, Brendan Dolan-Gavitt, and Siddharth Garg. 2023. Benchmarking Large Language Models for Automated Verilog RTL Code Generation. In Design, Automation & Test in Europe Conference & Exhibition (DATE), 1–6.arxiv.org/abs/2212.11140
- [35]Shailja Thakur, Baleeh Ahmad, Hammond Pearce, Benjamin Tan, Brendan Dolan-Gavitt, Ramesh Karri, and Siddharth Garg. 2024. VeriGen: A Large Language Model for Verilog Code Generation. ACM Transactions on Design Automation of Electronic Systems (TODAES) 29, 3 (2024), 1–31.arxiv.org/abs/2308.00708
- [36]Pablo Villalobos, Anson Ho, Jaime Sevilla, Tamay Besiroglu, Lennart Heim, and Marius Hobbhahn. 2024. Position: Will We Run Out of Data? Limits of LLM Scaling Based on Human-Generated Data. In International Conference on Machine Learning (ICML) (PMLR, Vol. 235), 49523–49544.
- [37]Peiyi Wang, Lei Li, Liang Chen, Zefan Cai, Dawei Zhu, Binghuai Lin, Yunbo Cao, Linppeng Kong, Qi Liu, Tianyu Liu, et al. 2024. Large language models are not fair evaluators. In Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers). 9440–9450.arxiv.org/abs/2305.17926
- [38]Shiqi Wang, Zheng Li, Haifeng Qian, Chenghao Yang, Zijian Wang, Mingyue Shang, Varun Kumar, Samson Tan, Baishakhi Ray, Parminder Bhatia, Ramesh Nallapati, Murali Krishna Ramanathan, Dan Roth, and Bing Xiang. 2023. ReCode: Robustness Evaluation of Code Generation Models. In Annual Meeting of the Association for Computational Linguistics (ACL). 13818–13843.arxiv.org/abs/2212.10264
- [39]Claire Wolf. [n. d.]. Yosys Open SYnthesis Suite. https://yosyshq.net/yosys/. Version 0.57+265 used in this work.
- [40]Seonghyeon Ye, Doyoung Kim, Sungdong Kim, Hyeonbin Hwang, Seungone Kim, Yongrae Jo, James Thorne, Juho Kim, and Minjoon Seo. 2024. FLASK: Fine-grained Language Model Evaluation based on Alignment Skill Sets. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2307.10928
- [41]Patrick Yubeaton, Andre Nakkab, Weihua Xiao, Luca Collini, Ramesh Karri, Chinmay Hegde, and Siddharth Garg. 2025. VeriThoughts: Enabling Automated Verilog Code Generation using Reasoning and Formal Verification. In Advances in Neural Information Processing Systems (NeurIPS). 9430–9452.arxiv.org/abs/2505.20302
- [42]Daochen Zha, Zaid Pervaiz Bhat, Kwei-Herng Lai, Fan Yang, Zhimeng Jiang, Shaochen Zhong, and Xia Hu. 2025. Data-centric Artificial Intelligence: A Survey. ACM Computing Surveys (CSUR) 57, 5 (2025), 1–42.arxiv.org/abs/2303.10158
- [43]Yongan Zhang, Zhongzhi Yu, Yonggan Fu, Cheng Wan, and Yingyan Celine Lin. 2024. MG-Verilog: Multi-grained Dataset Towards Enhanced LLM-assisted Verilog Generation. In IEEE LLM Aided Design Workshop (LAD). 1–5.arxiv.org/abs/2407.01910
- [44]Yang Zhao, Di Huang, Chongxiao Li, Pengwei Jin, Muxin Song, Yinan Xu, Ziyuan Nan, Mingju Gao, Tianyun Ma, Lei Qi, Yansong Pan, Zhenxing Zhang, Rui Zhang, Xishan Zhang, Zidong Du, Qi Guo, and Xing Hu. 2026. CodeV: Empowering LLMs With HDL Generation Through Multilevel Summarization. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (TCAD) 45, 4 (2026), 1893–1906.arxiv.org/abs/2407.10424
- [45]Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric P. Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2023. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. In Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track.arxiv.org/abs/2306.05685
- [46]Ruizhe Zhong, Xingbo Du, Shixiong Kai, Zhentao Tang, Siyuan Xu, Hui-Ling Zhen, Jianye Hao, Qiang Xu, Mingxuan Yuan, and Junchi Yan. 2023. LLM4EDA: Emerging Progress in Large Language Models for Electronic Design Automation. arXiv preprint arXiv:2401.12224 (2023).arxiv.org/abs/2401.12224
- [47]Yaoyu Zhu, Di Huang, Hanqi Lyu, Xiaoyun Zhang, Chongxiao Li, Wenxuan Shi, Yutong Wu, Jianan Mu, Jinghua Wang, Yang Zhao, Pengwei Jin, Shuyao Cheng, Shengwen Jiang, Xishan Zhang, Rui Zhang, Zidong Du, Qi Guo, Xing Hu, and Yunji Chen. 2025. QiMeng-CodeV-R1: Reasoning-Enhanced Verilog Generation. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2505.24183


















