Causal Signal Credit Assignment for Verilog Code Generation via Counterfactual Hardware Verification
Yali Du, Ming Li
Key points
From the paper's conclusion- We present a new method named Causal Signal Credit Assignment (CSCA), which is a counterfactual preference-optimization framework for Verilog generation.
Abstract
Large language models have improved Verilog generation, yet functional correctness remains difficult to optimize because simulation commonly provides a coarse module-level pass/fail outcome. Such feedback discards useful evidence from partially correct RTL modules and cannot determine whether a source statement is functionally responsible for an observed output behavior. We present a new method named Causal Signal Credit Assignment (CSCA), which is a counterfactual preference-optimization framework for Verilog generation. CSCA first performs continuous signal-level behavioral verification on sampled candidate modules. It then locates output-driving assignment spans and applies five interventions while holding the remaining module and testbench fixed. The resulting changes in signal-level errors are combined with behavioral agreement to form a continuous statement credit, which is mapped to response-token weights for strict weighted direct preference optimization. This enables CSCA to learn from locally supported statements without uniformly reinforcing an otherwise incorrect response. Built on Icarus Verilog and a CodeV-derived corpus, CSCA is evaluated on VerilogEval~2.0 and RTLLM~v2.0, including both code completion and specification-to-RTL tasks. With a Qwen2.5-Coder-7B-Instruct backbone, CSCA leads the evaluated 7B-scale models and remains comparable to the much larger GPT-5.4-mini on the reported Verilog-generation benchmarks.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- CorrectRTL: Boost RTL Generation Quality Through Automated Self-Correction with Instruction DecompositionarXiv · 2026
- HaVen-Agent: Enhancing Hallucination-Mitigated Verilog Code Generation Aligned with HDL Engineers through Code Repair and Multi-Agent OrchestrationACM Transactions on Design Automation of Electronic Systems · 2026
- Robustness of LLM-Generated SystemVerilog Assertions to Semantics-Preserving RTL TransformationsarXiv · 2026
- VeriLadder: A Multi-Agent Specification Refinement System for Tool-Verified Verilog DatasetsarXiv · 2026
- RTLReviewBench: LLM Hardware Reviewers Rarely Miss Bugs but Routinely Reject Correct RTLarXiv · 2026
- Quality over Quantity: Diversity-Aware Data Selection for Efficient Verilog Code GenerationarXiv · 2026