用结构化中间表达提升自然语言到Verilog的代码生成精度
QiMeng-CRUX: Narrowing the Gap Between Natural Language and Verilog via Core Refined Understanding eXpression for Circuit Design
- 设计结构化中间空间CRUX,精准捕捉用户意图
- 两阶段训练使模型在多个基准上达顶尖水平
- 适配其他模型提示,适合硬件设计与AI辅助开发
大语言模型在硬件描述语言(HDL)生成方面展现出潜力。然而,现有方法多依赖模糊、冗余且无结构的自然语言描述,给下游Verilog代码生成带来挑战。本文将硬件代码生成视为从开放自然语言空间到特定领域、高度受限目标空间的复杂转换。为此,提出核心精炼理解表达(CRUX),一种结构化中间空间,既保留用户意图的核心语义,又组织表达以实现精确的Verilog生成。进一步设计两阶段训练框架——联合表达建模与双空间优化,以提升CRUX和Verilog代码质量。在多个Verilog生成基准上的实验表明,所提模型CRUX-V在通用模型中达到领先性能,尤其在高难度设计任务中表现突出。此外,CRUX空间具有可迁移性,作为提示输入可提升其他代码模型效果,证明其有效缩小自然语言描述与精确Verilog生成之间的鸿沟。
原文摘要 · Abstract (English)
Large language models (LLMs) have shown promising capabilities in hardware description language (HDL) generation. However, existing approaches often rely on free-form natural language descriptions that are often ambiguous, redundant, and unstructured, which poses significant challenges for downstream Verilog code generation. We treat hardware code generation as a complex transformation from an open-ended natural language space to a domain-specific, highly constrained target space. To bridge this gap, we introduce Core Refined Understanding eXpression (CRUX), a structured intermediate space that captures the essential semantics of user intent while organizing the expression for precise Verilog code generation. We further design a two-stage training framework, comprising Joint Expression Modeling and Dual-Space Optimization, to enhance the quality of both CRUX and Verilog code. Experiments across multiple Verilog generation benchmarks demonstrate that our model, CRUX-V, achieves state-of-the-art performance among general models, particularly under challenging design tasks. Furthermore, the CRUX space proves transferable and beneficial when used as input prompts for other code models, highlighting its effectiveness in narrowing the gap between free-form natural language descriptions and precise Verilog generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。