Skip to main content
QUICK REVIEW

[논문 리뷰] CodeV: Empowering LLMs with HDL Generation through Multi-Level Summarization

Yang Zhao, Di Huang|arXiv (Cornell University)|2024. 07. 15.
Natural Language Processing TechniquesComputer Science인용 수 5
한 줄 요약

CodeV는 Verilog 생성 LLM을 지시문 역 prompting으로 다단계 자연어 설명을 얻고, VerilogEval 및 RTLLM 벤치마크에서 SOTA를 달성하여 Verilog-생성에 대한 지시 학습을 수행합니다.

ABSTRACT

The design flow of processors, particularly in hardware description languages (HDL) like Verilog and Chisel, is complex and costly. While recent advances in large language models (LLMs) have significantly improved coding tasks in software languages such as Python, their application in HDL generation remains limited due to the scarcity of high-quality HDL data. Traditional methods of adapting LLMs for hardware design rely on synthetic HDL datasets, which often suffer from low quality because even advanced LLMs like GPT perform poorly in the HDL domain. Moreover, these methods focus solely on chat tasks and the Verilog language, limiting their application scenarios. In this paper, we observe that: (1) HDL code collected from the real world is of higher quality than code generated by LLMs. (2) LLMs like GPT-3.5 excel in summarizing HDL code rather than generating it. (3) An explicit language tag can help LLMs better adapt to the target language when there is insufficient data. Based on these observations, we propose an efficient LLM fine-tuning pipeline for HDL generation that integrates a multi-level summarization data synthesis process with a novel Chat-FIM-Tag supervised fine-tuning method. The pipeline enhances the generation of HDL code from natural language descriptions and enables the handling of various tasks such as chat and infilling incomplete code. Utilizing this pipeline, we introduce CodeV, a series of HDL generation LLMs. Among them, CodeV-All not only possesses a more diverse range of language abilities, i.e. Verilog and Chisel, and a broader scope of tasks, i.e. Chat and fill-in-middle (FIM), but it also achieves performance on VerilogEval that is comparable to or even surpasses that of CodeV-Verilog fine-tuned on Verilog only, making them the first series of open-source LLMs designed for multi-scenario HDL generation.

연구 동기 및 목표

  • 자동화된 Verilog/HDL 코드 생성을 촉진하여 하드웨어 설계 비용을 줄인다.
  • 실제 코드에서 고품질 Verilog 중심의 instruction-tuning 데이터 세트를 구성해 데이터 부족 문제를 해소한다.
  • 다단계 요약이 HDL 태스크에 대한 설명-코드 정렬을 향상시킨다는 것을 입증한다.
  • CodeV 데이터로 오픈 소스 LLM을 미세 조정하면 Verilog 생성에서 SOTA 성능을 얻을 수 있음을 보인다.

