arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2509.06239cs.AI
收藏

Proof2Silicon:基于强化学习的可验证代码与硬件生成的提示修复方法

Proof2Silicon: Prompt Repair for Verified Code and Hardware Generation via Reinforcement Learning

Electrical and Computer Engineering(电气与计算机工程系);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Manvi Jha, Jiaxin Wan, Deming Chen

AI总结:

本研究提出Proof2Silicon端到端框架,嵌入基于强化学习的PREFACE提示优化流程,实现从自然语言到可形式化验证硬件的自动生成,端到端硬件综合成功率最高达72%。

摘要:

大语言模型(LLM)在自动化代码生成方面展现出令人瞩目的能力,但生成的代码常常无法通过形式化验证,而形式化验证是硬件和安全关键领域的核心要求。为解决这一根本局限,我们此前提出了PREFACE——一种基于强化学习(RL)的模型无关框架,可迭代修复提供给冻结LLM的提示,系统性引导模型生成可形式化验证的Dafny代码,无需成本高昂的微调。本研究提出了Proof2Silicon这一新型端到端综合框架,它嵌入了此前提出的PREFACE流程,可直接从自然语言规范生成构造即正确的硬件。Proof2Silicon的运行流程为:(1)利用PREFACE的验证器驱动RL智能体迭代优化提示生成,确保Dafny代码的正确性;(2)借助Dafny的Python后端和PyLog,将经过验证的Dafny程序自动转换为可综合的高级C代码;(3)使用Vivado HLS生成RTL实现。我们在包含100项任务的高难度基准上进行了严格评估,结果显示PREFACE的RL引导提示优化可将各类LLM的Dafny验证成功率持续提升最高达21%。关键在于,Proof2Silicon的端到端硬件综合成功率最高可达72%,可通过Vivado HLS综合流程生成RTL设计。这些结果证明了该流水线具备鲁棒性、可扩展性和自动化特性,可实现LLM驱动的形式化验证硬件综合,打通了自然语言规范到硅片实现的链路。

英文摘要:

Large Language Models (LLMs) have demonstrated impressive capabilities in automated code generation but frequently produce code that fails formal verification, an essential requirement for hardware and safety-critical domains. To overcome this fundamental limitation, we previously proposed PREFACE, a model-agnostic framework based on reinforcement learning (RL) that iteratively repairs the prompts provided to frozen LLMs, systematically steering them toward generating formally verifiable Dafny code without costly fine-tuning. This work presents Proof2Silicon, a novel end-to-end synthesis framework that embeds the previously proposed PREFACE flow to enable the generation of correctness-by-construction hardware directly from natural language specifications. Proof2Silicon operates by: (1) leveraging PREFACE's verifier-driven RL agent to optimize prompt generation iteratively, ensuring Dafny code correctness; (2) automatically translating verified Dafny programs into synthesizable high-level C using Dafny's Python backend and PyLog; and (3) employing Vivado HLS to produce RTL implementations. Evaluated rigorously on a challenging 100-task benchmark, PREFACE's RL-guided prompt optimization consistently improved Dafny verification success rates across diverse LLMs by up to 21%. Crucially, Proof2Silicon achieved an end-to-end hardware synthesis success rate of up to 72%, generating RTL designs through Vivado HLS synthesis flows. These results demonstrate a robust, scalable, and automated pipeline for LLM-driven, formally verified hardware synthesis, bridging natural-language specification and silicon realization.

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

↑