arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2511.12033cs.LGcs.AI
收藏

EARL: 用于可靠RTL代码生成的熵感知强化学习对齐大语言模型

EARL: Entropy-Aware RL Alignment of LLMs for Reliable RTL Code Generation

MIT(麻省理工学院);IBM(国际商业机器公司)

Jiahe Shi, Zhengqi Gao, Ching-Yun Ko, Duane Boning

AI总结:

EARL通过熵感知强化学习提升Verilog代码生成的可靠性与准确性

摘要:

近年来,大型语言模型(LLMs)在硬件设计自动化领域展现了显著潜力,特别是在利用自然语言合成寄存器传输级(RTL)代码方面。尽管取得了进展,但模型能力与实际RTL设计需求之间仍存在差距,包括语法错误、功能幻觉以及对设计意图的对齐不足。具有可验证奖励的强化学习(RLVR)提供了一种有前景的方法来弥合这一差距,因为硬件提供了可执行且可形式验证的信号,可用于进一步将模型输出与设计意图对齐。然而,在长且结构化的RTL代码序列中,并非所有token对功能正确性贡献相等,简单地将梯度分布在所有token上会稀释学习信号。我们对RTL生成的熵分析得出的关键见解是,只有少量token(例如always、if、assign、posedge)表现出高不确定性,并且主要影响控制流和模块结构。为了解决这些挑战,我们提出了EARL,一种用于Verilog生成的熵感知强化学习框架。EARL通过可验证奖励信号进行策略优化,并引入熵引导的选性更新,将策略梯度限制在高熵token上。这种方法保持了训练稳定性,并将梯度更新集中于代码功能关键区域。我们在VerilogEval和RTLLM上的实验表明,EARL在功能通过率方面比先前的LLM基线提高了高达14.7%,同时减少了不必要的更新并提高了训练稳定性。这些结果表明,将强化学习聚焦于关键、高不确定性的token能够实现更可靠和有针对性的策略改进,以生成结构化的RTL代码。

英文摘要:

Recent advances in large language models (LLMs) have demonstrated significant potential in hardware design automation, particularly in using natural language to synthesize Register-Transfer Level (RTL) code. Despite this progress, a gap remains between model capability and the demands of real-world RTL design, including syntax errors, functional hallucinations, and weak alignment to designer intent. Reinforcement Learning with Verifiable Rewards (RLVR) offers a promising approach to bridge this gap, as hardware provides executable and formally checkable signals that can be used to further align model outputs with design intent. However, in long, structured RTL code sequences, not all tokens contribute equally to functional correctness, and naïvely spreading gradients across all tokens dilutes learning signals. A key insight from our entropy analysis in RTL generation is that only a small fraction of tokens (e.g., always, if, assign, posedge) exhibit high uncertainty and largely influence control flow and module structure. To address these challenges, we present EARL, an Entropy-Aware Reinforcement Learning framework for Verilog generation. EARL performs policy optimization using verifiable reward signals and introduces entropy-guided selective updates that gate policy gradients to high-entropy tokens. This approach preserves training stability and concentrates gradient updates on functionally important regions of code. Our experiments on VerilogEval and RTLLM show that EARL improves functional pass rates over prior LLM baselines by up to 14.7%, while reducing unnecessary updates and improving training stability. These results indicate that focusing RL on critical, high-uncertainty tokens enables more reliable and targeted policy improvement for structured RTL code generation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