QiMeng-CodeV-R1: Reasoning-Enhanced Verilog Generation

Yao-Yu Zhu, Di Huang, Han-Qi Lyu, Xiao-Yun Zhang, Chong-Xiao Li +14 more
5/1/2025
rlrlhf-rlvr-dpo

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) trained via reinforcement learning with verifiable reward (RLVR) have achieved breakthroughs on tasks with explicit, automatable verification, such as software programming and mathematical problems. Extending RLVR to electronic design automation (EDA), especially automatically generating hardware description languages (HDLs) like Verilog from natural-language (NL) specifications, however, poses three key challenges: the lack of automated and accurate verification environments, the scarcity of high-quality NL-code pairs, and the prohibitive computation cost of RLVR.

Show full abstract

To this end, we introduce CodeV-R1, an RLVR framework for training Verilog generation LLMs. First, we develop a rule-based testbench generator that performs robust equivalence checking against golden references. Second, we propose a round-trip data synthesis method that pairs open-source Verilog snippets with LLM-generated NL descriptions, verifies code-NL-code consistency via the generated testbench, and filters out inequivalent examples to yield a high-quality dataset. Third, we employ a two-stage"distill-then-RL"training pipeline: distillation for the cold start of reasoning abilities, followed by adaptive DAPO, our novel RLVR algorithm that can reduce training cost by adaptively adjusting sampling rate. The resulting model, CodeV-R1-7B, achieves 68.6% and 72.9% pass@1 on VerilogEval v2 and RTLLM v1.1, respectively, surpassing prior state-of-the-art by 12~20%, while even exceeding the performance of 671B DeepSeek-R1 on RTLLM. We have released our model, training code, and dataset to facilitate research in EDA and LLM communities.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhu2025qimengcodevr,
  title  = {QiMeng-CodeV-R1: Reasoning-Enhanced Verilog Generation},
  author = {Yao-Yu Zhu and Di Huang and Han-Qi Lyu and Xiao-Yun Zhang and Chong-Xiao Li and Wen-Xuan Shi and Yu-Tong Wu and Jia-Nan Mu and Jing-Hua Wang and Yang Zhao and Peng-Wei Jin and Shu-Yao Cheng and Sheng-rong Liang and Xi-Shan Zhang and Rui Zhang and Zi-Dong Du and Qi Guo and Xingang Hu and Yun-Ji Chen},
  year   = {2025},
  eprint = {2505.24183},
  archivePrefix = {arXiv},
  doi    = {10.52202/085713-5160},
  url    = {https://doi.org/10.52202/085713-5160},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.24183.svg)](https://codeofpaper.com/paper/2505.24183)

Discussion