CodeV: Potenziamento dei LLM per la Generazione di Verilog attraverso la Summarizzazione Multi-Livello
CodeV: Empowering LLMs for Verilog Generation through Multi-Level Summarization
July 15, 2024
Autori: Yang Zhao, Di Huang, Chongxiao Li, Pengwei Jin, Ziyuan Nan, Tianyun Ma, Lei Qi, Yansong Pan, Zhenxing Zhang, Rui Zhang, Xishan Zhang, Zidong Du, Qi Guo, Xing Hu, Yunji Chen
cs.AI
Abstract
La crescente complessità e gli elevati costi associati alla progettazione dei processori moderni hanno portato a un aumento della domanda di automazione nella progettazione dei processori. I grandi modelli linguistici (LLM) ottimizzati per le istruzioni hanno dimostrato prestazioni notevoli nella generazione automatica di codice per linguaggi di programmazione generici come Python. Tuttavia, questi metodi falliscono con i linguaggi di descrizione hardware (HDL) come Verilog a causa della scarsità di dati di alta qualità per l'ottimizzazione delle istruzioni, poiché anche LLM avanzati come GPT-3.5 mostrano prestazioni limitate nella generazione di Verilog. Riguardo a questo problema, osserviamo che (1) il codice Verilog raccolto dal mondo reale ha una qualità superiore rispetto a quello generato dagli LLM. (2) LLM come GPT-3.5 eccellono nel riassumere il codice Verilog piuttosto che nel generarlo. Sulla base di queste osservazioni, questo articolo introduce CodeV, una serie di LLM open-source ottimizzati per le istruzioni nella generazione di Verilog. Invece di generare prima le descrizioni e poi ottenere il codice corrispondente da LLM avanzati, forniamo all'LLM il codice Verilog e lasciamo che l'LLM generi la descrizione in linguaggio naturale corrispondente attraverso un riassunto multilivello. I risultati sperimentali mostrano che CodeV supera rispettivamente del 14,4% (BetterV in VerilogEval) e dell'11,3% (RTLCoder in RTLLM) il precedente SOTA open-source, e supera anche del 22,1% il precedente SOTA commerciale GPT-4 in VerilogEval.
English
The increasing complexity and high costs associated with modern processor
design have led to a surge in demand for processor design automation.
Instruction-tuned large language models (LLMs) have demonstrated remarkable
performance in automatically generating code for general-purpose programming
languages like Python. However, these methods fail on hardware description
languages (HDLs) like Verilog due to the scarcity of high-quality instruction
tuning data, as even advanced LLMs like GPT-3.5 exhibit limited performance on
Verilog generation. Regarding this issue, we observe that (1) Verilog code
collected from the real world has higher quality than those generated by LLMs.
(2) LLMs like GPT-3.5 excel in summarizing Verilog code rather than generating
it. Based on these observations, this paper introduces CodeV, a series of
open-source instruction-tuned Verilog generation LLMs. Instead of generating
descriptions first and then getting the corresponding code from advanced LLMs,
we prompt the LLM with Verilog code and let the LLM generate the corresponding
natural language description by multi-level summarization. Experimental results
show that CodeV relatively surpasses the previous open-source SOTA by 14.4%
(BetterV in VerilogEval) and 11.3% (RTLCoder in RTLLM) respectively, and also
relatively outperforms previous commercial SOTA GPT-4 by 22.1% in VerilogEval.