제안 방법

  • GitHub에서 고품질의 실제 Verilog 모듈을 수집하고 자체 포함 구문이 올바른 코드만 필터링한다.
  • Verilog 코드로부터 세부 기능 설명과 높은 수준의 요구사항을 생성하기 위해 GPT-3.5를 프롬프트하여 다단계 요약을 적용한다.
  • 역지시 생성과 Rouge-L 기반 필터링으로 설명-코드 데이터세트를 구축하고 오염 제거를 수행한다.
  • CodeV 데이터세트로 기본 LLM(CodeLlama, DeepSeekCoder, CodeQwen)을 지도학습 목표(음의 대수 우도)로 미세 조정한다.
  • VerilogEval 및 RTLLM 벤치마크에서 pass@k와 구문/기능 검사를 사용하여 평가한다.]
  • research_questions:["다단계 요약이 Verilog 코드와 자연어 설명 사이의 의미론적 격차를 데이터 효율적인 지시 학습에 다리 역할을 할 수 있는가?","역지시 생성이 전통적인 설명-우선 접근법에 비해 Verilog 설명-코드 쌍의 품질을 향상시키는가?","CodeV로 미세 조정된 모델은 Verilog 생성 벤치마크에서 기존 오픈 소스 및 상용 SOTA 모델과 어떻게 비교되는가?","데이터세트 크기와 MLS(다단계 요약)가 Verilog 생성 성능에 어떤 영향을 미치는가?"]
  • key_findings:["CodeV 모델은 VerilogEval 및 RTLLM 벤치마크에서 SOTA를 달성하며, 이전 오픈 소스 SOTA 및 GPT-4를 Verilog 생성 작업에서 능가한다.","다단계 요약은 Verilog 기능에 대한 추론을 크게 향상시켜 pass@k 및 구문/기능 정확성을 높인다.","CodeV-CodeLlama 및 CodeV-CodeQwen 변형은 주목할 만한 pass@1 및 구문/기능 점수에 도달하고 머신-사람 평가 격차에서 강력한 성능을 보인다.","데이터세트 크기 확장은 데이터가 많을수록 성능이 향상되나 수익 체감이 있으며, 양보다는 데이터 품질의 중요성을 강조한다.","이 접근 방식은 VerilogEval에서 GPT-4 대비 상대적 22.1% 향상을 가져온다."],"table_headers":[],"table_rows":[]} }```{table_headers:[],table_rows:[]} /* Note: The final JSON above keeps all numeric values and proper nouns unchanged and translates only the natural-language text. */} )} Wait: ignore trailing. Correction: The output should be valid JSON. Remove stray commentary. Here's the cleaned version. (End) }``` is not needed. Sorry. Let's present clean JSON. } } } pellet.
  • } (This got garbled) I must provide clean JSON. Let's retype clean.
Figure 1: The CodeV framework overview. We first collect and filter high-quality Verilog modules from open-source codebases. The modules are then sent to GPT-3.5 to request multi-level summaries. Pairing high-level descriptions with corresponding modules, the high-quality dataset is utilized to fine
Figure 1: The CodeV framework overview. We first collect and filter high-quality Verilog modules from open-source codebases. The modules are then sent to GPT-3.5 to request multi-level summaries. Pairing high-level descriptions with corresponding modules, the high-quality dataset is utilized to fine

실험 결과

연구 질문

  • RQ1다단계 요약이 Verilog 코드와 자연어 설명 사이의 의미론적 격차를 데이터 효율적인 지시 학습에 다리 역할을 할 수 있는가?
  • RQ2역지시 생성이 전통적인 설명-우선 접근법에 비해 Verilog 설명-코드 쌍의 품질을 향상시키는가?
  • RQ3CodeV로 미세 조정된 모델은 Verilog 생성 벤치마크에서 기존 오픈 소스 및 상용 SOTA 모델과 어떻게 비교되는가?
  • RQ4데이터세트 크기와 MLS(다단계 요약)가 Verilog 생성 성능에 어떤 영향을 미치는가?

주요 결과

  • CodeV 모델은 VerilogEval 및 RTLLM 벤치마크에서 SOTA를 달성하며, 이전 오픈 소스 SOTA 및 GPT-4를 Verilog 생성 작업에서 능가한다.
  • 다단계 요약은 Verilog 기능에 대한 추론을 크게 향상시켜 pass@k 및 구문/기능 정확성을 높인다.
  • CodeV-CodeLlama 및 CodeV-CodeQwen 변형은 주목할 만한 pass@1 및 구문/기능 점수에 도달하고 머신-사람 평가 격차에서 강력한 성능을 보인다.
  • 데이터세트 크기 확장은 데이터가 많을수록 성능이 향상되나 수익 체감이 있으며, 양보다는 데이터 품질의 중요성을 강조한다.
  • 이 접근 방식은 VerilogEval에서 GPT-4 대비 상대적 22.1% 향상을 가져온다.
Figure 2: GPT-generated Verilog dataset contains unrealistic code. (a) A synthetic description obtained from [ 26 ] , which is unrealistic. (b) The circuit’s block diagram according to the description, contains illegal loops in the circuit. (c) The corresponding incorrect Verilog code in the dataset
Figure 2: GPT-generated Verilog dataset contains unrealistic code. (a) A synthetic description obtained from [ 26 ] , which is unrealistic. (b) The circuit’s block diagram according to the description, contains illegal loops in the circuit. (c) The corresponding incorrect Verilog code in the dataset

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.