用分步描述提升大模型生成和总结VHDL代码的能力
Chain-of-Descriptions: Improving Code LLMs for VHDL Code Generation and Summarization
- 通过生成中间描述步骤,引导大模型分步理解任务
- 在两个数据集上均显著优于传统提示方法
- 适合硬件设计与代码自动化研究者使用
大型语言模型(LLMs)在众多自然语言处理任务中表现出色,但在电子设计自动化(EDA)领域,针对硬件描述语言(HDL),特别是VHDL的适配研究仍显不足。本研究评估了现有代码LLMs在VHDL代码生成与摘要任务上的表现,采用两个数据集——VHDL-Eval与自研的VHDL-Xform,后者用于衡量模型对功能等价代码的理解能力。结果显示,现有模型在各项指标上表现普遍不佳,存在明显性能差距。为此,我们提出链式描述(Chain-of-Descriptions, CoDes)方法:基于问题陈述或原始VHDL代码,生成一系列中间描述步骤,并将其与原始输入结合作为新提示输入给模型,以生成最终输出。实验表明,CoDes在两个数据集上均显著优于标准提示策略,不仅提升了VHDL代码生成与摘要质量,还为未来相关研究提供了可扩展框架。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have become widely used across diverse NLP tasks and domains, demonstrating their adaptability and effectiveness. In the realm of Electronic Design Automation (EDA), LLMs show promise for tasks like Register-Transfer Level (RTL) code generation and summarization. However, despite the proliferation of LLMs for general code-related tasks, there's a dearth of research focused on evaluating and refining these models for hardware description languages (HDLs), notably VHDL. In this study, we evaluate the performance of existing code LLMs for VHDL code generation and summarization using various metrics and two datasets -- VHDL-Eval and VHDL-Xform. The latter, an in-house dataset, aims to gauge LLMs' understanding of functionally equivalent code. Our findings reveal consistent underperformance of these models across different metrics, underscoring a significant gap in their suitability for this domain. To address this challenge, we propose Chain-of-Descriptions (CoDes), a novel approach to enhance the performance of LLMs for VHDL code generation and summarization tasks. CoDes involves generating a series of intermediate descriptive steps based on: (i) the problem statement for code generation, and (ii) the VHDL code for summarization. These steps are then integrated with the original input prompt (problem statement or code) and provided as input to the LLMs to generate the final output. Our experiments demonstrate that the CoDes approach significantly surpasses the standard prompting strategy across various metrics on both datasets. This method not only improves the quality of VHDL code generation and summarization but also serves as a framework for future research aimed at enhancing code LLMs for VHDL.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。