VerilogCL: A Contrastive Learning Framework for Robust LLM-Based Verilog Generation
Yan Tan, Tong Liu, Xiangchen Meng, Yangdi Lyu

TL;DR
VerilogCL is a contrastive learning framework that improves the accuracy and reliability of LLM-generated Verilog code by learning to distinguish correct from erroneous designs and proactively filtering low-confidence outputs.
Contribution
It introduces a novel contrastive learning approach with minimal-error data augmentation and a proactive screening module for robust Verilog code generation.
Findings
Outperforms baselines in compilation success rate.
Achieves higher functional correctness on benchmarks.
Enhances separation between correct and erroneous code in representation space.
Abstract
Large Language Models (LLMs) have recently achieved strong performance in software code generation. However, applying them to hardware description languages (HDLs), such as Verilog, remains challenging because high-quality training data are relatively scarce. In practice, LLM-generated Verilog often contains syntactic or structural errors that either cause compilation failures or produce functionally incorrect designs, which limit its reliability in hardware design workflows. In this work, we propose VerilogCL, an integrated framework that enhances Verilog code generation by explicitly learning the boundary between correct and erroneous RTL through contrastive learning and proactive error screening. Our approach introduces minimal-error data augmentation, generating paired training samples of correct RTL and minimally perturbed erroneous RTL to teach the model to recognize…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
