Saved in:
Bibliographic Details
Main Authors: Teng, Fu, Pan, Miao, Zhang, Xuhong, He, Zhezhi, Yang, Yiyao, Chai, Xinyi, Qi, Mengnan, Lu, Liqiang, Yin, Jianwei
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2508.18462
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912554656202752
author Teng, Fu
Pan, Miao
Zhang, Xuhong
He, Zhezhi
Yang, Yiyao
Chai, Xinyi
Qi, Mengnan
Lu, Liqiang
Yin, Jianwei
author_facet Teng, Fu
Pan, Miao
Zhang, Xuhong
He, Zhezhi
Yang, Yiyao
Chai, Xinyi
Qi, Mengnan
Lu, Liqiang
Yin, Jianwei
contents Recent advancements in code generation have shown remarkable success across software domains, yet hardware description languages (HDLs) such as Verilog remain underexplored due to their concurrency semantics, syntactic rigidity, and simulation complexity. In this work, we address these challenges by introducing a reinforcement learning (RL) framework tailored for Verilog code generation. We first construct Veribench-53K, a high-quality dataset curated from over 700K Verilog problems, enriched with structured prompts, complexity labels, and diverse testbenches. To tackle the problem of sparse and noisy reward signals, we propose a Trace-back based Rescore mechanism that leverages reasoning paths and iterative refinement to enhance feedback reliability and support reward model training. Furthermore, to mitigate catastrophic forgetting and overfitting during RL fine-tuning, we introduce a sample-balanced weighting strategy that adaptively balances learning dynamics based on reward-probability distributions. These innovations are integrated into an iterative RL pipeline that co-evolves the policy and reward models. In contrast to recent work such as CraftRTL, which relies on large-scale closed-source model distillation, and DeepSeek-style approaches that struggle with sparse feedback, our method demonstrates superior performance using a smaller but high-quality dataset combined with RL optimization. Experiments on Verilog generation tasks demonstrate state-of-the-art performance, with substantial gains in test pass rate, functional correctness, and compilation robustness. Our findings highlight the potential of RL-driven approaches for structured code generation in hardware-centric domains. VERIRL is publicly available at https://github.com/omniAI-Lab/VeriRL.
format Preprint
id arxiv_https___arxiv_org_abs_2508_18462
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle VERIRL: Boosting the LLM-based Verilog Code Generation via Reinforcement Learning
Teng, Fu
Pan, Miao
Zhang, Xuhong
He, Zhezhi
Yang, Yiyao
Chai, Xinyi
Qi, Mengnan
Lu, Liqiang
Yin, Jianwei
Machine Learning
Artificial Intelligence
Recent advancements in code generation have shown remarkable success across software domains, yet hardware description languages (HDLs) such as Verilog remain underexplored due to their concurrency semantics, syntactic rigidity, and simulation complexity. In this work, we address these challenges by introducing a reinforcement learning (RL) framework tailored for Verilog code generation. We first construct Veribench-53K, a high-quality dataset curated from over 700K Verilog problems, enriched with structured prompts, complexity labels, and diverse testbenches. To tackle the problem of sparse and noisy reward signals, we propose a Trace-back based Rescore mechanism that leverages reasoning paths and iterative refinement to enhance feedback reliability and support reward model training. Furthermore, to mitigate catastrophic forgetting and overfitting during RL fine-tuning, we introduce a sample-balanced weighting strategy that adaptively balances learning dynamics based on reward-probability distributions. These innovations are integrated into an iterative RL pipeline that co-evolves the policy and reward models. In contrast to recent work such as CraftRTL, which relies on large-scale closed-source model distillation, and DeepSeek-style approaches that struggle with sparse feedback, our method demonstrates superior performance using a smaller but high-quality dataset combined with RL optimization. Experiments on Verilog generation tasks demonstrate state-of-the-art performance, with substantial gains in test pass rate, functional correctness, and compilation robustness. Our findings highlight the potential of RL-driven approaches for structured code generation in hardware-centric domains. VERIRL is publicly available at https://github.com/omniAI-Lab/VeriRL.
title VERIRL: Boosting the LLM-based Verilog Code Generation via Reinforcement Learning
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2508.18462